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

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

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