This commit is contained in:
zyy 2020-11-03 10:30:43 +08:00
commit 6eefe21444
46 changed files with 487 additions and 233 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -17,10 +17,10 @@ export default {
/** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/ /** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/
if (sty.left.includes('%')) { if (sty.left.includes('%')) {
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100); styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100); styT = +document.body.clientHeight * (+sty.bottom.replace(/\%/g, '') / 100);
} else { } else {
styL = +sty.left.replace(/\px/g, ''); styL = +sty.left.replace(/\px/g, '');
styT = +sty.top.replace(/\px/g, ''); styT = +sty.bottom.replace(/\px/g, '');
} }
document.onmousemove = function (e) { document.onmousemove = function (e) {
@ -28,20 +28,23 @@ export default {
const l = e.clientX - disX; const l = e.clientX - disX;
const t = e.clientY - disY; const t = e.clientY - disY;
console.log(l, l + styL, dragDom.style.left);
/** 移动当前元素*/ /** 移动当前元素*/
if (l + styL < 0) { if (l + styL < 0) {
dragDom.style.left = `0px`; dragDom.style.left = `0px`;
} else if (l + styL > document.body.clientWidth - dragDom.clientWidth - 30) { } else if (l + styL > document.body.clientWidth - dragDom.clientWidth - 100) {
dragDom.style.left = `${document.body.clientWidth - dragDom.clientWidth - 30}px`; dragDom.style.left = `${document.body.clientWidth - dragDom.clientWidth - 100}px`;
} else { } else {
dragDom.style.left = `${l + styL}px`; dragDom.style.left = `${l + styL}px`;
} }
if (t + styT < 0) {
dragDom.style.top = `0px`; if (document.body.clientHeight - (styT - t) - dragDom.clientHeight < 0) {
} else if (t + styT > document.body.clientHeight - dragDom.clientHeight - 10) { dragDom.style.bottom = `${document.body.clientHeight - dragDom.clientHeight}px`;
dragDom.style.top = `${document.body.clientHeight - dragDom.clientHeight - 10}px`; } else if (document.body.clientHeight - (styT - t) - dragDom.clientHeight > document.body.clientHeight - dragDom.clientHeight) {
dragDom.style.bottom = `0px`;
} else { } else {
dragDom.style.top = `${t + styT}px`; dragDom.style.bottom = `${styT - t}px`;
} }
/** 将此时的位置传出去*/ /** 将此时的位置传出去*/

View File

@ -3,6 +3,7 @@ const mapDeviceStyle = {
'02': 'fuzhou_01', '02': 'fuzhou_01',
'03': 'bejing_01', '03': 'bejing_01',
'04': 'chengdu_03', '04': 'chengdu_03',
'05': 'fuzhou_01',
'06': 'ningbo_01', '06': 'ningbo_01',
'07': 'haerbin_01', '07': 'haerbin_01',
'08': 'foshan_01', '08': 'foshan_01',

View File

@ -270,8 +270,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080',
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -407,8 +407,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -208,8 +208,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -424,8 +424,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -464,8 +464,9 @@ class SkinCode extends defaultStyle {
}; };
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
strokeColor: 'red', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
extendLength: 8 // 延伸长度 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度
}; };
// 延续保护计时 // 延续保护计时

View File

@ -266,7 +266,7 @@ class SkinCode extends defaultStyle {
z:1, z:1,
position: 1, // 停跳方向 position: 1, // 停跳方向
text: 'S', // 停跳显示内容 text: 'S', // 停跳显示内容
offset: { x: 10, y: 20 }, offset: { x: 20, y: 21 },
textColor: '#00FF00', // 停跳文字颜色 textColor: '#00FF00', // 停跳文字颜色
fontWeight: 'bold', // 文字居中 fontWeight: 'bold', // 文字居中
fontSize: 18 // 文字大小 fontSize: 18 // 文字大小
@ -448,8 +448,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };
// 延续保护计时 // 延续保护计时

View File

@ -472,8 +472,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -527,8 +527,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -282,8 +282,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -440,8 +440,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -564,8 +564,8 @@ class SkinCode extends defaultStyle {
// 供电线路 // 供电线路
this[deviceType.Power] = { this[deviceType.Power] = {
lineColor: '#FFFFFF', // 线条颜色 noElectricStrokeColor:'#808080', // 无电颜色
strokeColor: 'red', // 线条颜色 defaultStrokeColor: '#F00', // 线条颜色
extendLength: 10 // 延伸长度 extendLength: 10 // 延伸长度
}; };

View File

@ -18,7 +18,7 @@ export default class AutomacticRoute extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.isShowShape = true; this.isShowShape = true;
if (isShowThePrdType(model.prdType, style.AutomaticRoute.displayCondition) || model.previewOrMapDraw) { if (isShowThePrdType(model.prdType, (style.AutomaticRoute || {}).displayCondition) || model.previewOrMapDraw) {
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
@ -134,7 +134,7 @@ export default class AutomacticRoute extends Group {
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = this.style.AutomaticRoute.displayCondition; const showConditions = (this.style.AutomaticRoute || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) { if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode(); this.showMode();
} else { } else {

View File

@ -18,7 +18,7 @@ export default class AxleReset extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.isShowShape = true; this.isShowShape = true;
if (isShowThePrdType(model.prdType, style.AxleReset.displayCondition) || model.previewOrMapDraw) { if (isShowThePrdType(model.prdType, (style.AxleReset || {}).displayCondition) || model.previewOrMapDraw) {
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
@ -129,7 +129,7 @@ export default class AxleReset extends Group {
} }
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = this.style.AxleReset.displayCondition; const showConditions = (this.style.AxleReset || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) { if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode(); this.showMode();
} else { } else {

View File

@ -13,7 +13,7 @@ export default class DirectionRod extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.isShowShape = true; this.isShowShape = true;
if (isShowThePrdType(model.prdType, style.DirectionRod.displayCondition) || model.previewOrMapDraw) { if (isShowThePrdType(model.prdType, (style.DirectionRod || {}).displayCondition) || model.previewOrMapDraw) {
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
@ -91,7 +91,7 @@ export default class DirectionRod extends Group {
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = this.style.DirectionRod.displayCondition; const showConditions = (this.style.DirectionRod || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) { if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode(); this.showMode();
} else { } else {

View File

@ -16,7 +16,7 @@ export default class FloodGate extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.isShowShape = true; this.isShowShape = true;
if (isShowThePrdType(model.prdType, style.FloodGate.displayCondition) || model.previewOrMapDraw) { if (isShowThePrdType(model.prdType, (style.FloodGate || {}).displayCondition) || model.previewOrMapDraw) {
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
@ -58,7 +58,7 @@ export default class FloodGate extends Group {
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = this.style.FloodGate.displayCondition; const showConditions = (this.style.FloodGate || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) { if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode(); this.showMode();
} else { } else {

View File

@ -18,7 +18,7 @@ export default class GuideLock extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.isShowShape = true; this.isShowShape = true;
if (isShowThePrdType(model.prdType, style.GuideLock.displayCondition) || model.previewOrMapDraw) { if (isShowThePrdType(model.prdType, (style.GuideLock || {}).displayCondition) || model.previewOrMapDraw) {
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
@ -134,7 +134,7 @@ export default class GuideLock extends Group {
} }
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = this.style.GuideLock.displayCondition; const showConditions = (this.style.GuideLock || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) { if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode(); this.showMode();
} else { } else {

View File

@ -41,7 +41,7 @@ export default class Line2 extends Group {
}, },
style: { style: {
lineWidth: model.width, lineWidth: model.width,
stroke: style.Power.strokeColor stroke: style.Power.defaultStrokeColor
} }
}); });
this.add(this.line); this.add(this.line);
@ -59,7 +59,7 @@ export default class Line2 extends Group {
z: this.z + 3, z: this.z + 3,
traingle: traingle, traingle: traingle,
width: model.width, width: model.width,
stroke: style.Power.strokeColor, stroke: style.Power.noElectricStrokeColor,
point: { point: {
x: model.points[0].x, x: model.points[0].x,
y: model.points[0].y y: model.points[0].y
@ -75,7 +75,7 @@ export default class Line2 extends Group {
z: this.z + 3, z: this.z + 3,
traingle: traingle, traingle: traingle,
width: model.width, width: model.width,
stroke: style.Power.strokeColor, stroke: style.Power.noElectricStrokeColor,
point: { point: {
x: model.points[model.points.length - 1].x, x: model.points[model.points.length - 1].x,
y: model.points[model.points.length - 1].y y: model.points[model.points.length - 1].y
@ -85,6 +85,20 @@ export default class Line2 extends Group {
} }
} }
getBoundingRect() {
const rect = this.line.getBoundingRect().clone();
if (this.model.leftTerminal) {
const subheadText = this.leftTerminal.getBoundingRect().clone();
rect.union(subheadText);
return rect;
}
if (this.model.rightTerminal) {
const subheadText = this.rightTerminal.getBoundingRect().clone();
rect.union(subheadText);
}
return rect;
}
setLineType(type) { setLineType(type) {
switch (type) { switch (type) {
case '01': break; case '01': break;
@ -95,11 +109,22 @@ export default class Line2 extends Group {
break; break;
} }
} }
setCharged() {
// noElectricStrokeColor
this.line.setStyle('stroke', this.style.Power.defaultStrokeColor);
}
setState(model) { setState(model) {
if (!this.isShowShape) return; if (!this.isShowShape) return;
this.recover();
this.setLineType(model.type); this.setLineType(model.type);
model.on && this.setCharged();
} }
recover() {
this.line.setStyle('stroke', this.style.Power.noElectricStrokeColor);
}
// 设置显示模式 // 设置显示模式
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;

View File

@ -23,7 +23,7 @@ export default class SaidLamp extends Group {
this.deviceStyle = style[model._type]; this.deviceStyle = style[model._type];
if (this.deviceStyle) { if (this.deviceStyle) {
this.isShowShape = true; this.isShowShape = true;
if (isShowThePrdType(model.prdType, this.deviceStyle.displayCondition) || model.previewOrMapDraw) { if (isShowThePrdType(model.prdType, (this.deviceStyle || {}).displayCondition) || model.previewOrMapDraw) {
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
@ -206,7 +206,7 @@ export default class SaidLamp extends Group {
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
if (this.deviceStyle) { if (this.deviceStyle) {
const showConditions = this.deviceStyle.displayCondition; const showConditions = (this.deviceStyle || {}).displayCondition;
if (showConditions === '01' || showMode === showConditions) { if (showConditions === '01' || showMode === showConditions) {
this.control && this.control.show(); this.control && this.control.show();
} else { } else {

View File

@ -89,7 +89,7 @@ export default class ELimitLines extends Group {
const beg = Object.assign({}, model.points[0]); const beg = Object.assign({}, model.points[0]);
const end = Object.assign({}, model.points[model.points.length - 1]); const end = Object.assign({}, model.points[model.points.length - 1]);
if (model.isSwitchSection && beg.y !== end.y) { if (model.isSwitchSection && beg.y !== end.y) {
const swch = Vue.prototype.$jlmap.mapDevice[model.switch.code]; // 获取道岔model 及状态数据 const swch = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode]; // 获取道岔model 及状态数据
if (swch && swch.instance) { if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew); const traingle = new JTriangle(swch.intersection, swch.skew);

View File

@ -290,7 +290,7 @@ export default class Section extends Group {
getShapeTipPoint() { getShapeTipPoint() {
let rect = this.getBoundingRect(); let rect = this.getBoundingRect();
const distance = this.style.Section.line.width / 2; const distance = this.style.Section.line.width / 2;
if (this.line) { if (this.line && this.line.getBoundingRect()) {
rect = this.line.getBoundingRect(); rect = this.line.getBoundingRect();
} }
return { return {

View File

@ -160,7 +160,7 @@ export default class StationTurnBack extends Group {
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = this.style.StationTurnBack.displayCondition; const showConditions = (this.style.StationTurnBack || {}).displayCondition;
if (!showConditions || showConditions == '01' || showMode === showConditions) { if (!showConditions || showConditions == '01' || showMode === showConditions) {
this.eachChild(item => item.show() ); this.eachChild(item => item.show() );
} else { } else {

View File

@ -126,7 +126,8 @@ export default {
Local: [ Local: [
{ {
title: '系统', title: '系统',
operate: OperationEvent.Command.mBar.system, // operate: OperationEvent.Command.mBar.system,
operate: '',
children: [ children: [
{ {
title: '登录', title: '登录',
@ -174,7 +175,8 @@ export default {
}, },
{ {
title: '查看', title: '查看',
operate: OperationEvent.Command.mBar.check, // operate: OperationEvent.Command.mBar.check,
operate: '',
children: [ children: [
{ {
title: '运行图', title: '运行图',
@ -287,7 +289,8 @@ export default {
}, },
{ {
title: '显示', title: '显示',
operate: OperationEvent.Command.mBar.view, // operate: OperationEvent.Command.mBar.view,
operate: '',
hide: true, hide: true,
children: [ children: [
{ {

View File

@ -119,7 +119,11 @@ export default {
if (selected._type == 'Train') { if (selected._type == 'Train') {
name = selected.serviceNumber; name = selected.serviceNumber;
} }
if (name) {
this.deviceName = deviceType[selected._type] + '-' + name; this.deviceName = deviceType[selected._type] + '-' + name;
} else {
this.deviceName = deviceType[selected._type];
}
this.faultList = deviceFaultType[selected._type]; this.faultList = deviceFaultType[selected._type];
if (this.faultList && this.faultList.length) { if (this.faultList && this.faultList.length) {
this.form.faultType = this.faultList[0].value; this.form.faultType = this.faultList[0].value;

View File

@ -302,6 +302,11 @@ export const menuOperate = {
// 批量取消扣车 // 批量取消扣车
operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation, operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation,
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL
},
openPsdByHand:{
// 手动开启屏蔽门
operation: OperationEvent.StationStand.openPsdByHand.menu.operation,
cmdType:CMD.Stand.CMD_STAND_OPEN_PSD
} }
}, },
StationControl:{ StationControl:{

View File

@ -13,6 +13,7 @@
<menu-train ref="menuTrain" :selected="selected" /> <menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" /> <menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" /> <menu-limit ref="menuLimit" :selected="selected" />
<menu-power ref="menuPower" :selected="selected" />
<!--<passive-alarm ref="passiveAlarm" />--> <!--<passive-alarm ref="passiveAlarm" />-->
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" /> <passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" />
<!--<passive-Timeout ref="passiveTimeout" />--> <!--<passive-Timeout ref="passiveTimeout" />-->
@ -34,6 +35,7 @@ import MenuStation from './menuStation';
import MenuBar from './menuBar'; import MenuBar from './menuBar';
import MenuLimit from './menuLimit'; import MenuLimit from './menuLimit';
import MenuStationTurnBack from './menuStationTurnBack'; import MenuStationTurnBack from './menuStationTurnBack';
import MenuPower from './menuPower';
// import PassiveAlarm from './passiveDialog/alarm'; // import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control'; import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
// import PassiveTimeout from './passiveDialog/timeout'; // import PassiveTimeout from './passiveDialog/timeout';
@ -54,6 +56,7 @@ export default {
MenuTrain, MenuTrain,
MenuStationTurnBack, MenuStationTurnBack,
MenuLimit, MenuLimit,
MenuPower,
// PassiveAlarm, // PassiveAlarm,
PassiveContorl PassiveContorl
// PassiveTimeout // PassiveTimeout

View File

@ -0,0 +1,117 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SectionMenu',
components: {
PopMenu,
SetFault
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data( ) {
return {
menu: [],
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
cmdType:CMD.Fault.CMD_SET_FAULT
},
{
label: '取消故障',
handler: this.cancelStoppage,
cmdType:CMD.Fault.CMD_CANCEL_FAULT
},
{
label: '触发故障管理',
handler: this.triggerFaultManagement,
cmdType: CMD.Fault.CMD_TRIGGER_FAULT
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Power) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
// this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
}
}
};
</script>

View File

@ -142,12 +142,17 @@ export default {
{ {
label: '设置故障', label: '设置故障',
handler: this.setStoppage, handler: this.setStoppage,
cmdType:CMD.Stand.CMD_STAND_ADD_FAULT cmdType:CMD.Fault.CMD_SET_FAULT
}, },
{ {
label: '取消故障', label: '取消故障',
handler: this.cancelStoppage, handler: this.cancelStoppage,
cmdType:CMD.Stand.CMD_STAND_REMOVE_FAULT cmdType:CMD.Fault.CMD_CANCEL_FAULT
},
{
label: '手动开启屏蔽门',
handler: this.openPsdByHand,
cmdType: CMD.Stand.CMD_STAND_OPEN_PSD
}, },
{ {
label: '触发故障管理', label: '触发故障管理',
@ -317,6 +322,13 @@ export default {
}, },
triggerFaultManagement() { triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected); this.$store.dispatch('training/setTriggerFaultCount', this.selected);
},
//
openPsdByHand() {
commitOperate(menuOperate.StationStand.openPsdByHand, {standCode:this.selected.code}, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
} }
} }
}; };

View File

@ -118,6 +118,7 @@ export const DeviceMenu = {
AxleReset: '12', AxleReset: '12',
Enabled: '13', Enabled: '13',
StationTurnBack: '14', StationTurnBack: '14',
Power:'15',
Map: '100', Map: '100',
PrdCategory: '101', PrdCategory: '101',

View File

@ -12,6 +12,7 @@ import FaviconTky from '@/assets/icon/favicon_tky.png';
import FaviconBxkc from '@/assets/icon/favicon_bxkc.png'; import FaviconBxkc from '@/assets/icon/favicon_bxkc.png';
import FaviconCrsc from '@/assets/icon/favicon_crsc.png'; import FaviconCrsc from '@/assets/icon/favicon_crsc.png';
import FaviconNty from '@/assets/icon/favicon_nty.png'; import FaviconNty from '@/assets/icon/favicon_nty.png';
import FaviconBjd from '@/assets/icon/favicon_bjd.png';
import Link_Bxkc from '@/assets/icon/link_bxkc.png'; import Link_Bxkc from '@/assets/icon/link_bxkc.png';
import Link_Crsc from '@/assets/icon/link_crsc.png'; import Link_Crsc from '@/assets/icon/link_crsc.png';
import Link_Hls from '@/assets/icon/link_hls.png'; import Link_Hls from '@/assets/icon/link_hls.png';
@ -29,6 +30,19 @@ export const loginInfo = {
navigationMarginLeft: '60px', navigationMarginLeft: '60px',
systemType: '013' systemType: '013'
}, },
bjd: {
title: '城市轨道交通列车运行智慧辅助系统',
loginPath: '/login?project=bjd',
logoWidth: '400px',
bottomIcon: FaviconBjd,
bottomColumn: '',
loginTitle: '空串',
linkIcon: FaviconBjd,
loginParam: 'BJD',
navigationLogoWidth: '160px',
navigationMarginLeft: '175px',
systemType: '011'
},
nty: { nty: {
title: '南京铁道职业技术学院城市轨道交通实训平台', title: '南京铁道职业技术学院城市轨道交通实训平台',
loginPath:'/login?project=nty', loginPath:'/login?project=nty',
@ -72,6 +86,18 @@ export const loginInfo = {
navigationMarginLeft: '60px', navigationMarginLeft: '60px',
systemType: '020' systemType: '020'
}, },
designbjd: {
title: '城市轨道交通列车运行智慧辅助系统',
loginPath: '/design/login?project=bjd',
logoWidth: '400px',
bottomIcon: FaviconBjd,
bottomColumn: '',
linkIcon: '',
loginParam: 'BJD',
navigationLogoWidth: '160px',
navigationMarginLeft: '175px',
systemType: '011'
},
designxty: { designxty: {
title: '西安铁路职业技术学院城市轨道交通设计平台', title: '西安铁路职业技术学院城市轨道交通设计平台',
loginPath:'/design/login?project=xty', loginPath:'/design/login?project=xty',
@ -352,7 +378,9 @@ export const ProjectIcon = {
drts: Favicon, drts: Favicon,
designdrts: Favicon, designdrts: Favicon,
nty: FaviconNty, nty: FaviconNty,
designnty: FaviconNty designnty: FaviconNty,
bjd: FaviconBjd,
designbjd: FaviconBjd
}; };
export const ProjectCode = { export const ProjectCode = {
@ -375,7 +403,7 @@ export const CaseHideProjectList = ['heb', 'designheb']; // 案例展示隐藏
export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'hyd', 'designhyd']; // 登录页右下角版本开发基于不展示 export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'hyd', 'designhyd']; // 登录页右下角版本开发基于不展示
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd']; // 登录页右下角主体不展示 export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd']; // 登录页右下角主体不展示
export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目 export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目
export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty']; // 登录页样式 export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd']; // 登录页样式
export const NoQrcodeList = ['heb', 'designheb']; export const NoQrcodeList = ['heb', 'designheb'];
export const goOtherPlatformMenu = { // 导航栏快速切换平台 export const goOtherPlatformMenu = { // 导航栏快速切换平台
login: '/design/login', login: '/design/login',

View File

@ -183,7 +183,9 @@ export default {
/** 查看站台状态 */ /** 查看站台状态 */
CMD_STAND_VIEW_STATUS:{value:'Stand_View_Status', label: '查看站台状态'}, CMD_STAND_VIEW_STATUS:{value:'Stand_View_Status', label: '查看站台状态'},
/** 站台总取消 */ /** 站台总取消 */
CMD_STAND_TOTAL_CANCLE:{value:'Stand_Total_Cancle', label: '站台总取消'} CMD_STAND_TOTAL_CANCLE:{value:'Stand_Total_Cancle', label: '站台总取消'},
/** 手动开启屏蔽门 */
CMD_STAND_OPEN_PSD:{value:'Stand_Open_Psd', label: '手动开启屏蔽门'}
}, },
Station: { Station: {

View File

@ -41,13 +41,17 @@ export const deviceFaultType = {
{label: '反位失表', value: 'REVERSE_SPLIT'} {label: '反位失表', value: 'REVERSE_SPLIT'}
], ],
StationStand: [ StationStand: [
{label: '屏蔽门故障打开', value: 'FAULT_PSD_OPEN'} {label: '屏蔽门无法关闭', value: 'PSD_CANNOT_BE_CLOSED'},
{label: '屏蔽门无法开启', value: 'PSD_CANNOT_BE_OPENED'}
], ],
ZcControl:[ ZcControl:[
{label: 'zc故障', value: 'FAULT'} {label: 'zc故障', value: 'FAULT'}
], ],
Train: [ Train: [
{label: '通信异常', value: 'COMMUNICATION_ABNORMAL'} {label: '通信异常', value: 'COMMUNICATION_ABNORMAL'}
],
Power:[
{label: '供电故障', value: 'FAULT'}
] ]
}; };
/** 设备类型 */ /** 设备类型 */
@ -58,5 +62,6 @@ export const deviceType = {
Station: '车站', Station: '车站',
StationStand: '站台', StationStand: '站台',
Train: '列车', Train: '列车',
ZcControl:'ZC' ZcControl:'ZC',
Power:'供电线'
}; };

View File

@ -141,7 +141,7 @@ class Handler {
} }
getTrainingStart() { getTrainingStart() {
return store.state.training.started; return store.state.training.trainingStart;
} }
getOperateBreakStatus () { getOperateBreakStatus () {

View File

@ -42,15 +42,15 @@ class MenuContextHandler {
data.conditionList.forEach(val=>{ data.conditionList.forEach(val=>{
switch (val.expression) { switch (val.expression) {
case 'eq': { case 'eq': {
result = result || (selected[val.name].toString() == val.value); result = result || ((selected[val.name] || 0).toString() == val.value);
break; break;
} }
case 'neq': { case 'neq': {
result = result || (selected[val.name].toString() != val.value); result = result || ((selected[val.name] || 0).toString() != val.value);
break; break;
} }
default: { default: {
result = result || (selected[val.name].toString() == val.value); result = result || ((selected[val.name] || 0).toString() == val.value);
break; break;
} }
} }

View File

@ -1766,6 +1766,13 @@ export const OperationEvent = {
operation: '518', operation: '518',
domId: '_Tips-Stand-cancelDetainTrainAuto-Menu' domId: '_Tips-Stand-cancelDetainTrainAuto-Menu'
} }
},
// 手动开启屏蔽门
openPsdByHand:{
menu: {
operation: '519',
domId: '_Tips-Stand-openPsdByHand-Menu'
}
} }
}, },

View File

@ -31,7 +31,6 @@ class ValidateHandler {
const steps = Handler.getSteps(); const steps = Handler.getSteps();
const order = Handler.getOrder(); const order = Handler.getOrder();
let valid = false; let valid = false;
if (operate.over && steps.length == 1) { // 右键菜单直接发送校验 if (operate.over && steps.length == 1) { // 右键菜单直接发送校验
if (operate && steps[0] && if (operate && steps[0] &&
operate.code == steps[0].code && operate.code == steps[0].code &&

View File

@ -43,7 +43,8 @@ const training = {
scriptQuitCount: 0, // 主动退出剧本 scriptQuitCount: 0, // 主动退出剧本
scriptOperationType: '', // 剧本操作类型 scriptOperationType: '', // 剧本操作类型
triggerFaultCount: 0, // 触发故障计数器 triggerFaultCount: 0, // 触发故障计数器
triggerFaultDevice: '' // 触发故障目标设备 triggerFaultDevice: '', // 触发故障目标设备
trainingStart: false // 实训开始状态
}, },
getters: { getters: {
@ -279,6 +280,9 @@ const training = {
setTriggerFaultCount: (state, device) => { setTriggerFaultCount: (state, device) => {
state.triggerFaultCount++; state.triggerFaultCount++;
state.triggerFaultDevice = device; state.triggerFaultDevice = device;
},
setTrainingStart: (state, flag) => {
state.trainingStart = flag;
} }
}, },
@ -314,7 +318,6 @@ const training = {
*/ */
reset: ({ commit }) => { reset: ({ commit }) => {
commit('over'); commit('over');
commit('resetOrder');
// commit('stopCountTime'); // commit('stopCountTime');
// 清空计时器以及得分 // 清空计时器以及得分
@ -338,13 +341,20 @@ const training = {
commit('resetScore'); commit('resetScore');
commit('start'); commit('start');
}, },
// setTrainingStart:({ commit }) ={
// commit('setTrainingStart');
// },
setTrainingStart: ({ commit }, flag) => {
commit('setTrainingStart', flag);
if (!flag) {
commit('resetOrder');
}
},
/** /**
* 结束 * 结束
*/ */
over: ({ commit }) => { over: ({ commit }) => {
commit('over'); commit('over');
commit('resetOrder');
// commit('stopCountTime'); // commit('stopCountTime');
}, },
@ -368,7 +378,7 @@ const training = {
* 主动判断是否结束 * 主动判断是否结束
*/ */
judgeFinish: ({ dispatch, commit, state }, rtn) => { judgeFinish: ({ dispatch, commit, state }, rtn) => {
if (state.started) { if (state.trainingStart) {
if (state.order >= state.steps.length) { if (state.order >= state.steps.length) {
if (rtn && rtn.valid) { if (rtn && rtn.valid) {
commit('next'); commit('next');
@ -470,7 +480,7 @@ const training = {
try { try {
// 处理operation // 处理operation
Handler.handle(operate).then(rtn => { Handler.handle(operate).then(rtn => {
if (state.started) { if (state.trainingStart) {
// 教学和联系模式需要给出过程步骤提示 // 教学和联系模式需要给出过程步骤提示
if (TrainingMode.TEACH === state.mode || TrainingMode.PRACTICE === state.mode) { if (TrainingMode.TEACH === state.mode || TrainingMode.PRACTICE === state.mode) {
if (rtn && rtn.valid) { if (rtn && rtn.valid) {

View File

@ -1,8 +1,8 @@
export function getBaseUrl() { 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.8.107:9000'; // 袁琪 // BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.144:9000'; // 旭强 // BASE_API = 'http://192.168.8.144:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛 // BASE_API = 'http://192.168.3.175:9000'; // 张赛

View File

@ -96,15 +96,15 @@ export default {
this.startLoading = true; this.startLoading = true;
if (this.$route.query.trainingId) { if (this.$route.query.trainingId) {
this.isDisable = true; this.isDisable = true;
this.$store.dispatch('training/setMapDefaultState');
startTrainingNew({ id: this.$route.query.trainingId }, this.group).then(response => { startTrainingNew({ id: this.$route.query.trainingId }, this.group).then(response => {
this.$store.dispatch('training/setTrainingStart', true);
this.$store.dispatch('training/examModeStart'); this.$store.dispatch('training/examModeStart');
this.$store.dispatch('exam/start'); this.$store.dispatch('exam/start');
this.$store.dispatch('map/clearJlmapTrainView').then(() => { this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/countTime', 'Lesson'); // this.$store.dispatch('training/countTime', 'Lesson'); //
}); });
});
this.startLoading = false; this.startLoading = false;
}).catch(() => { }).catch(() => {
this.isDisable = false; this.isDisable = false;

View File

@ -1,23 +1,25 @@
<template> <template>
<div v-drag class="reminder-drag"> <div v-quickMenuDrag class="reminder-drag" :style="{bottom: offsetBottom + 'px'}">
<div ref="drapBox" class="reminder-box" :style="{bottom: offsetBottom + 'px'}"> <div ref="drapBox" class="reminder-box">
<div class="tip-title"> <div class="tip-title">
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" /> <i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" /> <i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
<p v-if="!isShrink" style="color: #fff;"> <p v-if="!isShrink" style="color: #fff;">
<span class="time-label">{{ $t('display.exam.examTime') }}</span> <span class="time-label">{{ $t('display.exam.examTime') }}</span>
<span class="time-elem">{{ formatRemainTime }}</span> <span class="time-elem">{{ formatRemainTime }}</span>
</p> </p>
<p v-if="isShrink" style="color: #fff;"> <p v-if="isShrink" style="color: #fff;">
<span>{{ examName }}</span> <span>{{ examName }}</span>
</p> </p>
</div> </div>
<div v-if="isShrink" class="reminder-box-content">
<div class="zhezhao" />
<div ref="dragBody" class="tip-body-box"> <div ref="dragBody" class="tip-body-box">
<div v-show="detailShow" class="tip-body"> <div v-show="detailShow" class="tip-body">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-tree <el-tree
ref="treeQuestion" ref="treeQuestion"
style="background:rgba(0,0,0,0)"
:data="trainingList" :data="trainingList"
node-key="id" node-key="id"
highlight-current highlight-current
@ -73,6 +75,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -298,16 +301,22 @@ export default {
}); });
}, },
shrink() { shrink() {
const height = this.$refs.dragBody.offsetHeight + 40; // const height = this.$refs.dragBody.offsetHeight + 40;
const top = this.$refs.drapBox.style.top; // const top = this.$refs.drapBox.style.top;
if (this.isShrink) { if (this.isShrink) {
this.$refs.drapBox.style.height = '40px'; // this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = ''; // this.$refs.drapBox.style.top = '';
this.isShrink = false; this.isShrink = false;
} else { } else {
this.$refs.drapBox.style.height = height + 'px'; // this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top; // this.$refs.drapBox.style.top = top;
this.isShrink = true; this.isShrink = true;
this.$nextTick(()=>{
const dragDom = document.querySelector('.reminder-drag').style.bottom;
if (document.body.clientHeight - 470 - parseInt(dragDom.replace('px', '')) < 0) {
document.querySelector('.reminder-drag').style.bottom = `${document.body.clientHeight - 470}px`;
}
});
} }
} }
} }
@ -316,26 +325,46 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
.reminder-drag{
position: absolute;
bottom: 0px;
left: 15px;
z-index: 10;
}
.tip-body-box { .tip-body-box {
position: relative; position: relative;
height: 430px; height: 430px;
position: absolute;
left: 0;
top: 0;
width: 100%;
}
.zhezhao{
width: 100%;
height: 100%;
filter: blur(8px);
background: rgba(255,255,255,0.9);
}
.reminder-box-content{
width: 500px;
height: 430px;
left: 0;
top: 0;
z-index: 2;
background: rgba(255,255,255,0.8);
position: relative;
} }
.reminder-box { .reminder-box {
position: absolute;
float: left;
left: 15px;
bottom: 15px;
width: 650px;
height: 470px;
background-color: #fff;
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
z-index: 10; z-index: 10;
font-size: 18px; font-size: 18px;
.tip-title { .tip-title {
width: 100%; width: 500px;
overflow: hidden; overflow: hidden;
height: 40px; height: 40px;
display: flex; display: flex;
@ -385,7 +414,7 @@ export default {
} }
.tip-body { .tip-body {
height: 366px; height: 370px;
padding: 10px; padding: 10px;
.list-label { .list-label {
@ -398,7 +427,6 @@ export default {
position: absolute; position: absolute;
right: 0px; right: 0px;
bottom: 0px; bottom: 0px;
background-color: #fff;
padding: 10px 0 10px 10px; padding: 10px 0 10px 10px;
.foot-detail { .foot-detail {

View File

@ -81,7 +81,6 @@ export default {
computed: { computed: {
...mapGetters('training', [ ...mapGetters('training', [
'score', 'score',
'started',
'usedTime', 'usedTime',
'basicInfo' 'basicInfo'
]), ]),
@ -155,20 +154,19 @@ export default {
start() { start() {
// //
this.$store.dispatch('menuOperation/setButtonOperation', null); this.$store.dispatch('menuOperation/setButtonOperation', null);
this.$store.dispatch('training/setMapDefaultState');
this.startLoading = true; this.startLoading = true;
// console.log(2222222222222, this.startLoading, this.started, this.trainingObj);
if (this.trainingObj && this.trainingObj.id) { if (this.trainingObj && this.trainingObj.id) {
startTrainingNew(this.trainingObj, this.group).then(response => { startTrainingNew(this.trainingObj, this.group).then(response => {
this.isDisable = true; this.isDisable = true;
this.$store.dispatch('training/setTrainingStart', true);
this.$store.dispatch('map/clearJlmapTrainView').then(() => { this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/teachModeStart', this.demoMode).then(()=>{ this.$store.dispatch('training/teachModeStart', this.demoMode).then(()=>{
this.$store.dispatch('training/countTime', 'Lesson'); // this.$store.dispatch('training/countTime', 'Lesson'); //
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.tipInfo({ color: 'green', message: this.$t('global.pleaseOpearte') }); this.tipInfo({ color: 'green', message: this.$t('global.pleaseOpearte') });
}); });
}); });
});
this.startLoading = false; this.startLoading = false;
}).catch(() => { }).catch(() => {
this.isDisable = false; this.isDisable = false;
@ -192,6 +190,7 @@ export default {
this.$store.dispatch('training/judgeFinish', data).then(rsp => { this.$store.dispatch('training/judgeFinish', data).then(rsp => {
this.$store.dispatch('training/setStopCountTime'); this.$store.dispatch('training/setStopCountTime');
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/setTrainingStart', false);
}); });
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('display.lesson.endTrainingError')); this.$messageBox(this.$t('display.lesson.endTrainingError'));
@ -200,7 +199,6 @@ export default {
end() { end() {
// //
if (this.trainingObj && this.trainingObj.id) { if (this.trainingObj && this.trainingObj.id) {
if (this.started) {
this.isDisable = false; this.isDisable = false;
this.$store.dispatch('training/isStepOver').then((rnt) => { this.$store.dispatch('training/isStepOver').then((rnt) => {
if (rnt) { if (rnt) {
@ -227,6 +225,7 @@ export default {
this.$store.dispatch('training/setStopCountTime'); this.$store.dispatch('training/setStopCountTime');
this.$store.dispatch('training/setScore', 0); this.$store.dispatch('training/setScore', 0);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/setTrainingStart', false);
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('display.lesson.endTrainingError')); this.$messageBox(this.$t('display.lesson.endTrainingError'));
}); });
@ -236,9 +235,6 @@ export default {
}); });
} }
}); });
} else {
this.$messageBox(this.$t('display.lesson.startTrainingTip'));
}
} }
}, },
back() { back() {

View File

@ -1,9 +1,7 @@
<template> <template>
<!-- v-drag 拖拽 调整宽高 --> <!-- v-drag 拖拽 调整宽高 -->
<div v-quickMenuDrag class="reminder-drag"> <div v-quickMenuDrag class="reminder-drag" :style="{bottom: offsetBottom + 'px'}">
<div ref="drapBox" class="reminder-box" :style="{bottom: offsetBottom + 'px'}"> <div ref="drapBox" class="reminder-box">
<div class="zhezhao" />
<div class="reminder-box-content">
<div class="tip-title"> <div class="tip-title">
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" /> <i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" /> <i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
@ -11,6 +9,8 @@
<span>{{ lessonName }}</span> <span>{{ lessonName }}</span>
</p> </p>
</div> </div>
<div v-if="isShrink" class="reminder-box-content">
<div class="zhezhao" />
<div ref="dragBody" class="tip-body-box"> <div ref="dragBody" class="tip-body-box">
<div class="tip-body"> <div class="tip-body">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
@ -135,16 +135,23 @@ export default {
launchFullscreen(); launchFullscreen();
}, },
shrink() { shrink() {
const height = this.$refs.dragBody.offsetHeight + 40; // const height = this.$refs.dragBody.offsetHeight + 40;
const top = this.$refs.drapBox.style.top; // const top = this.$refs.drapBox.style.top;
if (this.isShrink) { if (this.isShrink) {
this.$refs.drapBox.style.height = '40px'; //
this.$refs.drapBox.style.top = ''; // this.$refs.drapBox.style.height = '40px';
// this.$refs.drapBox.style.top = '';
this.isShrink = false; this.isShrink = false;
} else { } else {
this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top;
this.isShrink = true; this.isShrink = true;
this.$nextTick(()=>{
const dragDom = document.querySelector('.reminder-drag').style.bottom;
if (document.body.clientHeight - 300 - parseInt(dragDom.replace('px', '')) < 0) {
document.querySelector('.reminder-drag').style.bottom = `${document.body.clientHeight - 300}px`;
}
});
// this.$refs.drapBox.style.height = height + 'px';
// this.$refs.drapBox.style.top = top;
} }
} }
} }
@ -156,14 +163,17 @@ export default {
.tip-body-box { .tip-body-box {
position: relative; position: relative;
height: 260px; height: 260px;
position: absolute;
left: 0;
top: 0;
width: 100%;
} }
.reminder-drag{ .reminder-drag{
position: absolute; position: absolute;
width: 500px;
height: 300px;
bottom: 0px; bottom: 0px;
left: 0px; left: 15px;
z-index: 10;
} }
.elem-span{ .elem-span{
@ -175,37 +185,31 @@ export default {
height: 100%; height: 100%;
filter: blur(8px); filter: blur(8px);
background: rgba(255,255,255,0.9); background: rgba(255,255,255,0.9);
position:absolute;
} }
.reminder-box-content{ .reminder-box-content{
position: absolute; width: 500px;
width: 100%; height: 260px;
height: 100%;
left: 0; left: 0;
top: 0; top: 0;
z-index: 2; z-index: 2;
background: rgba(255,255,255,0.8); background: rgba(255,255,255,0.8);
position: relative;
} }
.reminder-box { .reminder-box {
position: absolute;
float: left;
left: 15px;
bottom: 15px;
width: 500px;
height: 300px;
background: transparent;
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
z-index: 10; z-index: 10;
font-size: 18px; font-size: 18px;
.tip-title { .tip-title {
width: 100%; width: 500px;
overflow: hidden; overflow: hidden;
height: 40px; height: 40px;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row-reverse; flex-direction: row-reverse;
background-color: rgba(64, 158, 255,0.8); background-color: rgba(64, 158, 255,1);
border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0;
justify-content: space-between; justify-content: space-between;
padding: 0 10px; padding: 0 10px;
@ -249,7 +253,7 @@ export default {
} }
.tip-body { .tip-body {
height: 366px; height: 260px;
padding: 10px; padding: 10px;
.list-label { .list-label {

View File

@ -205,13 +205,13 @@ export function covertOperate(operationType, operationParamMap) {
if (operationType == 'Set_Fault' || operationType == 'Cancel_Fault') { if (operationType == 'Set_Fault' || operationType == 'Cancel_Fault') {
let deviceName = ''; let deviceName = '';
const device = store.getters['map/getDeviceByCode'](operationParamMap.code); const device = store.getters['map/getDeviceByCode'](operationParamMap.code);
if (device._type == 'StationStand') { if (device._type == 'StationStand' || device._type == 'Signal' || device._type == 'Switch') {
const station = store.getters['map/getDeviceByCode'](device.stationCode); const station = store.getters['map/getDeviceByCode'](device.stationCode);
deviceName += '【车站-' + station.name + '】/'; deviceName += '【车站-' + station.name + '】 / ' + deviceType[device._type] + device.name;
} else { } else {
deviceName = '' + device.name; deviceName = '' + device.name;
} }
let tip = '请找到' + deviceType[device._type] + deviceName + ','; let tip = '请找到' + deviceName + ',';
if (operationType == 'Set_Fault') { if (operationType == 'Set_Fault') {
tip += '设置故障,'; tip += '设置故障,';
} else { } else {
@ -262,9 +262,9 @@ export function covertOperate(operationType, operationParamMap) {
function covertDeviceName(deviceInfo, deviceType) { function covertDeviceName(deviceInfo, deviceType) {
let deviceName = ''; let deviceName = '';
const device = store.getters['map/getDeviceByCode'](deviceInfo); const device = store.getters['map/getDeviceByCode'](deviceInfo);
if (device._type == 'StationStand') { if (device._type == 'StationStand' || device._type == 'Signal' || device._type == 'Switch') {
const station = store.getters['map/getDeviceByCode'](device.stationCode); const station = store.getters['map/getDeviceByCode'](device.stationCode);
deviceName += '车站-' + station.name + '/'; deviceName += '车站-' + station.name + ' / ';
} }
if (device._type == 'Section') { if (device._type == 'Section') {
if (device.parentCode && device.type == '02') { if (device.parentCode && device.type == '02') {

View File

@ -41,7 +41,7 @@ export default {
this.$store.dispatch('training/isTeachMode').then(() => { this.$store.dispatch('training/isTeachMode').then(() => {
this.tipShow = true; this.tipShow = true;
const offset = this.$store.state.config.canvasOffset; const offset = this.$store.state.config.canvasOffset;
if (this.$store.state.training.started) { if (this.$store.state.training.trainingStart) {
const order = this.$store.state.training.order; const order = this.$store.state.training.order;
const steps = this.$store.state.training.steps; const steps = this.$store.state.training.steps;
if (order > -1 && order < steps.length) { if (order > -1 && order < steps.length) {