|
|
@ -129,15 +129,17 @@ export const importExcelUrlValidator = { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const extraParameterValidator = { |
|
|
|
export const extraParameterValidator = { |
|
|
|
validator: (rule: any, value: any, callback: (errMsg?: string) => void) => { |
|
|
|
validator: (rule: any, value: any) => { |
|
|
|
for (const param of value) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if (param.key === '') { |
|
|
|
for (const param of value) { |
|
|
|
callback('Parameter key cannot be empty') |
|
|
|
if (param.key === '') { |
|
|
|
} |
|
|
|
return reject(new Error('Parameter key cannot be empty')) |
|
|
|
if (value.filter((el: any) => el.key === param.key).length !== 1) { |
|
|
|
} |
|
|
|
callback('Duplicate parameter keys are not allowed') |
|
|
|
if (value.filter((el: any) => el.key === param.key).length !== 1) { |
|
|
|
|
|
|
|
return reject(new Error('Duplicate parameter keys are not allowed')) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return resolve(true) |
|
|
|
callback() |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|