This commit is contained in:
fan 2020-09-08 09:49:57 +08:00
commit 4bfe76c9cb
4 changed files with 39 additions and 45 deletions

View File

@ -78,7 +78,7 @@ class SkinCode extends defaultStyle {
line: {
isActiveShow: true, // 哈尔滨点击元素显示
width: 5, // 区段宽度
beyondWidth: 1, // 区段宽超出宽度
beyondWidth: 0, // 区段宽超出宽度
invadeColor: '#EF0C08', // 区段侵入颜色
spareColor: '#ffff00', // 区段空闲颜色 (黄色)
communicationOccupiedColor: '#ff0000', // 区段通信车占用颜色 红色

View File

@ -286,14 +286,11 @@ export default class Switch extends Group {
} else {
this.locShelter.show();
}
// this.sheltertriangle.show(); // 直角梯形覆盖图形
// this.sheltertriangle.setColor('red');
if (this.style.Switch.core.graphShow) { // 佛山线路显示
this.relocShelter.show();
this.sheltertriangle.show();
this.relocShelter.setColor('#00FF00');
this.sheltertriangle.setColor('#00FF00');
console.log(1111111);
} else {
this.relocShelter.hide();
this.sheltertriangle.hide();
@ -313,11 +310,11 @@ export default class Switch extends Group {
this.sheltertriangle.hide();
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
this.sheltertriangle.show();
this.setSectionState(this.sheltertriangle.getSection(), 'fill', this.model);
this.setSectionState(this.sheltertriangle, this.model);
} else {
// this.rhomboid.show();
// this.setSectionState(this.rhomboid.getSection(), 'fill', this.model);
// this.setSectionState(this.sheltertriangle.getSection(), 'fill', this.model);
// this.setSectionState(this.rhomboid, 'fill', this.model);
// this.setSectionState(this.sheltertriangle, 'fill', this.model);
}
if (this.style.Switch.core.graphShow) { // 佛山线路显示
// this.sheltertriangle.hide();
@ -496,45 +493,37 @@ export default class Switch extends Group {
}
}
setSectionState(section, style, state) {
// && !section.animators.length
if (section && section.ignore) {
const sectionA = store.getters['map/getDeviceByCode'](state.sectionACode);
/** 空闲 */
// section.setStyle(style, this.style.Section.line.spareColor);
setSectionState(section, state) {
const sectionC = store.getters['map/getDeviceByCode'](state.sectionCCode);
if (sectionC) {
// 空闲
// section.setColor('fill', this.style.Section.line.spareColor);
// section.setStyle('lineWidth', 0);
// section.setStyle('stroke', this.style.Section.line.spareColor);
/** 道岔保护区段锁闭 */
// this.sheltertriangle.hide();
if (sectionA.overlapLock) {
this.sheltertriangle.show();
section.setStyle(style, this.style.Section.line.protectiveLockColor);
// 道岔保护区段锁闭
if (sectionC.overlapLock) {
section.show();
section.setStyle({'fill': this.style.Section.line.protectiveLockColor});
}
/** 空闲锁闭或者叫进路锁闭 */
if (sectionA.routeLock) {
section.setStyle(style, this.style.Section.line.routeLockColor);
section.setStyle('stroke', this.style.Section.line.routeLockColor);
section.setStyle('lineWidth', this.style.Section.line.beyondWidth);
this.sheltertriangle.show();
// 空闲锁闭或者叫进路锁闭
if (sectionC.routeLock) {
section.setStyle({'fill': this.style.Section.line.routeLockColor, 'stroke': this.style.Section.line.routeLockColor, 'lineWidth': this.style.Section.line.beyondWidth});
section.show();
}
/** 非CBTC车占用 */
if (sectionA.nctOccupied) {
this.sheltertriangle.show();
section.setStyle(style, this.style.Section.line.unCommunicationOccupiedColor);
section.setStyle('stroke', this.style.Section.line.unCommunicationOccupiedColor);
section.setStyle('lineWidth', this.style.Section.line.beyondWidth);
// 非CBTC车占用
if (sectionC.nctOccupied) {
section.show();
section.setStyle({'fill': this.style.Section.line.unCommunicationOccupiedColor, 'stroke': this.style.Section.line.unCommunicationOccupiedColor, 'lineWidth': this.style.Section.line.beyondWidth});
}
/** CBTC车占用 */
if (sectionA.ctOccupied) {
this.sheltertriangle.show();
section.setStyle(style, this.style.Section.line.communicationOccupiedColor);
section.setStyle('stroke', this.style.Section.line.communicationOccupiedColor);
section.setStyle('lineWidth', this.style.Section.line.beyondWidth);
// CBTC车占用
if (sectionC.ctOccupied) {
section.show();
section.setStyle({'fill': this.style.Section.line.communicationOccupiedColor, 'stroke': this.style.Section.line.communicationOccupiedColor, 'lineWidth': this.style.Section.line.beyondWidth});
}
if (sectionA.cutOff) {
this.sheltertriangle.show();
// this.sheltertriangle.
// this.sectionCutOff(section);
if (sectionC.cutOff) {
section.show();
// this.sectionCutOff(section);
}
}
}
@ -542,9 +531,6 @@ export default class Switch extends Group {
setState(model) {
if (!this.isShowShape) return;
this.recover();
// console.log('定位>', model.normalPosition, '反位>', model.reversePosition);
// model.normalPosition = 0;
// model.reversePosition = 1;
if (model.normalPosition) {
this.setLocationAction(model); /** 定位*/
} else if (model.reversePosition) {
@ -560,8 +546,7 @@ export default class Switch extends Group {
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
// this.hideSwitchCenter();
// model.routeLock && this.setSectionState(this.rhomboid.getSection(), 'fill', this.model);
this.setSectionState(this.sheltertriangle.getSection(), 'fill', this.model);
this.setSectionState(this.sheltertriangle, this.model);
// this.interlockingReserved(); // 联锁预留道岔
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色

View File

@ -129,6 +129,8 @@ function handle(state, data) {
case 'Simulation_Member':
state.memberChangeCount++;
break;
case 'Simulation_Time_Sync':
state.simulationTimeSync = msg;
}
}
@ -257,7 +259,8 @@ const socket = {
beLogoutCount: 0, // 被登出
runPlanReloadCount: 0, // 仿真运行图变更
memberChangeCount: 0, // 仿真成员变更
roomInvite: {}
roomInvite: {},
simulationTimeSync: '' // 仿真时间
},
getters: {
},

View File

@ -18,6 +18,7 @@
<script>
import { prefixIntrger } from '@/utils/date';
import SystemTime from '@/views/components/systemTime/index';
import { timeFormat } from '@/utils/date';
//
export default {
@ -67,6 +68,11 @@ export default {
'$store.state.training.initTime': function (initTime) {
const date = new Date(initTime);
this.initDate(date);
},
'$store.state.socket.simulationTimeSync': function (time) { // 仿
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`));
const date = new Date(+new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`));
this.initDate(date);
}
},
mounted() {