// 闭塞分区与区段对应关系,格式 {key: "车站ID_Section_区段id"}
// let sectionRelationObj = getSectionRelationObj(datas.sectionInfo);
// store.dispatch("initConfigStore/sectionRelationObj", sectionRelationObj);
// 线路号与区段对应关系,格式 {key: "车站ID_Section_区段id"}
// let lineReationObj = getLineRelationObj(datas.sectionInfo);
// store.dispatch("initConfigStore/lineReationObj", lineReationObj)

function getSectionRelationObj(arr) {
let obj = {};
let sectionRelationObj = {};
arr.reduce((item, next) => {
if(obj[next.blockSectionID]) {
item.some(arrItem => {
let key = Object.keys(arrItem)[0]
if(key == next.blockSectionID) {
sectionRelationObj[key].push(next.tccDeviceId + "Section" + next.id);
return true;
}
})
} else {
obj[next.blockSectionID] = true;
let nextObj = {};
nextObj[next.blockSectionID] = [];
nextObj[next.blockSectionID].push(next.tccDeviceId + "Section" + next.id);
sectionRelationObj = Object.assign(sectionRelationObj, nextObj)
item.push(nextObj)
}
return item;
}, [])
return sectionRelationObj;
}

function getLineRelationObj(arr) {
let obj = {};
let lineRelationObj = {};
arr.reduce((item, next) => {
if(obj[next.lineID]) {
item.some(arrItem => {
let key = Object.keys(arrItem)[0]
if(key == next.lineID) {
lineRelationObj[key].push(next.tccDeviceId + "Section" + next.id);
return true;
}
})
} else {
obj[next.lineID] = true;
let nextObj = {};
nextObj[next.lineID] = [];
nextObj[next.lineID].push(next.tccDeviceId + "Section" + next.id);
lineRelationObj = Object.assign(lineRelationObj, nextObj)
item.push(nextObj)
}
return item;
}, [])
return lineRelationObj;
}