From 8e288eefbd4e8dbf7d0180dd880ce93256daa7a5 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期六, 22 六月 2024 01:05:18 +0800
Subject: [PATCH] 低代码优化

---
 src/views/tigerprojects/system/lowcode/composition/index.vue |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/composition/index.vue b/src/views/tigerprojects/system/lowcode/composition/index.vue
index b1beefd..1e75a9c 100644
--- a/src/views/tigerprojects/system/lowcode/composition/index.vue
+++ b/src/views/tigerprojects/system/lowcode/composition/index.vue
@@ -10,6 +10,7 @@
   >
     <GeneralTree
       class="w-1/4 xl:w-1/5"
+      v-if="isMounted"
       @select="handleSelect"
       @UnSelect="UnSelect"
       :title="title"
@@ -112,6 +113,8 @@
   const others = ref(getOthersValues(entityName.value, objParams.value.CODE, objParams.value.ID));
   const prodCode = ref('');
   const rotType = ref('');
+  const isMounted = ref(false);
+  const custImport = ref(null);
   const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
   const [registerItemAdd, { openModal: openItemModal }] = useModal();
   const [registerDrawer, { openDrawer }] = useDrawer();
@@ -173,11 +176,19 @@
    * @return {*}
    */
   function createIcon(params: Recordable<any>) {
-    return createIconByType(params, entityName.value);
+    const [CreateIcon] = custImport.value.default();
+    return CreateIcon(params);
   }
 
-  onMounted(() => {
-    fetch(entityName.value);
+  onMounted(async () => {
+    isMounted.value = false;
+    /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */
+    try {
+      custImport.value = await import(/* @vite-ignore */`../entityts/${entityName.value}`);
+      await fetch(entityName.value);
+      isMounted.value = true;
+    } catch (e) {
+    }
   });
 
   /**

--
Gitblit v1.9.3