From e2cad5345678266960d40f1ba5e3ffac4d5c85e8 Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期三, 13 七月 2022 09:19:05 +0800 Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/gtqt --- src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/hangLoadForm.vue | 33 +++++++++++++++++++++------------ 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/hangLoadForm.vue b/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/hangLoadForm.vue index 858080e..6b36361 100644 --- a/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/hangLoadForm.vue +++ b/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/hangLoadForm.vue @@ -1,6 +1,6 @@ <template> <div class="comp-container"> - <el-form :model="hlForm" label-width="180px" :rules="hlFormRules" ref="ruleFormRef"> + <el-form :model="hlForm" label-width="180px" :rules="hlFormRules" ref="hlRef"> <div class="homeCard"> <el-row> <el-col :span="8"> @@ -87,18 +87,15 @@ } export default defineComponent({ name: 'hangLoadForm', - setup() { + props: { + hlForm: Object + }, + setup(props) { const userInfo = useUserInfo() const { userInfos } = storeToRefs(userInfo); const state = reactive<stateType>({}); - const hlForm = reactive({ - hlDepartment: '', - hlApplyName: '', - hlLevel: '', - hlWeight: '', - hlToolsName: '' - }) - const ruleFormRef = ref<FormInstance>() + const hlForm1 = reactive(props.hlForm) + const hlRef = ref<FormInstance>() const hlFormRules = reactive<FormRules>({ hlDepartment:[{required: true,message: '此处不可为空',trigger: 'blur'}], hlApplyName:[{required: true,message: '此处不可为空',trigger: 'blur'}], @@ -106,6 +103,17 @@ hlWeight: [{required: true,message: '此处不可为空',trigger: 'blur'}], hlToolsName: [{required: true,message: '此处不可为空',trigger: 'blur'}] }) + const validateForm = async () => { + let flag = null + await hlRef.value.validate(valid=>{ + if(valid){ + flag = true + }else{ + flag = false + } + }) + return flag + } // 折线图 const renderMenu = async (value: string) => { Session.set('projectId',value) @@ -114,9 +122,10 @@ }; return { renderMenu, - hlForm, + hlForm1, hlFormRules, - ruleFormRef, + hlRef, + validateForm, ...toRefs(state), }; }, -- Gitblit v1.9.2