显示配置调整

This commit is contained in:
fan 2021-09-06 17:49:44 +08:00
parent 9ed4b26a57
commit 5e5474aee9
34 changed files with 90 additions and 56 deletions

View File

@ -54,7 +54,7 @@ export default class Arrow extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.show();
this.isShowShape = true;
this.setState(this.model);

View File

@ -173,7 +173,7 @@ export default class AutoTurnBack extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {

View File

@ -138,7 +138,7 @@ export default class AutomacticRoute extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {

View File

@ -142,7 +142,7 @@ export default class AxleReset extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {

View File

@ -98,7 +98,7 @@ export default class DirectionRod extends Group {
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {

View File

@ -62,7 +62,7 @@ export default class FloodGate extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {

View File

@ -149,7 +149,7 @@ export default class GuideLock extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {

View File

@ -89,7 +89,7 @@ export default class LcControl extends Group {
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.control.show();
this.isShowShape = true;
this.setState(this.model);

View File

@ -94,7 +94,7 @@ export default class LimitControl extends Group {
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.control.show();
this.isShowShape = true;
this.setState(this.model);

View File

@ -106,7 +106,7 @@ export default class Line2 extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.segment && this.segment.show();
this.viceSegment && this.viceSegment.show();
this.isShowShape = true;

View File

@ -58,7 +58,7 @@ export default class OutFrame extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.box && this.box.show();
this.isShowShape = true;
this.setState(this.model);

View File

@ -136,7 +136,7 @@ export default class Line2 extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild((child) => {
child.show();
});

View File

@ -92,7 +92,7 @@ export default class Line2 extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -71,7 +71,7 @@ export default class Resource extends Group {
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.image && this.image.show();
this.isShowShape = true;
this.setState(this.model);

View File

@ -189,7 +189,7 @@ export default class Responder extends Group {
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.block && this.block.show();
this.isShowShape = true;
this.setState(this.model);

View File

@ -223,7 +223,7 @@ export default class SaidLamp extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.control && this.control.show();
this.isShowShape = true;
this.setState(this.model);

View File

@ -597,7 +597,7 @@ export default class Section extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -1189,7 +1189,7 @@ class Signal extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -132,7 +132,7 @@ export default class SignalButton extends Group {
setShowMode() {
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -133,7 +133,7 @@ export default class SplitStation extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -784,7 +784,7 @@ export default class Station extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (this.model.visible) {
this.eachChild(item => {
item.show();

View File

@ -91,7 +91,7 @@ export default class StationCounter extends Group {
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -109,7 +109,7 @@ export default class StationDelayUnlock extends Group {
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -249,7 +249,7 @@ class StationStand extends Group {
}
}
setShowStation(stationCode) {
if ((!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) && this.model.visible) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code) && this.model.visible) {
this.eachChild(item => {
item.show();
});

View File

@ -199,7 +199,7 @@ export default class StationTurnBack extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -811,7 +811,7 @@ export default class Switch extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -70,7 +70,7 @@ export default class Text2 extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -462,7 +462,7 @@ export default class Train extends Group {
}
}
setShowStation(stationCode) {
if ((this.model.sectionModel && store.getters['map/checkDeviceShow'](stationCode, this.model.sectionModel.code)) || !stationCode) {
if (this.model.sectionModel && store.getters['map/checkDeviceShow'](stationCode, this.model.sectionModel.code)) {
this.eachChild(item => {
item.show();
});

View File

@ -111,7 +111,7 @@ export default class ZcControl extends Group {
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});

View File

@ -148,7 +148,9 @@ export default {
const roleDeviceCode = this.$store.state.training.roleDeviceCode;
const displayList = this.$store.state.map.map.displayList;
const display = displayList.find(each=>{
return each.stationCodeList.includes(roleDeviceCode);
if (each.type === 'LOCAL') {
return each.stationCodeList.includes(roleDeviceCode);
}
});
if (display) {
const codeList = [...display.switchStationCodeList];

View File

@ -671,7 +671,11 @@ const map = {
if (state.map && state.map.displayList && state.map.displayList.length) {
let flag = false;
state.map.displayList.forEach(item => {
if (item.stationCodeList.includes(stationCode) && item.elementList.includes(deviceCode)) {
if ( store.state.training.prdType === '01' && item.type === 'LOCAL' && item.stationCodeList.includes(stationCode) && item.elementList.includes(deviceCode)) {
flag = true;
} else if ( store.state.training.prdType === '02' && item.type === 'CENTER' && item.elementList.includes(deviceCode)) {
flag = true;
} else if ( store.state.training.prdType === '09' && item.type === 'DEPOT_IL' && item.elementList.includes(deviceCode)) {
flag = true;
}
});

View File

@ -141,28 +141,13 @@ export default {
back() {
this.$emit('goDraw');
},
generateOverlab() { //
if (!this.addModel.stationCodeList.length) {
this.$messageBox('请选择车站!');
return;
}
if (!this.addModel.switchStationCodeList.length) {
this.$messageBox('请选择可切换显示的车站!');
return;
}
this.tableData.push(this.addModel);
this.clearData();
},
clear() {
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
},
clearData() {
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
this.index = '';
this.addModel = { type: 'DEPOT_IL', elementList: [] };
},
generateData() {
this.loading = true;
this.tableData = [];
this.clear();
const station = this.stationList.find(item => item.depot);
console.log(station, station.code);
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,

View File

@ -142,13 +142,12 @@ export default {
this.$emit('goDraw');
},
clear() {
this.addModel = {elementList: []};
this.addModel = { type: 'CENTER', elementList: []};
},
generateData() {
this.loading = true;
this.tableData = [];
this.clear();
const station = this.stationList.find(item => item.depot);
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => {

View File

@ -65,7 +65,8 @@
</div>
</el-card>
<div style="display: table; margin-left: 90px; margin-top: 12px; margin-bottom: 20px;">
<el-button type="primary" size="small" @click="generateData">按集中站生成并保存</el-button>
<el-button type="primary" size="small" @click="generateData">按集中站生成</el-button>
<el-button type="primary" size="small" @click="generateAllData">全显生成</el-button>
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
<el-button type="primary" size="small" @click="back">返回</el-button>
</div>
@ -259,20 +260,63 @@ export default {
this.clearData();
},
clear() {
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
},
clearData() {
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
this.index = '';
this.cardMode = 'generate';
},
generateAllData() {
this.loading = true;
this.tableData = [];
const tempData = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
const stationCodeList = [];
this.stationList.forEach(item => {
if (!item.depot) {
tempData.stationCodeList.push(item.code);
} else { stationCodeList.push(item.code); }
});
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => {
if (!stationCodeList.includes(item.stationCode)) {
tempData.elementList.push(item.code);
}
});
[...this.directionRodList].forEach(item => {
if (!stationCodeList.includes(item.deviceStationCode)) {
tempData.elementList.push(item.code);
}
});
this.psdList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
if (!stationCodeList.includes(stand.stationCode)) {
tempData.elementList.push(item.code);
}
});
this.tableData.push(tempData);
const map = this.$store.state.map.map;
const param = {
displayList: [...this.tableData, ...this.otherData],
mapId: this.$route.params.mapId
};
saveMap(Object.assign(map, param)).then(response => {
this.loading = false;
this.$message.success('保存现地配置成功');
this.cancelOverlab();
}).catch(() => {
this.loading = false;
this.$messageBox('保存现地配置失败');
});
},
generateData() {
this.loading = true;
this.tableData = [];
// switchStationCodeList:[...item.switchStationCodeList, item.code]
this.stationList.forEach(item => {
if (item.centralized) {
this.tableData.push({stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]});
this.tableData.push({type: 'LOCAL', stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]});
}
});