From 530096340198888eb1808f39c0c75a6f1f6d1132 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期六, 15 六月 2024 16:32:44 +0800
Subject: [PATCH] 一些更新

---
 src/views/tigerprojects/system/lowcode/high/index.vue |   39 ++++++++-------------------------------
 1 files changed, 8 insertions(+), 31 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/high/index.vue b/src/views/tigerprojects/system/lowcode/high/index.vue
index 2ec339a..44cdb75 100644
--- a/src/views/tigerprojects/system/lowcode/high/index.vue
+++ b/src/views/tigerprojects/system/lowcode/high/index.vue
@@ -114,6 +114,7 @@
   getHomeUrl,
   getTitle,
   getOthersValues,
+  EditOperation,
 } from '../data';
 import { useModal } from '/@/components/Modal';
 import { useLocale } from '/@/locales/useLocale';
@@ -153,7 +154,7 @@
 const selectVals = ref({});
 const baseCards = ref([] as any[]);
 const otherCards = ref([] as any[]);
-const others = ref(getOthersValues(entityName.value, objParams.value.CODE));
+const others = ref(getOthersValues(entityName.value, objParams.value.CODE, objParams.value.ID));
 //鑾峰彇琛ㄦ牸鍒椾俊鎭苟鍒濆鍖栦竴浜涙暟鎹紝濡傦細formSchemas(寮瑰嚭妗嗘垨楂樼骇椤甸潰澶氳〃鍗曠粨鏋�), useFormData(琛ㄥ崟涓彃妲芥覆鏌撴寜閽墦寮�妯℃�佹useModal鏂规硶)...绛�
 const _columns = GetBasicColumnAndInit(entityName.value, formSchemas, useFormData, baseCards, otherCards, useForm);
 const data = ref([] as BAS_DEFECT[]);
@@ -213,7 +214,7 @@
     const Keys = Object.getOwnPropertyNames(useFormData.value);
     let i;
     for (i = 0; i < Keys.length; i++) {
-      others.value[objParams.value.pCode] = res[Keys[i]][objParams.value.pCode]
+      others.value[objParams.value.pCode] = objParams.value.IsID ? res[Keys[i]]['ID'] : res[Keys[i]][objParams.value.pCode]
     }
     openDrawer(true, {
       isUpdate: false,
@@ -233,35 +234,8 @@
  * @return {*}
  */
 function handleSuccess(d, u) {
-  if (u.isUpdate) {
-    //鏇存柊
-    var _data = data.value.map((item) => {
-      if (item.ID == d.ID)
-        return {
-          ...item,
-          DFT_CODE: d.DFT_CODE,
-          DFT_NAME: d.DFT_NAME,
-          DFT_LEVEL: d.DFT_LEVEL,
-          REMARK: d.REMARK,
-        };
-      return item;
-    });
-    data.value = _data;
-  } else {
-    //鏂板
-    d.ID = buildUUID();
-    d.CREATE_USER = useUserStore().getUserInfo.userId as string;
-    d.UPDATE_TIME = formatToDateTime(new Date());
-    d.UPDATE_USER = useUserStore().getUserInfo.userId as string;
-    var _data2: any[] = [];
-    if (!isNullOrEmpty(data.value)) {
-      _data2 = data.value.map((item) => {
-        return item;
-      });
-    }
-    _data2.push(d);
-    data.value = _data2;
-  }
+  /* 鑷畾涔夌紪杈戞柟娉曪紝鏍规嵁瀹炰綋鍚嶅幓璋冪敤 */
+  EditOperation(entityName.value, data, d, u)
   setProps({
     dataSource: [],
   });
@@ -307,6 +281,9 @@
       Promise.all(p).then((action) => {
         DeleteWhere(` ${objParams.value.pCode} = '${others.value[objParams.value.pCode]}'`, entityName.value).then((res) => {
           if (res.IsSuccessed) {
+            data.value.forEach((item) => {
+              item.ID = buildUUID();
+            });
             AddListEntity(data.value, entityName.value).then((action) => {
               if (action.IsSuccessed) {
                 cancel();

--
Gitblit v1.9.3