|
@@ -849,24 +849,26 @@ export const schemas: FormSchema[] = [
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- validator: async (_, value: any) => {
|
|
|
- let dealValue = '';
|
|
|
- if (value) {
|
|
|
- dealValue = value.replace(/\s*/g, '');
|
|
|
- }
|
|
|
- if (dealValue === '') {
|
|
|
- return Promise.reject('请输入注册资金');
|
|
|
- }
|
|
|
- if (value < 0) {
|
|
|
- return Promise.reject('注册资金不能小于0');
|
|
|
- }
|
|
|
+ dynamicRules: ({ values }) => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ validator: async (_, value: any) => {
|
|
|
+ let dealValue = '';
|
|
|
+ if (value) {
|
|
|
+ dealValue = value.replace(/\s*/g, '');
|
|
|
+ }
|
|
|
+ if (values.nature && dealValue === '') {
|
|
|
+ return Promise.reject('请输入注册资金');
|
|
|
+ }
|
|
|
+ if (values.nature && value < 0) {
|
|
|
+ return Promise.reject('注册资金不能小于0');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ trigger: 'blur',
|
|
|
},
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ],
|
|
|
+ ];
|
|
|
+ },
|
|
|
required: ({ values }) => {
|
|
|
if (values.nature !== 0) {
|
|
|
return true;
|