From 8cfe56d782e4f8cddf0fa8f0cff84a5b4034aa3d Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期日, 23 六月 2024 00:40:40 +0800
Subject: [PATCH] 一些优化

---
 src/views/tigerprojects/system/lowcode/detail/index.vue |   87 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 70 insertions(+), 17 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/detail/index.vue b/src/views/tigerprojects/system/lowcode/detail/index.vue
index efc08db..35bf287 100644
--- a/src/views/tigerprojects/system/lowcode/detail/index.vue
+++ b/src/views/tigerprojects/system/lowcode/detail/index.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-18 15:09:48
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-22 22:54:16
+ * @LastEditTime: 2024-06-23 00:31:33
 -->
 <!--
  * @Description: 浣庝唬鐮佽鎯呭憟鐜伴〉闈�
@@ -122,12 +122,7 @@
   import { useGo } from '/@/hooks/web/usePage';
   //璇︽儏鍒楄〃
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
-  import {
-    OpenCustModal,
-    OpenSelectItem,
-    custOnChange,
-    getHomeUrl,
-  } from '../data';
+  import { OpenCustModal, custOnChange } from '../data';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { DeleteEntity, getListByPage } from '/@/api/tigerapi/system';
@@ -139,6 +134,9 @@
   import { useGlobSetting } from '/@/hooks/setting';
   import { useModal } from '/@/components/Modal';
   import { GetBaseColumns, GetFormColumns, GetSearchFormColumns } from './data';
+  import { isNullOrUnDef } from '/@/utils/is';
+
+  const { t } = useI18n();
 
   const { t: bt } = useI18n('');
   const { createMessage } = useMessage();
@@ -189,7 +187,7 @@
       schemas: GetSearchFormColumns(entityName.value, 'detailfirst'),
     },
     actionColumn: {
-      width: 80,
+      width: 130,
       title: '鎿嶄綔',
       dataIndex: 'action',
       slots: { customRender: 'action' },
@@ -245,7 +243,16 @@
 
   // 椤甸潰宸︿晶鐐瑰嚮杩斿洖閾炬帴鏃剁殑鎿嶄綔
   function goBack() {
-    go(getHomeUrl(entityName.value));
+    /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */
+    try {
+      import(/* @vite-ignore */ `../entityts/${entityName.value}`)
+        .then((m) => {
+          const [{ GetHomeUrl }] = m.default();
+          // 鏈緥鐨勬晥鏋滄椂鐐瑰嚮杩斿洖濮嬬粓璺宠浆鍒拌处鍙峰垪琛ㄩ〉锛屽疄闄呭簲鐢ㄦ椂鍙繑鍥炰笂涓�椤�
+          go(GetHomeUrl(entityName.value));
+        })
+        .catch(() => {});
+    } catch (e) {}
   }
   const tabClkcallback = (val: string) => {
     if (val == 'detailfirst') {
@@ -303,10 +310,16 @@
     try {
       import(
         /* @vite-ignore */ `../entityts/${getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]}`
-      ).then((m) => {
-        const [{ GetSelectSuccess }] = m.default();
-        getForm().setFieldsValue(GetSelectSuccess(d, u));
-      });
+      )
+        .then((m) => {
+          const [{ GetSelectSuccess }] = m.default();
+          getForm().setFieldsValue(GetSelectSuccess(d, u));
+        })
+        .catch(() => {
+          getForm().setFieldsValue({
+            ITEM_CODE: d.values['val'],
+          });
+        });
     } catch (e) {}
   }
 
@@ -316,10 +329,50 @@
    * @return {*}
    */
   function handleSelectItem(item) {
-    OpenSelectItem(
-      openItemModal,
-      getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`],
-    );
+    /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */
+    try {
+      import(
+        /* @vite-ignore */ `../entityts/${getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]}`
+      )
+        .then((m) => {
+          const [{ OpenSelectItem }] = m.default();
+          OpenSelectItem(openItemModal);
+        })
+        .catch(() => {
+          openItemModal(true, {
+            title: '鐗╂枡鍒楄〃',
+            schemas: [
+              {
+                field: 'ITEM_CODE',
+                component: 'Input',
+                label: '鐗╂枡缂栫爜',
+                colProps: {
+                  span: 12,
+                },
+              },
+            ],
+            ItemColumns: [
+              {
+                title: t('鐗╂枡缂栫爜'),
+                dataIndex: 'ITEM_CODE',
+                resizable: true,
+                sorter: true,
+                width: 200,
+              },
+              {
+                title: t('鐗╂枡鍚嶇О'),
+                dataIndex: 'ITEM_NAME',
+                resizable: true,
+                sorter: true,
+                width: 180,
+              },
+            ],
+            tableName: 'BAS_ITEM',
+            rowKey: 'ITEM_CODE',
+            searchInfo: { TABLE_NAME: 'BAS_ITEM' },
+          });
+        });
+    } catch (e) {}
   }
 
   /**

--
Gitblit v1.9.3