From cc88111d61a350a4d24cf339b526d4357f934ddf Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 30 七月 2024 00:31:12 +0800 Subject: [PATCH] 标签模板维护变量更新 --- src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts | 122 ++++++++++++++++++++++++++++++++-------- 1 files changed, 98 insertions(+), 24 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 cca2279..b880b06 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts @@ -4,10 +4,13 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-03 08:52:24 + * @LastEditTime: 2024-07-29 23:38:12 */ +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() { const ActionColumn: BasicColumn = { @@ -27,9 +30,39 @@ * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� * @return {*} */ - CreateAction: (fnName: string) => { + CreateAction: (type: string) => { return { - action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) + action: 'go', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) | edit(濡傛灉鏄〃鏍煎彲缂栬緫椤甸潰灏辨槸鑷畾涔夋柟娉�) + url: 'BAS_LABEL_VAR/High', + params: { + CODE: '0', + ID: buildUUID(), + Name: 'BAS_LABEL_VAR', //瀹炰綋鍚� + Title: '鏂板妯℃澘', //鏍囬 + pCode: 'LABEL_CODE', //涓讳俊鎭叧閿瓧娈礐ODE + IsID: true, //鏄惁甯﹁繃鍘讳晶杈规鐨勬槸ID锛宖alse灏辨槸CODE锛宼rue鏄疘D + colSlots: ['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'], + drawers: [ + { + name: 'BAS_LABEL_VAR', //瀹炰綋鍚� + code: 'LABEL_ID', //浼犻�掕繃鍘婚珮绾ц〃鍗曢〉闈㈢殑鍏抽敭瀛楁鍚� + type: 'one', //one-琛ㄧず闇�瑕乧ode鐨勪竴涓�硷紝榛樿鏄繖涓� + keyName: 'BAS_LABEL_VAR', //鍏抽敭琛ㄥ悕锛堝疄浣撳悕锛� + order: 'VAR_NAME', //鎺掑簭 + showTbButton: false, //鏄惁鏄剧ず宸ュ叿鏍忔寜閽� + FnName: '', //鑷畾涔夋柟娉曞悕 + }, + { + name: 'BAS_LABEL_VAR_WO', //瀹炰綋鍚� + code: 'LABEL_ID', //浼犻�掕繃鍘婚珮绾ц〃鍗曢〉闈㈢殑鍏抽敭瀛楁鍚� + type: 'one', //all-琛ㄧず闇�瑕乧ode鐨勬墍鏈夌殑鍊� + keyName: 'BAS_LABEL_VAR_WO', //鍏抽敭琛ㄥ悕锛堝疄浣撳悕锛� + order: '', + showTbButton: true, //鏄惁鏄剧ず宸ュ叿鏍忔寜閽� + FnName: 'AddRow', //鑷畾涔夋柟娉曞悕 + }, + ], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃锛屽強鎸夐挳鐨勬墽琛屾柟娉� + }, }; }, /** @@ -37,16 +70,30 @@ * @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']}`, + ); + } }, }; @@ -59,20 +106,47 @@ */ function goDetail(go: Fn, params: Recordable) { const id = { - ID: params['record'].ID, CODE: params['record']['LABEL_CODE'], + ID: params['record']['ID'], 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', + Title: `缂栬緫妯℃澘${params['record']['LABEL_CODE']}鐨勫彉閲廯, + pCode: 'LABEL_CODE', + IsID: true, + colSlots: ['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'], + drawers: [ + { + name: 'BAS_LABEL_VAR', + code: 'LABEL_ID', + type: 'one', + keyName: 'BAS_LABEL_VAR', + order: 'VAR_NAME', + showTbButton: false, + FnName: '', + }, + { + name: 'BAS_LABEL_VAR_WO', + code: 'LABEL_ID', + type: 'one', + keyName: 'BAS_LABEL_VAR_WO', + order: '', + showTbButton: true, + FnName: 'AddRow', + }, + ], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }; - go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify(id))}`); + // const webSocketStore = useWebSocketStore(); + // if (webSocketStore.GetSocketState == 1) { + // webSocketStore.sendMessage( + // `wsSubStrings 1d441e20c43a469286319de9b0df5d7b_#_http://localhost:8800/files/10浣嶅敮涓�ID.btw`, + // ); + // } + // 灏嗗璞¤浆鎹负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