From eed29804d3973801f8eac3ad9bead1e608f05b6a Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期六, 20 七月 2024 22:31:56 +0800 Subject: [PATCH] 工单及自定义弹出窗口更新 --- src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts | 154 ++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 110 insertions(+), 44 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts index c09ebad..ea24486 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts @@ -4,13 +4,114 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-22 22:33:52 + * @LastEditTime: 2024-07-20 21:26:24 */ import { ActionItem, BasicColumn } from '/@/components/Table'; import { buildUUID } from '/@/utils/uuid'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { isNullOrUnDef } from '/@/utils/is'; +const { t } = useI18n(); function _default() { + const ActionColumn: BasicColumn = { + width: 100, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }; + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ + const methods = { + /** + * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� + * @return {*} + */ + CreateAction: (fnName: string) => { + return { + action: 'go', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) + url: 'BAS_DEFECT/High', + params: { + CODE: '0', + ID: buildUUID(), + Name: 'BAS_DEFECT', + Title: '鏂板涓嶈壇浠g爜缁�', + // pCode: 'DFTG_CODE', + IsID: false, + drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE', type: 'one', keyName: 'BAS_DEFECT' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 + }, + }; + }, + /** + * @description: 鎿嶄綔瀛楁鑷畾涔夋寜閽� + * @return {*} + */ + ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { + if (!isNullOrUnDef(data[0])) { + data[0].onClick = DftGrpEdit.bind(null, args, params); + } + return data; + }, + /** + * @description: 寮瑰嚭閫夋嫨妗嗘垚鍔熻繑鍥炴柟娉� + * @param {*} d + * @param {*} u + * @return {*} + */ + GetSelectSuccess: (d, u) => { + return { + ITEM_CODE: d.values['val'], + }; + }, + /** + * @description: 寮瑰嚭閫夋嫨妗嗘墦寮�鏂规硶 + * @param {Fn} openItemModal + * @return {*} + */ + OpenSelectItem: (openItemModal: Fn, ...args) => { + openItemModal(true, { + title: '鐗╂枡鍒楄〃', + schemas: [ + { + field: 'ITEM_CODE', + component: 'Input', + label: '鐗╂枡缂栫爜', + colProps: { + span: 12, + }, + }, + ], + ItemColumns: [ + { + title: t('鐗╂枡缂栫爜'), + dataIndex: 'ITEM_CODE', + resizable: true, + sorter: true, + width: 200, + }, + { + title: t('鐗╂枡鍚嶇О'), + dataIndex: 'ITEM_NAME', + resizable: true, + sorter: true, + width: 180, + }, + ], + tableName: 'BAS_ITEM', + rowKey: 'ITEM_CODE', + searchInfo: { TABLE_NAME: 'BAS_ITEM' }, + }); + }, + GetUseForm: () => { + return {}; + }, + }; + + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + /** * @description: 鑷畾涔夌紪杈戞柟娉� * @param {Fn} args @@ -22,54 +123,19 @@ CODE: params['record']['DFTG_CODE'], ID: params['record']['ID'], Name: 'BAS_DEFECT', + SessionName: 'BAS_DEFECT_update', Title: `缂栬緫涓嶈壇浠g爜缁勶細${params['record']['DFTG_CODE']}`, pCode: 'DFTG_CODE', IsID: false, + drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE', type: 'one', keyName: 'BAS_DEFECT' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }; - args[5](`/BAS_DEFECT/High/${encodeURI(JSON.stringify(param))}`); + // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage + sessionStorage.removeItem(`${param.SessionName}_params`); + sessionStorage.setItem(`${param.SessionName}_params`, encodeURI(JSON.stringify(param))); + args[5]( + `/BAS_DEFECT/High/${encodeURI(JSON.stringify({ sName: param.SessionName, Name: param.Name }))}`, + ); } - - const ActionColumn: BasicColumn = { - width: 100, - title: '鎿嶄綔', - dataIndex: 'action', - slots: { customRender: 'action' }, - fixed: 'right', - }; - - const methods = { - /** - * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� - * @return {*} - */ - CreateAction: () => { - return { - action: 'go', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) - url: 'BAS_DEFECT/High', - params: { - CODE: '0', - ID: buildUUID(), - Name: 'BAS_DEFECT', - Title: '鏂板涓嶈壇浠g爜缁�', - pCode: 'DFTG_CODE', - IsID: false, - }, - }; - }, - /** - * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽� - * @return {*} - */ - ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { - data[0].onClick = DftGrpEdit.bind(null, args, params); - return data; - }, - GetSelectSuccess:(d, u) => { - return { - ITEM_CODE: d.values['val'], - }; - } - }; return [methods, ActionColumn]; } -- Gitblit v1.9.3