From cdd0a28197fb9b432a45bbf9ebc0cfd8db939125 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 25 七月 2024 10:34:44 +0800 Subject: [PATCH] websocket更新,配置文件增加websocket地址 --- src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts | 96 +++++++++++++++++++++++++++++++----------------- 1 files changed, 62 insertions(+), 34 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 424074c..72c6fd6 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts @@ -4,33 +4,14 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-22 20:35:33 + * @LastEditTime: 2024-07-24 23:02:47 */ +import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; import { ActionItem, BasicColumn } from '/@/components/Table'; +import { useWebSocketStore } from '/@/store/modules/websocket'; function _default() { - /** - * @description: 璺宠浆鍒拌鎯呴〉闈㈡柟娉� - * @param {Fn} go - * @return {*} - */ - function goDetail(go: Fn, params: Recordable) { - const id = { - ID: '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: '鎿嶄綔', @@ -39,34 +20,81 @@ fixed: 'right', }; + /** + * @description: 浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� * @return {*} */ - CreateAction: () => { + CreateAction: (fnName: string) => { return { action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) }; }, /** - * @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 == 'goDetail') { + 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', + }; + // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage + sessionStorage.removeItem(`${id.SessionName}_params`); + sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id))); + go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`); + } + return [methods, ActionColumn]; } -- Gitblit v1.9.3