...
|
...
|
@@ -27,30 +27,14 @@ export const step1Schemas: FormSchema[] = [ |
27
|
27
|
component: 'Input',
|
28
|
28
|
componentProps: {
|
29
|
29
|
maxLength: 255,
|
|
30
|
+ placeholder: '请输入别名',
|
30
|
31
|
},
|
31
|
32
|
},
|
32
|
33
|
{
|
33
|
34
|
field: 'name',
|
34
|
35
|
label: '设备名称',
|
35
|
36
|
component: 'Input',
|
36
|
|
- dynamicRules: () => {
|
37
|
|
- return [
|
38
|
|
- {
|
39
|
|
- required: true,
|
40
|
|
- validator: (_, value) => {
|
41
|
|
- // 支持英文字母、数字、下划线(_)、中划线(-)、点号(.)、半角冒号(:)和特殊字符@,长度限制为4~32个字符
|
42
|
|
- const reg = /^[A-Za-z0-9_\( \)\-\@\:\.]+$/;
|
43
|
|
- const strLength = String(value).length as number;
|
44
|
|
- if (!reg.test(value) || strLength > 32 || strLength < 4) {
|
45
|
|
- return Promise.reject(
|
46
|
|
- '请输入支持英文字母、数字、下划线(_)、中划线(-)、点号(.)、半角冒号(:)和特殊字符@,长度限制为4~32个字符'
|
47
|
|
- );
|
48
|
|
- }
|
49
|
|
- return Promise.resolve();
|
50
|
|
- },
|
51
|
|
- },
|
52
|
|
- ];
|
53
|
|
- },
|
|
37
|
+ rules: [{ required: true, message: '设备名称为必填项' }],
|
54
|
38
|
slot: 'snCode',
|
55
|
39
|
},
|
56
|
40
|
{
|
...
|
...
|
@@ -97,6 +81,7 @@ export const step1Schemas: FormSchema[] = [ |
97
|
81
|
});
|
98
|
82
|
},
|
99
|
83
|
showSearch: true,
|
|
84
|
+ placeholder: '请选择产品',
|
100
|
85
|
filterOption: (inputValue: string, option: Record<'label' | 'value', string>) =>
|
101
|
86
|
option.label.includes(inputValue),
|
102
|
87
|
};
|
...
|
...
|
|