From 226ad601bb8326814c3e94efd6f476014f6a9e66 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 27 六月 2024 23:06:47 +0800 Subject: [PATCH] 产品工艺路线工序配置更新 --- src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts | 273 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 253 insertions(+), 20 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts index a303273..53c0ee9 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts @@ -4,17 +4,20 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-23 00:16:36 + * @LastEditTime: 2024-06-26 03:13:41 */ -import { Ref } from 'vue'; -import { DeleteEntity } from '/@/api/tigerapi/system'; +import { Ref, h, unref } from 'vue'; +import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system'; import { ActionItem, BasicColumn } from '/@/components/Table'; -import { isNullOrEmpty } from '/@/utils/is'; +import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; import { buildUUID } from '/@/utils/uuid'; import { useUserStore } from '/@/store/modules/user'; import { formatToDateTime } from '/@/utils/dateUtil'; +import { Tag } from 'ant-design-vue'; +import { useLocale } from '/@/locales/useLocale'; +const { getLocale } = useLocale(); function _default() { const ActionColumn: BasicColumn = { width: 80, @@ -25,7 +28,246 @@ }; const methods = { - EditOperation: (type: string, data: Ref<any[]>, d, u) => { + /** + * @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 = DftGrpDel.bind(null, args, params); + } + return data; + }, + /** + * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl + * @return {*} + */ + GetHomeUrl: () => { + const param = { ID: 'BAS_DEFECT_GRP', colSlots: [], crudColSlots: [] }; + return `/BAS_DEFECT_GRP/LC/${encodeURI(JSON.stringify(param))}`; + }, + GetBaseColumns: () => { + return [ + { + title: '涓嶈壇浠g爜缂栫爜', + dataIndex: 'DFT_CODE', + // ifShow: false, + width: 180, + }, + { + title: '涓嶈壇浠g爜鍚嶇О', + dataIndex: 'DFT_NAME', + }, + { + title: '缂洪櫡绛夌骇', + dataIndex: 'DFT_LEVEL', + customRender: ({ record }) => { + const type = record.DFT_LEVEL; + var text = ''; + var color = 'green'; + switch (type) { + case 0: + text = '杞诲井缂洪櫡'; + break; + case 1: + color = 'blue'; + text = '涓ラ噸缂洪櫡'; + break; + case 2: + color = 'red'; + text = '鑷村懡缂洪櫡'; + break; + } + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '涓嶈壇浠g爜缁勭紪鐮�', + dataIndex: 'DFTG_CODE', + }, + { + title: '澶囨敞', + dataIndex: 'REMARK', + }, + { + title: '鏇存柊鏃堕棿', + dataIndex: 'UPDATE_TIME', + }, + { + title: '鏇存柊浜�', + dataIndex: 'UPDATE_USER', + }, + ]; + }, + GetSearchForm: () => { + return [ + { + field: 'DFT_CODE', + label: '涓嶈壇浠g爜缂栫爜', + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: '涓嶈壇浠g爜鍚嶇О', + field: 'DFT_NAME', + component: 'Input', + colProps: { + span: 8, + }, + }, + ]; + }, + GetCrudForm: () => { + return [ + { + field: 'DFT_CODE', + label: '涓嶈壇浠g爜缂栫爜', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '涓嶈壇浠g爜鍚嶇О', + field: 'DFT_NAME', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '涓嶈壇浠g爜缁勭紪鐮�', + field: 'DFTG_CODE', + component: 'ApiSelect', + colProps: { + span: 24, + }, + componentProps: { + api: getEntity, + params: { entityName: 'BAS_DEFECT_GRP', sqlcmd: ' 1=1 ' }, + resultField: 'Data.Items', + labelField: 'DFTG_NAME', + valueField: 'DFTG_CODE', + }, + dynamicDisabled: ({ values }) => { + return true; + }, + }, + { + label: '缂洪櫡绛夌骇', + field: 'DFT_LEVEL', + component: 'ApiSelect', + required: true, + colProps: { + span: 24, + }, + componentProps: { + api: GetEnum, + params: { name: 'BAS_DEFECT+DFT_LEVELs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + }, + }, + { + label: '澶囨敞', + field: 'REMARK', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: 'ID', + field: 'ID', + component: 'Input', + colProps: { + span: 24, + }, + show: false, + }, + ]; + }, + GetBaseForm: () => { + return [ + { + field: 'DFTG_CODE', + label: '涓嶈壇浠g爜缁勭紪鐮�', + component: 'Input', + required: true, + colProps: { + span: 8, + }, + }, + { + label: '涓嶈壇浠g爜缁勫悕绉�', + field: 'DFTG_NAME', + required: true, + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: '澶囨敞', + field: 'REMARK', + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: 'ID', + field: 'ID', + component: 'Input', + colProps: { + span: 8, + }, + show: false, + }, + ]; + }, + GetBaseCards: () => { + return [ + { + name: 'BaseForm', + slots: [], + preIcons: {}, + title: '涓嶈壇浠g爜缁勪俊鎭�', + entityName: 'BAS_DEFECT_GRP', + }, + // { + // name: 'prodinfo', + // slots: ['addRot', 'setRot'], + // preIcons: { addRot: 'search|svg', setRot: 'config|svg' }, + // title: '浜у搧淇℃伅', + // }, + // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' }, + ]; + }, + OthersValues: (val: string, id: string) => { + return { DFTG_CODE: val }; + } /** + * @description: 鑷畾涔夋槑缁嗚〃涓紪杈戣繑鍥炴柟娉� + * @param {string} type + * @param {*} d + * @param {*} u + * @return {*} + */, + EditOperation: (data: Ref<any[]>, d, u) => { if (u.isUpdate) { //鏇存柊 var _data = data.value.map((item) => { @@ -57,26 +299,17 @@ } }, /** - * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� + * @description: 鑾峰彇鏍囬淇℃伅 + * @param {string} type * @return {*} */ - CreateAction: () => { + GetTitle: () => { return { - action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) + pageTitle: '涓嶈壇浠g爜缁勭鐞�', + pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀逛笉鑹唬鐮佺粍鍜屼笉鑹唬鐮併��', + baseTableTitle: '涓嶈壇浠g爜绠$悊', }; }, - /** - * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽� - * @return {*} - */ - ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { - data[1].popConfirm.confirm = DftGrpDel.bind(null, args, params); - return data; - }, - GetHomeUrl: () => { - const param = { ID: 'BAS_DEFECT_GRP', colSlots: [], crudColSlots: [] }; - return `/BAS_DEFECT_GRP/LC/${encodeURI(JSON.stringify(param))}`; - } }; /** -- Gitblit v1.9.3