From 647ef6974a149e21bc88e4b559ba9badaafe367e Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: Mon, 11 Jul 2022 18:02:28 +0800
Subject: [PATCH] 添加我的申请tab切换页面,优化组件表单的校验
---
src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/cutLineForm.vue | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/cutLineForm.vue b/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/cutLineForm.vue
index 046e3b7..4a0a5be 100644
--- a/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/cutLineForm.vue
+++ b/src/views/specialWorkSystem/workApplyManagement/workApplyForm/components/cutLineForm.vue
@@ -1,6 +1,6 @@
<template>
<div class="comp-container">
- <el-form :model="clForm" label-width="180px" :rules="clFormRules" ref="ruleFormRef">
+ <el-form :model="clForm" label-width="180px" :rules="clFormRules" ref="clRef">
<div class="homeCard">
<el-row>
<el-col :span="8">
@@ -108,7 +108,7 @@
const { userInfos } = storeToRefs(userInfo);
const state = reactive<stateType>({});
const clForm1 = reactive(props.clForm)
- const ruleFormRef = ref<FormInstance>()
+ const clRef = ref<FormInstance>()
const clFormRules = reactive<FormRules>({
clDepartment:[{required: true,message: '此处不可为空',trigger: 'blur'}],
clApplyName:[{required: true,message: '此处不可为空',trigger: 'blur'}],
@@ -148,6 +148,17 @@
() => false
)
}
+ const validateForm = async () => {
+ let flag = null
+ await clRef.value.validate(valid=>{
+ if(valid){
+ flag = true
+ }else{
+ flag = false
+ }
+ })
+ return flag
+ }
// 折线图
const renderMenu = async (value: string) => {
Session.set('projectId',value)
@@ -159,8 +170,9 @@
clForm1,
Search,
clFormRules,
- ruleFormRef,
+ clRef,
fileList,
+ validateForm,
handleRemove,
handlePreview,
handleExceed,
--
Gitblit v1.9.2