| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-06-22 00:33:55 |
| | | * @LastEditTime: 2024-06-24 15:52:02 |
| | | */ |
| | | |
| | | import { ActionItem } from '/@/components/Table'; |
| | | import { ActionItem, BasicColumn } from '/@/components/Table'; |
| | | |
| | | function _default() { |
| | | /** |
| | | * @description: 产品绑定工艺路线操作字段自定义按钮 |
| | | * @return {*} |
| | | */ |
| | | function ActionItem(params: Recordable<any>, data, ...args): ActionItem[] { |
| | | return [ |
| | | ...data, |
| | | ...[ |
| | | { |
| | | icon: 'clarity:info-standard-line', |
| | | tooltip: '模板变量', |
| | | onClick: goDetail.bind(null, args[5], params), |
| | | }, |
| | | ], |
| | | ]; |
| | | } |
| | | |
| | | /** |
| | | * @description: 跳转到详情页面方法 |
| | | * @param {Fn} go |
| | |
| | | */ |
| | | function goDetail(go: Fn, params: Recordable) { |
| | | const id = { |
| | | ID: 'BAS_LABEL_VAR', |
| | | ID: params['record'].ID, |
| | | CODE: params['record']['LABEL_CODE'], |
| | | Name: 'BAS_LABEL_VAR', |
| | | firstTabName: '标签模板变量', |
| | | secondTabName: '', //'标签过程变量', |
| | | firstTitle: '模板变量', |
| | |
| | | }; |
| | | go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify(id))}`); |
| | | } |
| | | return [ActionItem]; |
| | | |
| | | const ActionColumn: BasicColumn = { |
| | | width: 120, |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | | fixed: 'right', |
| | | }; |
| | | |
| | | const methods = { |
| | | /** |
| | | * @description: 获取新增按钮的行为 |
| | | * @return {*} |
| | | */ |
| | | CreateAction: (fnName: string) => { |
| | | return { |
| | | action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面) |
| | | }; |
| | | }, |
| | | /** |
| | | * @description: 操作字段自定义按钮 |
| | | * @return {*} |
| | | */ |
| | | ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { |
| | | return [ |
| | | ...data, |
| | | ...[ |
| | | { |
| | | icon: 'clarity:info-standard-line', |
| | | tooltip: '模板变量', |
| | | onClick: goDetail.bind(null, args[5], params), |
| | | }, |
| | | ], |
| | | ]; |
| | | }, |
| | | }; |
| | | |
| | | return [methods, ActionColumn]; |
| | | } |
| | | |
| | | export default _default; |