Commit 2df3b64816afc776b67b78fedb3da36391f42f18

Authored by fengtao
1 parent f1911d8d

feat:首页到字典管理的所有基本字段限制完了,还有一些待限制

1 import { FormSchema } from '/@/components/Table'; 1 import { FormSchema } from '/@/components/Table';
  2 +import { phoneRule, emailRule } from '/@/utils/rules';
2 3
3 export const formSchema: FormSchema[] = [ 4 export const formSchema: FormSchema[] = [
4 { 5 {
@@ -20,6 +21,7 @@ export const formSchema: FormSchema[] = [ @@ -20,6 +21,7 @@ export const formSchema: FormSchema[] = [
20 componentProps: { 21 componentProps: {
21 placeholder: '请输入手机号码', 22 placeholder: '请输入手机号码',
22 }, 23 },
  24 + rules: phoneRule,
23 }, 25 },
24 { 26 {
25 field: 'email', 27 field: 'email',
@@ -30,5 +32,6 @@ export const formSchema: FormSchema[] = [ @@ -30,5 +32,6 @@ export const formSchema: FormSchema[] = [
30 componentProps: { 32 componentProps: {
31 placeholder: '请输入邮箱', 33 placeholder: '请输入邮箱',
32 }, 34 },
  35 + rules: emailRule,
33 }, 36 },
34 ]; 37 ];
@@ -231,8 +231,8 @@ export const DeviceProfileQueryUserNameMaxLength: Rule[] = [ @@ -231,8 +231,8 @@ export const DeviceProfileQueryUserNameMaxLength: Rule[] = [
231 { 231 {
232 required: true, 232 required: true,
233 validator: (_, value: string) => { 233 validator: (_, value: string) => {
234 - if (String(value).length > 50) {  
235 - return Promise.reject('配置名称长度不超过50字'); 234 + if (String(value).length > 255) {
  235 + return Promise.reject('配置名称长度不超过255字');
236 } 236 }
237 return Promise.resolve(); 237 return Promise.resolve();
238 }, 238 },
@@ -70,6 +70,7 @@ export const formSchema: FormSchema[] = [ @@ -70,6 +70,7 @@ export const formSchema: FormSchema[] = [
70 component: 'Input', 70 component: 'Input',
71 componentProps: { 71 componentProps: {
72 placeholder: '请输入联系人姓名', 72 placeholder: '请输入联系人姓名',
  73 + maxLength: 255,
73 }, 74 },
74 }, 75 },
75 { 76 {
@@ -108,6 +109,7 @@ export const formSchema: FormSchema[] = [ @@ -108,6 +109,7 @@ export const formSchema: FormSchema[] = [
108 component: 'Input', 109 component: 'Input',
109 componentProps: { 110 componentProps: {
110 placeholder: '请输入微信号', 111 placeholder: '请输入微信号',
  112 + maxLength: 255,
111 }, 113 },
112 }, 114 },
113 { 115 {
@@ -115,7 +117,8 @@ export const formSchema: FormSchema[] = [ @@ -115,7 +117,8 @@ export const formSchema: FormSchema[] = [
115 label: '备注', 117 label: '备注',
116 component: 'InputTextArea', 118 component: 'InputTextArea',
117 componentProps: { 119 componentProps: {
118 - placeholder: '', 120 + placeholder: '请输入备注',
  121 + maxLength: 255,
119 }, 122 },
120 }, 123 },
121 { 124 {
@@ -123,5 +126,8 @@ export const formSchema: FormSchema[] = [ @@ -123,5 +126,8 @@ export const formSchema: FormSchema[] = [
123 label: '', 126 label: '',
124 component: 'Input', 127 component: 'Input',
125 show: false, 128 show: false,
  129 + componentProps: {
  130 + maxLength: 36,
  131 + },
126 }, 132 },
127 ]; 133 ];
@@ -8,11 +8,6 @@ import { @@ -8,11 +8,6 @@ import {
8 DeviceUserNameMaxLength, 8 DeviceUserNameMaxLength,
9 DeviceProfileIdMaxLength, 9 DeviceProfileIdMaxLength,
10 DeviceOrgIdMaxLength, 10 DeviceOrgIdMaxLength,
11 - DeviceLabelMaxLength,  
12 - DeviceDescriptionlMaxLength,  
13 - DeviceIdMaxLength,  
14 - DeviceTenantIdMaxLength,  
15 - DeviceTbDeviceIdMaxLength,  
16 } from '/@/utils/rules'; 11 } from '/@/utils/rules';
17 12
18 // 第一步的表单 13 // 第一步的表单
@@ -81,7 +76,6 @@ export const step1Schemas: FormSchema[] = [ @@ -81,7 +76,6 @@ export const step1Schemas: FormSchema[] = [
81 componentProps: { 76 componentProps: {
82 maxLength: 255, 77 maxLength: 255,
83 }, 78 },
84 - rules: DeviceLabelMaxLength,  
85 }, 79 },
86 { 80 {
87 field: 'deviceAddress', 81 field: 'deviceAddress',
@@ -93,28 +87,36 @@ export const step1Schemas: FormSchema[] = [ @@ -93,28 +87,36 @@ export const step1Schemas: FormSchema[] = [
93 field: 'description', 87 field: 'description',
94 label: '备注', 88 label: '备注',
95 component: 'InputTextArea', 89 component: 'InputTextArea',
96 - rules: DeviceDescriptionlMaxLength, 90 + componentProps: {
  91 + maxLength: 500,
  92 + },
97 }, 93 },
98 { 94 {
99 field: 'id', 95 field: 'id',
100 label: 'id', 96 label: 'id',
101 component: 'Input', 97 component: 'Input',
102 show: false, 98 show: false,
103 - rules: DeviceIdMaxLength, 99 + componentProps: {
  100 + maxLength: 36,
  101 + },
104 }, 102 },
105 { 103 {
106 field: 'tenantId', 104 field: 'tenantId',
107 label: '租户Code', 105 label: '租户Code',
108 component: 'Input', 106 component: 'Input',
109 show: false, 107 show: false,
110 - rules: DeviceTenantIdMaxLength, 108 + componentProps: {
  109 + maxLength: 36,
  110 + },
111 }, 111 },
112 { 112 {
113 field: 'tbDeviceId', 113 field: 'tbDeviceId',
114 label: 'tbDeviceId', 114 label: 'tbDeviceId',
115 component: 'Input', 115 component: 'Input',
116 show: false, 116 show: false,
117 - rules: DeviceTbDeviceIdMaxLength, 117 + componentProps: {
  118 + maxLength: 36,
  119 + },
118 }, 120 },
119 ]; 121 ];
120 122
@@ -265,6 +267,9 @@ export const step2Schemas: FormSchema[] = [ @@ -265,6 +267,9 @@ export const step2Schemas: FormSchema[] = [
265 field: 'credentialsId', 267 field: 'credentialsId',
266 required: true, 268 required: true,
267 ifShow: false, 269 ifShow: false,
  270 + componentProps: {
  271 + maxLength: 64,
  272 + },
268 }, 273 },
269 { 274 {
270 label: 'RSA公钥', 275 label: 'RSA公钥',
@@ -272,6 +277,9 @@ export const step2Schemas: FormSchema[] = [ @@ -272,6 +277,9 @@ export const step2Schemas: FormSchema[] = [
272 field: 'publicKey', 277 field: 'publicKey',
273 required: true, 278 required: true,
274 ifShow: false, 279 ifShow: false,
  280 + componentProps: {
  281 + maxLength: 36,
  282 + },
275 }, 283 },
276 { 284 {
277 label: '客户端ID', 285 label: '客户端ID',
@@ -279,6 +287,9 @@ export const step2Schemas: FormSchema[] = [ @@ -279,6 +287,9 @@ export const step2Schemas: FormSchema[] = [
279 field: 'clientId', 287 field: 'clientId',
280 required: true, 288 required: true,
281 ifShow: false, 289 ifShow: false,
  290 + componentProps: {
  291 + maxLength: 36,
  292 + },
282 }, 293 },
283 { 294 {
284 label: '用户名', 295 label: '用户名',
@@ -292,6 +303,9 @@ export const step2Schemas: FormSchema[] = [ @@ -292,6 +303,9 @@ export const step2Schemas: FormSchema[] = [
292 label: '密码', 303 label: '密码',
293 component: 'InputPassword', 304 component: 'InputPassword',
294 field: 'password', 305 field: 'password',
  306 + componentProps: {
  307 + maxLength: 36,
  308 + },
295 ifShow: false, 309 ifShow: false,
296 }, 310 },
297 ]; 311 ];
@@ -431,6 +445,9 @@ export const TokenSchemas: FormSchema[] = [ @@ -431,6 +445,9 @@ export const TokenSchemas: FormSchema[] = [
431 field: 'credentialsId', 445 field: 'credentialsId',
432 required: true, 446 required: true,
433 ifShow: false, 447 ifShow: false,
  448 + componentProps: {
  449 + maxLength: 64,
  450 + },
434 }, 451 },
435 { 452 {
436 label: 'RSA公钥', 453 label: 'RSA公钥',
@@ -438,6 +455,9 @@ export const TokenSchemas: FormSchema[] = [ @@ -438,6 +455,9 @@ export const TokenSchemas: FormSchema[] = [
438 field: 'publicKey', 455 field: 'publicKey',
439 required: true, 456 required: true,
440 ifShow: false, 457 ifShow: false,
  458 + componentProps: {
  459 + maxLength: 36,
  460 + },
441 }, 461 },
442 { 462 {
443 label: '客户端ID', 463 label: '客户端ID',
@@ -445,6 +465,9 @@ export const TokenSchemas: FormSchema[] = [ @@ -445,6 +465,9 @@ export const TokenSchemas: FormSchema[] = [
445 field: 'clientId', 465 field: 'clientId',
446 required: true, 466 required: true,
447 ifShow: false, 467 ifShow: false,
  468 + componentProps: {
  469 + maxLength: 36,
  470 + },
448 }, 471 },
449 { 472 {
450 label: '用户名', 473 label: '用户名',
@@ -459,17 +482,26 @@ export const TokenSchemas: FormSchema[] = [ @@ -459,17 +482,26 @@ export const TokenSchemas: FormSchema[] = [
459 component: 'InputPassword', 482 component: 'InputPassword',
460 field: 'password', 483 field: 'password',
461 ifShow: false, 484 ifShow: false,
  485 + componentProps: {
  486 + maxLength: 36,
  487 + },
462 }, 488 },
463 { 489 {
464 label: 'id', 490 label: 'id',
465 component: 'Input', 491 component: 'Input',
466 field: 'id', 492 field: 'id',
467 show: false, 493 show: false,
  494 + componentProps: {
  495 + maxLength: 36,
  496 + },
468 }, 497 },
469 { 498 {
470 label: 'tbDeviceId', 499 label: 'tbDeviceId',
471 component: 'Input', 500 component: 'Input',
472 field: 'tbDeviceId', 501 field: 'tbDeviceId',
473 show: false, 502 show: false,
  503 + componentProps: {
  504 + maxLength: 36,
  505 + },
474 }, 506 },
475 ]; 507 ];
@@ -180,8 +180,25 @@ export const formSchema: FormSchema[] = [ @@ -180,8 +180,25 @@ export const formSchema: FormSchema[] = [
180 colProps: { span: 13 }, 180 colProps: { span: 13 },
181 component: 'Input', 181 component: 'Input',
182 componentProps: { 182 componentProps: {
  183 + maxLength: 16,
183 placeholder: '请输入持续时间值(请输入数字)', 184 placeholder: '请输入持续时间值(请输入数字)',
184 }, 185 },
  186 + dynamicRules: () => {
  187 + return [
  188 + {
  189 + validator: (_, value) => {
  190 + if (!value) {
  191 + return Promise.reject('持续时间值不能为空');
  192 + }
  193 + const pwdRegex = new RegExp(/-?\d+/);
  194 + if (!pwdRegex.test(value)) {
  195 + return Promise.reject('只能为数字,且最长不超过16位');
  196 + }
  197 + return Promise.resolve();
  198 + },
  199 + },
  200 + ];
  201 + },
185 ifShow: ({ values }) => isWenDu(Reflect.get(values, 'conditionType')), 202 ifShow: ({ values }) => isWenDu(Reflect.get(values, 'conditionType')),
186 show: ({ values }) => { 203 show: ({ values }) => {
187 return !values.field5; 204 return !values.field5;
@@ -229,9 +246,25 @@ export const formSchema: FormSchema[] = [ @@ -229,9 +246,25 @@ export const formSchema: FormSchema[] = [
229 colProps: { span: 13 }, 246 colProps: { span: 13 },
230 component: 'Input', 247 component: 'Input',
231 componentProps: { 248 componentProps: {
  249 + maxLength: 2147483637,
232 placeholder: '请输入事件计数值(应在1到2147483637之间)', 250 placeholder: '请输入事件计数值(应在1到2147483637之间)',
233 }, 251 },
234 - rules: [{ message: '事件计数应在1到2147483637之间', trigger: 'blur' }], 252 + dynamicRules: () => {
  253 + return [
  254 + {
  255 + validator: (_, value) => {
  256 + if (!value) {
  257 + return Promise.reject('事件计数不能为空');
  258 + }
  259 + const pwdRegex = new RegExp(/-?\d+/);
  260 + if (!pwdRegex.test(value)) {
  261 + return Promise.reject('只能为数字,且最长不超过16位');
  262 + }
  263 + return Promise.resolve();
  264 + },
  265 + },
  266 + ];
  267 + },
235 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'conditionType')), 268 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'conditionType')),
236 show: ({ values }) => { 269 show: ({ values }) => {
237 return !values.field6; 270 return !values.field6;
@@ -66,6 +66,7 @@ export const formSchema: FormSchema[] = [ @@ -66,6 +66,7 @@ export const formSchema: FormSchema[] = [
66 component: 'Input', 66 component: 'Input',
67 componentProps: { 67 componentProps: {
68 placeholder: '请输入键名', 68 placeholder: '请输入键名',
  69 + maxLength: 255,
69 // options: [ 70 // options: [
70 // { label: 'active', value: 'active' }, 71 // { label: 'active', value: 'active' },
71 // { label: 'inactivityAlarmTime', value: 'inactivityAlarmTime' }, 72 // { label: 'inactivityAlarmTime', value: 'inactivityAlarmTime' },
@@ -82,6 +83,8 @@ export const formSchema: FormSchema[] = [ @@ -82,6 +83,8 @@ export const formSchema: FormSchema[] = [
82 colProps: { span: 13 }, 83 colProps: { span: 13 },
83 component: 'Input', 84 component: 'Input',
84 componentProps: { 85 componentProps: {
  86 + maxLength: 255,
  87 +
85 placeholder: '请输入键名', 88 placeholder: '请输入键名',
86 // options: [ 89 // options: [
87 // { label: 'CO2', value: 'CO2' }, 90 // { label: 'CO2', value: 'CO2' },
@@ -97,6 +100,8 @@ export const formSchema: FormSchema[] = [ @@ -97,6 +100,8 @@ export const formSchema: FormSchema[] = [
97 colProps: { span: 13 }, 100 colProps: { span: 13 },
98 component: 'Input', 101 component: 'Input',
99 componentProps: { 102 componentProps: {
  103 + maxLength: 255,
  104 +
100 placeholder: '请输入键名', 105 placeholder: '请输入键名',
101 }, 106 },
102 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'type')), 107 ifShow: ({ values }) => isTimeAll(Reflect.get(values, 'type')),
@@ -183,8 +188,25 @@ export const formSchema: FormSchema[] = [ @@ -183,8 +188,25 @@ export const formSchema: FormSchema[] = [
183 colProps: { span: 13 }, 188 colProps: { span: 13 },
184 component: 'Input', 189 component: 'Input',
185 componentProps: { 190 componentProps: {
  191 + maxLength: 16,
186 placeholder: '请输入默认值(数字)', 192 placeholder: '请输入默认值(数字)',
187 }, 193 },
  194 + dynamicRules: () => {
  195 + return [
  196 + {
  197 + validator: (_, value) => {
  198 + if (!value) {
  199 + return Promise.reject('默认值不能为空');
  200 + }
  201 + const pwdRegex = new RegExp(/-?\d+/);
  202 + if (!pwdRegex.test(value)) {
  203 + return Promise.reject('只能为数字,且最长不超过16位');
  204 + }
  205 + return Promise.resolve();
  206 + },
  207 + },
  208 + ];
  209 + },
188 ifShow: ({ values }) => isString(Reflect.get(values, 'type1')), 210 ifShow: ({ values }) => isString(Reflect.get(values, 'type1')),
189 show: ({ values }) => { 211 show: ({ values }) => {
190 return !values.field5; 212 return !values.field5;
@@ -259,6 +281,22 @@ export const formSchema: FormSchema[] = [ @@ -259,6 +281,22 @@ export const formSchema: FormSchema[] = [
259 componentProps: { 281 componentProps: {
260 placeholder: '请输入值(数字)', 282 placeholder: '请输入值(数字)',
261 }, 283 },
  284 + dynamicRules: () => {
  285 + return [
  286 + {
  287 + validator: (_, value) => {
  288 + if (!value) {
  289 + return Promise.reject('值');
  290 + }
  291 + const pwdRegex = new RegExp(/-?\d+/);
  292 + if (!pwdRegex.test(value)) {
  293 + return Promise.reject('只能为数字,且最长不超过16位');
  294 + }
  295 + return Promise.resolve();
  296 + },
  297 + },
  298 + ];
  299 + },
262 ifShow: ({ values }) => isNumeric(Reflect.get(values, 'type1')), 300 ifShow: ({ values }) => isNumeric(Reflect.get(values, 'type1')),
263 show: ({ values }) => { 301 show: ({ values }) => {
264 return !values.field6; 302 return !values.field6;
@@ -8,6 +8,7 @@ export const formSchema: FormSchema[] = [ @@ -8,6 +8,7 @@ export const formSchema: FormSchema[] = [
8 required: true, 8 required: true,
9 component: 'Input', 9 component: 'Input',
10 componentProps: { 10 componentProps: {
  11 + maxLength: 255,
11 placeholder: '请输入报警详细信息', 12 placeholder: '请输入报警详细信息',
12 }, 13 },
13 }, 14 },
@@ -14,6 +14,7 @@ export const step1Schemas: FormSchema[] = [ @@ -14,6 +14,7 @@ export const step1Schemas: FormSchema[] = [
14 required: true, 14 required: true,
15 component: 'Input', 15 component: 'Input',
16 componentProps: { 16 componentProps: {
  17 + maxLength: 255,
17 placeholder: '请输入配置名称', 18 placeholder: '请输入配置名称',
18 }, 19 },
19 rules: DeviceProfileQueryUserNameMaxLength, 20 rules: DeviceProfileQueryUserNameMaxLength,
@@ -67,6 +68,10 @@ export const step1Schemas: FormSchema[] = [ @@ -67,6 +68,10 @@ export const step1Schemas: FormSchema[] = [
67 label: '描述', 68 label: '描述',
68 field: 'description', 69 field: 'description',
69 component: 'InputTextArea', 70 component: 'InputTextArea',
  71 + componentProps: {
  72 + maxLength: 0,
  73 + placeholder: '请输入描述',
  74 + },
70 }, 75 },
71 ]; 76 ];
72 77
@@ -98,6 +103,7 @@ export const step3Schemas: FormSchema[] = [ @@ -98,6 +103,7 @@ export const step3Schemas: FormSchema[] = [
98 span: 12, 103 span: 12,
99 }, 104 },
100 componentProps: { 105 componentProps: {
  106 + maxLength: 255,
101 placeholder: '请输入报警类型', 107 placeholder: '请输入报警类型',
102 }, 108 },
103 }, 109 },
@@ -118,6 +124,7 @@ export const step3ViewHighSetting: FormSchema[] = [ @@ -118,6 +124,7 @@ export const step3ViewHighSetting: FormSchema[] = [
118 span: 11, 124 span: 11,
119 }, 125 },
120 componentProps: { 126 componentProps: {
  127 + maxLength: 255,
121 placeholder: '要传递的关联类型', 128 placeholder: '要传递的关联类型',
122 }, 129 },
123 }, 130 },
@@ -138,6 +145,7 @@ export const step3HighSetting: FormSchema[] = [ @@ -138,6 +145,7 @@ export const step3HighSetting: FormSchema[] = [
138 span: 11, 145 span: 11,
139 }, 146 },
140 componentProps: { 147 componentProps: {
  148 + maxLength: 255,
141 placeholder: '要传递的关联类型', 149 placeholder: '要传递的关联类型',
142 }, 150 },
143 ifShow: ({ values }) => !!values.propagate, 151 ifShow: ({ values }) => !!values.propagate,
@@ -115,6 +115,9 @@ export const formSchema: FormSchema[] = [ @@ -115,6 +115,9 @@ export const formSchema: FormSchema[] = [
115 label: '配置名称', 115 label: '配置名称',
116 required: true, 116 required: true,
117 component: 'Input', 117 component: 'Input',
  118 + componentProps: {
  119 + maxLength: 30,
  120 + },
118 }, 121 },
119 { 122 {
120 field: 'messageType', 123 field: 'messageType',
@@ -150,12 +153,18 @@ export const formSchema: FormSchema[] = [ @@ -150,12 +153,18 @@ export const formSchema: FormSchema[] = [
150 label: 'accessKeyId', 153 label: 'accessKeyId',
151 required: true, 154 required: true,
152 component: 'Input', 155 component: 'Input',
  156 + componentProps: {
  157 + maxLength: 36,
  158 + },
153 ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')), 159 ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')),
154 }, 160 },
155 { 161 {
156 field: 'accessKeySecret', 162 field: 'accessKeySecret',
157 label: 'accessKeySecret', 163 label: 'accessKeySecret',
158 required: true, 164 required: true,
  165 + componentProps: {
  166 + maxLength: 36,
  167 + },
159 component: 'Input', 168 component: 'Input',
160 ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')), 169 ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')),
161 }, 170 },
@@ -165,6 +174,9 @@ export const formSchema: FormSchema[] = [ @@ -165,6 +174,9 @@ export const formSchema: FormSchema[] = [
165 defaultValue: 'smtp.163.com', 174 defaultValue: 'smtp.163.com',
166 required: true, 175 required: true,
167 component: 'Input', 176 component: 'Input',
  177 + componentProps: {
  178 + maxLength: 36,
  179 + },
168 ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')), 180 ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')),
169 }, 181 },
170 { 182 {
@@ -172,6 +184,9 @@ export const formSchema: FormSchema[] = [ @@ -172,6 +184,9 @@ export const formSchema: FormSchema[] = [
172 label: '端口', 184 label: '端口',
173 defaultValue: 25, 185 defaultValue: 25,
174 required: true, 186 required: true,
  187 + componentProps: {
  188 + maxLength: 36,
  189 + },
175 component: 'InputNumber', 190 component: 'InputNumber',
176 ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')), 191 ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')),
177 }, 192 },
@@ -179,6 +194,9 @@ export const formSchema: FormSchema[] = [ @@ -179,6 +194,9 @@ export const formSchema: FormSchema[] = [
179 field: 'username', 194 field: 'username',
180 label: '用户名', 195 label: '用户名',
181 required: true, 196 required: true,
  197 + componentProps: {
  198 + maxLength: 255,
  199 + },
182 component: 'Input', 200 component: 'Input',
183 ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')), 201 ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')),
184 }, 202 },
@@ -186,6 +204,7 @@ export const formSchema: FormSchema[] = [ @@ -186,6 +204,7 @@ export const formSchema: FormSchema[] = [
186 field: 'password', 204 field: 'password',
187 label: '密码', 205 label: '密码',
188 required: true, 206 required: true,
  207 +
189 component: 'InputPassword', 208 component: 'InputPassword',
190 ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')), 209 ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')),
191 }, 210 },
@@ -194,12 +213,18 @@ export const formSchema: FormSchema[] = [ @@ -194,12 +213,18 @@ export const formSchema: FormSchema[] = [
194 label: '消息配置', 213 label: '消息配置',
195 component: 'Input', 214 component: 'Input',
196 show: false, 215 show: false,
  216 + componentProps: {
  217 + maxLength: 255,
  218 + },
197 }, 219 },
198 { 220 {
199 field: 'id', 221 field: 'id',
200 label: '主键', 222 label: '主键',
201 component: 'Input', 223 component: 'Input',
202 show: false, 224 show: false,
  225 + componentProps: {
  226 + maxLength: 36,
  227 + },
203 }, 228 },
204 { 229 {
205 field: 'status', 230 field: 'status',
@@ -216,6 +241,9 @@ export const formSchema: FormSchema[] = [ @@ -216,6 +241,9 @@ export const formSchema: FormSchema[] = [
216 { 241 {
217 label: '备注', 242 label: '备注',
218 field: 'remark', 243 field: 'remark',
  244 + componentProps: {
  245 + maxLength: 255,
  246 + },
219 component: 'InputTextArea', 247 component: 'InputTextArea',
220 }, 248 },
221 { 249 {
@@ -223,5 +251,8 @@ export const formSchema: FormSchema[] = [ @@ -223,5 +251,8 @@ export const formSchema: FormSchema[] = [
223 field: 'tenantId', 251 field: 'tenantId',
224 component: 'Input', 252 component: 'Input',
225 show: false, 253 show: false,
  254 + componentProps: {
  255 + maxLength: 36,
  256 + },
226 }, 257 },
227 ]; 258 ];
@@ -110,6 +110,9 @@ export const formSchema: FormSchema[] = [ @@ -110,6 +110,9 @@ export const formSchema: FormSchema[] = [
110 label: '主键', 110 label: '主键',
111 component: 'Input', 111 component: 'Input',
112 show: false, 112 show: false,
  113 + componentProps: {
  114 + maxLength: 36,
  115 + },
113 }, 116 },
114 { 117 {
115 field: 'messageType', 118 field: 'messageType',
@@ -145,12 +148,18 @@ export const formSchema: FormSchema[] = [ @@ -145,12 +148,18 @@ export const formSchema: FormSchema[] = [
145 label: '模板名称', 148 label: '模板名称',
146 required: true, 149 required: true,
147 component: 'Input', 150 component: 'Input',
  151 + componentProps: {
  152 + maxLength: 32,
  153 + },
148 }, 154 },
149 { 155 {
150 field: 'templateCode', 156 field: 'templateCode',
151 label: '模板编号', 157 label: '模板编号',
152 required: true, 158 required: true,
153 component: 'Input', 159 component: 'Input',
  160 + componentProps: {
  161 + maxLength: 20,
  162 + },
154 ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')), 163 ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')),
155 }, 164 },
156 { 165 {
@@ -158,6 +167,9 @@ export const formSchema: FormSchema[] = [ @@ -158,6 +167,9 @@ export const formSchema: FormSchema[] = [
158 label: '签名', 167 label: '签名',
159 required: true, 168 required: true,
160 component: 'Input', 169 component: 'Input',
  170 + componentProps: {
  171 + maxLength: 32,
  172 + },
161 ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')), 173 ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')),
162 }, 174 },
163 { 175 {
@@ -180,5 +192,8 @@ export const formSchema: FormSchema[] = [ @@ -180,5 +192,8 @@ export const formSchema: FormSchema[] = [
180 label: '租户ID', 192 label: '租户ID',
181 component: 'Input', 193 component: 'Input',
182 show: false, 194 show: false,
  195 + componentProps: {
  196 + maxLength: 36,
  197 + },
183 }, 198 },
184 ]; 199 ];
@@ -147,6 +147,7 @@ export const formSchema: FormSchema[] = [ @@ -147,6 +147,7 @@ export const formSchema: FormSchema[] = [
147 required: true, 147 required: true,
148 component: 'Input', 148 component: 'Input',
149 componentProps: { 149 componentProps: {
  150 + maxLength: 36,
150 placeholder: '请输入场景联动名称', 151 placeholder: '请输入场景联动名称',
151 }, 152 },
152 }, 153 },
@@ -200,6 +201,7 @@ export const formSchema: FormSchema[] = [ @@ -200,6 +201,7 @@ export const formSchema: FormSchema[] = [
200 colProps: { span: 24 }, 201 colProps: { span: 24 },
201 component: 'InputTextArea', 202 component: 'InputTextArea',
202 componentProps: { 203 componentProps: {
  204 + maxLength: 255,
203 placeholder: '请输入描述', 205 placeholder: '请输入描述',
204 }, 206 },
205 }, 207 },
@@ -225,6 +227,7 @@ export const searchFormSchema: FormSchema[] = [ @@ -225,6 +227,7 @@ export const searchFormSchema: FormSchema[] = [
225 component: 'Input', 227 component: 'Input',
226 colProps: { span: 8 }, 228 colProps: { span: 8 },
227 componentProps: { 229 componentProps: {
  230 + maxLength: 36,
228 placeholder: '请输入场景联动状态', 231 placeholder: '请输入场景联动状态',
229 }, 232 },
230 }, 233 },
@@ -279,6 +282,8 @@ export const useTriggerDrawerSchema: FormSchema[] = [ @@ -279,6 +282,8 @@ export const useTriggerDrawerSchema: FormSchema[] = [
279 component: 'Input', 282 component: 'Input',
280 label: '', 283 label: '',
281 componentProps: { 284 componentProps: {
  285 + maxLength: 255,
  286 +
282 placeholder: '请输入Cron表达式', 287 placeholder: '请输入Cron表达式',
283 }, 288 },
284 colProps: { 289 colProps: {
@@ -367,6 +372,8 @@ export const useTriggerDrawerSchema: FormSchema[] = [ @@ -367,6 +372,8 @@ export const useTriggerDrawerSchema: FormSchema[] = [
367 component: 'Input', 372 component: 'Input',
368 label: '', 373 label: '',
369 componentProps: { 374 componentProps: {
  375 + maxLength: 16,
  376 +
370 placeholder: '请输入比较值', 377 placeholder: '请输入比较值',
371 }, 378 },
372 ifShow: ({ values }) => 379 ifShow: ({ values }) =>
@@ -518,6 +525,7 @@ export const useConditionDrawerSchema: FormSchema[] = [ @@ -518,6 +525,7 @@ export const useConditionDrawerSchema: FormSchema[] = [
518 component: 'Input', 525 component: 'Input',
519 label: '', 526 label: '',
520 componentProps: { 527 componentProps: {
  528 + maxLength: 16,
521 placeholder: '请输入比较值', 529 placeholder: '请输入比较值',
522 }, 530 },
523 ifShow: ({ values }) => 531 ifShow: ({ values }) =>
@@ -550,6 +558,8 @@ export const useConditionDrawerSchema: FormSchema[] = [ @@ -550,6 +558,8 @@ export const useConditionDrawerSchema: FormSchema[] = [
550 component: 'Input', 558 component: 'Input',
551 label: '', 559 label: '',
552 componentProps: { 560 componentProps: {
  561 + maxLength: 16,
  562 +
553 placeholder: '请输入比较值', 563 placeholder: '请输入比较值',
554 }, 564 },
555 ifShow: ({ values }) => 565 ifShow: ({ values }) =>
@@ -602,6 +612,8 @@ export const useActionDrawerSchema: FormSchema[] = [ @@ -602,6 +612,8 @@ export const useActionDrawerSchema: FormSchema[] = [
602 component: 'Input', 612 component: 'Input',
603 label: '', 613 label: '',
604 componentProps: { 614 componentProps: {
  615 + maxLength: 255,
  616 +
605 placeholder: '请输入下发指定', 617 placeholder: '请输入下发指定',
606 }, 618 },
607 ifShow: ({ values }) => 619 ifShow: ({ values }) =>
@@ -58,6 +58,9 @@ export const accountFormSchema: FormSchema[] = [ @@ -58,6 +58,9 @@ export const accountFormSchema: FormSchema[] = [
58 label: 'id', 58 label: 'id',
59 component: 'Input', 59 component: 'Input',
60 show: false, 60 show: false,
  61 + componentProps: {
  62 + maxLength: 36,
  63 + },
61 }, 64 },
62 { 65 {
63 field: 'username', 66 field: 'username',
@@ -108,6 +111,9 @@ export const accountFormSchema: FormSchema[] = [ @@ -108,6 +111,9 @@ export const accountFormSchema: FormSchema[] = [
108 component: 'Input', 111 component: 'Input',
109 colProps: { span: 12 }, 112 colProps: { span: 12 },
110 required: true, 113 required: true,
  114 + componentProps: {
  115 + maxLength: 255,
  116 + },
111 }, 117 },
112 { 118 {
113 label: '角色', 119 label: '角色',
@@ -35,12 +35,18 @@ export const searchFormSchema: FormSchema[] = [ @@ -35,12 +35,18 @@ export const searchFormSchema: FormSchema[] = [
35 label: '字典名称', 35 label: '字典名称',
36 component: 'Input', 36 component: 'Input',
37 colProps: { span: 6 }, 37 colProps: { span: 6 },
  38 + componentProps: {
  39 + maxLength: 32,
  40 + },
38 }, 41 },
39 { 42 {
40 field: 'dictCode', 43 field: 'dictCode',
41 label: '字典编码', 44 label: '字典编码',
42 component: 'Input', 45 component: 'Input',
43 colProps: { span: 6 }, 46 colProps: { span: 6 },
  47 + componentProps: {
  48 + maxLength: 32,
  49 + },
44 }, 50 },
45 ]; 51 ];
46 52
@@ -50,16 +56,25 @@ export const formSchema: FormSchema[] = [ @@ -50,16 +56,25 @@ export const formSchema: FormSchema[] = [
50 label: '字典名称', 56 label: '字典名称',
51 required: true, 57 required: true,
52 component: 'Input', 58 component: 'Input',
  59 + componentProps: {
  60 + maxLength: 32,
  61 + },
53 }, 62 },
54 { 63 {
55 field: 'dictCode', 64 field: 'dictCode',
56 label: '字典编码', 65 label: '字典编码',
57 required: true, 66 required: true,
58 component: 'Input', 67 component: 'Input',
  68 + componentProps: {
  69 + maxLength: 32,
  70 + },
59 }, 71 },
60 { 72 {
61 label: '备注', 73 label: '备注',
62 field: 'description', 74 field: 'description',
63 component: 'InputTextArea', 75 component: 'InputTextArea',
  76 + componentProps: {
  77 + maxLength: 255,
  78 + },
64 }, 79 },
65 ]; 80 ];
@@ -67,12 +67,18 @@ export const searchFormSchema: FormSchema[] = [ @@ -67,12 +67,18 @@ export const searchFormSchema: FormSchema[] = [
67 label: '文本值', 67 label: '文本值',
68 component: 'Input', 68 component: 'Input',
69 colProps: { span: 6 }, 69 colProps: { span: 6 },
  70 + componentProps: {
  71 + maxLength: 32,
  72 + },
70 }, 73 },
71 { 74 {
72 field: 'dictId', 75 field: 'dictId',
73 label: '文本值', 76 label: '文本值',
74 component: 'Input', 77 component: 'Input',
75 show: false, 78 show: false,
  79 + componentProps: {
  80 + maxLength: 36,
  81 + },
76 }, 82 },
77 ]; 83 ];
78 84
@@ -82,18 +88,27 @@ export const formSchema: FormSchema[] = [ @@ -82,18 +88,27 @@ export const formSchema: FormSchema[] = [
82 label: '文本值', 88 label: '文本值',
83 required: true, 89 required: true,
84 component: 'Input', 90 component: 'Input',
  91 + componentProps: {
  92 + maxLength: 32,
  93 + },
85 }, 94 },
86 { 95 {
87 field: 'itemValue', 96 field: 'itemValue',
88 label: '字典值', 97 label: '字典值',
89 required: true, 98 required: true,
90 component: 'Input', 99 component: 'Input',
  100 + componentProps: {
  101 + maxLength: 32,
  102 + },
91 }, 103 },
92 { 104 {
93 field: 'sort', 105 field: 'sort',
94 label: '排序', 106 label: '排序',
95 component: 'InputNumber', 107 component: 'InputNumber',
96 defaultValue: 1, 108 defaultValue: 1,
  109 + componentProps: {
  110 + maxLength: 32,
  111 + },
97 }, 112 },
98 { 113 {
99 field: 'status', 114 field: 'status',
@@ -111,5 +126,8 @@ export const formSchema: FormSchema[] = [ @@ -111,5 +126,8 @@ export const formSchema: FormSchema[] = [
111 label: '备注', 126 label: '备注',
112 field: 'description', 127 field: 'description',
113 component: 'InputTextArea', 128 component: 'InputTextArea',
  129 + componentProps: {
  130 + maxLength: 255,
  131 + },
114 }, 132 },
115 ]; 133 ];
@@ -123,6 +123,9 @@ export const formSchema: FormSchema[] = [ @@ -123,6 +123,9 @@ export const formSchema: FormSchema[] = [
123 label: t('routes.common.system.tableTitleSystemMenuName'), //菜单名称 123 label: t('routes.common.system.tableTitleSystemMenuName'), //菜单名称
124 component: 'Input', 124 component: 'Input',
125 required: true, 125 required: true,
  126 + componentProps: {
  127 + maxLength: 255,
  128 + },
126 }, 129 },
127 130
128 { 131 {
@@ -144,6 +147,9 @@ export const formSchema: FormSchema[] = [ @@ -144,6 +147,9 @@ export const formSchema: FormSchema[] = [
144 label: t('routes.common.system.tableTitleSystemSort'), //排序 147 label: t('routes.common.system.tableTitleSystemSort'), //排序
145 component: 'InputNumber', 148 component: 'InputNumber',
146 required: true, 149 required: true,
  150 + componentProps: {
  151 + maxLength: 32,
  152 + },
147 }, 153 },
148 { 154 {
149 field: 'icon', 155 field: 'icon',
@@ -159,18 +165,27 @@ export const formSchema: FormSchema[] = [ @@ -159,18 +165,27 @@ export const formSchema: FormSchema[] = [
159 component: 'Input', 165 component: 'Input',
160 required: true, 166 required: true,
161 ifShow: ({ values }) => !isButton(Reflect.get(values, 'menuType')), 167 ifShow: ({ values }) => !isButton(Reflect.get(values, 'menuType')),
  168 + componentProps: {
  169 + maxLength: 255,
  170 + },
162 }, 171 },
163 { 172 {
164 field: 'component', 173 field: 'component',
165 label: t('routes.common.system.menuEditPagesComponentsPath'), //组件路径 174 label: t('routes.common.system.menuEditPagesComponentsPath'), //组件路径
166 component: 'Input', 175 component: 'Input',
167 ifShow: ({ values }) => isMenu(Reflect.get(values, 'menuType')), 176 ifShow: ({ values }) => isMenu(Reflect.get(values, 'menuType')),
  177 + componentProps: {
  178 + maxLength: 100,
  179 + },
168 }, 180 },
169 { 181 {
170 field: 'permission', 182 field: 'permission',
171 label: t('routes.common.system.tableTitleSystemPermissionTag'), //权限标识 183 label: t('routes.common.system.tableTitleSystemPermissionTag'), //权限标识
172 component: 'Input', 184 component: 'Input',
173 ifShow: ({ values }) => !isDir(Reflect.get(values, 'menuType')), 185 ifShow: ({ values }) => !isDir(Reflect.get(values, 'menuType')),
  186 + componentProps: {
  187 + maxLength: 100,
  188 + },
174 }, 189 },
175 { 190 {
176 field: 'status', 191 field: 'status',
@@ -45,22 +45,34 @@ export const formSchema: FormSchema[] = [ @@ -45,22 +45,34 @@ export const formSchema: FormSchema[] = [
45 label: t('routes.common.organization.queryOrganizationName'), 45 label: t('routes.common.organization.queryOrganizationName'),
46 component: 'Input', 46 component: 'Input',
47 required: true, 47 required: true,
  48 + componentProps: {
  49 + maxLength: 255,
  50 + },
48 }, 51 },
49 { 52 {
50 field: 'sort', 53 field: 'sort',
51 label: t('routes.common.common.sort'), //排序 54 label: t('routes.common.common.sort'), //排序
52 component: 'InputNumber', 55 component: 'InputNumber',
53 required: true, 56 required: true,
  57 + componentProps: {
  58 + maxLength: 32,
  59 + },
54 }, 60 },
55 { 61 {
56 label: t('routes.common.common.remark'), //备注 62 label: t('routes.common.common.remark'), //备注
57 field: 'remark', 63 field: 'remark',
58 component: 'InputTextArea', 64 component: 'InputTextArea',
  65 + componentProps: {
  66 + maxLength: 255,
  67 + },
59 }, 68 },
60 { 69 {
61 label: '租户ID', 70 label: '租户ID',
62 field: 'tenantId', 71 field: 'tenantId',
63 component: 'Input', 72 component: 'Input',
64 show: false, 73 show: false,
  74 + componentProps: {
  75 + maxLength: 36,
  76 + },
65 }, 77 },
66 ]; 78 ];
@@ -88,6 +88,9 @@ export const formSchema: FormSchema[] = [ @@ -88,6 +88,9 @@ export const formSchema: FormSchema[] = [
88 label: '角色名称', 88 label: '角色名称',
89 required: true, 89 required: true,
90 component: 'Input', 90 component: 'Input',
  91 + componentProps: {
  92 + maxLength: 255,
  93 + },
91 }, 94 },
92 { 95 {
93 field: 'status', 96 field: 'status',
@@ -105,11 +108,17 @@ export const formSchema: FormSchema[] = [ @@ -105,11 +108,17 @@ export const formSchema: FormSchema[] = [
105 label: '备注', 108 label: '备注',
106 field: 'remark', 109 field: 'remark',
107 component: 'InputTextArea', 110 component: 'InputTextArea',
  111 + componentProps: {
  112 + maxLength: 255,
  113 + },
108 }, 114 },
109 { 115 {
110 label: ' ', 116 label: ' ',
111 field: 'menu', 117 field: 'menu',
112 slot: 'menu', 118 slot: 'menu',
113 component: 'Input', 119 component: 'Input',
  120 + componentProps: {
  121 + maxLength: 255,
  122 + },
114 }, 123 },
115 ]; 124 ];
@@ -35,6 +35,9 @@ @@ -35,6 +35,9 @@
35 label: 'id:', 35 label: 'id:',
36 show: false, 36 show: false,
37 component: 'Input', 37 component: 'Input',
  38 + componentProps: {
  39 + maxLength: 36,
  40 + },
38 }, 41 },
39 { 42 {
40 field: 'username', 43 field: 'username',
@@ -76,6 +79,9 @@ @@ -76,6 +79,9 @@
76 label: '真实名字', 79 label: '真实名字',
77 required: true, 80 required: true,
78 component: 'Input', 81 component: 'Input',
  82 + componentProps: {
  83 + maxLength: 255,
  84 + },
79 }, 85 },
80 { 86 {
81 field: 'phoneNumber', 87 field: 'phoneNumber',
@@ -46,12 +46,18 @@ export const tenantFormSchema: FormSchema[] = [ @@ -46,12 +46,18 @@ export const tenantFormSchema: FormSchema[] = [
46 label: 'id', 46 label: 'id',
47 slot: 'iconSelect', 47 slot: 'iconSelect',
48 component: 'Input', 48 component: 'Input',
  49 + componentProps: {
  50 + maxLength: 36,
  51 + },
49 show: false, 52 show: false,
50 }, 53 },
51 { 54 {
52 field: 'tenantId', 55 field: 'tenantId',
53 label: 'tenantId', 56 label: 'tenantId',
54 component: 'Input', 57 component: 'Input',
  58 + componentProps: {
  59 + maxLength: 36,
  60 + },
55 show: false, 61 show: false,
56 }, 62 },
57 { 63 {
@@ -59,12 +65,18 @@ export const tenantFormSchema: FormSchema[] = [ @@ -59,12 +65,18 @@ export const tenantFormSchema: FormSchema[] = [
59 label: '租户图标: ', 65 label: '租户图标: ',
60 slot: 'iconSelect', 66 slot: 'iconSelect',
61 component: 'Input', 67 component: 'Input',
  68 + componentProps: {
  69 + maxLength: 255,
  70 + },
62 }, 71 },
63 { 72 {
64 field: 'name', 73 field: 'name',
65 label: '租户名称:', 74 label: '租户名称:',
66 required: true, 75 required: true,
67 component: 'Input', 76 component: 'Input',
  77 + componentProps: {
  78 + maxLength: 255,
  79 + },
68 }, 80 },
69 { 81 {
70 field: 'roleIds', 82 field: 'roleIds',
@@ -106,5 +118,8 @@ export const tenantFormSchema: FormSchema[] = [ @@ -106,5 +118,8 @@ export const tenantFormSchema: FormSchema[] = [
106 label: '备注: ', 118 label: '备注: ',
107 field: 'description', 119 field: 'description',
108 component: 'InputTextArea', 120 component: 'InputTextArea',
  121 + componentProps: {
  122 + maxLength: 500,
  123 + },
109 }, 124 },
110 ]; 125 ];
@@ -8,6 +8,7 @@ export const schemas: FormSchema[] = [ @@ -8,6 +8,7 @@ export const schemas: FormSchema[] = [
8 span: 24, 8 span: 24,
9 }, 9 },
10 componentProps: { 10 componentProps: {
  11 + maxLength: 50,
11 placeholder: '请输入平台名称', 12 placeholder: '请输入平台名称',
12 }, 13 },
13 }, 14 },
@@ -9,6 +9,7 @@ export const schemas: FormSchema[] = [ @@ -9,6 +9,7 @@ export const schemas: FormSchema[] = [
9 span: 24, 9 span: 24,
10 }, 10 },
11 componentProps: { 11 componentProps: {
  12 + maxLength: 50,
12 placeholder: '请输入平台名称', 13 placeholder: '请输入平台名称',
13 }, 14 },
14 }, 15 },
@@ -55,6 +56,9 @@ export const schemas: FormSchema[] = [ @@ -55,6 +56,9 @@ export const schemas: FormSchema[] = [
55 colProps: { 56 colProps: {
56 span: 24, 57 span: 24,
57 }, 58 },
  59 + componentProps: {
  60 + maxLength: 100,
  61 + },
58 }, 62 },
59 { 63 {
60 field: 'presentedOurselves', 64 field: 'presentedOurselves',
@@ -63,6 +67,9 @@ export const schemas: FormSchema[] = [ @@ -63,6 +67,9 @@ export const schemas: FormSchema[] = [
63 colProps: { 67 colProps: {
64 span: 24, 68 span: 24,
65 }, 69 },
  70 + componentProps: {
  71 + maxLength: 50,
  72 + },
66 }, 73 },
67 { 74 {
68 field: 'domain', 75 field: 'domain',
@@ -71,5 +78,8 @@ export const schemas: FormSchema[] = [ @@ -71,5 +78,8 @@ export const schemas: FormSchema[] = [
71 colProps: { 78 colProps: {
72 span: 24, 79 span: 24,
73 }, 80 },
  81 + componentProps: {
  82 + maxLength: 100,
  83 + },
74 }, 84 },
75 ]; 85 ];
@@ -11,6 +11,7 @@ export const schemas: FormSchema[] = [ @@ -11,6 +11,7 @@ export const schemas: FormSchema[] = [
11 span: 24, 11 span: 24,
12 }, 12 },
13 componentProps: { 13 componentProps: {
  14 + maxLength: 100,
14 placeholder: '请输入公司名称', 15 placeholder: '请输入公司名称',
15 }, 16 },
16 }, 17 },
@@ -22,6 +23,8 @@ export const schemas: FormSchema[] = [ @@ -22,6 +23,8 @@ export const schemas: FormSchema[] = [
22 span: 24, 23 span: 24,
23 }, 24 },
24 componentProps: { 25 componentProps: {
  26 + maxLength: 100,
  27 +
25 placeholder: '请输入公司简称', 28 placeholder: '请输入公司简称',
26 }, 29 },
27 }, 30 },
@@ -33,6 +36,7 @@ export const schemas: FormSchema[] = [ @@ -33,6 +36,7 @@ export const schemas: FormSchema[] = [
33 span: 24, 36 span: 24,
34 }, 37 },
35 componentProps: { 38 componentProps: {
  39 + maxLength: 255,
36 placeholder: '请输入公司官网', 40 placeholder: '请输入公司官网',
37 }, 41 },
38 }, 42 },
@@ -57,6 +61,7 @@ export const schemas: FormSchema[] = [ @@ -57,6 +61,7 @@ export const schemas: FormSchema[] = [
57 span: 24, 61 span: 24,
58 }, 62 },
59 componentProps: { 63 componentProps: {
  64 + maxLength: 500,
60 placeholder: '请输入公司简介', 65 placeholder: '请输入公司简介',
61 autoSize: { minRows: 8, maxRows: 12 }, 66 autoSize: { minRows: 8, maxRows: 12 },
62 showCount: true, 67 showCount: true,
@@ -244,6 +249,7 @@ export const schemas: FormSchema[] = [ @@ -244,6 +249,7 @@ export const schemas: FormSchema[] = [
244 span: 24, 249 span: 24,
245 }, 250 },
246 componentProps: { 251 componentProps: {
  252 + maxLength: 100,
247 placeholder: '请输入详细地址', 253 placeholder: '请输入详细地址',
248 }, 254 },
249 }, 255 },
@@ -256,6 +262,7 @@ export const schemas: FormSchema[] = [ @@ -256,6 +262,7 @@ export const schemas: FormSchema[] = [
256 span: 24, 262 span: 24,
257 }, 263 },
258 componentProps: { 264 componentProps: {
  265 + maxLength: 25,
259 placeholder: '请输入联系人', 266 placeholder: '请输入联系人',
260 }, 267 },
261 }, 268 },
@@ -275,6 +282,9 @@ export const schemas: FormSchema[] = [ @@ -275,6 +282,9 @@ export const schemas: FormSchema[] = [
275 field: 'qrcode', 282 field: 'qrcode',
276 label: '二维码', 283 label: '二维码',
277 component: 'Input', 284 component: 'Input',
  285 + componentProps: {
  286 + maxLength: 255,
  287 + },
278 colProps: { 288 colProps: {
279 span: 24, 289 span: 24,
280 }, 290 },
@@ -285,5 +295,8 @@ export const schemas: FormSchema[] = [ @@ -285,5 +295,8 @@ export const schemas: FormSchema[] = [
285 label: '唯一id', 295 label: '唯一id',
286 component: 'Input', 296 component: 'Input',
287 show: false, 297 show: false,
  298 + componentProps: {
  299 + maxLength: 36,
  300 + },
288 }, 301 },
289 ]; 302 ];
@@ -67,6 +67,9 @@ export const searchFormSchema: FormSchema[] = [ @@ -67,6 +67,9 @@ export const searchFormSchema: FormSchema[] = [
67 label: '角色名称', 67 label: '角色名称',
68 component: 'Input', 68 component: 'Input',
69 colProps: { span: 8 }, 69 colProps: { span: 8 },
  70 + componentProps: {
  71 + maxLength: 255,
  72 + },
70 }, 73 },
71 { 74 {
72 field: 'roleType', 75 field: 'roleType',
@@ -75,6 +78,9 @@ export const searchFormSchema: FormSchema[] = [ @@ -75,6 +78,9 @@ export const searchFormSchema: FormSchema[] = [
75 colProps: { span: 8 }, 78 colProps: { span: 8 },
76 defaultValue: RoleEnum.TENANT_ADMIN, 79 defaultValue: RoleEnum.TENANT_ADMIN,
77 ifShow: false, 80 ifShow: false,
  81 + componentProps: {
  82 + maxLength: 20,
  83 + },
78 }, 84 },
79 { 85 {
80 field: 'status', 86 field: 'status',
@@ -96,6 +102,9 @@ export const formSchema: FormSchema[] = [ @@ -96,6 +102,9 @@ export const formSchema: FormSchema[] = [
96 label: '角色名称', 102 label: '角色名称',
97 required: true, 103 required: true,
98 component: 'Input', 104 component: 'Input',
  105 + componentProps: {
  106 + maxLength: 255,
  107 + },
99 }, 108 },
100 { 109 {
101 field: 'status', 110 field: 'status',
@@ -113,11 +122,17 @@ export const formSchema: FormSchema[] = [ @@ -113,11 +122,17 @@ export const formSchema: FormSchema[] = [
113 label: '备注', 122 label: '备注',
114 field: 'remark', 123 field: 'remark',
115 component: 'InputTextArea', 124 component: 'InputTextArea',
  125 + componentProps: {
  126 + maxLength: 255,
  127 + },
116 }, 128 },
117 { 129 {
118 label: ' ', 130 label: ' ',
119 field: 'menu', 131 field: 'menu',
120 slot: 'menu', 132 slot: 'menu',
121 component: 'Input', 133 component: 'Input',
  134 + componentProps: {
  135 + maxLength: 255,
  136 + },
122 }, 137 },
123 ]; 138 ];
@@ -49,6 +49,7 @@ export const formSchema: FormSchema[] = [ @@ -49,6 +49,7 @@ export const formSchema: FormSchema[] = [
49 required: true, 49 required: true,
50 component: 'Input', 50 component: 'Input',
51 componentProps: { 51 componentProps: {
  52 + maxLength: 255,
52 placeholder: '名称', 53 placeholder: '名称',
53 }, 54 },
54 }, 55 },
@@ -70,6 +71,7 @@ export const formSchema: FormSchema[] = [ @@ -70,6 +71,7 @@ export const formSchema: FormSchema[] = [
70 colProps: { span: 24 }, 71 colProps: { span: 24 },
71 component: 'InputTextArea', 72 component: 'InputTextArea',
72 componentProps: { 73 componentProps: {
  74 + maxLength: 0,
73 placeholder: '请输入说明', 75 placeholder: '请输入说明',
74 }, 76 },
75 }, 77 },
1 import { FormSchema } from '/@/components/Table'; 1 import { FormSchema } from '/@/components/Table';
2 -// import { numberRule } from '/@/utils/rules'; 2 +import { numberRule } from '/@/utils/rules';
3 3
4 export const formSchema: FormSchema[] = [ 4 export const formSchema: FormSchema[] = [
5 { 5 {
@@ -23,6 +23,7 @@ export const formSchema: FormSchema[] = [ @@ -23,6 +23,7 @@ export const formSchema: FormSchema[] = [
23 componentProps: { 23 componentProps: {
24 placeholder: '请输入最大设备数(请输入数字)', 24 placeholder: '请输入最大设备数(请输入数字)',
25 }, 25 },
  26 + rules: numberRule,
26 }, 27 },
27 { 28 {
28 field: 'maxAssets', 29 field: 'maxAssets',
@@ -34,6 +35,7 @@ export const formSchema: FormSchema[] = [ @@ -34,6 +35,7 @@ export const formSchema: FormSchema[] = [
34 componentProps: { 35 componentProps: {
35 placeholder: '请输入最大资产(请输入数字)', 36 placeholder: '请输入最大资产(请输入数字)',
36 }, 37 },
  38 + rules: numberRule,
37 }, 39 },
38 { 40 {
39 field: 'maxCustomers', 41 field: 'maxCustomers',
@@ -45,6 +47,7 @@ export const formSchema: FormSchema[] = [ @@ -45,6 +47,7 @@ export const formSchema: FormSchema[] = [
45 componentProps: { 47 componentProps: {
46 placeholder: '请输入最大客户数(请输入数字)', 48 placeholder: '请输入最大客户数(请输入数字)',
47 }, 49 },
  50 + rules: numberRule,
48 }, 51 },
49 { 52 {
50 field: 'maxUsers', 53 field: 'maxUsers',
@@ -56,6 +59,7 @@ export const formSchema: FormSchema[] = [ @@ -56,6 +59,7 @@ export const formSchema: FormSchema[] = [
56 componentProps: { 59 componentProps: {
57 placeholder: '请输入最大用户数(请输入数字)', 60 placeholder: '请输入最大用户数(请输入数字)',
58 }, 61 },
  62 + rules: numberRule,
59 }, 63 },
60 { 64 {
61 field: 'maxDashboards', 65 field: 'maxDashboards',
@@ -67,6 +71,7 @@ export const formSchema: FormSchema[] = [ @@ -67,6 +71,7 @@ export const formSchema: FormSchema[] = [
67 componentProps: { 71 componentProps: {
68 placeholder: '请输入仪表板的最大数量(请输入数字)', 72 placeholder: '请输入仪表板的最大数量(请输入数字)',
69 }, 73 },
  74 + rules: numberRule,
70 }, 75 },
71 { 76 {
72 field: 'maxRuleChains', 77 field: 'maxRuleChains',
@@ -78,6 +83,7 @@ export const formSchema: FormSchema[] = [ @@ -78,6 +83,7 @@ export const formSchema: FormSchema[] = [
78 componentProps: { 83 componentProps: {
79 placeholder: '请输入最大规则链数(请输入数字)', 84 placeholder: '请输入最大规则链数(请输入数字)',
80 }, 85 },
  86 + rules: numberRule,
81 }, 87 },
82 { 88 {
83 field: 'maxResourcesInBytes', 89 field: 'maxResourcesInBytes',
@@ -89,6 +95,7 @@ export const formSchema: FormSchema[] = [ @@ -89,6 +95,7 @@ export const formSchema: FormSchema[] = [
89 componentProps: { 95 componentProps: {
90 placeholder: '请输入(请输入数字)', 96 placeholder: '请输入(请输入数字)',
91 }, 97 },
  98 + rules: numberRule,
92 }, 99 },
93 { 100 {
94 field: 'maxOtaPackagesInBytes', 101 field: 'maxOtaPackagesInBytes',
@@ -100,6 +107,7 @@ export const formSchema: FormSchema[] = [ @@ -100,6 +107,7 @@ export const formSchema: FormSchema[] = [
100 componentProps: { 107 componentProps: {
101 placeholder: '请输入(请输入数字)', 108 placeholder: '请输入(请输入数字)',
102 }, 109 },
  110 + rules: numberRule,
103 }, 111 },
104 { 112 {
105 field: 'maxTransportMessages', 113 field: 'maxTransportMessages',
@@ -111,6 +119,7 @@ export const formSchema: FormSchema[] = [ @@ -111,6 +119,7 @@ export const formSchema: FormSchema[] = [
111 componentProps: { 119 componentProps: {
112 placeholder: '请输入最大传输消息数(请输入数字)', 120 placeholder: '请输入最大传输消息数(请输入数字)',
113 }, 121 },
  122 + rules: numberRule,
114 }, 123 },
115 { 124 {
116 field: 'maxTransportDataPoints', 125 field: 'maxTransportDataPoints',
@@ -122,6 +131,7 @@ export const formSchema: FormSchema[] = [ @@ -122,6 +131,7 @@ export const formSchema: FormSchema[] = [
122 componentProps: { 131 componentProps: {
123 placeholder: '请输入传输数据点的最大数量(请输入数字)', 132 placeholder: '请输入传输数据点的最大数量(请输入数字)',
124 }, 133 },
  134 + rules: numberRule,
125 }, 135 },
126 { 136 {
127 field: 'maxREExecutions', 137 field: 'maxREExecutions',