| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-06-27 20:40:25 |
| | | * @LastEditTime: 2024-07-31 08:26:33 |
| | | */ |
| | | |
| | | import { ActionItem, BasicColumn } from '/@/components/Table'; |
| | |
| | | fixed: undefined, |
| | | }; |
| | | |
| | | /** |
| | | * @description: 一些自定义方法 |
| | | * @return {*} |
| | | */ |
| | | const methods = { |
| | | /** |
| | | * @description: 获取新增按钮的行为 |
| | | * @return {*} |
| | | */ |
| | | CreateAction: (fnName: string) => { |
| | | CreateAction: (type: string) => { |
| | | return { |
| | | action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面) |
| | | }; |
| | |
| | | * @return {*} |
| | | */ |
| | | ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { |
| | | data.map((x) => { |
| | | if ( |
| | | (x.name == 'Delete' || x.name == 'Edit') && |
| | | (params['record']['VAR_CODE'] == 'PV-WorkOrder-Plan' || |
| | | params['record']['VAR_CODE'] == 'PV-CUSTOMER' || |
| | | params['record']['VAR_CODE'] == 'PV-ITEM' || |
| | | params['record']['VAR_CODE'] == 'PV-SN') |
| | | ) { |
| | | x.disabled = true; |
| | | x.tooltip = '删除'; |
| | | } |
| | | }); |
| | | return data; |
| | | }, |
| | | /** |
| | |
| | | VAR_VALUE: d.values['val'], |
| | | }; |
| | | }, |
| | | OpenSelectItem:(openItemModal: Fn, ...args) => { |
| | | openItemModal(true, { |
| | | title: '过程变量列表', |
| | | schemas: [ |
| | | { |
| | | field: 'VAR_CODE', |
| | | component: 'Input', |
| | | label: '过程变量编码', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | OpenSelectItem: (openItemModal: Fn, ...args) => { |
| | | openItemModal(true, { |
| | | title: '过程变量列表', |
| | | schemas: [ |
| | | { |
| | | field: 'VAR_CODE', |
| | | component: 'Input', |
| | | label: '过程变量编码', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('过程变量编码'), |
| | | dataIndex: 'VAR_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('过程变量名称'), |
| | | dataIndex: 'VAR_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'BAS_LABEL_PV', |
| | | rowKey: 'VAR_CODE', |
| | | searchInfo: {TABLE_NAME: 'BAS_LABEL_PV'} |
| | | }); |
| | | } |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('过程变量编码'), |
| | | dataIndex: 'VAR_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('过程变量名称'), |
| | | dataIndex: 'VAR_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'BAS_LABEL_PV', |
| | | rowKey: 'VAR_CODE', |
| | | searchInfo: { TABLE_NAME: 'BAS_LABEL_PV' }, |
| | | }); |
| | | }, |
| | | GetUseForm: () => { |
| | | return {}; |
| | | }, |
| | | }; |
| | | |
| | | return [methods, ActionColumn]; |