Commit 6dfe1177 authored by 皮倩雯's avatar 皮倩雯

fix: '维保模板新增配置验证优化'

parent cebc9c2c
Pipeline #75493 failed with stages
......@@ -47,13 +47,18 @@ const RuleConfig = props => {
}, [visible]);
// 保存线配置
const onSave = () => {
RuleValidation({ ruleContent: rule, flowId: flowID }).then(res => {
if (res.data) {
onSubumit(rule);
} else {
message.error('请检查规则是否正确');
}
});
if (rule) {
RuleValidation({ ruleContent: rule, flowId: flowID }).then(res => {
if (res.data) {
onSubumit(rule);
} else {
message.error('请检查规则是否正确');
}
});
} else {
onSubumit('');
handleCancel();
}
};
// 处理树数据
const mapTree = (val, index) => ({
......
......@@ -1113,7 +1113,9 @@ const AddModal = props => {
validator: (rule, value) => {
let filterValue = formAdd.getFieldsValue().parmars;
let num = filterValue.findIndex(i => i.fromField === value);
if (num !== undefined && num !== fieldKey) {
let index = rule.field.split('.')[1];
// debugger
if (num !== undefined && num !== Number(index)) {
return Promise.reject('字段重复');
}
return Promise.resolve();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment