Эх сурвалжийг харах

fix(CustomDialog): 修复二次打开表单直接触发验证的BUG

fxs 2 сар өмнө
parent
commit
d2564f0d16

+ 4 - 0
src/components/common/CustomDialog.vue

@@ -106,6 +106,9 @@ const addForm = () => {
   dialogConfigInfo.reqConfig.url = addUrl.value
   dialogConfig.type = 0
   dialogConfig.dialogVisible = true
+  nextTick(() => {
+    dialogFormRef.value?.clearValid?.()
+  })
 }
 
 // 表单修改
@@ -118,6 +121,7 @@ const editForm = (row: any, updateURL?: string) => {
   }
 
   nextTick(() => {
+    dialogFormRef.value?.clearValid?.()
     dialogFormRef.value?.fillForm(row)
   })
 }

+ 1 - 0
src/components/form/CustomForm.vue

@@ -89,6 +89,7 @@ const submitFormData = (otherOption?: any) => {
  */
 const resetForm = () => {
   formRef.value?.resetFields()
+  formRef.value?.clearValidate()
   setDefaultValue()
 }
 

+ 1 - 2
src/views/AppManage/GameManageView.vue

@@ -24,7 +24,6 @@ import type { ResponseInfo } from '@/types/res.ts'
 import { FieldSpecialEffectType } from '@/types/tableText.ts'
 import { computed, onMounted, reactive, ref } from 'vue'
 import { useRequest } from '@/hooks/useRequest.ts'
-import { useCommonStore } from '@/stores/useCommon.ts'
 
 import Dialog from '@/components/common/CustomDialog.vue'
 import Table from '@/components/table/CustomTable.vue'
@@ -279,7 +278,7 @@ const gameRules = reactive<FormRules<typeof gameFormRule>>({
   pid: [
     {
       required: true,
-      message: '请输入gid',
+      message: '请选择Pid',
       trigger: 'blur'
     }
   ]

+ 1 - 0
src/views/IndexView.vue

@@ -379,6 +379,7 @@ onMounted(() => {
   initLoadResource(resourceInfo).then((data) => {
     Object.assign(blobUrlInfo, data)
   })
+  console.log(selectInfo)
   selectedGame.value = selectInfo.gid
 
   if (userInfo) {