# Conflicts:
#	src/jmapNew/shape/Automactic/index.js
This commit is contained in:
zyy 2020-03-10 14:47:13 +08:00
commit 8c71459ac1
30 changed files with 447 additions and 386 deletions

View File

@ -6,6 +6,7 @@ import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
import EMouse from './EMouse';
import {getPrdType} from '../utils/handlePath';
export default class Automactic extends Group {
constructor(model, style) {
@ -16,17 +17,8 @@ export default class Automactic extends Group {
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.prdType = '';
const path = window.location.href;
if (path.includes('?')) {
const arr = window.location.href.split('?')[1].split('&');
arr.forEach(elem => {
if (elem.split('=')[0] === 'prdType') {
this.prdType = elem.split('=')[1];
}
});
}
if (!this.prdType || this.style.AutomaticRoute.displayCondition.indexOf(this.prdType) !== -1) {
this.prdType = getPrdType();
if (!this.prdType || this.style.MapCycleButtonVO.visibleConditions.indexOf(this.prdType) !== -1) {
this.create();
this.createMouseEvent();
this.setState(model);

View File

@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group';
import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import EMouse from './EMouse';
import {getPrdType} from '../utils/handlePath';
export default class LcControl extends Group {
constructor(model, style) {
@ -15,13 +16,7 @@ export default class LcControl extends Group {
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
const arr = window.location.href.split('?')[1].split('&');
this.prdType = '';
arr.forEach(elem => {
if (elem.split('=')[0] === 'prdType') {
this.prdType = elem.split('=')[1];
}
});
this.prdType = getPrdType();
if (!this.prdType || this.style.AutomaticRoute.displayCondition.indexOf(this.prdType) !== -1) {
this.create();
this.createMouseEvent();

View File

@ -30,6 +30,7 @@ export default class LcControl extends Group {
cy: model.position.y,
r: this.style.LcControl.lamp.radiusR
},
subType: 'Control',
lineWidth: 0,
fill: this.style.LcControl.lamp.controlColor
},

View File

@ -6,77 +6,78 @@ import EControl from '../element/EControl';
import EMouse from './EMouse';
export default class LimitControl extends Group {
constructor(model, style) {
super();
this.selected = false;
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.z = 20;
this.create(model);
this.createMouseEvent();
this.setState(model);
}
constructor(model, style) {
super();
this.selected = false;
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.z = 20;
this.create(model);
this.createMouseEvent();
this.setState(model);
}
create(model) {
this.control = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.position.x,
cy: model.position.y,
r: this.style.LimitControl.lamp.radiusR
},
lineWidth: 0,
fill: this.style.LimitControl.lamp.controlColor,
mouseover: this.mouseoverArc,
mouseout: this.mouseoutArc
},
text: {
position: [0, 0],
x: model.position.x,
y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
fontWeight: this.style.LimitControl.text.fontWeight,
fontSize: this.style.LimitControl.text.fontSize,
fontFamily: this.style.fontFamily,
text: model.name,
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top',
mouseover: this.mouseoverText,
mouseout: this.mouseoutText
},
style: this.style
});
create(model) {
this.control = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.position.x,
cy: model.position.y,
r: this.style.LimitControl.lamp.radiusR
},
subType: 'Control',
lineWidth: 0,
fill: this.style.LimitControl.lamp.controlColor,
mouseover: this.mouseoverArc,
mouseout: this.mouseoutArc
},
text: {
position: [0, 0],
x: model.position.x,
y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance,
fontWeight: this.style.LimitControl.text.fontWeight,
fontSize: this.style.LimitControl.text.fontSize,
fontFamily: this.style.fontFamily,
text: model.name,
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top',
mouseover: this.mouseoverText,
mouseout: this.mouseoutText
},
style: this.style
});
this.add(this.control);
}
this.add(this.control);
}
// 设置状态
setState(model) {
}
// 设置状态
setState(model) {
}
createMouseEvent() {
if (this.style.LimitControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
createMouseEvent() {
if (this.style.LimitControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
getShapeTipPoint() {
if (this.control) {
var distance = 2;
var rect = this.control.getBoundingRect();
return {
x: rect.x + rect.width / 2,
y: rect.y - distance
};
}
return null;
}
getShapeTipPoint() {
if (this.control) {
var distance = 2;
var rect = this.control.getBoundingRect();
return {
x: rect.x + rect.width / 2,
y: rect.y - distance
};
}
return null;
}
}

View File

@ -1,5 +1,6 @@
import Line from 'zrender/src/graphic/shape/Line';
import Group from 'zrender/src/container/Group';
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
export default class Line2 extends Group {
constructor(model, style) {
@ -10,8 +11,11 @@ export default class Line2 extends Group {
this.z = 0;
this.model = model;
this.style = style;
this.create();
this.setState(model);
this.prdType = getPrdType();
if (isShowThePrdType(this.prdType, model.showConditions)) {
this.create();
this.setState(model);
}
}
create() {

View File

@ -1,5 +1,6 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
export default class OutFrame extends Group {
constructor(model, style) {
@ -10,8 +11,11 @@ export default class OutFrame extends Group {
this.style = style;
this.zlevel = model.zlevel;
this.z = 0;
this.create();
this.setState(model);
this.prdType = getPrdType();
if (isShowThePrdType(this.prdType, model.showConditions)) {
this.create();
this.setState(model);
}
}
create() {

View File

@ -0,0 +1,46 @@
import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
/** 创建三角形*/
export default class ETriangle extends Group {
constructor(model) {
super();
this.model = model;
this.zlevel = model.zlevel;
this.z = model.z;
this.create(model);
}
create(model) {
if (model && model.point) {
const right = model.right == 1 ? 1 : -1;
this.angle = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points:[[model.point.x + 10 * right, model.point.y], [model.point.x + (1 - right) * 10 / 4, model.point.y - 6], [model.point.x + (1 - right) * 10 / 4, model.point.y + 6]]
},
style: {
stroke:'#FFFF00',
lineWidth: 0.5,
fill: '#FFFF00'
}
});
this.add(this.angle);
}
}
// 隐藏
hide() {
this.angle.hide();
}
// 显示
show() {
this.angle.show();
}
// setModel(model) {
// this.shape
// }
}

View File

@ -3,13 +3,14 @@ import ETextName from '../element/ETextName'; // 名称文字 (共有)
import ERelease from './ERelease'; // 线段 (共有)
import ELimitLines from './ELimitLines'; // 区段限速 (私有)
import ELines from './ELines'; // 创建多线条 曲线 (私有)
import EblockLines from './EblockLines'; // 区段封锁特有
import EblockLines from './EblockLines'; // 区段封锁特有
import ESeparator from './ESeparator'; // 分隔符 (私有)
import EMouse from './EMouse';
import { EAxle } from './EAxle'; // 创建计轴 (私有)
import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
import ELimitName from './ELimitName'; // 成都三号线 限速名称
import JTriangle from '../../utils/JTriangle';
import ETriangle from './ETriangle';
import router from '@/router';
import { drawSectionStyle } from '../../config/defaultStyle';
import store from '@/store';
@ -45,6 +46,9 @@ export default class Section extends Group {
this.creatRelease(); // 创建延时释放
this.createSeparator(); // 创建分隔符
this.createTurnBack(); // 创建成都三号线 折返箭头
if (this.style.Section.trainPosition.display) {
this.createTriangle(); // 创建成都一号线 列车精确位置
}
if (model.type === '01' && model.type === '03') {
this.createAxles(); // 创建计轴
}
@ -577,7 +581,7 @@ export default class Section extends Group {
recover() {
if (this.section) {
this.section.stopAnimation(true);
this.sectionBlock && this.sectionBlock.hide(); // 因此特殊区段
this.sectionBlock && this.sectionBlock.hide(); // 因此特殊区段
this.section.setStyle({
fill: this.style.backgroundColor,
stroke: this.style.Section.line.spareColor,
@ -591,6 +595,11 @@ export default class Section extends Group {
this.remove(this.speedLimitLeft);
this.remove(this.speedLimitRight);
}
if (this.style.Section.trainPosition.display) {
this.triangleL.hide();
this.triangleR.hide();
}
}
}
@ -644,6 +653,121 @@ export default class Section extends Group {
}
}
// updateTriangle(model) {
// if(model.offsetp)
// // if (model.right && model.points.length > 1) {
// // this.triangle.setModel([model.points[0].x + (model.points[1].x - model.points[0].x) * model.offsetp, model.points[0].y]);
// // }
// this.triangle.show();
// }
createTriangle() {
const model = this.model;
this.triangleL = new ETriangle({
style: this.style,
zlevel: this.zlevel,
z:10,
right: 0,
point:{x:model.points[model.points.length - 1].x, y:model.points[model.points.length - 1].y}
});
this.triangleR = new ETriangle({
style: this.style,
zlevel: this.zlevel,
z:10,
right: 1,
point:{x:model.points[0].x, y:model.points[0].y}
});
this.add(this.triangleL);
this.add(this.triangleR);
}
// 成都一号线列车的精确位置
updateTriangle() {
const model = this.model;
// debugger;
// if (model.hideOld) {
// // debugger;
// if (model.right == 1) {
// this.triangleR.hide();
// } else {
// this.triangleL.hide();
// }
// }
if (model.right != undefined && model.offsetp != undefined && model.points.length > 1) {
const newX = model.points[0].x + (model.points[1].x - model.points[0].x) * model.offsetp;
const newY = model.points[0].y + (model.points[1].y - model.points[0].y) * model.offsetp;
if (!model.oldX && !model.oldY) {
model.oldX = this.triangleL.model.point.x;
model.oldY = this.triangleL.model.point.y;
}
if (model.right == 1) {
if (model.hideOld) {
// debugger;
this.triangleR.hide();
}
this.triangleL.hide();
this.triangleR.show();
this.triangleR.position = [newX - model.oldX, newY - model.oldY];
// const runner = this.triangleR.animate('position', false).when(100, [newX - model.oldX, newY - model.oldY]);
// runner.done(function() {
// runner.stop();
// data.hide();
// model.oldX = newX;
// model.oldY = newY;
// }).start();
} else {
if (model.hideOld) {
this.triangleL.hide();
}
this.triangleR.hide();
this.triangleL.show();
this.triangleL.position = [newX - model.oldX, newY - model.oldY];
// const runner = this.triangleL.animate('position', false).when(100, [newX - model.oldX, newY - model.oldY]);
// runner.done(function() {
// // debugger;
// runner.stop();
// data.hide();
// model.oldX = newX;
// model.oldY = newY;
// }).start();
// stopAnimation(true)
}
// if (!model.hasTriangle) {
// this.triangle = new ETriangle({
// style: this.style,
// zlevel: this.zlevel,
// z:1000,
// right: model.right,
// point:{x:model.points[0].x + (model.points[1].x - model.points[0].x) * model.offsetp, y:model.points[0].y}
// });
// /** 添加视图*/
// this.add(this.triangle);
// model.hasTriangle = true;
// } else {
// // debugger;
// console.log(2222222);
// const newX = model.points[0].x + (model.points[1].x - model.points[0].x) * model.offsetp;
// const newY = model.points[0].y;
// // debugger;
// if (this.triangle) {
// if (model.offsetp >= 1) {
// this.remove(this.triangle);
// model.hasTriangle = false;
// } else {
// // this.remove(this.triangle);
// // model.hasTriangle = false;
// const runner = this.triangle.animate('position', true).when(100, [newX - this.triangle.model.point.x, newY - this.triangle.model.point.y]);
// runner.start();
// }
// // this.triangle.position = [newX - this.triangle.model.point.x, newY - this.triangle.model.point.y];
// // this.triangle.dirty();
// }
// }
}
}
/** 封锁 06*/
block() {
if (this.style.Section.block.special) {
@ -803,6 +927,8 @@ export default class Section extends Group {
}
/** 道岔保护区段锁闭 */
model.overlapLock && this.protectiveLock();
/** 成都一号线列车精确位置 */
model.offsetp && this.updateTriangle();
/** 空闲锁闭或者叫进路锁闭 */
model.routeLock && this.routeLock();
/** 轨道封锁 */

View File

@ -10,6 +10,7 @@ import EArrow from './EArrow';
import { arrow } from '../utils/ShapePoints';
import Rect from 'zrender/src/graphic/shape/Rect';
import BoundingRect from 'zrender/src/core/BoundingRect';
import {getPrdType} from '../utils/handlePath';
export default class Station extends Group {
constructor(model, style) {
@ -23,15 +24,7 @@ export default class Station extends Group {
this.create();
this.createTurnBack(); // 创建按图折返
const path = window.location.href;
if (path.includes('?')) {
const arr = window.location.href.split('?')[1].split('&');
arr.forEach(elem => {
if (elem.split('=')[0] === 'prdType') {
this.prdType = elem.split('=')[1];
}
});
}
this.prdType = getPrdType();
if ((!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1) && model.guideTotalLockPoint) {
this.createGuideTotalLock(); // 创建引导总锁
}
@ -123,15 +116,18 @@ export default class Station extends Group {
if (model.guideTotalLock) {
this.guideLamp = new EControl({
zlevel: this.zlevel,
z: this.z,
z: 1000,
arc: {
shape: {
cx: model.guideTotalLockPoint.x,
cy: model.guideTotalLockPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'GuideLamp',
lineWidth: 0,
fill: style.Station.lamp.guideColor
fill: style.Station.lamp.guideColor,
onmouseover: this.guideMouseOver,
onmouseout: this.guideMouseOut
},
text: {
position: [0, 0],

View File

@ -12,6 +12,7 @@ import EHighlight from '../element/EHighlight';
import ETrainStop from './ETrainStop';
import ETrainDepart from './ETrainDepart';
import EControl from '../element/EControl';
import {getPrdType} from '../utils/handlePath';
class StationStand extends Group {
constructor(model, style) {
@ -23,16 +24,7 @@ class StationStand extends Group {
this.zlevel = model.zlevel;
this.z = 1;
this.doors = new Group();
this.prdType = '';
const path = window.location.href;
if (path.includes('?')) {
const arr = window.location.href.split('?')[1].split('&');
arr.forEach(elem => {
if (elem.split('=')[0] === 'prdType') {
this.prdType = elem.split('=')[1];
}
});
}
this.prdType = getPrdType();
this.create();
this.createMouseEvent();
if (!this.prdType || this.style.StationStand.common.functionButtonShow.indexOf(this.prdType) !== -1) {
@ -239,6 +231,7 @@ class StationStand extends Group {
cy: model.stopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'StopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
@ -268,6 +261,7 @@ class StationStand extends Group {
cy: model.cancelStopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'CancelStopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
@ -297,6 +291,7 @@ class StationStand extends Group {
cy: model.upDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'UpDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
@ -326,6 +321,7 @@ class StationStand extends Group {
cy: model.downDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'DownDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
@ -336,7 +332,7 @@ class StationStand extends Group {
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '行扣车',
text: '行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'

View File

@ -1,5 +1,6 @@
import Text from 'zrender/src/graphic/Text';
import Group from 'zrender/src/container/Group';
import {getPrdType, isShowThePrdType} from '../utils/handlePath';
export default class Text2 extends Group {
constructor(model, style) {
@ -11,15 +12,11 @@ export default class Text2 extends Group {
this.model = model;
this.style = style;
this.z = 6;
const arr = window.location.href.split('?')[1].split('&');
this.prdType = '';
arr.forEach(elem => {
if (elem.split('=')[0] === 'prdType') {
this.prdType = elem.split('=')[1];
}
});
this.create();
this.setState(model);
this.prdType = getPrdType();
if (isShowThePrdType(this.prdType, model.showConditions)) {
this.create();
this.setState(model);
}
}
create() {

View File

@ -128,7 +128,17 @@ export default class Train extends Group {
let models = [];
const model = deepAssign(oldmodel, {_type: 'Section'}); // 修改元素model
models = [model];
store.dispatch('map/updateMapDevices', models);
store.dispatch('map/updateMapDevices', models).then(()=>{
if (train.oldsection && train.oldsection != train.physicalCode) {
const oldmodels = store.getters['map/getDeviceByCode'](train.oldsection);
const models = deepAssign(oldmodels, {_type: 'Section'}); // 修改元素model
models.hideOld = true;
models.offsetp = undefined;
const trainOldSection = [models];
store.dispatch('map/updateMapDevices', trainOldSection);
}
train.oldsection = train.physicalCode;
});
}
}

View File

@ -31,6 +31,7 @@ export default class ZcControl extends Group {
cy: model.position.y,
r: this.style.ZcControl.lamp.radiusR
},
subType: 'Control',
lineWidth: 0,
fill: this.style.ZcControl.lamp.controlColor,
mouseover: this.mouseoverArc,

View File

@ -19,7 +19,7 @@ export default class EControl extends Group {
create() {
this.control = new Arc({
_subType: 'Control',
_subType: this.arcStyle.subType,
zlevel: this.zlevel,
z: this.z,
shape: this.arcStyle.shape,
@ -30,7 +30,6 @@ export default class EControl extends Group {
onmouseover: this.arcStyle.mouseover,
onmouseout: this.arcStyle.mouseout
});
this.text = new Text({
_subType: 'Text',
zlevel: this.zlevel,

View File

@ -0,0 +1,25 @@
export function getPrdType() {
let prdType = '';
const path = window.location.href;
if (path.includes('?')) {
const arr = window.location.href.split('?')[1].split('&');
arr.forEach(elem => {
if (elem.split('=')[0] === 'prdType') {
prdType = elem.split('=')[1];
}
});
}
return prdType;
}
export function isShowThePrdType (prdType, showConditions) {
const path = window.location.href;
if (path.indexOf('map/draw') !== -1 ) {
return true;
} else {
if (showConditions === '01' || (showConditions === '02' && prdType === '02') || (showConditions === '03' && prdType === '01')) {
return true;
} else if (!showConditions) {
return true; // 兼容老数据没有showConditions
}
}
}

View File

@ -149,7 +149,7 @@ export default {
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
@ -169,7 +169,7 @@ export default {
}
}).catch((error) => {
this.loading = false;
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
@ -189,7 +189,7 @@ export default {
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//

View File

@ -137,7 +137,7 @@ export default {
} else {
return '';
}
},
}
},
watch: {
},
@ -306,7 +306,7 @@ export default {
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
@ -329,7 +329,7 @@ export default {
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
cancel() {

View File

@ -1,157 +0,0 @@
<template>
<div>
<el-dialog class="beijing-01__systerm route-lock" :title="title" :visible.sync="show" width="340px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row class="header">
<el-col :span="10"><span>车站名称</span></el-col>
<el-col :span="10" :offset="2"><span>信号机名称</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled></el-input>
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="signalName" size="small" disabled></el-input>
</el-col>
</el-row>
<div class="table">
<span>信号按钮列表</span>
<el-table ref="table" :data="tempData" border style="width: 100%" size="mini" highlight-current-row
:height="140">
<el-table-column prop="name" label="按钮名称">
</el-table-column>
<el-table-column prop="status" label="按钮状态">
</el-table-column>
</el-table>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
export default {
name: 'RouteLock',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
operate: null,
stationName: '',
signalName: ''
}
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.lock.menu.domId : '';
},
title() {
return '封锁信号按钮'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
/** status 04:封锁*/
let signal = (selected || {}).state;
this.tempData = [{ code: selected.code, name: selected.name, status: signal.status != '04' ? '未封锁' : '封锁' }]
let timer = setInterval(() => {
if (this.$refs.table) {
this.$refs.table.setCurrentRow(this.tempData[0]);
clearInterval(timer);
}
}, 300);
}
this.dialogShow = true;
this.$nextTick(() => {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
// mouseCancelState(this.selected);
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.lock.menu.operation
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>

View File

@ -195,7 +195,7 @@ export default {
//
row.routeSectionList.forEach(elem => {
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem));
if (section.logicSectionCodeList && section.logicSectionCodeList.length){
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(item => {
const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item));
sec.cutOff = true;
@ -246,7 +246,7 @@ export default {
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, [error.message]);
this.$refs.noticeInfo.doShow(operate, error.message);
});
}
},

View File

@ -22,10 +22,9 @@ import AlxeEffective from './dialog/alxeEffective';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mouseCancelState } from './utils/menuItemStatus';
export default {
name: 'SectionMenu',
@ -137,6 +136,11 @@ export default {
} else {
this.doClose();
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
}
}
},
computed: {
@ -176,6 +180,18 @@ export default {
this.$refs.popMenu.close();
}
},
operationHandler(buttonOperation, selectType) {
switch (buttonOperation) {
case OperationEvent.Signal.guide.button.operation: {
//
break;
}
case OperationEvent.Signal.guide.button.operation: {
//
break;
}
}
},
// //
// alxeFailure() {
// const operate = {

View File

@ -2,7 +2,6 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<route-selection ref="routeSelection" />
<route-lock ref="routeLock" />
<route-control ref="routeControl" />
<route-cmd-control ref="routeCmdControl" />
<route-hand-control ref="routeHandControl" />
@ -15,7 +14,6 @@
import PopMenu from '@/components/PopMenu';
import RouteControl from './dialog/routeControl';
import RouteSelection from './dialog/routeSelection';
import RouteLock from './dialog/routeLock';
import RouteCmdControl from './dialog/routeCmdControl';
import RouteHandControl from './dialog/routeHandControl';
import RouteDetail from './dialog/routeDetail';
@ -24,7 +22,7 @@ import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import {OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { mouseCancelState } from './utils/menuItemStatus';
export default {
@ -33,7 +31,6 @@ export default {
PopMenu,
RouteControl,
RouteSelection,
RouteLock,
RouteCmdControl,
RouteHandControl,
RouteDetail,
@ -160,9 +157,9 @@ export default {
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation) {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected._type);
}
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Signal') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
}
}
},
computed: {
@ -175,7 +172,7 @@ export default {
]),
...mapGetters('map', [
'routeList'
]),
])
},
methods: {
clickEvent() {
@ -235,16 +232,18 @@ export default {
//
break;
}
case OperationEvent.Signal.guide.button.operation: {
case OperationEvent.Signal.setAutoInterlock.button.operation: {
//
break;
}
case OperationEvent.Signal.guide.button.operation: {
//
break;
}
case OperationEvent.Signal.guide.button.operation: {
//
if (selectType.fleetMode != undefined) {
if (selectType.fleetMode) {
this.singalCancelPassModel(selectType);
} else {
this.singalPassModel(selectType);
}
} else {
this.$refs.noticeInfo.doShow({}, `信号机[${selectType.name}(${selectType.code})]没有已锁闭进路,不能设置联锁自动进路`);
}
break;
}
}
@ -340,42 +339,6 @@ export default {
}
});
},
// //
// lock() {
// const operate = {
// start: true,
// send: true,
// code: this.selected.code,
// type: MapDeviceType.Signal.type,
// label: MapDeviceType.Signal.label,
// operation: OperationEvent.Signal.lock.menu.operation
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.routeLock.doShow(operate.operation, this.selected);
// }
// }).catch(() => {
// this.$refs.noticeInfo.doShow(operate);
// });
// },
// //
// unlock() {
// const operate = {
// start: true,
// code: this.selected.code,
// type: MapDeviceType.Signal.type,
// label: MapDeviceType.Signal.label,
// operation: OperationEvent.Signal.unlock.menu.operation
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.routeCmdControl.doShow(operate, this.selected);
// }
// });
// },
//
reopenSignal() {
const operate = {
@ -456,6 +419,44 @@ export default {
}
});
},
//
singalPassModel(selectType) {
const operate = {
start: true,
over: true,
operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
param: {
signalCode:selectType.code
},
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
singalCancelPassModel(selectType) {
const operate = {
start: true,
over: true,
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
param: {
signalCode:selectType.code
},
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(error => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
detail() {
const step = {

View File

@ -52,16 +52,16 @@ export default {
menu: [],
menuNormal: {
Local: [
{
label: '轨道切除',
handler: this.split,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
},
{
label: '轨道激活',
handler: this.active,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
}
// {
// label: '',
// handler: this.split,
// cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
// },
// {
// label: '',
// handler: this.active,
// cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
// }
// {
// label: '',
// handler: this.undeveloped

View File

@ -19,20 +19,20 @@
</span>
</button>
<!-- 流程未做暂不显示 -->
<!-- <button :id="Switch.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.guideLock.button.operation)">
<span style="color: red">
<button :id="Switch.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.guideLock.button.operation)">
<span style="color: #800000">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button> -->
</button>
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, 'Signal')">
<span style="color: red">
<span style="color: #800000">
<center><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Section.fault.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Section.fault.button.operation, 'Section')">
<span style="color: black">
<span style="color: #800000">
<center><b></b></center>
<center><b></b><b></b></center>
</span>
@ -56,7 +56,7 @@
</span>
</button>
<button :id="Switch.unlock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.unlock.button.operation, 'Switch')">
<span style="color: red">
<span style="color: #800000">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
@ -331,10 +331,10 @@ export default {
}
} else if (deviceList.length === 2) {
this.routeList.forEach(item => {
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code){
item.type
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
item.type;
const operate = this.handelOperate(item);
console.log(operate,item);
console.log(operate, item);
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
}
});

View File

@ -207,27 +207,27 @@ export default {
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
};
this.sendCommand(operate)
this.sendCommand(operate);
},
//
locate() {
const operate = {
over: true,
operation: OperationEvent.Switch.locate.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
};
this.sendCommand(operate)
this.sendCommand(operate);
},
//
reverse() {
const operate = {
over: true,
operation: OperationEvent.Switch.reverse.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
};
this.sendCommand(operate)
this.sendCommand(operate);
},
//
split() {
@ -236,7 +236,7 @@ export default {
operation: OperationEvent.Switch.split.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
};
this.sendCommand(operate)
this.sendCommand(operate);
},
//
active() {
@ -245,7 +245,7 @@ export default {
operation: OperationEvent.Switch.active.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
};
this.sendCommand(operate)
this.sendCommand(operate);
},
cancel() {
const operate = {

View File

@ -49,12 +49,12 @@ export default {
{
label: '定操',
handler: this.locate,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
},
{
label: '反操',
handler: this.reverse,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
},
{
label: '道岔单锁',
@ -81,12 +81,12 @@ export default {
{
label: '定操',
handler: this.locate,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
},
{
label: '反操',
handler: this.reverse,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
},
{
type: 'separator'

View File

@ -33,7 +33,11 @@ export default {
/** 定位(定操) */
CMD_SWITCH_NORMAL_POSITION:{value:'Switch_Normal_Position', label:'单操到定位'},
/** 反位(反操) */
CMD_SWITCH_REVERSE_POSITION:{value:'Switch_Reverse_Position', label:'单操到反位'}
CMD_SWITCH_REVERSE_POSITION:{value:'Switch_Reverse_Position', label:'单操到反位'},
/** 道岔定操(联动) */
CMD_SWITCH_TURN_NP_CHAIN: {value: 'Switch_Turn_NP_Chain', label: '道岔定操(联动)'},
/** 道岔反操(联动)*/
CMD_SWITCH_TURN_RP_CHAIN: {value: 'Switch_Turn_RP_Chain', label: '道岔反操(联动)'}
},
// 控制模式操作

View File

@ -11,6 +11,7 @@ const menuOperation = {
mbmpCount: 0, // 地图按钮菜单位置变更标识
buttonOperation: null, // 按钮菜单是否被按下
selected: {}, // 选中的地图对象
subType: '', // 选中的设备子元素类型
selectedCount: 0, // 选中对象变更标识
menu: null, // 弹出菜单设备
menuPosition: {}, // 弹出菜单位置
@ -26,6 +27,9 @@ const menuOperation = {
selected: (state) => {
return state.selected;
},
subType: (state) => {
return state.subType;
},
mbmpCount: (state) => {
return state.mbmpCount;
},
@ -71,7 +75,8 @@ const menuOperation = {
state.buttonOperation = operation;
},
setSelected: (state, selected) => {
state.selected = selected;
state.selected = selected.device;
state.subType = selected.subType;
state.selectedCount += 1;
},
mbmpCountIncrement: (state) => {

View File

@ -99,7 +99,7 @@ export default {
}
this.selected = device;
this.$store.dispatch('menuOperation/setSelected', device);
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
this.$store.dispatch('training/emitTipFresh');
},
@ -119,7 +119,7 @@ export default {
if (device) {
this.selected = device = this.getSelectedByLineCode(device);
if (!this.buttonOperation) {
this.$store.dispatch('menuOperation/setSelected', device);
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
if (!this.checkShouldPop(device)) {
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null });
} else {

View File

@ -103,9 +103,8 @@ export default {
}
}
}
this.selected = device;
this.$store.dispatch('menuOperation/setSelected', device);
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
this.$store.dispatch('training/emitTipFresh');
},
@ -120,7 +119,7 @@ export default {
this.$store.dispatch('map/setTrainWindowShow', true);
} else if (em.subType == 'button' && em.deviceType == 'Station') { // 线
const equipment = this.getDeviceByEm(em);
this.$store.dispatch('menuOperation/setSelected', equipment);
this.$store.dispatch('menuOperation/setSelected', {device:equipment, subType: em.subType});
menu = getDeviceMenuByDeviceType('StationControl');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
this.$store.dispatch('training/emitTipFresh');
@ -133,7 +132,7 @@ export default {
if (device) {
this.selected = device = this.getSelectedByLineCode(device);
if (!this.buttonOperation) {
this.$store.dispatch('menuOperation/setSelected', device);
this.$store.dispatch('menuOperation/setSelected', {device: device, subType: em.subType});
if (!this.checkShouldPop(device)) {
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null });
} else {

View File

@ -97,7 +97,7 @@ export default {
content: '',
font: '',
fontColor: '',
showConditions: '',
showConditions: '01',
position: {
x: 0,
y: 0
@ -106,7 +106,7 @@ export default {
addModel: {
prepend: 'H',
content: '',
showConditions: '',
showConditions: '01',
position: {
x: 0,
y: 0