Commit be3f27997eba3ff8fd363eb4f4e9108556822784
Committed by
xp.Huang
1 parent
be0aa579
fix:修复枚举值可以输入小数&&参考描述添加正则验证
Showing
2 changed files
with
11 additions
and
2 deletions
| ... | ... | @@ -20,6 +20,8 @@ export const getFormSchemas = (): FormSchema[] => { |
| 20 | 20 | placeholder: '编号如"0"', |
| 21 | 21 | min: -2147483648, |
| 22 | 22 | max: 2147483647, |
| 23 | + step: 1, | |
| 24 | + decimalSeparator: 0, | |
| 23 | 25 | }; |
| 24 | 26 | }, |
| 25 | 27 | colProps: { |
| ... | ... | @@ -39,7 +41,14 @@ export const getFormSchemas = (): FormSchema[] => { |
| 39 | 41 | field: FormFieldsEnum.NAME, |
| 40 | 42 | label: '', |
| 41 | 43 | component: 'Input', |
| 42 | - rules: [{ required: true, message: `参数描述不能为空`, type: 'string' }], | |
| 44 | + rules: [ | |
| 45 | + { | |
| 46 | + required: true, | |
| 47 | + message: `支持中文、英文大小写、数字、下划线和短划线,必须以中文、英文或数字开头,不超过20个字符`, | |
| 48 | + type: 'string', | |
| 49 | + pattern: /^[a-zA-Z0-9\u4e00-\u9fa5a][\u4e00-\u9fa5a-zA-Z0-9_-]*$/, | |
| 50 | + }, | |
| 51 | + ], | |
| 43 | 52 | componentProps: () => { |
| 44 | 53 | return { |
| 45 | 54 | placeholder: '对该枚举项的描述', | ... | ... |
| ... | ... | @@ -112,7 +112,7 @@ |
| 112 | 112 | <div class="w-1/2"> |
| 113 | 113 | <span>参考描述</span> |
| 114 | 114 | <Tooltip |
| 115 | - title="支持中文、英文大小写、日文、数字、下划线和短划线,必须以中文、英文或数字开头,不超过20个字符" | |
| 115 | + title="支持中文、英文大小写、数字、下划线和短划线,必须以中文、英文或数字开头,不超过20个字符" | |
| 116 | 116 | > |
| 117 | 117 | <Icon icon="ant-design:question-circle-outlined" class="cursor-pointer ml-1" /> |
| 118 | 118 | </Tooltip> | ... | ... |