From 6cc2d85787171281c269f4a6c3290b4a0762bcb6 Mon Sep 17 00:00:00 2001 From: YangYuGang <1378265336@qq.com> Date: 星期三, 05 三月 2025 16:21:43 +0800 Subject: [PATCH] 生产工具 --- src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts | 70 ++++++++++++++++++++++++++-------- 1 files changed, 53 insertions(+), 17 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts index b669e72..5169b8a 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-08-20 14:59:13 + * @LastEditTime: 2024-10-22 11:40:44 */ import { Tag, Tooltip } from 'ant-design-vue'; @@ -26,6 +26,7 @@ BasLabelTempInput, } from '/@/api/tigerapi/model/mesModel'; import { useUserStore } from '/@/store/modules/user'; +import { cloneDeep } from 'lodash-es'; const { getLocale } = useLocale(); @@ -166,7 +167,7 @@ component: 'Input', isexist: 'N', show: true, - required: true, + // required: true, colProps: { span: 7, }, @@ -346,6 +347,15 @@ GetNewRow: (type: string) => { let values = {}; switch (type) { + case 'BAS_LABEL_VAR': + values = { + VAR_NAME: '', + VAR_TYPE: '', + VAR_VALUE: '', + BARCODE_RULE: '', + REMARK: '', + }; + break; case 'BAS_LABEL_VAR_WO': values = newRow; break; @@ -380,7 +390,7 @@ GetBaseCards: (type: string) => { return [ { - name: 'BaseForm', + name: 'BaseForm', //绗竴涓崱鐗囧悕绉板繀闇�鏄疊aseForm slots: [], preIcons: {}, title: '妯℃澘淇℃伅', @@ -397,7 +407,7 @@ { BAS_LABEL_VAR: useDrawer(), }, - { BAS_LABEL_VAR_WO: useDrawer() }, + // { BAS_LABEL_VAR_WO: useDrawer() }, ]; }, /** @@ -427,13 +437,13 @@ // rowSelection: { // type: 'radio', //'checkbox' // }, - // actionColumn: { - // width: 130, - // title: '鎿嶄綔', - // dataIndex: 'action', - // slots: { customRender: 'action' }, - // fixed: 'right', - // }, //鑷畾涔夋搷浣滃垪 + actionColumn: { + width: 130, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }, //鑷畾涔夋搷浣滃垪 }), BAS_LABEL_VAR_WO: useTable({ title: '鍒楄〃淇℃伅', @@ -546,8 +556,8 @@ PROD_CODE: label.PROD_CODE, REMARK: '', } as unknown as BAS_LABEL_TEMP, - LabelVars: {} as unknown as BAS_LABEL_VAR[], - LabelVarWos: {} as unknown as BAS_LABEL_VAR_WO[], + LabelVars: [] as unknown as BAS_LABEL_VAR[], + LabelVarWos: [] as unknown as BAS_LABEL_VAR_WO[], }; drawers.forEach((d) => { let where = `${d['code']} = '${keyFieldValues.value[d['code']]}'`; @@ -716,6 +726,27 @@ } }); }, + /** + * @desc 淇濆瓨鏂规硶 + */ + SaveRow: (param: CustModalParams) => { + return new Promise((resolve, reject) => { + try { + param.data.value[param.cType] = param.data.value[param.cType].map((d) => { + if (d.ID == param.values['ID']) { + d.VAR_NAME = param.values['VAR_NAME']; + d.VAR_TYPE = param.values['VAR_TYPE']; + d.VAR_VALUE = param.values['VAR_VALUE']; + d.BARCODE_RULE = param.values['BARCODE_RULE']; + d.REMARK = param.values['REMARK']; + } + return d; + }); + } catch { + reject(false); + } + }); + }, }; let columns: BasicColumn[] = []; @@ -738,13 +769,14 @@ title: '鍙橀噺鍚嶇О', ifShow: true, sorter: true, + editRow: true, resizable: true, customRender: () => {}, }, { dataIndex: 'VAR_TYPE', title: '鍙橀噺绫诲瀷', - edit: true, + editRow: true, editRule: true, ifShow: true, sorter: true, @@ -759,7 +791,10 @@ valueField: 'Value', onChange: (e, v) => { if (e == 1 || e == 4) { - const where = e == 1? { TABLE_NAME: 'BAS_LABEL_PV', VAR_TYPE: 0}: { TABLE_NAME: 'BAS_LABEL_PV', VAR_TYPE: 1}; + const where = + e == 1 + ? { TABLE_NAME: 'BAS_LABEL_PV', VAR_TYPE: 0 } + : { TABLE_NAME: 'BAS_LABEL_PV', VAR_TYPE: 1 }; emit('opencust', { data: column.record, name: 'BAS_LABEL_VAR', @@ -837,7 +872,7 @@ { dataIndex: 'VAR_VALUE', title: '鍙橀噺鍊�', - edit: true, + editRow: true, // editable: true, editRule: true, ifShow: (column) => true, @@ -848,7 +883,7 @@ dataIndex: 'BARCODE_RULE', title: '鏉$爜鐢熸垚瑙勫垯', ifShow: true, - edit: true, + editRow: true, editRule: true, sorter: true, resizable: true, @@ -867,6 +902,7 @@ dataIndex: 'REMARK', title: '澶囨敞', ifShow: true, + editRow: true, sorter: true, resizable: true, }, -- Gitblit v1.9.3