From ae0e1c96b6da4f4515bf449db45a4ee839d2c61f Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期四, 14 七月 2022 09:08:37 +0800
Subject: [PATCH] 添加修改页面

---
 src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/highWorkForm.vue |   32 +++++++++++++++++++++-----------
 1 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/highWorkForm.vue b/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/highWorkForm.vue
index 198b18b..1ae364a 100644
--- a/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/highWorkForm.vue
+++ b/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/highWorkForm.vue
@@ -1,6 +1,6 @@
 <template>
 	<div class="comp-container">
-		<el-form :model="hwForm" label-width="150px" :rules="hwRules" ref="ruleFormRef">
+		<el-form :model="hwForm" label-width="150px" :rules="hwRules" ref="hwRef">
 			<div class="homeCard">
 				<el-row>
 					<el-col :span="8">
@@ -72,23 +72,32 @@
 	}
 	export default defineComponent({
 		name: 'highWorkForm',
-		setup() {
+		props:{
+			hwForm: Object
+		},
+		setup(props) {
 			const userInfo = useUserInfo()
 			const { userInfos } = storeToRefs(userInfo);
 			const state  = reactive<stateType>({});
-			const hwForm = reactive({
-				hwDepartment: '',
-				hwApplyName: '',
-				hwLevel: '',
-				hwHeight: ''
-			})
-			const ruleFormRef = ref<FormInstance>()
+			const hwForm1 = reactive(props.hwForm)
+			const hwRef = ref<FormInstance>()
 			const hwRules = reactive<FormRules>({
 				hwDepartment:[{required: true,message: '此处不可为空',trigger: 'blur'}],
 				hwApplyName:[{required: true,message: '此处不可为空',trigger: 'blur'}],
 				hwLevel: [{required: true,message: '此处不可为空',trigger: 'blur'}],
 				hwHeight: [{required: true,message: '此处不可为空',trigger: 'blur'}]
 			})
+			const validateForm = async () => {
+				let flag = null
+				await hwRef.value.validate(valid=>{
+					if(valid){
+						flag = true
+					}else{
+						flag = false
+					}
+				})
+				return flag
+			}
 			// 折线图
 			const renderMenu = async (value: string) => {
 				Session.set('projectId',value)
@@ -97,9 +106,10 @@
 			};
 			return {
 				renderMenu,
-				hwForm,
-				ruleFormRef,
+				hwForm1,
+				hwRef,
 				hwRules,
+				validateForm,
 				...toRefs(state),
 			};
 		},

--
Gitblit v1.9.2