Commit 517701ec78a34e852f4b359e6d6820e33fd680e0

Authored by xp.Huang
2 parents be0aa579 be3f2799

Merge branch 'fix/object-model-enums' into 'main_dev'

fix:修复枚举值可以输入小数&&参考描述添加正则验证

See merge request yunteng/thingskit-front!1141
... ... @@ -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>
... ...