1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
| /*
| * @Description: 工艺相关
| * @Author: Ben Lin
| * @version:
| * @Date: 2024-06-19 20:34:27
| * @LastEditors: Ben Lin
| * @LastEditTime: 2024-07-29 16:53:24
| */
|
| import { ActionItem, BasicColumn } from '/@/components/Table';
| import { useI18n } from '/@/hooks/web/useI18n';
|
| const { t } = useI18n();
|
| function _default() {
| const ActionColumn: BasicColumn = {
| width: 80,
| title: '操作',
| dataIndex: 'action',
| slots: { customRender: 'action' },
| fixed: undefined,
| };
|
| /**
| * @description: 一些自定义方法
| * @return {*}
| */
| const methods = {
| /**
| * @description: 获取新增按钮的行为
| * @return {*}
| */
| CreateAction: (type: string) => {
| return {
| action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
| };
| },
| /**
| * @description: 操作字段自定义按钮
| * @return {*}
| */
| ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
| return data;
| },
| /**
| * @description: 选择过程变量弹出选择框成功返回赋值方法
| * @param {*} d
| * @param {*} u
| * @return {*}
| */
| GetSelectSuccess: (d, u) => {
| return {
| ROT_CODE: d.values['val'],
| };
| },
| /**
| * @description: 打开客户弹出选择框
| * @param {Fn} openItemModal
| * @param {array} args
| * @return {*}
| */
| OpenSelectItem: (openItemModal: Fn, ...args) => {
| openItemModal(true, {
| title: '工艺路线列表',
| schemas: [
| {
| field: 'ROT_CODE',
| component: 'Input',
| label: '工艺路线编码',
| colProps: {
| span: 12,
| },
| },
| {
| field: 'ROT_NAME',
| component: 'Input',
| label: '工艺路线名称',
| colProps: {
| span: 12,
| },
| },
| ],
| ItemColumns: [
| {
| title: t('工艺路线编码'),
| dataIndex: 'ROT_CODE',
| resizable: true,
| sorter: true,
| width: 200,
| },
| {
| title: t('工艺路线名称'),
| dataIndex: 'ROT_NAME',
| resizable: true,
| sorter: true,
| width: 180,
| },
| ],
| tableName: 'MES_ROUTE',
| rowKey: 'ROT_CODE',
| searchInfo: { TABLE_NAME: 'MES_ROUTE' },
| });
| },
| GetUseForm: () => {
| return {};
| },
| };
|
| return [methods, ActionColumn];
| }
|
| export default _default;
|
|