Commit 60a8e1ca authored by 皮倩雯's avatar 皮倩雯

fix: '流程中心报错修复'

parent 4789f572
Pipeline #74412 waiting for manual action with stages
......@@ -1043,7 +1043,6 @@ const FlowChart = props => {
list.FlowNodeBackfillConfigs = jsonData(list.FlowNodeBackfillConfigs);
currentNode.current = list;
console.log(currentNode.current);
debugger;
FlowNodeSave({
PreviewImage: response.data,
CreateUser: sessionStorage.getItem('userName'),
......@@ -1083,47 +1082,54 @@ const FlowChart = props => {
const jsonData = val => {
let listArr = [];
val.map((item, index) => {
let arr = [];
arr.push({
mapServer: item.schemeName,
tableName: item[0].nodeName,
filed: item[0].nodeValue,
});
if (item.users) {
item.users.map(i => {
arr.push({
mapServer: item.schemeName,
tableName: i.nodeName,
filed: i.nodeValue,
});
if(!item.Config){
console.log(item);
debugger
let arr = [];
arr.push({
mapServer: item.schemeName,
tableName: item[0].nodeName,
filed: item[0].nodeValue,
});
}
let obj = {};
obj.type = 'GIS';
if (item.tableType === 'mapping') {
obj.mapping = [
{
fromData: {
tableName: item.TableName,
filed: item.Fields,
if (item.users) {
item.users.map(i => {
arr.push({
mapServer: item.schemeName,
tableName: i.nodeName,
filed: i.nodeValue,
});
});
}
let obj = {};
obj.type = 'GIS';
if (item.tableType === 'mapping') {
obj.mapping = [
{
fromData: {
tableName: item.TableName,
filed: item.Fields,
},
toData: arr,
},
toData: arr,
},
];
} else {
obj.relationFormMapping = [
{
fromData: {
tableName: item.TableName,
filed: item.Fields,
];
} else {
obj.relationFormMapping = [
{
fromData: {
tableName: item.TableName,
filed: item.Fields,
},
toData: arr,
},
toData: arr,
},
];
];
}
let json = JSON.stringify(obj);
let newObj = { Config: json, BackfillType: 'GIS', RuleName: item.RuleName };
listArr.push(newObj);
}else{
listArr.push(item);
}
let json = JSON.stringify(obj);
let newObj = { Config: json, BackfillType: 'GIS', RuleName: item.RuleName };
listArr.push(newObj);
});
return listArr;
};
......@@ -1280,7 +1286,6 @@ const FlowChart = props => {
i.FlowNodeBackfillConfigs = jsonData(i.FlowNodeBackfillConfigs);
});
console.log(diagramObj.nodeDataArray);
debugger;
SaveNodeChange({
FlowId: flowID,
// DeleteNodes,
......
......@@ -45,9 +45,6 @@ const AddModal = props => {
const [form] = Form.useForm();
useEffect(() => {
if (visible) {
console.log(tableData);
console.log(msg);
debugger;
let arr = [];
tableData.map(i => {
arr.push(i.RuleName);
......@@ -105,6 +102,8 @@ const AddModal = props => {
const getLayerFields = (val, key, value, typeFields) => {
let obj = form.getFieldsValue();
let newValue = value ? value : schemeValue;
console.log(schemeValue);
debugger
let data = newValue.find(i => i.servicename === obj.schemeName);
GetLayerFields({
mapServer: data.servicename,
......@@ -136,12 +135,12 @@ const AddModal = props => {
});
let data = arr.find(i => i.FieldName === val[Object.keys(val)[0]]);
console.log(data);
debugger;
setTableType(data.type);
setType(data.FiledType);
setTableName(data.table);
// 修改源字段字段类型改变要重新获取type更新所有目标字段下拉框数据
getLayerFields()
// getLayerFields(val[Object.keys(val)[0]]);
}
};
......@@ -226,9 +225,6 @@ const AddModal = props => {
{ required: true },
{
validator: (_, value) => {
console.log(value);
console.log(ruleList);
debugger
if (modalType === 'add' && ruleList.indexOf(value) !== -1) {
return Promise.reject(new Error('规则名称已存在'));
} else if (
......
/* eslint-disable no-else-return */
/* eslint-disable prettier/prettier */
/* eslint-disable indent */
/* eslint-disable no-unused-expressions */
......@@ -78,55 +79,63 @@ const ConfigGIS = (props, ref) => {
// });
tableData.current = editMsg.FlowNodeBackfillConfigs?.map((item, index) => {
let obj = {};
let newConfig =JSON.parse(item.Config);
if (newConfig.mapping) {
let users = [];
newConfig.mapping[0].toData.map((x, y)=>{
obj[y]={nodeName: x.tableName, nodeValue: x.filed}
})
obj.Fields = newConfig.mapping[0].fromData.filed;
obj.ID = index;
obj.RuleName = item.RuleName;
obj.TableName = newConfig.mapping[0].fromData.tableName;
obj.key = index;
obj.nodeName1 = newConfig.mapping[0].toData[0].tableName;
obj.nodeValue1 = newConfig.mapping[0].toData[0].filed;
obj.schemeName = newConfig.mapping[0].toData[0].mapServer;
obj.tableType = 'mapping';
if (newConfig.mapping[0].toData.length > 1) {
newConfig.mapping[0].toData.map((i, j) => {
if (j !== 0) {
users.push({ nodeName: i.tableName, nodeValue: i.filed });
}
if (item.Config) {
let newConfig = JSON.parse(item.Config);
if (newConfig.mapping) {
let users = [];
newConfig.mapping[0].toData.map((x, y) => {
obj[y] = { nodeName: x.tableName, nodeValue: x.filed };
});
obj.users = users;
}
} else {
let users = [];
newConfig.relationFormMapping[0].toData.map((x, y)=>{
obj[y]={nodeName: x.tableName, nodeValue: x.filed}
})
obj.Fields = newConfig.relationFormMapping[0].fromData.filed;
obj.ID = index;
obj.RuleName = item.RuleName;
obj.TableName = newConfig.relationFormMapping[0].fromData.tableName;
obj.key = index;
obj.nodeName1 = newConfig.relationFormMapping[0].toData[0].tableName;
obj.nodeValue1 = newConfig.relationFormMapping[0].toData[0].filed;
obj.schemeName = newConfig.relationFormMapping[0].toData[0].mapServer;
obj.tableType = 'relationFormMapping';
if (newConfig.relationFormMapping[0].toData.length > 1) {
newConfig.relationFormMapping[0].toData.map((i, j) => {
if (j !== 0) {
users.push({ nodeName: i.tableName, nodeValue: i.filed });
}
obj.Fields = newConfig.mapping[0].fromData.filed;
obj.ID = index;
obj.RuleName = item.RuleName;
obj.TableName = newConfig.mapping[0].fromData.tableName;
obj.key = index;
obj.nodeName1 = newConfig.mapping[0].toData[0].tableName;
obj.nodeValue1 = newConfig.mapping[0].toData[0].filed;
obj.schemeName = newConfig.mapping[0].toData[0].mapServer;
obj.tableType = 'mapping';
if (newConfig.mapping[0].toData.length > 1) {
newConfig.mapping[0].toData.map((i, j) => {
if (j !== 0) {
users.push({ nodeName: i.tableName, nodeValue: i.filed });
}
});
obj.users = users;
}
} else {
let users = [];
newConfig.relationFormMapping[0].toData.map((x, y) => {
obj[y] = { nodeName: x.tableName, nodeValue: x.filed };
});
obj.users = users;
obj.Fields = newConfig.relationFormMapping[0].fromData.filed;
obj.ID = index;
obj.RuleName = item.RuleName;
obj.TableName = newConfig.relationFormMapping[0].fromData.tableName;
obj.key = index;
obj.nodeName1 = newConfig.relationFormMapping[0].toData[0].tableName;
obj.nodeValue1 = newConfig.relationFormMapping[0].toData[0].filed;
obj.schemeName = newConfig.relationFormMapping[0].toData[0].mapServer;
obj.tableType = 'relationFormMapping';
if (newConfig.relationFormMapping[0].toData.length > 1) {
newConfig.relationFormMapping[0].toData.map((i, j) => {
if (j !== 0) {
users.push({ nodeName: i.tableName, nodeValue: i.filed });
}
});
obj.users = users;
}
}
return {
...obj,
};
} else {
return {
...item,
key: index,
ID: index,
};
}
return {
...obj,
};
});
setFlag(flag + 1);
tableFields();
......@@ -142,7 +151,7 @@ const ConfigGIS = (props, ref) => {
}).then(res => {
if (res.code === 0) {
res.data.FromData.map(i => {
i.type = '工单、事件表';
i.type = '事件工单表';
i.TableFields.map(j => {
j.table = i.TableName;
j.type = 'mapping';
......@@ -181,7 +190,6 @@ const ConfigGIS = (props, ref) => {
}
tableData.current = list;
console.log(list);
debugger;
nodeChage('FlowNodeBackfillConfigs', tableData.current);
setViewModal(false);
};
......@@ -247,7 +255,7 @@ const ConfigGIS = (props, ref) => {
fontWeight: 700,
}}
>
GIS配置
GIS数据回填
</Divider>
<div
style={{
......
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