From b3305675a429cac20c2b73464badb64f999b615b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期三, 05 三月 2025 12:09:27 +0800
Subject: [PATCH] 高级页面更新

---
 src/views/tigerprojects/system/lowcode/composition/index.vue |  131 ++++++++++++++++++++++++++++---------------
 1 files changed, 84 insertions(+), 47 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/composition/index.vue b/src/views/tigerprojects/system/lowcode/composition/index.vue
index 5fa8386..58504c3 100644
--- a/src/views/tigerprojects/system/lowcode/composition/index.vue
+++ b/src/views/tigerprojects/system/lowcode/composition/index.vue
@@ -4,20 +4,18 @@
  * @version: 
  * @Date: 2024-06-18 23:30:30
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-29 06:16:43
+ * @LastEditTime: 2024-10-21 23:03:27
 -->
 <template>
   <PageWrapper
-    :dense="dense"
     contentFullHeight
-    fixedHeight
     contentClass="flex"
     :title="pageTitle"
     :content="pageContent"
     @back="goBack"
   >
     <Suspense class="w-1/4 xl:w-1/5">
-      <LeftTree @select="NodeSelect" />
+      <LeftTree @select="NodeSelect" @deletenode="delCallback" />
     </Suspense>
     <Suspense>
       <div class="w-3/4 xl:w-4/5 p-5">
@@ -25,11 +23,16 @@
           <template #[item] v-for="item in otherSlots" :key="item">
             <!-- 鑷畾涔夊唴瀹� -->
             <div class="h-full" style="height: 400px">
-              <FlowChartView :data="routeData" @init="init"
-            /></div>
+              <FlowChartView :data="routeData" @init="init" />
+            </div>
           </template>
         </CarGridNav>
-        <Config v-if="showConfig" :configType="configType" @success="configSuccess" />
+        <Config
+          v-if="showConfig"
+          :configType="configType"
+          :OtherTableName="OtherTableName"
+          @success="configSuccess"
+        />
       </div>
     </Suspense>
     <!-- <BasicTable class="w-3/4 xl:w-4/5" @register="registerTable">
@@ -43,32 +46,35 @@
       </template>
     </BasicTable> -->
     <!-- <normalDrawer @register="registerDrawer" @success="handleSuccess" /> -->
-    <CustModal
-      @register="registerCust"
-      @success="custSuccess"
-      :type="cType"
-      :detailSlots="dtlSlots"
-    >
-      <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� -->
-      <template #[item.name] v-for="item in dtlSlots" :key="item.name">
-        <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]">
-          <!-- 鐢ㄦ彃妲借嚜瀹氫箟寮瑰嚭閫夋嫨妗� -->
-          <template #[name]="{ field }" v-for="name in item.slots" :key="name">
-            <a-button
-              class="mt-1 ml-1"
-              size="small"
-              @click="handleCustClick(field)"
-              :preIcon="item.preIcons[name]"
-            />
-            <GeneralModal
-              @register="useModalData[name][0]"
-              @success="(d, u) => handleEntSuccess(d, u, item.name)"
-            />
-          </template>
-        </BasicForm>
-        <!-- 鑷畾涔夊唴瀹� -->
-      </template>
-    </CustModal>
+    <Suspense>
+      <CustModal
+        @register="registerCust"
+        @success="custSuccess"
+        :type="cType"
+        :detailSlots="dtlSlots"
+        :entityName="entityName"
+      >
+        <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� -->
+        <template #[item.name] v-for="item in dtlSlots" :key="item.name">
+          <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]">
+            <!-- 鐢ㄦ彃妲借嚜瀹氫箟寮瑰嚭閫夋嫨妗� -->
+            <template #[name]="{ field }" v-for="name in item.slots" :key="name">
+              <a-button
+                class="mt-1 ml-1"
+                size="small"
+                @click="handleCustClick(field)"
+                :preIcon="item.preIcons[name]"
+              />
+              <GeneralModal
+                @register="useModalData[name][0]"
+                @success="(d, u) => handleEntSuccess(d, u, item.name)"
+              />
+            </template>
+          </BasicForm>
+          <!-- 鑷畾涔夊唴瀹� -->
+        </template>
+      </CustModal>
+    </Suspense>
   </PageWrapper>
 </template>
 <script lang="ts" setup>
@@ -77,10 +83,9 @@
   import GeneralModal from '/@/views/components/GeneralModal.vue';
   import CarGridNav from './CarGridNav.vue';
   import Config from './Config.vue';
-  import LeftTree from './LeftTree.vue';
   import CustModal from '/@/views/components/CustModal.vue';
   import { OpenCustModal, initRoute } from '../data';
-  import { Ref, VNode, onMounted, provide, ref, unref } from 'vue';
+  import { Ref, VNode, defineAsyncComponent, onMounted, provide, ref, unref } from 'vue';
   import { FlowChartView } from '/@/components/FlowChart';
   import { useRoute } from 'vue-router';
   import { BasicForm, useForm } from '/@/components/Form/index';
@@ -88,17 +93,21 @@
   import { isNullOrUnDef } from '/@/utils/is';
   import { useGo } from '/@/hooks/web/usePage';
   import { useMessage } from '/@/hooks/web/useMessage';
-  import { getRouteData } from '/@/api/tigerapi/mes/router';
   import LogicFlow from '@logicflow/core';
 
-  defineOptions({ name: 'DeptManagement' });
+  defineOptions({ name: '宸ュ崟宸ヨ壓缁戝畾' });
 
+  const LeftTree = defineAsyncComponent(() => import('./LeftTree.vue'));
   const { notification, createErrorModal } = useMessage();
   const go = useGo();
   const route = useRoute();
-  const { setTitle } = useTabs();
-  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); //ref(JSON.parse(history.state.obj))
-  const entityName = ref(objParams.value.Name);
+  const { setTitle, refreshPage } = useTabs();
+  // const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); //ref(JSON.parse(history.state.obj))
+  const routeParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
+  // 浠巗essionStorage涓鍙栧弬鏁板苟杞崲鍥炲璞�
+  const savedParams = sessionStorage.getItem(`${routeParams.value.sName}_params`);
+  const objParams = savedParams ? ref(JSON.parse(decodeURI(savedParams))) : ref({});
+  const entityName = ref(routeParams.value.Name);
   const useModalData = ref({}); //琛ㄥ崟涓彃妲芥覆鏌撴寜閽墦寮�妯℃�佹useModal鏂规硶
   const useFormData = ref({});
   const cType = ref('');
@@ -108,20 +117,23 @@
   const dense = isNullOrUnDef(objParams.value.dense) ? ref(false) : ref(objParams.value.dense);
   const pageTitle = ref(objParams.value.pageTitle);
   const pageContent = ref(objParams.value.pageContent);
+  const colSlots = ref<any>(objParams.value.colSlots);
   const selectedNodes = ref([]);
   const isMounted = ref(false);
   const showNav = ref(false);
   const showConfig = ref(false);
+  const showOtherTable = ref(false);
   const configType = ref('');
+  const OtherTableName = ref('');
   const nodes = ref([]);
   const routeData = ref({
     nodes: [],
     edges: [],
   });
   const custImport = ref<any>(null);
-  const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
+  const [registerCust] = useModal();
   provide<Ref<any>>('objParams', objParams);
-  provide<Ref<any>>('selectedNodes', selectedNodes);
+  provide<Ref<any>>('selectedNodes', nodes);
   setTitle(objParams.value.Title); //璁剧疆鏍囩椤垫爣棰�
 
   /**
@@ -132,7 +144,7 @@
     if (!isNullOrUnDef(custImport.value)) {
       const [{ GetHomeUrl }] = custImport.value['default']();
       // 鏈緥鐨勬晥鏋滄椂鐐瑰嚮杩斿洖濮嬬粓璺宠浆鍒拌处鍙峰垪琛ㄩ〉锛屽疄闄呭簲鐢ㄦ椂鍙繑鍥炰笂涓�椤�
-      go(GetHomeUrl(entityName.value));
+      go(GetHomeUrl({ colSlots: colSlots.value, sName:objParams.value.firstSessionName  }));
     }
   }
 
@@ -156,12 +168,12 @@
 
   const currlf = ref(null) as Ref<LogicFlow | null>;
   /**
-   * @description: 宸ヨ壓璺嚎鍒濆鍖�
+   * @description: 宸ヨ壓璺嚎鍒濆鍖栵紝鐗规畩椤甸潰鑷畾涔夊唴瀹�
    * @param {*} lf
    * @return {*}
    */
   async function init(lf, rotId) {
-    initRoute(lf, rotId, routeData, currlf);
+    initRoute(lf, rotId, routeData, currlf, objParams.value.rotType);
   }
 
   /**
@@ -171,14 +183,32 @@
    */
   function NodeSelect(e) {
     showConfig.value = e.showConfig;
+    showOtherTable.value = e.showOtherTable;
     showNav.value = e.showNav;
     configType.value = e.type;
+    OtherTableName.value = objParams.value.OtherTableName;
     nodes.value = e.nodes;
     routeData.value = {
       nodes: [],
       edges: [],
     };
-    initRoute(currlf, e.nodes[0].id, routeData, currlf);
+    /* 鑷畾涔夊唴瀹癸紝鍙湁鏄剧ず宸ヨ壓璺嚎鐨勭粍鍚堥〉闈細杩涙潵 */
+    if (e.nodes[0].type == 'Route') {
+      let _rotId = e.nodes[0].code;
+      if (objParams.value.rotType == 'Wo') {
+        _rotId = e.nodes[0].wo;
+      }
+      initRoute(currlf, _rotId, routeData, currlf, objParams.value.rotType);
+    }
+  }
+
+  /**
+   * @description: 鍒犻櫎鑺傜偣鍚庡洖璋�
+   * @param {*} node
+   * @return {*}
+   */
+  function delCallback(node) {
+    refreshPage();
   }
 
   /**
@@ -213,7 +243,9 @@
         var values = GetSelectSuccess(d, u);
         selectVals.value = values; //淇濆瓨寮瑰嚭妗嗛�夋嫨鐨勭粨鏋�
         let _val = {};
-        _val[d.returnFieldName] = values[d.returnFieldName];
+        d.returnFieldName.map((x) => {
+          _val[x] = values[x];
+        });
         useFormData.value[item][1].setFieldsValue(_val);
       });
     } catch (e) {}
@@ -234,3 +266,8 @@
     ); //[openRvModal], selectVals.value['ID']杩欐槸鑷畾涔夊弬鏁帮紝鎸夊疄闄呴渶姹�
   }
 </script>
+<style lang="less">
+.vben-page-wrapper .vben-page-wrapper-content {
+    margin: 1px;
+}
+</style>

--
Gitblit v1.9.3