From 440522ea896377c45ffd80f4b70927d27e701c64 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 25 十二月 2023 17:30:30 +0800
Subject: [PATCH] 编写评估任务模块逻辑,未完成

---
 src/composables/formConfirm.js |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/composables/formConfirm.js b/src/composables/formConfirm.js
index dc295d5..fcd2828 100644
--- a/src/composables/formConfirm.js
+++ b/src/composables/formConfirm.js
@@ -1,4 +1,4 @@
-import { defineProps, onActivated, onDeactivated, ref, watch } from 'vue';
+import { defineProps, onActivated, onDeactivated, reactive, ref, watch } from 'vue';
 import { useCloned } from '@vueuse/core';
 import { useMessageBoxTip, useMessageBox } from './messageBox';
 
@@ -26,7 +26,8 @@
   // });
 
   //琛ㄥ崟鍐呭
-  const formObj = ref(defaultForm ? defaultForm : {});
+  const formObj = reactive(defaultForm ? defaultForm : {});
+  // const formObj = reactive({});
   let formObjClone = useCloned(formObj, { manual: true });
   //琛ㄥ崟缁勪欢寮曠敤
   const formRef = ref(null);
@@ -92,9 +93,10 @@
   };
 
   // 鎻愪氦琛ㄥ崟
-  const onSubmit = function () {
-    formRef.value.validate((valid) => {
+  const onSubmit = function (messageBox = true) {
+    formRef.value.validate(async (valid) => {
       if (valid) {
+        if (messageBox) {
         useMessageBoxTip({
           confirmMsg: submit.msg,
           confirmTitle: submit.title,
@@ -104,6 +106,10 @@
             return res;
           }
         });
+        } else {
+          await submit.do();
+          submited();
+        }
       }
     });
   };

--
Gitblit v1.9.3