From 943954bdcb3b672b89cfa097e53d2ac17a36a101 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 30 六月 2024 13:13:25 +0800 Subject: [PATCH] 产品工艺路线路由节点选择功能更新 --- src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts | 332 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 311 insertions(+), 21 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts index e94bebc..59ceb76 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts @@ -4,23 +4,321 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-22 00:34:46 + * @LastEditTime: 2024-06-26 03:14:01 */ -import { DeleteEntity } from '/@/api/tigerapi/system'; -import { ActionItem } from '/@/components/Table'; -import { isNullOrEmpty } from '/@/utils/is'; +import { Ref } from 'vue'; +import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; +import { ActionItem, BasicColumn } from '/@/components/Table'; +import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; +import { buildUUID } from '/@/utils/uuid'; +import { useUserStore } from '/@/store/modules/user'; +import { formatToDateTime } from '/@/utils/dateUtil'; -function _default() { +function _default(): any[] { + const ActionColumn: BasicColumn = { + width: 80, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: undefined, + }; + /** - * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽� + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 * @return {*} - */ - function ActionItem(params: Recordable<any>, data, ...args): ActionItem[] { - data[1].popConfirm.confirm = custDel.bind(null, args[1], params); - return data; - } + */ + const methods = { + /** + * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� + * @return {*} + */ + CreateAction: (fnName: string) => { + return { + action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) + }; + }, + /** + * @description: 鎿嶄綔瀛楁鑷畾涔夋寜閽� + * @return {*} + */ + ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { + /* 閲嶅啓鍒犻櫎鏂规硶 */ + if (!isNullOrUnDef(data[1])) { + data[1].popConfirm.confirm = custDel.bind(null, args, params); + } + return data; + }, + /** + * @description: 鑷畾涔夋槑缁嗚〃涓紪杈戣繑鍥炴柟娉� + * @param {string} type + * @param {*} d + * @param {*} u + * @return {*} + */ + EditOperation: (data: Ref<any[]>, d, u) => { + if (u.isUpdate) { + //鏇存柊 + var _data = data.value.map((item) => { + if (item['ID'] == d.ID) + return { + ...item, + PKG_CODE: d.PKG_CODE, + PKG_LEVEL: d.PKG_LEVEL, + PKG_QTY: d.PKG_QTY, + LABEL_CODE: d.LABEL_CODE, + REMARK: d.REMARK, + }; + return item; + }); + data.value = _data; + } else { + //鏂板 + d.ID = buildUUID(); + d.CREATE_USER = useUserStore().getUserInfo.userId as string; + d.UPDATE_TIME = formatToDateTime(new Date()); + d.UPDATE_USER = useUserStore().getUserInfo.userId as string; + var _data2: any[] = []; + if (!isNullOrEmpty(data.value)) { + _data2 = data.value.map((item) => { + return item; + }); + } + _data2.push(d); + data.value = _data2; + } + }, + /** + * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl + * @return {*} + */ + GetHomeUrl: () => { + return `/BAS_PKG_RULE/LC/${encodeURI(JSON.stringify({ ID: 'BAS_PKG_RULE', colSlots: [], crudColSlots: [] }))}`; + }, + /** + * @description: 楂樼骇琛ㄥ崟鏄庣粏琛ㄦ牸瀛楁 + * @return {*} + */ + GetBaseColumns: () => { + return [ + { + title: '鍖呰/杞藉叿缂栫爜', + dataIndex: 'PKG_CODE', + // ifShow: false, + width: 180, + }, + { + title: '鍖呰灞傜骇', + dataIndex: 'PKG_LEVEL', + }, + { + title: '鍖呰鏁伴噺', + dataIndex: 'PKG_QTY', + }, + { + title: '鍖呰瑙勫垯ID', + dataIndex: 'PKG_RULE_ID', + ifShow: false, + }, + { + title: '澶囨敞', + dataIndex: 'REMARK', + }, + { + title: '鏇存柊鏃堕棿', + dataIndex: 'UPDATE_TIME', + }, + { + title: '鏇存柊浜�', + dataIndex: 'UPDATE_USER', + }, + ]; + }, + /** + * @description: 楂樼骇琛ㄥ崟鏌ヨ鏉′欢瀛楁 + * @return {*} + */ + GetSearchForm: () => { + return [ + { + field: 'PKG_CODE', + label: '鍖呰瑙勫垯缂栫爜', + component: 'Input', + colProps: { + span: 8, + }, + }, + ]; + }, + /** + * @description: 楂樼骇琛ㄥ崟澧炲垹鏀硅〃鍗曞瓧娈� + * @return {*} + */ + GetCrudForm: () => { + return [ + { + field: 'PKG_CODE', + label: '鍖呰/杞藉叿缂栫爜', + component: 'ApiSelect', + required: true, + colProps: { + span: 24, + }, + componentProps: { + api: getEntity, + params: { entityName: 'BAS_PKG_TYPE', sqlcmd: ' 1=1 ' }, + resultField: 'Data.Items', + labelField: 'PKG_NAME', + valueField: 'PKG_CODE', + }, + }, + { + label: '鍖呰灞傜骇', + field: 'PKG_LEVEL', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '鍖呰瑙勫垯ID', + field: 'PKG_RULE_ID', + component: 'Input', + colProps: { + span: 24, + }, + dynamicDisabled: ({ values }) => { + return true; + }, + }, + { + label: '鍖呰鏁伴噺', + field: 'PKG_QTY', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: '澶囨敞', + field: 'REMARK', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: 'ID', + field: 'ID', + component: 'Input', + colProps: { + span: 24, + }, + show: false, + }, + ]; + }, + OthersValues: (val: string, id: string) => { + return { PKG_RULE_ID: id }; + }, + /** + * @description: 楂樼骇琛ㄥ崟涓诲熀鏈俊鎭瓧娈� + * @return {*} + */ + GetBaseForm: () => { + return [ + { + field: 'RULE_CODE', + label: '鍖呰瑙勫垯缂栫爜', + component: 'Input', + required: true, + colProps: { + span: 8, + }, + }, + { + label: '鍖呰瑙勫垯鍚嶇О', + field: 'RULE_NAME', + required: true, + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: '鏄惁鍚敤', + field: 'IS_ACTIVE', + required: true, + component: 'Select', + colProps: { + span: 8, + }, + componentProps: { + options: [ + { + label: '鍚敤', + value: 'Y', + key: 'Y', + }, + { + label: '绂佺敤', + value: 'N', + key: 'N', + }, + ], + }, + }, + { + label: '澶囨敞', + field: 'REMARK', + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: 'ID', + field: 'ID', + component: 'Input', + colProps: { + span: 8, + }, + show: false, + }, + ]; + }, + /** + * @description: 楂樼骇琛ㄥ崟涓讳俊鎭崱鐗囩敓鎴愶紝鍙互澶氫釜 + * @return {*} + */ + GetBaseCards: () => { + return [ + { + name: 'BaseForm', + slots: [], //瀹氫箟鎻掓Ы + preIcons: {}, //瀹氫箟鎻掓Ы涓寜閽浘鏍� + title: '鍖呰淇℃伅', + entityName: 'BAS_PKG_RULE', //瀹炰綋鍚嶇О + }, + ]; + }, + /** + * @description: 鑾峰彇鏍囬淇℃伅 + * @param {string} type + * @return {*} + */ + GetTitle: () => { + return { + pageTitle: '鍖呰瑙勫垯绠$悊', + pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀瑰寘瑁呰鍒欏拰鍖呰淇℃伅銆�', + baseTableTitle: '鍖呰淇℃伅绠$悊', + }; + }, + }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + /** * @description: 鑷畾涔夊垹闄ゆ柟娉� * @param {Fn} args @@ -46,17 +344,9 @@ }); } } - /** - * @description: 鍏敤缂栬緫鏂规硶 - * @param {Fn} fn - * @param {*} params - * @return {*} - */ - function editRecord(fn: Fn, params: {}) { - fn(true, params); - } - return [ActionItem]; + + return [methods, ActionColumn]; } export default _default; -- Gitblit v1.9.3