Showing
1 changed file
with
10 additions
and
1 deletions
| ... | ... | @@ -176,8 +176,17 @@ export const formSchema: BFormSchema[] = [ |
| 176 | 176 | field: 'name', |
| 177 | 177 | label: '报表名称', |
| 178 | 178 | colProps: { span: 24 }, |
| 179 | - required: true, | |
| 180 | 179 | component: 'Input', |
| 180 | + rules: [ | |
| 181 | + { required: true, message: '请输入报表名称' }, | |
| 182 | + { | |
| 183 | + validator(_rule, value, _callback) { | |
| 184 | + const reg = /[\/\\]/; | |
| 185 | + if (reg.test(value)) return Promise.reject('报表名称中存在斜杠或反斜杠'); | |
| 186 | + return Promise.resolve(); | |
| 187 | + }, | |
| 188 | + }, | |
| 189 | + ], | |
| 181 | 190 | componentProps: { |
| 182 | 191 | maxLength: 64, |
| 183 | 192 | placeholder: '请输入报表名称', | ... | ... |