Commit 5f55221920d3742767ae83f13998a64f746cc058

Authored by fengtao
1 parent b423a055

fix:DEFECT-962 前端限制字符串长度

... ... @@ -154,6 +154,7 @@ export const formSchema: QFormSchema[] = [
154 154 return values.accessMode === AccessMode.ManuallyEnter;
155 155 },
156 156 componentProps: {
  157 + maxLength: 36,
157 158 placeholder: '请输入视频厂家',
158 159 },
159 160 },
... ... @@ -167,6 +168,7 @@ export const formSchema: QFormSchema[] = [
167 168 return values.accessMode === AccessMode.ManuallyEnter;
168 169 },
169 170 componentProps: {
  171 + maxLength: 36,
170 172 placeholder: '请输入摄像头编号',
171 173 },
172 174 },
... ...
... ... @@ -101,6 +101,7 @@ export const formDetailSchema: FormSchema[] = [
101 101 helpMessage: ['平台IP + 端口'],
102 102 rules: [{ required: true, message: '平台地址为必填项' }],
103 103 componentProps: {
  104 + maxLength: 36,
104 105 placeholder: '请输入平台地址',
105 106 },
106 107 },
... ... @@ -110,6 +111,7 @@ export const formDetailSchema: FormSchema[] = [
110 111 component: 'Input',
111 112 rules: [{ required: true, message: '用户Key为必填项' }],
112 113 componentProps: {
  114 + maxLength: 36,
113 115 placeholder: '请输入用户Key',
114 116 },
115 117 },
... ... @@ -122,6 +124,7 @@ export const formDetailSchema: FormSchema[] = [
122 124 { required: true, min: 20, message: '用户密钥不能少于20位字符' },
123 125 ],
124 126 componentProps: {
  127 + maxLength: 36,
125 128 placeholder: '请输入用户密钥',
126 129 },
127 130 },
... ...
... ... @@ -59,6 +59,7 @@ export const formSchema: FormSchema[] = [
59 59 const { setFieldsValue } = formActionType;
60 60 return {
61 61 placeholder: '请输入标题',
  62 + maxLength: 36,
62 63 onChange: (value: Event) => {
63 64 setFieldsValue({
64 65 [PackageField.VERSION_TAG]: getVersionTag(
... ... @@ -79,6 +80,7 @@ export const formSchema: FormSchema[] = [
79 80 const { setFieldsValue } = formActionType;
80 81 return {
81 82 placeholder: '请输入版本',
  83 + maxLength: 36,
82 84 onChange: (value: Event) => {
83 85 setFieldsValue({
84 86 [PackageField.VERSION_TAG]: getVersionTag(
... ... @@ -97,6 +99,7 @@ export const formSchema: FormSchema[] = [
97 99 helpMessage: ['自定义标签应与您设备报告的软件包版本相匹配'],
98 100 componentProps: () => {
99 101 return {
  102 + maxLength: 36,
100 103 placeholder: '请输入版本标签',
101 104 };
102 105 },
... ... @@ -191,6 +194,7 @@ export const formSchema: FormSchema[] = [
191 194 },
192 195 rules: [{ required: true, message: '外部URL为必填项' }],
193 196 componentProps: {
  197 + maxLength: 36,
194 198 placeholder: '请输入外部URL',
195 199 },
196 200 },
... ... @@ -238,6 +242,7 @@ export const formSchema: FormSchema[] = [
238 242 },
239 243 helpMessage: ['如果校验和为空,会自动生成'],
240 244 componentProps: {
  245 + maxLength: 36,
241 246 placeholder: '请输入校验和',
242 247 },
243 248 },
... ... @@ -246,6 +251,7 @@ export const formSchema: FormSchema[] = [
246 251 label: '描述',
247 252 component: 'InputTextArea',
248 253 componentProps: {
  254 + maxLength: 255,
249 255 placeholder: '请输入描述',
250 256 },
251 257 },
... ...
... ... @@ -147,7 +147,7 @@ export const formSchema: QFormSchema[] = [
147 147 required: true,
148 148 component: 'Input',
149 149 componentProps: {
150   - maxLength: 255,
  150 + maxLength: 64,
151 151 placeholder: '请输入报表名称',
152 152 },
153 153 },
... ...
... ... @@ -59,7 +59,7 @@ export const formSchema: FormSchema[] = [
59 59 required: true,
60 60 component: 'Input',
61 61 componentProps: {
62   - maxLength: 36,
  62 + maxLength: 32,
63 63 placeholder: '请输入名称',
64 64 },
65 65 },
... ...
... ... @@ -65,12 +65,14 @@
65 65 v-if="ifAdd"
66 66 v-model:value="scriptForm.description"
67 67 placeholder="请输入备注"
  68 + :maxlength="255"
68 69 />
69 70 <a-textarea
70 71 :rows="3"
71 72 v-else
72 73 v-model:value="scriptForm.output"
73 74 placeholder="输出参数为服务端返回的内容"
  75 + :maxlength="255"
74 76 />
75 77 </a-form-item>
76 78 </a-form>
... ... @@ -184,6 +186,10 @@
184 186 const trimParams = scriptForm.params.replace(/\s*/g, '');
185 187 Reflect.set(value, 'params', trimParams);
186 188 }
  189 + if (scriptForm.convertJs.length > 1000) {
  190 + createMessage.error('脚本内容长度不能大于1000');
  191 + throw '脚本内容长度不能大于1000';
  192 + }
187 193 return {
188 194 ...value,
189 195 ...{ convertJs: props.ifAdd ? scriptForm.convertJs : null },
... ...