Commit 637ef695 authored by 皮倩雯's avatar 皮倩雯

fix: '巡检反馈字段映射优化'

parent c52c1119
Pipeline #63396 passed with stages
......@@ -307,6 +307,7 @@ const AddModal = props => {
const onSubmit = () => {
formAdd.validateFields().then(validate1 => {
console.log(validate1);
if (validate1) {
form.validateFields().then(validate => {
if (validate) {
......@@ -314,18 +315,19 @@ const AddModal = props => {
let objaa = formAdd.getFieldValue('parmars');
console.log(objaa);
console.log(keep);
objaa.map(i => {
keep.map(j => {
if (j.key === i.fromField) {
i.fromField = j.value;
}
objaa &&
objaa.map(i => {
keep.map(j => {
if (j.key === i.fromField) {
i.fromField = j.value;
}
});
});
});
console.log(objaa);
if (type == 'add') {
CM_Feedback_OperatePatrolFeedback({
...obj,
mappingFields: JSON.stringify(objaa),
mappingFields: objaa && JSON.stringify(objaa),
}).then(res => {
if (res.msg == '') {
form.resetFields();
......@@ -347,7 +349,7 @@ const AddModal = props => {
CM_Feedback_OperatePatrolFeedback({
...obj,
id: formObj.id,
mappingFields: JSON.stringify(objaa),
mappingFields: objaa && JSON.stringify(objaa),
}).then(res => {
if (res.msg == '') {
form.resetFields();
......@@ -593,36 +595,39 @@ const AddModal = props => {
const changeValue = () => {
console.log(formAdd.getFieldsValue().parmars);
let aa = formAdd.getFieldsValue().parmars;
let from = [];
let to = [];
aa.map(i => {
if (i && i.fromField) {
from.push(i.fromField);
}
if (i && i.toField) {
to.push(i.toField);
}
});
if (aa) {
console.log(aa);
let from = [];
let to = [];
aa.map(i => {
if (i && i.fromField) {
from.push(i.fromField);
}
if (i && i.toField) {
to.push(i.toField);
}
});
let lastFrom = [];
let lastTo = [];
console.log(from);
console.log(keep);
keep.map(j => {
if (from.indexOf(j.key) == -1) {
lastFrom.push(j);
}
});
console.log(lastFrom);
setKeepData(lastFrom);
let lastFrom = [];
let lastTo = [];
console.log(from);
console.log(keep);
keep.map(j => {
if (from.indexOf(j.key) == -1) {
lastFrom.push(j);
}
});
console.log(lastFrom);
setKeepData(lastFrom);
keepAll.map(j => {
if (to.indexOf(j.name) == -1) {
lastTo.push(j);
}
});
console.log(lastTo);
setKeepTree(lastTo);
keepAll.map(j => {
if (to.indexOf(j.name) == -1) {
lastTo.push(j);
}
});
console.log(lastTo);
setKeepTree(lastTo);
}
// let data = keepAll;
// data.map(k => {
......
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