fieldOptions

This commit is contained in:
cxc
2022-07-27 16:56:23 +08:00
parent 488071ab2b
commit 181a643b93
5 changed files with 151 additions and 99 deletions

View File

@ -85,20 +85,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="所属站点:" prop="tenantId">
<el-select
v-model="modelValue.tenantId"
placeholder="请选择,支持搜索"
size="default"
filterable
>
<el-option
v-for="item in siteList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<!-- <SiteOptions :size="''" :limitWidth="false" v-model="value" /> -->
<SiteOptions v-model="modelValue.tenantId" />
</el-form-item>
</el-col>
</el-row>
@ -217,7 +204,11 @@
</el-col>
</el-row>
<!-- <FieldOptions v-model="value" :labelWidth="labelWidth" ref="fieldForm" /> -->
<FieldOptions
v-model="modelValue"
:labelWidth="labelWidth"
ref="fieldFormRef"
/>
<InputBoxAdd
:labelWidth="labelWidth"
@ -307,6 +298,8 @@ import { tenantSelect } from "@/api/subPlatform/tenant";
import { enterpriseOptions } from "@/utils/parameter";
import { reactive, ref, toRefs } from "vue";
import WangEditor from "../../../components/WangEditor/index.vue";
import SiteOptions from "@/views/components/SiteOptions";
import FieldOptions from "@/views/components/FieldOptions";
const props = defineProps({
modelValue: { type: Object },
@ -332,6 +325,7 @@ const cityFormRef = ref(null);
const formRef = ref(null);
const keywordsFormRef = ref(null);
const researchsFormRef = ref(null);
const fieldFormRef = ref(null);
const directionsFormRef = ref([]);
const researchOptions = ref([]);
const options = ref([]);
@ -443,17 +437,28 @@ const validateForm = async () => {
formValid = false;
}
const cityFormValid = await cityFormRef.value.validateForm();
const fieldFormValid = await fieldFormRef.value.validateForm();
console.log(fieldFormValid);
const keywordsFormValid = await keywordsFormRef.value.validateForm();
if (formType.value == 1) {
const researchsFormValid = await researchsFormRef.value.validateForm();
//个人
const researchsFormValid = await researchsFormRef.value.validateForm(); // 研究方向验证
return (
formValid && cityFormValid && keywordsFormValid && researchsFormValid
formValid &&
cityFormValid &&
fieldFormValid &&
keywordsFormValid &&
researchsFormValid
);
} else if (formType.value == 2) {
const directionsFormValid = await directionsFormRef.value.validateForm();
//企业
const directionsFormValid = await directionsFormRef.value.validateForm(); //生产方向验证
return (
formValid && cityFormValid && keywordsFormValid && directionsFormValid
formValid &&
cityFormValid &&
fieldFormValid &&
keywordsFormValid &&
directionsFormValid
);
} else {
throw "未知的formType";