From a82003f4cf9ae6b69f70212374b3a71090f1770f Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期六, 27 七月 2024 13:24:37 +0800
Subject: [PATCH] 打印模板更新为高级页面

---
 src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts |  139 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 102 insertions(+), 37 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
index 02f4089..4ef3a4c 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
@@ -4,35 +4,15 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-23 23:53:41
+ * @LastEditTime: 2024-07-27 13:20:29
  */
 
+import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
 import { ActionItem, BasicColumn } from '/@/components/Table';
+import { useWebSocketStore } from '/@/store/modules/websocket';
+import { buildUUID } from '/@/utils/uuid';
 
 function _default() {
-  /**
-   * @description: 璺宠浆鍒拌鎯呴〉闈㈡柟娉�
-   * @param {Fn} go
-   * @return {*}
-   */
-  function goDetail(go: Fn, params: Recordable) {
-    const id = {
-      ID: params['record'].ID,
-      CODE: params['record']['LABEL_CODE'],
-      Name: 'BAS_LABEL_VAR',
-      firstTabName: '鏍囩妯℃澘鍙橀噺',
-      secondTabName: '', //'鏍囩杩囩▼鍙橀噺',
-      firstTitle: '妯℃澘鍙橀噺',
-      secondTitle: '', //'杩囩▼鍙橀噺',
-      pageTitle: '鏍囩妯℃澘鍙橀噺', //璇︽儏椤甸潰鏍囬
-      contentStr: '杩欓噷鏄爣绛炬ā鏉垮彉閲忕鐞嗛〉闈紝鍙互绠$悊鏍囩鐨勬ā鏉垮彉閲忔垨鑰呮墦鍗拌繃绋嬩腑鐨勫彉閲�',
-      detailName: `妯℃澘[${params['record'].LABEL_NAME}]`,
-      others: { LABEL_ID: params['record'].ID },
-      colSlots: ['BAS_LABEL_PV1add'],
-    };
-    go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify(id))}`);
-  }
-
   const ActionColumn: BasicColumn = {
     width: 120,
     title: '鎿嶄綔',
@@ -41,34 +21,119 @@
     fixed: 'right',
   };
 
+  /**
+   * @description: 浜涜嚜瀹氫箟鏂规硶
+   * @return {*}
+   */
   const methods = {
     /**
      * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
      * @return {*}
      */
-    CreateAction: () => {
+    CreateAction: (fnName: string) => {
       return {
-        action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�)
+        action: 'go', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�)
+        url: 'BAS_LABEL_VAR/High',
+        params: {
+          CODE: '0',
+          ID: buildUUID(),
+          Name: 'BAS_LABEL_VAR', //瀹炰綋鍚�
+          Title: '鏂板妯℃澘', //鏍囬
+          pCode: 'LABEL_CODE', //涓讳俊鎭叧閿瓧娈礐ODE
+          IsID: false, //鏄惁甯﹁繃鍘讳晶杈规鐨勬槸ID锛宖alse灏辨槸CODE锛宼rue鏄疘D
+          drawers: [
+            { name: 'BAS_LABEL_VAR', code: 'LABEL_ID', type: 'one', keyName: 'BAS_LABEL_VAR', order: 'VAR_NAME' },
+            // {
+            //   name: 'MES_SHIFT_PRD',
+            //   code: 'SFT_CODE',
+            //   type: 'all',
+            //   keyName: 'MES_SHIFT',
+            //   order: 'SFT_CODE, SEQ',
+            // },
+          ], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
+        },
       };
     },
     /**
-     * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽�
+     * @description: 鎿嶄綔瀛楁鑷畾涔夋寜閽�
      * @return {*}
      */
     ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
-      return [
-        ...data,
-        ...[
-          {
-            icon: 'clarity:info-standard-line',
-            tooltip: '妯℃澘鍙橀噺',
-            onClick: goDetail.bind(null, args[5], params),
-          },
-        ],
-      ];
+      data.map((x) => {
+        if (x.name == 'Edit') {
+          x.onClick = goDetail.bind(null, args[5], params);
+          x.tooltip = '妯℃澘鍙橀噺';
+        }
+      });
+      return data;
+    },
+    GetUseForm: () => {
+      return {};
+    },
+    /**
+     * @description: 鑷畾涔夋柟娉�
+     * @param {string} type
+     * @param {array} args
+     * @return {*}
+     */
+    CustFunc: (param: CustModalParams) => {
+      const webSocketStore = useWebSocketStore();
+      if (webSocketStore.GetSocketState == 1) {
+        webSocketStore.sendMessage(
+          `wsSubStrings ${param.values['ID']}_#_${param.values['TEMP_PATH']}`
+        );
+      }
     },
   };
 
+  /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */
+
+  /**
+   * @description: 璺宠浆鍒拌鎯呴〉闈㈡柟娉�
+   * @param {Fn} go
+   * @return {*}
+   */
+  function goDetail(go: Fn, params: Recordable) {
+    // const id = {
+    //   ID: params['record'].ID,
+    //   CODE: params['record']['LABEL_CODE'],
+    //   Name: 'BAS_LABEL_VAR',
+    //   firstTabName: '鏍囩妯℃澘鍙橀噺',
+    //   secondTabName: '', //'鏍囩杩囩▼鍙橀噺',
+    //   firstTitle: '妯℃澘鍙橀噺',
+    //   secondTitle: '', //'杩囩▼鍙橀噺',
+    //   pageTitle: '鏍囩妯℃澘鍙橀噺', //璇︽儏椤甸潰鏍囬
+    //   contentStr: '杩欓噷鏄爣绛炬ā鏉垮彉閲忕鐞嗛〉闈紝鍙互绠$悊鏍囩鐨勬ā鏉垮彉閲忔垨鑰呮墦鍗拌繃绋嬩腑鐨勫彉閲�',
+    //   detailName: `妯℃澘[${params['record'].LABEL_NAME}]`,
+    //   keyFieldValues: { LABEL_ID: params['record'].ID },
+    //   colSlots: ['BAS_LABEL_PV1add'],
+    //   SessionName: 'BAS_LABEL_VAR_update',
+    // };
+    const id = {
+      CODE: params['record']['LABEL_CODE'],
+      ID: params['record']['ID'],
+      Name: 'BAS_LABEL_VAR',
+      SessionName: 'BAS_LABEL_VAR_update',
+      Title: `缂栬緫妯℃澘${params['record']['LABEL_CODE']}鐨勫彉閲廯,
+      pCode: 'LABEL_CODE',
+      IsID: true,
+      drawers: [
+        { name: 'BAS_LABEL_VAR', code: 'LABEL_ID', type: 'one', keyName: 'BAS_LABEL_VAR', order: 'VAR_NAME' },
+        // {
+        //   name: 'MES_SHIFT_PRD',
+        //   code: 'SFT_CODE',
+        //   type: 'all',
+        //   keyName: 'MES_SHIFT',
+        //   order: 'SFT_CODE, SEQ',
+        // },
+      ], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
+    };
+    // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
+    sessionStorage.removeItem(`${id.SessionName}_params`);
+    sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id)));
+    go(`/BAS_LABEL_VAR/High/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`);
+  }
+
   return [methods, ActionColumn];
 }
 

--
Gitblit v1.9.3