Showing
1 changed file
with
8 additions
and
0 deletions
... | ... | @@ -182,12 +182,16 @@ export const formSchemas: FormSchema[] = [ |
182 | 182 | componentProps: { |
183 | 183 | placeholder: '如:关', |
184 | 184 | }, |
185 | + defaultValue: '关', | |
185 | 186 | ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_BOOL, |
186 | 187 | dynamicRules: ({ model }) => { |
187 | 188 | const close = model[FormField.BOOL_CLOSE]; |
188 | 189 | const open = model[FormField.BOOL_OPEN]; |
189 | 190 | return [ |
190 | 191 | { |
192 | + required: true, | |
193 | + }, | |
194 | + { | |
191 | 195 | validator() { |
192 | 196 | if (open === close) return Promise.reject('布尔值不能相同'); |
193 | 197 | return Promise.resolve(); |
... | ... | @@ -207,12 +211,16 @@ export const formSchemas: FormSchema[] = [ |
207 | 211 | componentProps: { |
208 | 212 | placeholder: '如:开', |
209 | 213 | }, |
214 | + defaultValue: '开', | |
210 | 215 | ifShow: ({ values }) => values[FormField.TYPE] === DataTypeEnum.IS_BOOL, |
211 | 216 | dynamicRules: ({ model }) => { |
212 | 217 | const close = model[FormField.BOOL_CLOSE]; |
213 | 218 | const open = model[FormField.BOOL_OPEN]; |
214 | 219 | return [ |
215 | 220 | { |
221 | + required: true, | |
222 | + }, | |
223 | + { | |
216 | 224 | validator() { |
217 | 225 | if (open === close) return Promise.reject('布尔值不能相同'); |
218 | 226 | return Promise.resolve(); | ... | ... |