data.ts
4.74 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
import {FormSchema as BFormSchema, useComponentRegister} from "../../../../components/Form";
import {useI18n} from "../../../../hooks/web/useI18n";
const { t } = useI18n();
import { CategoryTreeSelect } from '../../../common/CategoryTreeSelect';
import { OrgTreeSelect } from '../../../common/OrgTreeSelect';
useComponentRegister('OrgTreeSelect', OrgTreeSelect);
useComponentRegister('CategoryTreeSelect', CategoryTreeSelect);
const statusOptions = [
{ label: t('equipment.ledger.NORMAL'), value: 'NORMAL' },
{ label: t('equipment.ledger.FAULT'), value: 'FAULT' },
{ label: t('equipment.ledger.SCRAP'), value: 'SCRAP' },
];
export const formSchema: BFormSchema[] = [
{
field: 'code',
label: t('equipment.ledger.nameCode'),
component: 'Input',
colProps: { span: 24 },
required: true,
componentProps: {
maxLength: 20,
},
},
{
field: 'name',
label: t('equipment.ledger.deviceName'),
component: 'Input',
colProps: { span: 24 },
required: true,
componentProps: {
maxLength: 20,
},
},
{
field: 'categoryId',
label: t('equipment.category.categoryText'),
colProps: { span: 24 },
component: 'CategoryTreeSelect',
required: true,
},
{
field: 'status',
component: 'Select',
label: t('equipment.ledger.status'),
required: true,
colProps: { span: 24 },
defaultValue: 'NORMAL',
componentProps: {
options: statusOptions,
},
},
{
field: 'org',
component: 'OrgTreeSelect',
label: '负责人组织',
required: true,
colProps: { span: 24 },
componentProps: {
// 添加 change 事件
onChange: (value: string) => {
// 这里需要触发加载人员数据的逻辑
console.log(value,'value')
},
},
},
{
field: 'directorId',
component: 'Select',
label: '负责人',
required: true,
colProps: { span: 24 },
componentProps: {
// 动态加载的选项
options: [], // 初始为空,后续动态加载
},
},
{
field: 'isOnline',
component: 'Select',
label: '是否联网',
required: true,
colProps: { span: 24 },
componentProps: {
options: [
{
label: '是',
value: true,
},
{
label: '否',
value: false,
}
],
},
},
{
field: 'brand',
label: t('equipment.ledger.brandText'),
component: 'Input',
colProps: { span: 24 },
componentProps: {
maxLength: 20,
},
},
{
field: 'modelNum',
label: t('equipment.ledger.modelNumText'),
component: 'Input',
colProps: { span: 24 },
componentProps: {
maxLength: 20,
},
},
{
field: 'specifications',
label: t('equipment.ledger.specificationsText'),
component: 'Input',
colProps: { span: 24 },
componentProps: {
maxLength: 20,
},
},
{
field: 'specifications',
label: t('equipment.ledger.manufacturerText'),
component: 'Input',
colProps: { span: 24 },
componentProps: {
maxLength: 20,
},
},
{
field: 'buyDate',
label: t('equipment.ledger.buyDate'),
component: 'DatePicker',
colProps: { span: 24 },
componentProps: {
format: 'YYYY-MM-DD hh:mm:ss', // 设置日期格式
showTime: true, // 显示时间选择器
},
},
{
field: 'price',
label: t('equipment.ledger.priceText'),
component: 'InputNumber',
colProps: { span: 24 },
componentProps: {
},
},
{
field: 'productDate',
label: t('equipment.ledger.productDate'),
component: 'DatePicker',
colProps: { span: 24 },
componentProps: {
format: 'YYYY-MM-DD hh:mm:ss', // 设置日期格式
showTime: true, // 显示时间选择器
},
},
{
field: 'receiveDate',
label: t('equipment.ledger.receiveDate'),
component: 'DatePicker',
colProps: { span: 24 },
componentProps: {
format: 'YYYY-MM-DD hh:mm:ss', // 设置日期格式
showTime: true, // 显示时间选择器
},
},
{
field: 'registeDate',
label: t('equipment.ledger.registeDate'),
component: 'DatePicker',
colProps: { span: 24 },
componentProps: {
format: 'YYYY-MM-DD hh:mm:ss', // 设置日期格式
showTime: true, // 显示时间选择器
},
},
{
field: 'supplierId',
component: 'OrgTreeSelect',
label: '供应商',
colProps: { span: 24 },
componentProps: {
// 添加 change 事件
onChange: (value: string) => {
// 这里需要触发加载人员数据的逻辑
console.log(value,'value')
},
},
},
{
field: 'description',
label: t('equipment.ledger.description'),
component: 'InputTextArea',
colProps: { span: 24 },
componentProps: {
maxLength: 200,
},
},
];