调整道岔生成逻辑
This commit is contained in:
parent
9ca3612715
commit
e5687c13dd
@ -2,10 +2,10 @@ export function getBaseUrl() {
|
|||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||||
BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||||
|
@ -170,14 +170,12 @@ export default {
|
|||||||
if (!this.checkAddListA(oneSection, section.code)) { // 右侧关系清空
|
if (!this.checkAddListA(oneSection, section.code)) { // 右侧关系清空
|
||||||
const sectionModel = deepAssign({}, section);
|
const sectionModel = deepAssign({}, section);
|
||||||
sectionModel.rightSectionCode = '';
|
sectionModel.rightSectionCode = '';
|
||||||
sectionModel.parentCode = '';
|
|
||||||
sectionModel.sepTypeRight = '00'; // 分隔符
|
sectionModel.sepTypeRight = '00'; // 分隔符
|
||||||
sectionModel.type = '03';
|
sectionModel.type = '03';
|
||||||
const list = this.findSectionA(sectionModel.points[sectionModel.points.length - 1].x, sectionModel.points[sectionModel.points.length - 1].y);
|
const list = this.findSectionA(sectionModel.points[sectionModel.points.length - 1].x, sectionModel.points[sectionModel.points.length - 1].y);
|
||||||
list.forEach(elem => {
|
list.forEach(elem => {
|
||||||
const sectionModel = deepAssign({}, elem);
|
const sectionModel = deepAssign({}, elem);
|
||||||
sectionModel.leftSectionCode = '';
|
sectionModel.leftSectionCode = '';
|
||||||
sectionModel.parentCode = '';
|
|
||||||
sectionModel.sepTypeLeft = '00';
|
sectionModel.sepTypeLeft = '00';
|
||||||
sectionModel.type = '03';
|
sectionModel.type = '03';
|
||||||
changeSectionList.push(sectionModel);
|
changeSectionList.push(sectionModel);
|
||||||
@ -191,14 +189,12 @@ export default {
|
|||||||
if (!this.checkAddListB(oneSectionStar, section.code)) { // 左侧关系清空
|
if (!this.checkAddListB(oneSectionStar, section.code)) { // 左侧关系清空
|
||||||
const sectionModel = deepAssign({}, section);
|
const sectionModel = deepAssign({}, section);
|
||||||
sectionModel.leftSectionCode = '';
|
sectionModel.leftSectionCode = '';
|
||||||
sectionModel.parentCode = '';
|
|
||||||
sectionModel.sepTypeLeft = '00';
|
sectionModel.sepTypeLeft = '00';
|
||||||
sectionModel.type = '03';
|
sectionModel.type = '03';
|
||||||
const list = this.findSectionB(sectionModel.points[0].x, sectionModel.points[0].y);
|
const list = this.findSectionB(sectionModel.points[0].x, sectionModel.points[0].y);
|
||||||
list.forEach(elem => {
|
list.forEach(elem => {
|
||||||
const sectionModel = deepAssign({}, elem);
|
const sectionModel = deepAssign({}, elem);
|
||||||
sectionModel.rightSectionCode = '';
|
sectionModel.rightSectionCode = '';
|
||||||
sectionModel.parentCode = '';
|
|
||||||
sectionModel.sepTypeRight = '00'; // 分隔符
|
sectionModel.sepTypeRight = '00'; // 分隔符
|
||||||
sectionModel.type = '03';
|
sectionModel.type = '03';
|
||||||
changeSectionList.push(sectionModel);
|
changeSectionList.push(sectionModel);
|
||||||
@ -249,45 +245,45 @@ export default {
|
|||||||
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
|
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
|
||||||
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
|
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
|
||||||
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
|
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
|
||||||
const parentSectionModel = this.$store.getters['map/getDeviceByCode'](sectiona.parentCode);
|
// const parentSectionModel = this.$store.getters['map/getDeviceByCode'](sectiona.parentCode);
|
||||||
if (!parentSectionModel) { // 找不到父元素删除
|
// if (!parentSectionModel) { // 找不到父元素删除
|
||||||
if (switchSectionList.indexOf(elem.code) == -1) {
|
if (switchSectionList.indexOf(elem.code) == -1) {
|
||||||
let uid;
|
let uid;
|
||||||
if (!elem['uid']) {
|
if (!elem['uid']) {
|
||||||
uid = getUID('T', [...this.sectionList, ...addSectionList]);
|
uid = getUID('T', [...this.sectionList, ...addSectionList]);
|
||||||
elem['uid'] = uid;
|
elem['uid'] = uid;
|
||||||
}
|
|
||||||
addSectionList.push({ code: elem.uid });
|
|
||||||
sectiona.parentCode = elem['uid'];
|
|
||||||
sectionb.parentCode = elem['uid'];
|
|
||||||
sectionc.parentCode = elem['uid'];
|
|
||||||
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode];
|
|
||||||
sectionList.push(elem);
|
|
||||||
switchList.forEach(ele => {
|
|
||||||
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
|
|
||||||
const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
|
|
||||||
const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
|
|
||||||
if (sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
|
|
||||||
ele['uid'] = uid;
|
|
||||||
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
|
||||||
sectiona1.parentCode = uid;
|
|
||||||
sectionb1.parentCode = uid;
|
|
||||||
sectionc1.parentCode = uid;
|
|
||||||
switchSectionList.push(ele.code);
|
|
||||||
sectionList.forEach((item, index) => {
|
|
||||||
if (item.code == ele.code) {
|
|
||||||
sectionList.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
addSectionList.push({ code: elem.uid });
|
||||||
parentSectionModel.relevanceSectionList.push(elem.sectionACode);
|
sectiona.parentCode = elem['uid'];
|
||||||
parentSectionModel.relevanceSectionList.push(elem.sectionBCode);
|
sectionb.parentCode = elem['uid'];
|
||||||
parentSectionModel.relevanceSectionList.push(elem.sectionCCode);
|
sectionc.parentCode = elem['uid'];
|
||||||
models.push(parentSectionModel);
|
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode];
|
||||||
|
sectionList.push(elem);
|
||||||
|
switchList.forEach(ele => {
|
||||||
|
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
|
||||||
|
const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
|
||||||
|
const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
|
||||||
|
if (sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
|
||||||
|
ele['uid'] = uid;
|
||||||
|
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
||||||
|
sectiona1.parentCode = uid;
|
||||||
|
sectionb1.parentCode = uid;
|
||||||
|
sectionc1.parentCode = uid;
|
||||||
|
switchSectionList.push(ele.code);
|
||||||
|
sectionList.forEach((item, index) => {
|
||||||
|
if (item.code == ele.code) {
|
||||||
|
sectionList.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
// } else {
|
||||||
|
// parentSectionModel.relevanceSectionList.push(elem.sectionACode);
|
||||||
|
// parentSectionModel.relevanceSectionList.push(elem.sectionBCode);
|
||||||
|
// parentSectionModel.relevanceSectionList.push(elem.sectionCCode);
|
||||||
|
// models.push(parentSectionModel);
|
||||||
|
// }
|
||||||
sectiona.relSwitchCode = elem.code;
|
sectiona.relSwitchCode = elem.code;
|
||||||
sectionb.relSwitchCode = elem.code;
|
sectionb.relSwitchCode = elem.code;
|
||||||
sectionc.relSwitchCode = elem.code;
|
sectionc.relSwitchCode = elem.code;
|
||||||
|
Loading…
Reference in New Issue
Block a user