From d1d56c89cff34a9a2d52ca6b4694ec0672dadb09 Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: Tue, 12 Jul 2022 18:35:46 +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