Commit 10fd328231645a43baa98f100928587a806f08d2

Authored by ww
1 parent d441ea67

fix: 去除新增设备设备名称中文校验

@@ -27,30 +27,14 @@ export const step1Schemas: FormSchema[] = [ @@ -27,30 +27,14 @@ export const step1Schemas: FormSchema[] = [
27 component: 'Input', 27 component: 'Input',
28 componentProps: { 28 componentProps: {
29 maxLength: 255, 29 maxLength: 255,
  30 + placeholder: '请输入别名',
30 }, 31 },
31 }, 32 },
32 { 33 {
33 field: 'name', 34 field: 'name',
34 label: '设备名称', 35 label: '设备名称',
35 component: 'Input', 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 slot: 'snCode', 38 slot: 'snCode',
55 }, 39 },
56 { 40 {
@@ -97,6 +81,7 @@ export const step1Schemas: FormSchema[] = [ @@ -97,6 +81,7 @@ export const step1Schemas: FormSchema[] = [
97 }); 81 });
98 }, 82 },
99 showSearch: true, 83 showSearch: true,
  84 + placeholder: '请选择产品',
100 filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => 85 filterOption: (inputValue: string, option: Record<'label' | 'value', string>) =>
101 option.label.includes(inputValue), 86 option.label.includes(inputValue),
102 }; 87 };
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 </template> 40 </template>
41 <template #snCode="{ model, field }"> 41 <template #snCode="{ model, field }">
42 <div class="flex"> 42 <div class="flex">
43 - <Input v-model:value="model[field]" /> 43 + <Input v-model:value="model[field]" placeholder="请输入设备名称" />
44 <a-button type="link" @click="generateSN">自动生成</a-button> 44 <a-button type="link" @click="generateSN">自动生成</a-button>
45 </div> 45 </div>
46 </template> 46 </template>