From de7e6c408b6209158b08991d729c4bcc72055eec Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 20 六月 2024 00:30:52 +0800 Subject: [PATCH] 产品工艺路线 --- src/views/tigerprojects/system/lowcode/data.ts | 158 +++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 137 insertions(+), 21 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/data.ts b/src/views/tigerprojects/system/lowcode/data.ts index 29d3ef9..a398732 100644 --- a/src/views/tigerprojects/system/lowcode/data.ts +++ b/src/views/tigerprojects/system/lowcode/data.ts @@ -18,15 +18,14 @@ * //.-~~~-~_--~- |-------~~~~~~~~ * //.-~~~--\ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * + * * 绁炲吔淇濅綉 姘告棤BUG */ - /* * @Description: 閫氱敤浣庝唬鐮佸憟鐜伴〉闈富鏁版嵁 * @Author: Ben Lin - * @version: + * @version: * @Date: 2024-06-02 17:52:35 * @LastEditors: Ben Lin * @LastEditTime: 2024-06-14 09:08:11 @@ -44,18 +43,44 @@ DftGrpDel, dftEditeOperation, } from './normal/basDefectGrp'; -import { onChangeFns, rsnGrpEdit, rsGrpGetSelectSuccess, rsGrpOpenSelectItem, rsnBaseSchema, rsnCrudSchema, rsnSearchSchema, rsnBaseColumn, rsnGrpDel, rsnEditeOperation } from './normal/basReasonGrp'; -import { DeleteEntity } from '/@/api/tigerapi/system'; +import { + onChangeFns, + rsnGrpEdit, + rsGrpGetSelectSuccess, + rsGrpOpenSelectItem, + rsnBaseSchema, + rsnCrudSchema, + rsnSearchSchema, + rsnBaseColumn, + rsnGrpDel, + rsnEditeOperation, +} from './normal/basReasonGrp'; +import { DeleteEntity, convertToTree, getEntity } from '/@/api/tigerapi/system'; import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table'; import { useI18n } from '/@/hooks/web/useI18n'; import { isNullOrEmpty } from '/@/utils/is'; import { woCustFn, woformSchema } from '/@/views/components/bizMesWo'; import { useModal } from '/@/components/Modal'; -import { goDetail, labelActionItem, labelGetSelectSuccess, labelOpenSelectItem } from './detail/basLabelVar'; +import { + goDetail, + labelActionItem, + labelGetSelectSuccess, + labelOpenSelectItem, +} from './detail/basLabelVar'; import { buildUUID } from '/@/utils/uuid'; import { Tag } from 'ant-design-vue'; import { Ref, h } from 'vue'; -import { pkgBaseColumn, pkgBaseSchema, pkgCrudSchema, pkgEditeOperation, pkgGrpEdit, pkgSearchSchema } from './basPkgrule'; +import { + pkgBaseColumn, + pkgBaseSchema, + pkgCrudSchema, + pkgEditeOperation, + pkgGrpEdit, + pkgSearchSchema, +} from './basPkgrule'; +import { GetRoutePTree } from '/@/api/tigerapi/mes/router'; +import { V_MES_ROUTE_PTREE } from '/@/api/tigerapi/model/router'; +import { prodRouteCreateIcon } from './composition/prodRoute'; const { t } = useI18n(); @@ -117,13 +142,12 @@ /* 鏍囩妯℃澘 */ case 'BAS_LABEL_TEMP': const _data = labelActionItem; - _data[0].onClick = goDetail.bind(null, args[5], params['record']) + _data[0].onClick = goDetail.bind(null, args[5], params['record']); data = [...data, ..._data]; break; } return data; } - /** * @description: 鑷畾涔夊垹闄ゆ柟娉� @@ -158,7 +182,7 @@ export function EditOperation(type: string, data: Ref<any[]>, d, u) { switch (type) { case 'BAS_PKG_DTL': - return pkgEditeOperation(data, d, u); + return pkgEditeOperation(data, d, u); break; case 'BAS_REASON': return rsnEditeOperation(data, d, u); @@ -178,17 +202,38 @@ case 'BAS_DEFECT_GRP': data.action = 'go'; data.url = 'BAS_DEFECT/High'; - data.params = { CODE: '0', ID: buildUUID(), Name: 'BAS_DEFECT', Title: '鏂板涓嶈壇浠g爜缁�', pCode: 'DFTG_CODE', IsID: false }; + data.params = { + CODE: '0', + ID: buildUUID(), + Name: 'BAS_DEFECT', + Title: '鏂板涓嶈壇浠g爜缁�', + pCode: 'DFTG_CODE', + IsID: false, + }; break; case 'BAS_REASON_GRP': data.action = 'go'; data.url = 'BAS_REASON/High'; - data.params = { CODE: '0', ID: buildUUID(), Name: 'BAS_REASON', Title: '鏂板涓嶈壇鍘熷洜缁�', pCode: 'RSNG_CODE', IsID: false }; + data.params = { + CODE: '0', + ID: buildUUID(), + Name: 'BAS_REASON', + Title: '鏂板涓嶈壇鍘熷洜缁�', + pCode: 'RSNG_CODE', + IsID: false, + }; break; case 'BAS_PKG_RULE': data.action = 'go'; data.url = 'BAS_PKG_DTL/High'; - data.params = { CODE: '0', ID: buildUUID(), Name: 'BAS_PKG_DTL', Title: '鏂板鍖呰瑙勫垯', pCode: 'PKG_RULE_ID', IsID: true }; + data.params = { + CODE: '0', + ID: buildUUID(), + Name: 'BAS_PKG_DTL', + Title: '鏂板鍖呰瑙勫垯', + pCode: 'PKG_RULE_ID', + IsID: true, + }; break; } return data; @@ -344,6 +389,7 @@ ], tableName: 'BAS_ITEM', rowKey: 'ITEM_CODE', + searchInfo: { TABLE_NAME: 'BAS_ITEM' }, }); break; } @@ -364,10 +410,10 @@ break; default: break; - (e) => { }; + (e) => {}; } } else { - (e) => { }; + (e) => {}; } } @@ -418,6 +464,7 @@ ], tableName: 'BAS_ITEM', rowKey: 'ITEM_CODE', + searchInfo: { TABLE_NAME: 'BAS_ITEM' }, }); break; } @@ -490,7 +537,13 @@ }), }; args[2].value = [ - { name: 'BaseForm', slots: [], preIcons: {}, title: '涓嶈壇浠g爜缁勪俊鎭�', entityName: 'BAS_DEFECT_GRP' }, + { + name: 'BaseForm', + slots: [], + preIcons: {}, + title: '涓嶈壇浠g爜缁勪俊鎭�', + entityName: 'BAS_DEFECT_GRP', + }, // { // name: 'prodinfo', // slots: ['addRot', 'setRot'], @@ -514,7 +567,13 @@ }), }; args[2].value = [ - { name: 'BaseForm', slots: [], preIcons: {}, title: '涓嶈壇鍘熷洜缁勪俊鎭�', entityName: 'BAS_REASON_GRP' }, + { + name: 'BaseForm', + slots: [], + preIcons: {}, + title: '涓嶈壇鍘熷洜缁勪俊鎭�', + entityName: 'BAS_REASON_GRP', + }, ]; break; case 'BAS_PKG_DTL': @@ -531,7 +590,13 @@ }), }; args[2].value = [ - { name: 'BaseForm', slots: [], preIcons: {}, title: '鍖呰淇℃伅', entityName: 'BAS_PKG_RULE' }, + { + name: 'BaseForm', + slots: [], + preIcons: {}, + title: '鍖呰淇℃伅', + entityName: 'BAS_PKG_RULE', + }, ]; break; default: @@ -558,6 +623,9 @@ case 'BAS_PKG_DTL': url = `/BAS_PKG_RULE/LC/${encodeURI(JSON.stringify({ ID: 'BAS_PKG_RULE', colSlots: [], crudColSlots: [] }))}`; break; + case 'BAS_LABEL_VAR': + url = `/BAS_LABEL_TEMP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_LABEL_TEMP', colSlots: [], crudColSlots: [] }))}`; + break; default: break; } @@ -573,13 +641,25 @@ let title = {}; switch (type) { case 'BAS_DEFECT': - title = { pageTitle: '涓嶈壇浠g爜缁勭鐞�', pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀逛笉鑹唬鐮佺粍鍜屼笉鑹唬鐮併��', baseTableTitle: '涓嶈壇浠g爜绠$悊' }; + title = { + pageTitle: '涓嶈壇浠g爜缁勭鐞�', + pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀逛笉鑹唬鐮佺粍鍜屼笉鑹唬鐮併��', + baseTableTitle: '涓嶈壇浠g爜绠$悊', + }; break; case 'BAS_REASON': - title = { pageTitle: '涓嶈壇鍘熷洜缁勭鐞�', pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀逛笉鑹師鍥犵粍鍜屼笉鑹唬鐮併��', baseTableTitle: '涓嶈壇鍘熷洜绠$悊' }; + title = { + pageTitle: '涓嶈壇鍘熷洜缁勭鐞�', + pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀逛笉鑹師鍥犵粍鍜屼笉鑹唬鐮併��', + baseTableTitle: '涓嶈壇鍘熷洜绠$悊', + }; break; case 'BAS_PKG_DTL': - title = { pageTitle: '鍖呰瑙勫垯绠$悊', pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀瑰寘瑁呰鍒欏拰鍖呰淇℃伅銆�', baseTableTitle: '鍖呰淇℃伅绠$悊' }; + title = { + pageTitle: '鍖呰瑙勫垯绠$悊', + pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀瑰寘瑁呰鍒欏拰鍖呰淇℃伅銆�', + baseTableTitle: '鍖呰淇℃伅绠$悊', + }; break; default: break; @@ -611,4 +691,40 @@ return Values; } +/** + * @description: 鑾峰彇鏍戝舰鏁版嵁 + * @param {string} type + * @return {*} + */ +export async function fetchTreeData(type: string) { + let data = { title: '', treeData: [] as any[], fieldNames: {} }; + switch (type) { + case 'Customer': + let prodTreeData = await GetRoutePTree('K5019AA013517'); + data.treeData = convertToTree(prodTreeData, 'pid', 'id', 'root'); + data.title = '宸ヨ壓璺嚎'; + data.fieldNames = { key: 'id', title: 'name' } + break; + case 'BAS_PKG_DTL': + break; + default: + break; + } + return data; +} +/** + * @description: 鏍规嵁type鑾峰彇鍥炬爣 + * @param {Recordable} params + * @param {string} type + * @return {*} + */ +export function createIconByType(params: Recordable<any>, type: string) { + let icon = ''; + switch (type) { + case 'Customer': + icon = prodRouteCreateIcon(params); + break; + } + return icon; +} -- Gitblit v1.9.3