| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-06-22 00:20:39 |
| | | * @LastEditTime: 2024-07-01 20:14:42 |
| | | */ |
| | | |
| | | import { ActionItem } from '/@/components/Table'; |
| | | import { ActionItem, BasicColumn } from '/@/components/Table'; |
| | | import { isNullOrUnDef } from '/@/utils/is'; |
| | | import { buildUUID } from '/@/utils/uuid'; |
| | | |
| | | function _default() { |
| | | 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[0].onClick = pkgGrpEdit.bind(null, args[5], params); |
| | | return data; |
| | | } |
| | | const methods = { |
| | | /** |
| | | * @description: 获取新增按钮的行为 |
| | | * @return {*} |
| | | */ |
| | | CreateAction: (fnName: string) => { |
| | | return { |
| | | action: 'go', //drawer(打开左侧抽屉框) | go(跳转到新的页面) |
| | | url: 'BAS_PKG_DTL/High', |
| | | params: { |
| | | CODE: '0', |
| | | ID: buildUUID(), |
| | | Name: 'BAS_PKG_DTL', |
| | | Title: '新增包装规则', |
| | | pCode: 'PKG_RULE_ID', |
| | | IsID: true, |
| | | drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID' }], //drawers是右边弹出增改侧框的名字列表 |
| | | }, |
| | | }; |
| | | }, |
| | | /** |
| | | * @description: 操作字段自定义按钮 |
| | | * @return {*} |
| | | */ |
| | | ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { |
| | | if (!isNullOrUnDef(data[0])) { |
| | | data[0].onClick = pkgGrpEdit.bind(null, args[5], params); |
| | | } |
| | | return data; |
| | | }, |
| | | }; |
| | | |
| | | /* 以下是内部方法,不export,供上面的方法调用 */ |
| | | |
| | | /** |
| | | * @description: 自定义编辑方法,跳转到高级页面 |
| | |
| | | Title: `编辑包装规则:${params['record']['RULE_CODE']}`, |
| | | pCode: 'PKG_RULE_ID', |
| | | IsID: true, |
| | | drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID' }], //drawers是右边弹出增改侧框的名字列表 |
| | | }; |
| | | go(`/BAS_PKG_DTL/High/${encodeURI(JSON.stringify(param))}`); |
| | | } |
| | | |
| | | return [ActionItem]; |
| | | return [methods, ActionColumn]; |
| | | } |
| | | |
| | | export default _default; |