This commit is contained in:
zyy 2020-08-21 16:38:35 +08:00
commit f8d3ffa91d
34 changed files with 1687 additions and 898 deletions

BIN
src/assets/stop_route.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

View File

@ -83,7 +83,7 @@ class SkinCode extends defaultStyle {
spareColor: '#C0C0C0', // 区段空闲颜色 spareColor: '#C0C0C0', // 区段空闲颜色
communicationOccupiedColor: '#FE0000', // 区段通信车占用颜色 // 调整 未确定 communicationOccupiedColor: '#FE0000', // 区段通信车占用颜色 // 调整 未确定
unCommunicationOccupiedColor: '#EF72A7', // 区段非通讯车占用颜色 unCommunicationOccupiedColor: '#EF72A7', // 区段非通讯车占用颜色
routeLockColor: '#00ff00', // 区段进路锁定颜色 routeLockColor: '#C0C0C0', // 区段进路锁定颜色
faultLockColor: '#81007F', // 区段故障锁定颜色 faultLockColor: '#81007F', // 区段故障锁定颜色
undefinedColor: '#0071C1', // 区段未定义颜色 undefinedColor: '#0071C1', // 区段未定义颜色
protectionLockedColor: '#FFFFFF', // 保护区段锁闭 protectionLockedColor: '#FFFFFF', // 保护区段锁闭
@ -92,9 +92,9 @@ class SkinCode extends defaultStyle {
atsExcisionColor: '#A0522D', // 区段ats切除颜色 atsExcisionColor: '#A0522D', // 区段ats切除颜色
invalidColor: '#AC8F40', // 计轴故障颜色 invalidColor: '#AC8F40', // 计轴故障颜色
timeReleaseColor: '#3F3F3F', // 区段延时释放颜色 timeReleaseColor: '#3F3F3F', // 区段延时释放颜色
protectiveLockColor: '#03C85C', // 区段保护锁闭 延续保护 protectiveLockColor: '#C0C0C0', // 区段保护锁闭 延续保护
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁 protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用) logicalColor: '#C0C0C0', // 逻辑区段颜色 (未用)
logicalTextColor: 'white', // 逻辑区段名称颜色 (未用) logicalTextColor: 'white', // 逻辑区段名称颜色 (未用)
speedLimitColor: '#008081' // 临时限速颜色 speedLimitColor: '#008081' // 临时限速颜色
}, },
@ -106,6 +106,27 @@ class SkinCode extends defaultStyle {
width: 2, width: 2,
defaultColor: '#03FFF8' defaultColor: '#03FFF8'
}, },
routeArrow: {
radius: 5,
lineWidth: 3,
arrowLineWidth: 1,
defaultArrowStroke: '#0F0',
defaultArrowFill: '#0F0',
defaultLineStroke: '#0F0',
autoArrowStroke: '#000',
manualArrowStroke: '#000',
manualArrowFill: '#0201F2',
atmArrowStroke: '#0201F2',
atmArrowFill: '#0201F2',
atmLineStroke: '#0201F2',
mauArrowStroke: '#FFFF00',
mauArrowFill: '#FFFF00',
mauLineStroke: '#FFFF00',
cancelMauArrowStroke: '#000',
cancelMauArrowFill: '#000',
cancelMauLineStroke: '#000'
},
stopRouteImg: {},
axle: {}, // 计轴 axle: {}, // 计轴
speedLimit: { // 限速元素 speedLimit: { // 限速元素
width: 1, // 限速线的宽度 width: 1, // 限速线的宽度

View File

@ -12,7 +12,8 @@ deviceState[deviceType.Section] = {
cutOff: 0, // 是否切除 cutOff: 0, // 是否切除
invalid: 0, // 是否失效 invalid: 0, // 是否失效
speedUpLimit: 0, // 最高限速 speedUpLimit: 0, // 最高限速
fault: 0 /** 非故障*/ fault: 0, /** 非故障*/
lockRight: 0 // 区段进路锁闭方向
}; };
// 进路后端状态 // 进路后端状态
// boolean cbtcMode;是否CBTC模式 // boolean cbtcMode;是否CBTC模式

View File

@ -1,7 +1,8 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
// import Line from 'zrender/src/graphic/shape/Line';
import Polyline from 'zrender/src/graphic/shape/Polyline'; import Polyline from 'zrender/src/graphic/shape/Polyline';
import Isogon from 'zrender/src/graphic/shape/Isogon';
import BezierCurve from 'zrender/src/graphic/shape/BezierCurve'; import BezierCurve from 'zrender/src/graphic/shape/BezierCurve';
import JTriangle from '../../utils/JTriangle';
/** 创建区段线集合*/ /** 创建区段线集合*/
export default class ELines extends Group { export default class ELines extends Group {
@ -110,6 +111,101 @@ export default class ELines extends Group {
this.add(this.bottomWithSection); this.add(this.bottomWithSection);
this.bottomWithSection.hide(); this.bottomWithSection.hide();
} }
if (model.style.Section.routeArrow && !model.isCurve) {
const cPointLeft = {x: 0, y:0};
const cPointRight = {x: 0, y:0};
const pointsLeft = [];
const pointsRight = [];
const length = this.model.points.length;
const triangleLeft = new JTriangle(this.model.points[0], this.model.points[1]);
cPointLeft.x = this.model.points[0].x + triangleLeft.getCos(model.style.Section.routeArrow.radius);
cPointLeft.y = this.model.points[0].y + triangleLeft.getSin(model.style.Section.routeArrow.radius);
for (let i = 0; i < length; i++) {
if (i === 0) {
pointsLeft.push([cPointLeft.x, cPointLeft.y]);
} else {
pointsLeft.push([model.points[i].x, model.points[i].y]);
}
}
const triangleRight = new JTriangle(this.model.points[length - 2], this.model.points[length - 1 ]);
cPointRight.x = this.model.points[length - 1].x - triangleRight.getCos(model.style.Section.routeArrow.radius);
cPointRight.y = this.model.points[length - 1].y - triangleRight.getSin(model.style.Section.routeArrow.radius);
for (let i = 0; i < length; i++) {
if (i === length - 1) {
pointsRight.push([cPointRight.x, cPointRight.y]);
} else {
pointsRight.push([model.points[i].x, model.points[i].y]);
}
}
this.routeArrowLeft = new Isogon({
zlevel: this.zlevel,
origin: [cPointLeft.x, cPointLeft.y],
rotation: Math.PI / 2 - triangleLeft.getRotation(),
z: this.z + 9,
shape: {
x: cPointLeft.x,
y: cPointLeft.y,
r: model.style.Section.routeArrow.radius,
n: 3
},
style: {
lineWidth: model.style.Section.routeArrow.arrowLineWidth,
stroke: model.style.Section.routeArrow.defaultArrowStroke,
fill: model.style.Section.routeArrow.defaultArrowFill
}
});
this.routeArrowRight = new Isogon({
zlevel: this.zlevel,
origin: [cPointLeft.x, cPointLeft.y],
rotation: -Math.PI / 2 - triangleRight.getRotation(),
z: this.z + 9,
shape: {
x: cPointRight.x,
y: cPointRight.y,
r: model.style.Section.routeArrow.radius,
n: 3
},
style: {
lineWidth: model.style.Section.routeArrow.arrowLineWidth,
stroke: model.style.Section.routeArrow.defaultArrowStroke,
fill: model.style.Section.routeArrow.defaultArrowFill
}
});
this.routeLineLeft = new Polyline({
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
shape: {
points: pointsLeft
},
style: {
lineWidth: model.style.Section.routeArrow.lineWidth,
stroke: model.style.Section.routeArrow.defaultLineStroke
}
});
this.routeLineRight = new Polyline({
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
shape: {
points: pointsRight
},
style: {
lineWidth: model.style.Section.routeArrow.lineWidth,
stroke: model.style.Section.routeArrow.defaultLineStroke
}
});
this.add(this.routeArrowLeft);
this.add(this.routeLineLeft);
this.add(this.routeArrowRight);
this.add(this.routeLineRight);
this.routeArrowLeft.hide();
this.routeLineLeft.hide();
this.routeArrowRight.hide();
this.routeLineRight.hide();
}
} }
} }
@ -179,7 +275,86 @@ export default class ELines extends Group {
this.lineBorder && this.lineBorder.show(); this.lineBorder && this.lineBorder.show();
} }
} }
setRouteLock(lockRight) {
if (lockRight) {
this.routeArrowRight && this.routeArrowRight.show();
this.routeLineRight && this.routeLineRight.show();
} else {
this.routeLineLeft && this.routeArrowLeft.show();
this.routeLineLeft && this.routeLineLeft.show();
}
}
setAutoRoute(lockRight) {
if (lockRight) {
this.routeArrowRight && this.routeArrowRight.show();
this.routeLineRight && this.routeLineRight.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.autoArrowStroke});
} else {
this.routeLineLeft && this.routeLineLeft.show();
this.routeArrowLeft && this.routeArrowLeft.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.autoArrowStroke});
}
}
setManualRoute(lockRight) {
if (lockRight) {
this.routeArrowRight && this.routeArrowRight.show();
this.routeLineRight && this.routeLineRight.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.manualArrowStroke, fill: this.model.style.Section.routeArrow.manualArrowFill});
} else {
this.routeLineLeft && this.routeLineLeft.show();
this.routeArrowLeft && this.routeArrowLeft.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.manualArrowStroke, fill: this.model.style.Section.routeArrow.manualArrowFill});
}
}
setAtmRoute(lockRight) {
if (lockRight) {
this.routeArrowRight && this.routeArrowRight.show();
this.routeLineRight && this.routeLineRight.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.atmArrowStroke, fill: this.model.style.Section.routeArrow.atmArrowFill});
this.routeLineRight && this.routeLineRight.setStyle({stroke: this.model.style.Section.routeArrow.atmLineStroke});
} else {
this.routeLineLeft && this.routeLineLeft.show();
this.routeArrowLeft && this.routeArrowLeft.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.atmArrowStroke, fill: this.model.style.Section.routeArrow.atmArrowFill});
this.routeLineRight && this.routeLineRight.setStyle({stroke: this.model.style.Section.routeArrow.atmLineStroke});
}
}
setMauRoute(lockRight) {
if (lockRight) {
this.routeArrowRight && this.routeArrowRight.show();
this.routeLineRight && this.routeLineRight.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.mauArrowStroke, fill: this.model.style.Section.routeArrow.mauArrowFill});
this.routeLineRight && this.routeLineRight.setStyle({stroke: this.model.style.Section.routeArrow.mauLineStroke});
} else {
this.routeLineLeft && this.routeLineLeft.show();
this.routeArrowLeft && this.routeArrowLeft.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.mauArrowStroke, fill: this.model.style.Section.routeArrow.mauArrowFill});
this.routeLineRight && this.routeLineRight.setStyle({stroke: this.model.style.Section.routeArrow.mauLineStroke});
}
}
setCancelMauRoute(lockRight) {
if (lockRight) {
this.routeArrowRight && this.routeArrowRight.show();
this.routeLineRight && this.routeLineRight.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.cancelMauArrowStroke, fill: this.model.style.Section.routeArrow.cancelMauArrowFill});
this.routeLineRight && this.routeLineRight.setStyle({stroke: this.model.style.Section.routeArrow.cancelMauLineStroke});
} else {
this.routeLineLeft && this.routeLineLeft.show();
this.routeArrowLeft && this.routeArrowLeft.show();
this.routeArrowRight && this.routeArrowRight.setStyle({stroke: this.model.style.Section.routeArrow.cancelMauArrowStroke, fill: this.model.style.Section.routeArrow.cancelMauArrowFill});
this.routeLineRight && this.routeLineRight.setStyle({stroke: this.model.style.Section.routeArrow.cancelMauLineStroke});
}
}
recoverRoute() {
this.routeArrowLeft && this.routeArrowLeft.hide();
this.routeLineLeft && this.routeLineLeft.hide();
this.routeArrowRight && this.routeArrowRight.hide();
this.routeLineRight && this.routeLineRight.hide();
this.routeArrowLeft && this.routeArrowLeft.setStyle({ stroke: this.model.style.Section.routeArrow.defaultArrowStroke, fill: this.model.style.Section.routeArrow.defaultArrowFill });
this.routeArrowRight && this.routeArrowRight.setStyle({ stroke: this.model.style.Section.routeArrow.defaultArrowStroke, fill: this.model.style.Section.routeArrow.defaultArrowFill });
this.routeLineLeft && this.routeLineLeft.setStyle({ fill: this.model.style.Section.routeArrow.defaultLineStroke });
this.routeArrowRight && this.routeArrowRight.setStyle({ fill: this.model.style.Section.routeArrow.defaultLineStroke });
}
getBoundingRect() { getBoundingRect() {
return this.section.getBoundingRect().clone(); return this.section.getBoundingRect().clone();
} }

View File

@ -0,0 +1,52 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import Stop_Route from '@/assets/stop_route.png';
import Pattern from 'zrender/src/graphic/Pattern';
import JTriangle from '../../utils/JTriangle';
export default class EStopRouteImg extends Group {
constructor(model) {
super();
this.model = model;
this.zlevel = model.zlevel;
this.z = model.z;
this.stopRouteImgList = [];
this.create();
}
create() {
const image = new Image(5, 8);
image.src = Stop_Route;
image.decode()
.then(() => {
const pattern = new Pattern(image, 'repeat');
for (let i = 1; i < this.model.points.length; i++) {
const triangle = new JTriangle(this.model.points[i - 1], this.model.points[i]);
this.stopRouteImgList.push(new Rect({
zlevel: this.zlevel,
z: this.z + 1,
origin: [this.model.points[i - 1].x, this.model.points[i - 1].y],
rotation: -triangle.getRotation(),
shape: {
x: this.model.points[i - 1].x,
y: this.model.points[i - 1].y - this.model.style.Section.line.width / 2,
width: triangle.getLength(),
height: this.model.style.Section.line.width
},
style: {
fill: pattern
}
}));
}
this.stopRouteImgList.forEach(item => {
this.add(item);
item.hide();
});
});
}
setModel(dx, dy) {
}
setCursor(mouseStyle) {
this.imageBg.attr('cursor', mouseStyle);
}
}

View File

@ -11,6 +11,7 @@ import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路
import ELimitName from './ELimitName'; // 成都三号线 限速名称 import ELimitName from './ELimitName'; // 成都三号线 限速名称
import JTriangle from '../../utils/JTriangle'; import JTriangle from '../../utils/JTriangle';
import { drawSectionStyle } from '../../config/defaultStyle'; import { drawSectionStyle } from '../../config/defaultStyle';
import EStopRouteImg from './EStopRouteImg';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
import Vue from 'vue'; import Vue from 'vue';
@ -318,6 +319,15 @@ export default class Section extends Group {
this.add(this.lineBorder); this.add(this.lineBorder);
this.lineBorder.setStyle({ lineWidth: 0 }); this.lineBorder.setStyle({ lineWidth: 0 });
} }
if (this.style.Section.stopRouteImg && model.type !== '04') {
this.stopRouteImg = new EStopRouteImg({
zlevel: this.zlevel,
z: this.z,
points: model.points,
style:style
});
this.add(this.stopRouteImg);
}
} }
} }
@ -565,6 +575,7 @@ export default class Section extends Group {
fill: this.style.Section.line.spareColor fill: this.style.Section.line.spareColor
}); });
} }
this.section && this.section.recoverRoute();
} }
/** 未定义状态 00*/ /** 未定义状态 00*/

View File

@ -3,6 +3,7 @@ class Theme {
this._code = '02'; this._code = '02';
this._mapMenu = { this._mapMenu = {
'01': 'chengdu_01', '01': 'chengdu_01',
// '01': 'ningbo_03',
'02': 'fuzhou_01', '02': 'fuzhou_01',
'03': 'beijing_01', '03': 'beijing_01',
'04': 'chengdu_03', '04': 'chengdu_03',

View File

@ -95,6 +95,8 @@
<train-delete ref="trainDelete" /> <train-delete ref="trainDelete" />
<manage-user ref="manageUser" /> <manage-user ref="manageUser" />
<help-about ref="helpAbout" /> <help-about ref="helpAbout" />
<arrange-route ref="arrangeRoute" />
<train-distribution ref="trainDistribution" />
</div> </div>
</template> </template>
<script> <script>
@ -108,10 +110,12 @@ import TrainTranstalet from './menuDialog/trainTranstalet';
import TrainDelete from './menuDialog/trainDelete'; import TrainDelete from './menuDialog/trainDelete';
import ManageUser from './menuDialog/manageUser'; import ManageUser from './menuDialog/manageUser';
import HelpAbout from './menuDialog/helpAbout'; import HelpAbout from './menuDialog/helpAbout';
import ArrangeRoute from './menuDialog/arrangeRoute';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import { State2SimulationMap } from '@/scripts/cmdPlugin/Config'; import { State2SimulationMap } from '@/scripts/cmdPlugin/Config';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import TrainDistribution from './menuDialog/trainDistribution';
export default { export default {
name: 'MenuBar', name: 'MenuBar',
@ -124,7 +128,9 @@ export default {
TrainTranstalet, TrainTranstalet,
TrainDelete, TrainDelete,
ManageUser, ManageUser,
HelpAbout HelpAbout,
ArrangeRoute,
TrainDistribution
}, },
props: { props: {
selected: { selected: {
@ -155,11 +161,11 @@ export default {
children: [ children: [
{ {
title: '排列进路', title: '排列进路',
click: this.undeveloped click: this.handleArrangeRoute
}, },
{ {
title: '分配', title: '分配',
click: this.undeveloped click: this.handleTrainDistribution
}, },
{ {
title: '操作', title: '操作',
@ -569,11 +575,11 @@ export default {
children: [ children: [
{ {
title: '排列进路', title: '排列进路',
click: this.undeveloped click: this.handleArrangeRoute
}, },
{ {
title: '分配', title: '分配',
click: this.undeveloped click: this.handleTrainDistribution
}, },
{ {
title: '操作', title: '操作',
@ -1307,6 +1313,14 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
EventBus.$emit('closeMenu'); EventBus.$emit('closeMenu');
}); });
},
handleArrangeRoute() {
this.$refs.arrangeRoute.doShow();
this.doClose();
},
handleTrainDistribution() {
this.$refs.trainDistribution.doShow();
this.doClose();
} }
} }
}; };
@ -1371,7 +1385,6 @@ export default {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
max-height: 550px; max-height: 550px;
overflow-y: scroll;
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 4px; width: 4px;
@ -1391,11 +1404,14 @@ export default {
.menu-ul { .menu-ul {
display: none; display: none;
position: relative;
left: 180px;
transform: translateY(-30px);
list-style: none; list-style: none;
padding-left: 0 !important;
background: #F0F0F0; background: #F0F0F0;
line-height: $menuItemHeight; line-height: $menuItemHeight;
width: $menuItemWidth; width: $menuItemWidth;
bottom: $menuItemHeight;
} }
.active { .active {

View File

@ -0,0 +1,202 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="10">
<el-table :data="tableData" height="397px" style="margin-top: 57px">
<el-table-column prop="groupNumber" label="列车" />
<el-table-column prop="groupNumber" label="班次" />
<el-table-column prop="groupNumber" label="运行线" />
<el-table-column prop="groupNumber" label="模式" />
</el-table>
</el-col>
<el-col :span="13" :offset="1">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane label="站台" name="first">
<el-row>
<el-col :span="11">
<div style="width: 220px;border: 2px solid #696969; border-bottom: 0;color: #000;padding-left: 5px;">站台</div>
<div style="width: 220px;height: 350px;overflow: scroll; border: 2px solid #696969;">
<template v-for="(stationStand, index) in stationStandList">
<li :key="index" class="menu-li" :style="{background: selectStandCode === stationStand.code? '#BFCDDB': '#FFF'}" @click="selectStand(stationStand)">{{ stationStand.name }}</li>
</template>
</div>
</el-col>
<el-col :span="12" :offset="1">
<el-table :data="tempData" height="340px">
<el-table-column prop="groupNumber" label="路径" />
<el-table-column prop="groupNumber" label="运行方向" />
</el-table>
<el-checkbox v-model="displayCopyPath">显示复制路径</el-checkbox>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="信号机" name="second">信号机</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="commitDisabled" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
import { mapGetters } from 'vuex';
export default {
name: 'RouteSelection',
components: {
NoticeInfo
},
data() {
return {
tempData: [],
tableData: [{}],
activeName: 'first',
beforeSectionList: [],
dialogShow: false,
loading: false,
selected: null,
row: null,
operation: '',
display: true,
stationName: '',
signalName: '',
selectStandCode: '',
displayCopyPath: false,
tableStyle: {
'border-bottom': 'none'
}
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '列车排进路';
},
commitDisabled() {
let disabled = true;
if (this.row) {
disabled = !this.row.canSetting;
}
return disabled;
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show && !this.commitDisabled) {
this.commit();
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
expandPath() {
console.log('展开进路预览');
},
doShow(operate, selected, tempData) {
this.selected = selected;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.restoreBeforeDevices();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
restoreBeforeDevices() {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
});
}
this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]);
this.beforeSectionList = [];
},
commit() {
if (this.row && this.row.canSetting) {
this.loading = true;
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
}
},
handleClick() {
},
selectStand(stationStand) {
this.selectStandCode = stationStand.code;
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
</style>

View File

@ -0,0 +1,194 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="10">
<el-table :data="tableData" height="397px" style="margin-top: 57px">
<el-table-column prop="groupNumber" label="列车" />
<el-table-column prop="groupNumber" label="班次" />
<el-table-column prop="groupNumber" label="运行线" />
<el-table-column prop="length" label="长度" />
<el-table-column prop="mode" label="模式" />
<el-table-column prop="status" label="状态" />
</el-table>
</el-col>
<el-col :span="13" :offset="1">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane label="运行线" name="first">
<div style="width: 100%;border: 2px solid #696969; border-bottom: 0;color: #000;padding-left: 5px;">站台</div>
<div style="width: 100%;height: 350px;overflow: scroll; border: 2px solid #696969;">
<template v-for="(stationStand, index) in stationStandList">
<li :key="index" class="menu-li" :style="{background: selectStandCode === stationStand.code? '#BFCDDB': '#FFF'}" @click="selectStand(stationStand)">{{ stationStand.name }}</li>
</template>
</div>
</el-tab-pane>
<el-tab-pane label="往返" name="second">往返</el-tab-pane>
<el-tab-pane label="班次" name="third">班次</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="commitDisabled" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
import { mapGetters } from 'vuex';
export default {
name: 'RouteSelection',
components: {
NoticeInfo
},
data() {
return {
tempData: [],
tableData: [{}],
activeName: 'first',
beforeSectionList: [],
dialogShow: false,
loading: false,
selected: null,
row: null,
operation: '',
display: true,
stationName: '',
signalName: '',
selectStandCode: '',
displayCopyPath: false,
tableStyle: {
'border-bottom': 'none'
}
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '列车分配';
},
commitDisabled() {
let disabled = true;
if (this.row) {
disabled = !this.row.canSetting;
}
return disabled;
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show && !this.commitDisabled) {
this.commit();
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
expandPath() {
console.log('展开进路预览');
},
doShow(operate, selected, tempData) {
this.selected = selected;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.restoreBeforeDevices();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
restoreBeforeDevices() {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
});
}
this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]);
this.beforeSectionList = [];
},
commit() {
if (this.row && this.row.canSetting) {
this.loading = true;
commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:this.row.code}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
}
},
handleClick() {
},
selectStand(stationStand) {
this.selectStandCode = stationStand.code;
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
</style>

View File

@ -52,6 +52,9 @@ JTriangle.prototype = {
getSinRate () { getSinRate () {
return Math.sqrt(this.abspowy / this.abspowz); return Math.sqrt(this.abspowy / this.abspowz);
}, },
getLength() {
return Math.sqrt(this.abspowz);
},
getTanRate () { getTanRate () {
var diff_x = this.end.x - this.beg.x; var diff_x = this.end.x - this.beg.x;
var diff_y = this.end.y - this.beg.y; var diff_y = this.end.y - this.beg.y;

View File

@ -303,7 +303,7 @@ export const ProjectCode = {
export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls']; // 底部栏仅展示公司信息不展示备案号 export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls']; // 底部栏仅展示公司信息不展示备案号
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb']; // 实训设计平台通过项目code获取地图列表的项目 export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb']; // 实训设计平台通过项目code获取地图列表的项目
export const CaseHideProjectList = ['heb', 'designheb']; // 案例展示隐藏的项目 export const CaseHideProjectList = ['heb', 'designheb']; // 案例展示隐藏的项目
export const VersionBaseNoShow = ['heb', 'designheb']; // 登录页右下角版本开发基于不展示 export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls']; // 登录页右下角版本开发基于不展示
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls']; // 登录页右下角主体不展示 export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls']; // 登录页右下角主体不展示
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']; // 登录页样式 export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls']; // 登录页样式

View File

@ -39,7 +39,9 @@ const training = {
centerStationCode:'', // 当前居中的集中站code centerStationCode:'', // 当前居中的集中站code
memberList: [], // 综合仿真成员列表 memberList: [], // 综合仿真成员列表
memberData: {}, // 综合仿真成员列表 memberData: {}, // 综合仿真成员列表
simulationUserList: [] // 综合仿真用户列表 simulationUserList: [], // 综合仿真用户列表
addMemberInScript:{}, // 剧本录制新增角色
orignalUserRoleId:'' // 设置旧的角色的id
}, },
getters: { getters: {
@ -253,7 +255,8 @@ const training = {
addMemberListInScript:(state, newMember) => { addMemberListInScript:(state, newMember) => {
if (!state.memberData[newMember.id]) { if (!state.memberData[newMember.id]) {
state.memberData[newMember.id] = newMember; // state.memberData[newMember.id] = newMember;
state.addMemberInScript = newMember;
} }
}, },
@ -292,6 +295,9 @@ const training = {
}, },
setRoleDeviceCode :(state, roleDeviceCode) => { setRoleDeviceCode :(state, roleDeviceCode) => {
state.roleDeviceCode = roleDeviceCode; state.roleDeviceCode = roleDeviceCode;
},
setOrignalUserRoleId:(state, orignalUserRoleId) => {
state.orignalUserRoleId = orignalUserRoleId;
} }
}, },
@ -594,8 +600,8 @@ const training = {
/** /**
* 开始教学模式 * 开始教学模式
*/ */
teachModeStart: ({ dispatch }) => { teachModeStart: ({ dispatch }, mode) => {
const payLoad = { start: true, mode: TrainingMode.TEACH }; const payLoad = { start: true, mode: mode };
dispatch('startTraining', payLoad); dispatch('startTraining', payLoad);
}, },
@ -716,6 +722,10 @@ const training = {
/** 添加新成员(剧本录制)*/ /** 添加新成员(剧本录制)*/
addMemberListInScript:({ commit }, data) => { addMemberListInScript:({ commit }, data) => {
commit('addMemberListInScript', data); commit('addMemberListInScript', data);
},
/** 剧本仿真 设置旧的角色的id */
setOrignalUserRoleId:({ commit }, data) => {
commit('setOrignalUserRoleId', data);
} }
} }
}; };

View File

@ -36,8 +36,9 @@
:key="item.id" :key="item.id"
:label="(roleConfig[item.type]?roleConfig[item.type]: '')+(item.name?item.name: '')" :label="(roleConfig[item.type]?roleConfig[item.type]: '')+(item.name?item.name: '')"
:value="item.id" :value="item.id"
:disabled="checkDisabled(item.type)" :disabled="item.disabled"
/> />
<!-- checkDisabled(item.type) -->
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -170,6 +171,15 @@ export default {
const name = each.name == undefined ? '' : '-' + each.name; const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName; const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.name = each.type + deviceName + name; each.name = each.type + deviceName + name;
each.disabled = false;
const prdType = this.$store.state.training.prdType;
if ( prdType == '01') {
if (each.type !== '行值' && each.type !== 'no') { each.disabled = true; }
} else if (prdType == '02') {
if (each.type !== '行调' && each.type !== 'no') { each.disabled = true; }
} else if (prdType == '04') {
if (each.type !== '司机' && each.type !== 'no') { each.disabled = true; }
}
}); });
return lastData; return lastData;
}, },
@ -242,24 +252,19 @@ export default {
this.roleShow = false; this.roleShow = false;
}, },
checkDisabled(role) { // checkDisabled(role) {
if (!this.$route.fullPath.includes('design/displayNew/demon')) { // const prdType = this.$store.state.training.prdType;
const prdType = this.$route.query.prdType; // return this.judgeDisabled(prdType, role);
return this.judgeDisabled(prdType, role); // },
} else { // judgeDisabled(prdType, role) {
const prdType = this.$store.state.training.prdType; // if ( prdType == '01') {
return this.judgeDisabled(prdType, role); // return role !== '' && role !== 'no';
} // } else if (prdType == '02') {
}, // return role !== '' && role !== 'no';
judgeDisabled(prdType, role) { // } else if (prdType == '04') {
if ( prdType == '01') { // return role !== '' && role !== 'no';
return role !== '行值' && role !== 'no'; // }
} else if (prdType == '02') { // },
return role !== '行调' && role !== 'no';
} else if (prdType == '04') {
return role !== '司机' && role !== 'no';
}
},
handleName(item) { handleName(item) {
return this.roleConfig[item.type] ? this.roleConfig[item.type] : '' + (item.name ? item.name : ''); return this.roleConfig[item.type] ? this.roleConfig[item.type] : '' + (item.name ? item.name : '');

View File

@ -1,4 +1,5 @@
<template> <template>
<div>
<chat-box <chat-box
ref="chatbox" ref="chatbox"
:group="group" :group="group"
@ -12,9 +13,12 @@
:is-quit-show="isQuitShow" :is-quit-show="isQuitShow"
@resetCoversition="resetCoversition" @resetCoversition="resetCoversition"
/> />
<script-tip ref="scriptTip" :offset="offset" :member-data="memberData" @allowCreatCoversition="allowCreatCoversition" />
</div>
</template> </template>
<script> <script>
import ChatBox from '../chatView/chatBox.vue'; import ChatBox from '../chatView/chatBox.vue';
import ScriptTip from '@/views/newMap/displayNew/scriptDisplay/component/scriptTip';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { getSimulationMemberList} from '@/api/simulation'; import { getSimulationMemberList} from '@/api/simulation';
@ -22,7 +26,8 @@ import {getAllConversition} from '@/api/chat';
export default { export default {
name:'DemonChat', name:'DemonChat',
components:{ components:{
ChatBox ChatBox,
ScriptTip
}, },
props: { props: {
group: { group: {
@ -32,6 +37,10 @@ export default {
userRole: { userRole: {
type: String, type: String,
required: true required: true
},
offset: {
type: Number,
required: true
} }
}, },
data() { data() {
@ -39,7 +48,7 @@ export default {
isHasCoversition:false, isHasCoversition:false,
conversitionId:'', conversitionId:'',
currentMemberList:[], currentMemberList:[],
memberData:{}, memberData:[],
chatContentList:[], chatContentList:[],
activeTrainList:[], activeTrainList:[],
isStartRecord:false, isStartRecord:false,
@ -89,13 +98,17 @@ export default {
member.disabled = false; member.disabled = false;
} else { } else {
member.disabled = true; member.disabled = true;
member.userName = this.$store.state.user.nickname;
this.$store.dispatch('training/setOrignalUserRoleId', member.id);
} }
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name; const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) { if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) { if (device) {
if (device._type == 'Train') { if (device._type == 'Train') {
member.label = member.type + device.groupNumber + name; member.deviceName = device.groupNumber;
member.label = member.type + device.groupNumber + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
if (this.activeTrainList.length > 0) { if (this.activeTrainList.length > 0) {
if (this.activeTrainList.includes(member.deviceCode)) { if (this.activeTrainList.includes(member.deviceCode)) {
@ -105,18 +118,21 @@ export default {
this.driverList.push(member); this.driverList.push(member);
} }
} else { } else {
member.label = member.type + device.name + name; member.deviceName = device.name;
member.label = member.type + device.name + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
if (device._type == 'Station') { if (device._type == 'Station') {
stationSupervisorList.push(member); stationSupervisorList.push(member);
} }
} }
} else { } else {
member.label = member.type + member.deviceCode + name; member.deviceName = member.deviceCode;
member.label = member.type + member.deviceCode + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
} }
} else { } else {
member.label = member.type + name; member.label = member.type + name + userName;
member.deviceName = '';
if (member.type == '行调') { if (member.type == '行调') {
dispatcherList.push(member); dispatcherList.push(member);
} else if (member.type == '通号') { } else if (member.type == '通号') {
@ -176,7 +192,8 @@ export default {
memberList.push(member); memberList.push(member);
} else { } else {
const member = this.memberData.find(member=>{ return member.id == id; }); const member = this.memberData.find(member=>{ return member.id == id; });
member.connect = false; // member.connect = false;
member.connect = true;
member && memberList.push(member); member && memberList.push(member);
} }
}); });
@ -256,6 +273,7 @@ export default {
// //
'$store.state.socket.scriptFinish':function(val, old) { '$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成'); this.$message('剧本执行完成');
this.$refs.scriptTip.resetScriptTip();
}, },
// 退 // 退
'$store.state.socket.overConversition': function (val) { '$store.state.socket.overConversition': function (val) {
@ -276,7 +294,15 @@ export default {
member.connect = true; member.connect = true;
member.online = true; member.online = true;
this.inviteUser = member; this.inviteUser = member;
this.$refs.chatbox.inviteMember();
this.currentMemberList.push(member);
const member = this.memberData.find(member=>{ return member.id == val.memberId; });
member.connect = true;
this.currentMemberList.push(member);
this.isStartRecord = true;
// this.$refs.chatbox.inviteMember();
this.$message.success(this.inviteUserName + '与你开启会话');
} }
} }
@ -300,7 +326,24 @@ export default {
}, },
clearAllData() { clearAllData() {
this.resetCoversition(); this.resetCoversition();
this.createCoversition = false; this.createCoversition = true;
this.$refs.scriptTip.resetScriptTip();
},
setMembers(roleId) {
this.memberData.map(member=>{
if (member.id == roleId) {
member.userId = this.$store.state.user.id;
member.userName = this.$store.state.user.nickname;
member.disabled = true;
} else {
member.userId = '';
member.userName = '';
member.disabled = false;
}
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name;
member.label = member.type + member.deviceName + name + userName;
});
}, },
resetCoversition() { resetCoversition() {
this.conversitionId = ''; this.conversitionId = '';
@ -311,6 +354,12 @@ export default {
this.inviteUserName = ''; this.inviteUserName = '';
this.inviteUser = {}; this.inviteUser = {};
this.isQuitShow = false; this.isQuitShow = false;
},
allowCreatCoversition() {
this.createCoversition = true;
},
resetScriptTip() {
this.$refs.scriptTip.resetScriptTip();
} }
// isAudienceInitData() { // isAudienceInitData() {
// getAllConversition(this.group).then(resp => { // getAllConversition(this.group).then(resp => {

View File

@ -0,0 +1,227 @@
<template>
<!-- {} -->
<div>
<div v-if="isAllShow" class="display_top_draft" :style="allStyle">
<div class="btn_hover" @click="menuClick">菜单</div>
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
<!-- 地图错误判断 -->
<!-- 设备视图 -->
<el-button v-if="jl3dmodelShow" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
<!-- 三维视图 -->
<el-button v-if="jl3dnameShow" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<!-- cctv视图 -->
<el-button v-if="cctvShow" size="small" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
<!-- 故障设备视图 -->
<el-button v-if="jlmap3dFaultShow" size="small" @click="jumpjlmap3dFault">故障设备</el-button>
<!-- 司机视角 -->
<el-button v-if="driverShow" size="small" type="jumpjlmap3d" @click="jumpjlmap3dDriver">{{ $t('joinTraining.driverPerspective') }}</el-button>
<!-- 排班计划 -->
<el-button v-if="scheduleLoadShow" type="primary" size="small" @click="jumpScheduling">派班计划加载</el-button>
<el-button v-if="schedulePreviewShow" type="primary" size="small" @click="schedulingView">派班计划预览</el-button>
</el-button-group>
</div>
<Jl3d-Device
v-if="deviceShow"
ref="Jl3dDevice"
:panel-show="deviceShow"
@closedevice3dview="jumpjlmap3dmodel"
/>
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<scheduling v-if="scheduleLoadShow" ref="scheduling" :group="group" />
<scheduling-view v-if="schedulePreviewShow" ref="schedulingView" :group="group" />
</div>
</template>
<script>
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import { getToken } from '@/utils/auth';
import { getSessionStorage } from '@/utils/auth';
import Scheduling from '@/views/newMap/displayNew/demon/scheduling';
import SchedulingView from '@/views/newMap/displayNew/demon/schedulingView';
export default {
name:'DemonMenu',
components:{
Jl3dDevice,
Jl3dDrive,
Scheduling,
SchedulingView
},
props:{
isAllShow:{
type:Boolean,
require:true
},
jl3dmodelShow:{
type:Boolean,
require:true
},
jl3dnameShow:{
type:Boolean,
require:true
},
cctvShow:{
type:Boolean,
require:true
},
scheduleLoadShow:{
type:Boolean,
require:true
},
driverShow:{
type:Boolean,
require:true
},
schedulePreviewShow:{
type:Boolean,
require:true
},
jlmap3dFaultShow:{
type:Boolean,
require:true
},
allStyle:{
type:String,
default() {
return '';
}
}
},
data() {
return {
hoverBtn: false,
btnWidth: 0,
group:'',
mapId:'',
deviceShow: false,
drivingShow: false,
jl3dpassflow:this.$t('display.demon.passengerflow'),
jl3dname: this.$t('display.demon.threeDimensionalView'),
jl3dmodel: this.$t('display.demon.deviceView')
};
},
computed:{
isDrive() {
return this.$route.query.prdType == '04';
},
project() {
return getSessionStorage('project');
}
},
mounted() {
this.group = this.$route.query.group;
this.mapId = this.$route.query.mapId;
},
methods:{
menuClick() {
this.hoverBtn = !this.hoverBtn;
if (this.hoverBtn) {
// this.$refs.button_group_box.$el.clientWidth ||
this.btnWidth = 500; //
} else {
// button_group_box
this.btnWidth = 0;
}
},
jumpjlmap3dmodel() {
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
},
showdriving() {
this.drivingShow = false;
},
jumpjlmap3d() {
const routeData = this.$router.resolve({
path:'/jlmap3d/sandbox',
query:{
mapid:this.mapId,
group:this.group,
token:getToken(),
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
jumpjl3dpassflow() {
const routeData = this.$router.resolve({
path:'/jlmap3d/passengerflow',
query:{
mapid:this.mapId,
group:this.group,
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
jumpjlmap3dFault() {
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainer',
query:{
mapid:this.mapId,
group:this.group,
token:getToken(),
project: this.project,
noPreLogout: true
}
});
this.openWindow = window.open(routeData.href);
},
jumpjlmap3dDriver() {
this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group);
},
jumpScheduling() {
this.$refs.scheduling.doShow();
},
schedulingView() {
this.$refs.schedulingView.doShow();
},
hideScheduling(running) {
if (running) {
this.$refs.scheduling && this.$refs.scheduling.doClose();
} else {
this.$refs.schedulingView && this.$refs.schedulingView.doClose();
}
}
}
};
</script>
<style lang="scss" scoped>
.display_top_draft{
position: absolute;
left: 5px;
top: 15px;
height: 32px;
overflow: hidden;
padding-left: 44px;
z-index: 35;
.btn_hover{
position: absolute;
left: 0;
top: 0;
z-index: 2;
color: #4e4d4d;
font-size: 14px;
background: #fff;
padding: 8px;
border-radius: 5px;
display: table;
cursor: pointer;
float: left;
height: 32px;
}
.button_group_box{
float: left;
transition: all 0.5s;
overflow: hidden;
margin-left: -700px;
// transform: translateX(0px);
}
}
</style>

View File

@ -1,66 +1,16 @@
<template> <template>
<div class="main" :style="{width: canvasWidth+'px'}"> <div class="main" :style="{width: canvasWidth+'px',height:'100%',position:'absolute',overflow:'hidden'}">
<template v-show="panelShow" :panelShow="panelShow"> <template>
<!-- v-show="panelShow" :panelShow="panelShow" -->
<transition name="el-zoom-in-bottom"> <transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" /> <map-system-draft ref="mapCanvas" @back="back" />
</transition> </transition>
<status-icon v-if="$route.query.lineCode == '11' || $route.query.lineCode == '10'" ref="statusIcon" /> <status-icon v-if="$route.query.lineCode == '11' || $route.query.lineCode == '10'" ref="statusIcon" />
<menu-demon <menu-demon v-if="isDemon" ref="menuDemon" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" />
v-if="isDemon" <!-- ok -->
ref="menuDemon" <menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" :tip-bottom="tipBottom" />
:offset="offset" <!-- ok -->
:offset-bottom="offsetBottom" <menu-exam v-if="isExam" ref="menuExam" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" />
:data-error="dataError"
:script-id="scriptId"
:show-station="showStation"
:text-status-height="textStatusHeight"
@hidepanel="hidepanel"
@passflow="passflow"
@quitQuest="quitQuest"
@jl3dstation="jl3dstation"
@devicemodel="devicemodel"
@showScheduling="showScheduling"
@schedulingView="schedulingView"
@hideScheduling="hideScheduling"
@switchStationMode="switchStationMode"
/>
<menu-lesson
v-if="isLesson"
ref="lessonMenu"
:offset="offset"
:data-error="dataError"
:offset-bottom="offsetBottom"
:tip-bottom="tipBottom"
:show-station="showStation"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchStationMode="switchStationMode"
/>
<menu-exam
v-if="isExam"
ref="menuExam"
:offset="offset"
:data-error="dataError"
:offset-bottom="offsetBottom"
:show-station="showStation"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchStationMode="switchStationMode"
/>
<menu-schema
v-if="isDemon || isScript"
ref="menuSchema"
:offset="offset"
:data-error="dataError"
:offset-bottom="offsetBottom"
:show-station="showStation"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchMode="switchMode"
@selectQuest="selectQuest"
@switchStationMode="switchStationMode"
/>
<menu-script <menu-script
v-if="isScript" v-if="isScript"
@ -70,7 +20,6 @@
:project="project" :project="project"
:text-status-height="textStatusHeight" :text-status-height="textStatusHeight"
:data-error="dataError" :data-error="dataError"
@script3ddriveshow="script3ddriveshow"
/> />
<menu-practice <menu-practice
@ -78,114 +27,66 @@
ref="menuPractice" ref="menuPractice"
:offset="offset" :offset="offset"
:offset-bottom="offsetBottom" :offset-bottom="offsetBottom"
:show-station="showStation"
:station-list="stationListMode"
:show-select-station="showSelectStation"
:data-error="dataError" :data-error="dataError"
@switchMode="switchMode"
@switchStationMode="switchStationMode"
/> />
<menu-train-list v-if="isDemon" @setCenter="setCenter" /> <!-- @showScheduling="showScheduling"
@schedulingView="schedulingView"
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" /> @hideScheduling="hideScheduling" -->
<!-- @devicemodel="devicemodel" -->
<!-- @jl3dstation="jl3dstation" -->
<!-- @quitQuest="quitQuest" -->
<!-- @passflow="passflow" -->
<!-- @hidepanel="hidepanel" -->
<!-- :is-script-run="isScriptRun" -->
</template> </template>
<Jl3d-Device <menu-train-list v-if="isDemon" @setCenter="setCenter" />
v-if="deviceShow" <menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
ref="Jl3dDevice"
:panel-show="deviceShow"
@closedevice3dview="devicemodel"
/>
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />
<scheduling-view v-if="isShowScheduling" ref="schedulingView" :group="group" />
</div> </div>
</template> </template>
<script> <script>
import { getSessionStorage } from '@/utils/auth';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { timeFormat } from '@/utils/date';
import MapSystemDraft from '@/views/newMap/mapsystemNew/index'; import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
import StatusIcon from '@/views/components/StatusIcon/statusIcon'; import StatusIcon from '@/views/components/StatusIcon/statusIcon';
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
import MenuExam from '@/views/newMap/displayNew/menuExam'; import MenuExam from '@/views/newMap/displayNew/menuExam';
import MenuLesson from '@/views/newMap/displayNew/menuLesson'; import MenuLesson from '@/views/newMap/displayNew/menuLesson';
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import MenuTrainList from '@/views/newMap/displayNew/menuTrainList'; import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import MenuScript from '@/views/newMap/displayNew/menuScript'; import MenuScript from '@/views/newMap/displayNew/menuScript';
import MenuPractice from '@/views/newMap/displayNew/menuPractice'; import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
//
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
import Scheduling from './demon/scheduling';
import SchedulingView from './demon/schedulingView';
import { clearSimulation, getSimulationInfoNew, getSimulationMemberList } from '@/api/simulation';
import { getTrainingDetailNew } from '@/api/jmap/training';
import { mapGetters } from 'vuex';
import { EventBus } from '@/scripts/event-bus';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { getToken } from '@/utils/auth';
import { loadNewMapDataByGroup } from '@/utils/loaddata'; import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { timeFormat } from '@/utils/date'; import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth';
export default { export default {
name: 'DisplayDraft', name: 'DisplayDraft',
components: { components: {
MapSystemDraft, MapSystemDraft,
MenuDemon,
StatusIcon, StatusIcon,
MenuSystemTime, MenuDemon,
MenuExam, MenuExam,
MenuLesson, MenuLesson,
MenuSchema, MenuSystemTime,
MenuTrainList, MenuTrainList,
MenuScript, MenuScript
MenuPractice,
// Jl3dSimulation,
Jl3dDrive,
Jl3dDevice,
Scheduling,
SchedulingView
}, },
data() { data() {
return { return {
panelShow: true,
drivingShow: false,
deviceShow: false,
// simulationShow: false,
offset: 15, offset: 15,
offsetBottom: 15, offsetBottom: 15,
tipBottom: 0, tipBottom: 0,
scriptId: 0, textStatusHeight: 0,
dataError: false,
group:'',
showStation: '',
stationListMode: [],
showSelectStation: false, // select
prdTypeMap: {
'01': '01', // =>
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
},
planRunning:false, planRunning:false,
textStatusHeight: 0 dataError: false,
group:''
}; };
}, },
computed:{ computed:{
...mapGetters([ ...mapGetters([
'canvasWidth' 'canvasWidth'
]), ]),
...mapGetters('map', [
'map',
'stationList'
]),
// ...mapGetters('training', [
// 'offsetStationCode'
// ]),
mode() { mode() {
return this.$route.params.mode; return this.$route.params.mode;
}, },
@ -201,54 +102,23 @@ export default {
isScript() { isScript() {
return this.mode === 'script'; return this.mode === 'script';
}, },
isPractice() {
return this.mode === 'practice';
},
mapId() {
return this.$route.query.mapId;
},
width() { width() {
return this.$store.state.app.width; return this.$store.state.app.width;
}, },
height() { height() {
return this.$store.state.app.height; return this.$store.state.app.height;
}, },
mapId() {
return this.$route.query.mapId;
},
prdType() {
return this.$route.query.prdType;
},
project() { project() {
return getSessionStorage('project'); return getSessionStorage('project');
},
isShowScheduling() {
return this.$route.query.prdType == '05';
},
isPractice() {
return this.mode === 'practice';
},
isDrive() {
return this.prdType == '04';
},
trainingId() {
return this.$route.query.trainingId;
}
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) { // menuBar
this.setPosition();
},
'$store.state.training.prdType': function (val) { //
this.setPosition();
this.setMode();
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
this.setPosition();
},
$route() {
this.initLoadData();
},
'$store.state.training.centerStationCode': function(code) {
if (code) {
this.showStation = code;
} }
}, },
watch:{
'$store.state.socket.permissionOver': function () { '$store.state.socket.permissionOver': function () {
this.$alert('用户权限已被收回', '提示', { this.$alert('用户权限已被收回', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -257,47 +127,49 @@ export default {
} }
}); });
}, },
'stationList': function () { '$store.state.config.menuBarLoadedCount': function (val) { // menuBar
!this.isExam && !this.isLesson && this.setStationList(); this.setPosition();
},
'$store.state.app.windowSizeCount': function() { //
this.setWindowSize();
this.setPosition();
},
'$store.state.training.prdType': function (val) { //
this.setPosition();
}, },
'$store.state.map.mapViewLoadedCount': function (val) { // '$store.state.map.mapViewLoadedCount': function (val) { //
if (this.planRunning) { if (this.planRunning) {
this.$store.dispatch('training/simulationStart'); this.$store.dispatch('training/simulationStart');
} }
this.isExam && this.$store.state.exam.deviceCode && this.setCenter(this.$store.state.exam.deviceCode);
!this.isExam && !this.isLesson && this.switchStationMode(this.showStation);
}
}, },
async mounted() { $route() {
this.group = this.$route.query.group; this.initLoadData();
this.setWindowSize(); }
await this.initLoadData();
this.setMode();
}, },
beforeDestroy() { beforeDestroy() {
this.quit(this.group); this.quit(this.group);
this.$store.dispatch('training/reset'); this.$store.dispatch('training/reset');
this.$store.dispatch('map/mapClear'); this.$store.dispatch('map/mapClear');
}, },
async mounted() {
this.group = this.$route.query.group;
this.setWindowSize();
this.initLoadData();
},
methods:{ methods:{
// //
async initLoadData() { endViewLoading(isSuccess) {
this.$store.dispatch('training/reset'); if (!isSuccess) {
try { this.$store.dispatch('map/mapClear');
await this.loadSimulationInfo();
if (this.isDemon) {
await this.initLoadDemonData();
} else if (this.isScript) {
await this.initLoadScriptData();
} else if (this.isPractice) {
await this.initPracticeData();
} else {
await this.initLoadLessonOrExamData();
}
} catch (error) {
this.$messageBox(`初始化失败: ${error.message}`);
this.endViewLoading();
} }
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
// 仿
quit(group) {
clearSimulation(group);
this.$store.dispatch('training/over');
}, },
// 仿退 // 仿退
async back() { async back() {
@ -311,219 +183,10 @@ export default {
await this.$refs.menuScript.back(); await this.$refs.menuScript.back();
} }
}, },
// 仿 setCenter(code) {
quit(group) { this.$jlmap.setCenter(code);
clearSimulation(group);
this.$store.dispatch('training/over');
}, },
// //
setWindowSize() {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
},
//
async initLoadScriptData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.switchMode('01');
if (this.mapId) {
await this.loadNewMapDataByGroup(this.group);
} else {
this.endViewLoading();
}
},
script3ddriveshow() {
this.panelShow = false;
this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group);
},
//
async initLoadLessonOrExamData() {
this.$store.dispatch('training/end', null);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (parseInt(this.trainingId)) {
//
//
const resp = await getTrainingDetailNew(this.trainingId);
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
if (resp && resp.code == 200) {
const detail = resp.data;
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
await this.loadNewMapDataByGroup(this.group);
} else {
this.$messageBox(`获取实训步骤数据失败`);
this.endViewLoading();
}
} else {
this.endViewLoading();
}
},
//
async initPracticeData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.switchMode('01');
if (parseInt(this.mapId)) {
await this.loadNewMapDataByGroup(this.group);
} else {
this.endViewLoading();
}
},
// 仿group仿
async loadSimulationInfo() {
getSimulationMemberList(this.$route.query.group).then(resp => { // 仿
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId: this.$store.state.user.id});
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
this.dataError = false;
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); //
this.scriptId = Number(resp.data.scriptId) || 0;
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.planRunning = resp.data.planRunning;
if (!this.planRunning) {
this.$store.dispatch('training/over');
}
if (this.isDemon) {
this.$refs.menuDemon.initPlannedDriving(this.planRunning); //
} else if (this.isScript) {
// this.$refs.menuScript.initPlannedDriving(resp.data.planRunning);
}
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;
this.$messageBox('此地图数据正在维护中,无法运行!');
}
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
switchMode(prdType) {
this.$store.dispatch('training/setPrdType', prdType); // prdType
},
setMode() {
if (this.map) {
this.showSelectStation = this.map.skinVO.code === '06' && this.$store.state.training.prdType === '01';
}
},
//
selectQuest(row) {
this.scriptId = parseInt(row.id);
if (this.isDemon) {
this.$refs.menuDemon.initLoadPage();
}
if (this.isScript) {
this.$refs.menuScript.initLoadPage();
}
},
// 仿
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]);
if (parseInt(this.mapId)) {
await this.loadNewMapDataByGroup(this.group);
} else {
this.endViewLoading();
}
},
// group
async loadNewMapDataByGroup(group) {
try {
await loadNewMapDataByGroup(group);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
// 退
async quitQuest() {
this.scriptId = 0;
},
hidepanel() {
if (this.isDrive) {
this.panelShow = false;
this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group);
} else {
const routeData = this.$router.resolve({
path:'/jlmap3d/sandbox',
query:{
mapid:this.mapId,
group:this.group,
token:getToken(),
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
}
},
passflow() {
const routeData = this.$router.resolve({
path:'/jlmap3d/passengerflow',
query:{
mapid:this.mapId,
group:this.group,
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
devicemodel() {
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
},
jl3dstation() {
const routeData = this.$router.resolve({
path:'/jlmap3d/jl3dstation',
query:{
mapid:this.mapId,
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
showScheduling() {
this.$refs.scheduling.doShow();
},
schedulingView() {
this.$refs.schedulingView.doShow();
},
hideScheduling(running) {
if (running) {
this.$refs.scheduling && this.$refs.scheduling.doClose();
} else {
this.$refs.schedulingView && this.$refs.schedulingView.doClose();
}
},
showdriving() {
this.panelShow = true;
this.drivingShow = false;
},
// showpanel() {
// this.panelShow = true;
// this.simulationShow = false;
// }
setPosition() { setPosition() {
this.$nextTick(() => { this.$nextTick(() => {
this.offset = 10; this.offset = 10;
@ -552,57 +215,60 @@ export default {
} }
}); });
}, },
setCenter(code) { //
this.$jlmap.setCenter(code); setWindowSize() {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
}, },
switchStationMode(val) { //
if (this.stationListMode.length > 0) { initLoadData() {
if (val == null) { this.$store.dispatch('training/reset');
this.showStation = this.stationListMode[0].value; this.loadSimulationInfo();
} else { this.loadMapData();
this.showStation = val; },
// 仿group仿
async loadSimulationInfo() {
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
this.dataError = false;
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); //
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.planRunning = resp.data.planRunning;
if (!this.planRunning) {
this.$store.dispatch('training/over');
} }
const nameList = Object.keys(this.$store.state.map.map); if (this.isDemon) {
let list = []; this.$refs.menuDemon.initPlannedDriving(this.planRunning); //
nameList.forEach(item => { } else if (this.isScript) {
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) { // this.$refs.menuScript.initPlannedDriving(resp.data.planRunning);
if (item === 'trainList') {
this.$store.state.map.map[item].forEach(elem => {
elem && list.push(elem);
});
} else {
list = [...list, ...this.$store.state.map.map[item]];
} }
} } else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
}); this.dataError = true;
this.$jlmap.updateShowStation(list, this.showStation); this.$messageBox('此地图数据正在维护中,无法运行!');
this.setCenter(this.showStation);
// this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation);
// this.$store.dispatch('map/setShowCentralizedStationNum');
} }
}, },
setStationList() { //
this.stationListMode = []; loadMapData() {
(this.stationList || []).forEach(item => { if (parseInt(this.mapId)) {
if (item.centralized) { this.loadNewMapDataByGroup(this.group);
this.stationListMode.push({value: item.code, name: item.name}); } else {
this.endViewLoading();
} }
}); },
if (this.stationListMode.length && this.showSelectStation) { // group
this.showStation = this.stationListMode[0].value; async loadNewMapDataByGroup(group) {
try {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
await loadNewMapDataByGroup(group);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
} }
} }
} }
}; };
</script> </script>
<style scoped lang="scss" rel="stylesheep/scss">
.main {
display: block;
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
}
</style>

View File

@ -1,32 +1,30 @@
<template> <template>
<div> <div>
<demon-chat ref="chatbox" :group="group" :user-role="userRole" /> <demon-chat ref="chatbox" :group="group" :user-role="userRole" :offset="offset" />
<div class="display-card" :style="{top: offset+'px'}"> <div class="display-card" :style="{top: offset+'px'}">
<el-row> <el-row>
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span> <span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
</el-row> </el-row>
</div> </div>
<div v-if="!dataError" class="display_top_draft" :style="{top: offset+textStatusHeight+'px'}"> <demon-menu
<div class="btn_hover" @click="menuClick">菜单</div> ref="demonMenu"
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`"> :is-all-show="!dataError"
<!-- 地图错误判断 --> :jl3dmodel-show="isShow3dmodel && !isShowScheduling"
<!-- 设备视图 --> :jl3dname-show="!isShowScheduling&&!isDrive"
<el-button v-if="isShow3dmodel && !isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button> :cctv-show="!isShowScheduling"
<!-- 三维视图 --> :schedule-load-show="isShowScheduling && !runing"
<el-button v-if="!isShowScheduling" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button> :schedule-preview-show="isShowScheduling && runing"
<!-- cctv视图 --> :jlmap3d-fault-show="false"
<el-button v-if="!isShowScheduling" size="small" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button> :driver-show="isDrive"
<!-- 排班计划 --> :all-style="'top:'+(offset+textStatusHeight)+'px'"
<el-button v-if="isShowScheduling && !runing" type="primary" size="small" @click="jumpScheduling">派班计划加载</el-button> />
<el-button v-if="isShowScheduling && runing" type="primary" size="small" @click="schedulingView">派班计划预览</el-button>
</el-button-group>
</div>
<div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}"> <div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}">
<el-button-group class="button-group-box"> <el-button-group class="button-group-box">
<el-button type="primary" size="small" @click="back">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button> <el-button type="primary" size="small" @click="back">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button>
<template v-if="!dataError"> <template v-if="!dataError">
<template v-if="isShowQuest"> <template v-if="isScriptRun">
<el-button v-if="!isDesignPlatform" type="danger" size="small" @click="handleQuitQuest">退出剧本</el-button> <el-button type="danger" size="small" @click="handleQuitQuest">退出剧本</el-button>
</template> </template>
<template v-else-if="!projectDevice"> <template v-else-if="!projectDevice">
<el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button> <el-button type="danger" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
@ -35,6 +33,21 @@
</template> </template>
</el-button-group> </el-button-group>
</div> </div>
<menu-schema
ref="menuSchema"
:offset="offset"
:data-error="dataError"
:offset-bottom="offsetBottom"
@selectQuest="selectQuest"
/>
<!-- :station-list="stationListMode"
:show-select-station="showSelectStation"
@selectQuest="selectQuest"
@switchStationMode="switchStationMode"
@switchMode="switchMode" -->
<set-time ref="setTime" @ConfirmSelectBeginTime="start" /> <set-time ref="setTime" @ConfirmSelectBeginTime="start" />
</div> </div>
@ -43,20 +56,27 @@
<!-- 单人仿真 --> <!-- 单人仿真 -->
<script> <script>
import SetTime from './demon/setTime'; import SetTime from './demon/setTime';
import DemonMenu from './demonMenu';
import DemonChat from './demonChat'; import DemonChat from './demonChat';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
import { getGoodsTryUse } from '@/api/management/goods'; import { getGoodsTryUse } from '@/api/management/goods';
import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation'; import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { PermissionType } from '@/scripts/ConstDic'; import { PermissionType } from '@/scripts/ConstDic';
import { getCountTime } from '@/utils/index'; import { getCountTime } from '@/utils/index';
import { TrainingMode } from '@/scripts/ConstDic';
import { quitScriptNew } from '@/api/simulation'; import { quitScriptNew } from '@/api/simulation';
import { setGoodsTryUse } from '@/api/management/goods'; import { setGoodsTryUse } from '@/api/management/goods';
import {loadScriptNew } from '@/api/simulation';
import Vue from 'vue';
export default { export default {
name: 'MenuDemon', name: 'MenuDemon',
components: { components: {
SetTime, SetTime,
DemonChat DemonChat,
MenuSchema,
DemonMenu
}, },
props: { props: {
offset: { offset: {
@ -67,18 +87,6 @@ export default {
type: Number, type: Number,
required: true required: true
}, },
scriptId: {
type: Number,
default() {
return 0;
}
},
showStation: {
type: String,
default() {
return '';
}
},
dataError: { dataError: {
type: Boolean, type: Boolean,
default() { default() {
@ -100,6 +108,7 @@ export default {
time: null, // time: null, //
countTime: 0, // countTime: 0, //
remainingTime: 0, remainingTime: 0,
userRole:'AUDIENCE',
goodsId: this.$route.query.goodsId, goodsId: this.$route.query.goodsId,
try: this.$route.query.try, // try: this.$route.query.try, //
training: { training: {
@ -107,43 +116,32 @@ export default {
name: '', name: '',
remarks: '' remarks: ''
}, },
isScriptRun:false,
jl3dpassflow:this.$t('display.demon.passengerflow'), jl3dpassflow:this.$t('display.demon.passengerflow'),
jl3dname: this.$t('display.demon.threeDimensionalView'), jl3dname: this.$t('display.demon.threeDimensionalView'),
jl3dstation: this.$t('display.demon.threeDimensionalStation'), jl3dstation: this.$t('display.demon.threeDimensionalStation'),
jl3dmodel: this.$t('display.demon.deviceView'), jl3dmodel: this.$t('display.demon.deviceView'),
isShow3dmodel :false, isShow3dmodel :false,
isGoback: false, isGoback: false,
hoverBtn: false, runing:false,
btnWidth: 0, prdTypeMap: {
runing:false '01': '01', // =>
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
}
}; };
}, },
computed: { computed: {
isShowQuest() {
return this.scriptId;
},
isShowScheduling() { isShowScheduling() {
return this.$route.query.prdType == '05'; return this.$route.query.prdType == '05';
}, },
isDesignPlatform() { isDrive() {
return this.$route.fullPath.includes('design/display/demon'); return this.$route.query.prdType == '04';
}, },
group() { group() {
return this.$route.query.group; return this.$route.query.group;
}, },
userRole() {
if (this.$route.query.prdType == '02') {
return 'DISPATCHER';
} else if (this.$route.query.prdType == '01') {
return 'STATION_SUPERVISOR';
} else if (this.$route.query.prdType == '04') {
return 'DRIVER';
} else if (this.$route.query.prdType == '05') {
return 'DEPOT_DISPATCHER';
} else {
return 'AUDIENCE';
}
},
projectDevice() { projectDevice() {
return this.$route.query.projectDevice; return this.$route.query.projectDevice;
} }
@ -174,6 +172,20 @@ export default {
this.setRuning(false); this.setRuning(false);
} }
}, },
created() {
this.$store.dispatch('training/setPrdType', this.$route.query.prdType);
if (this.$store.state.training.prdType == '02') {
this.userRole = 'DISPATCHER';
} else if (this.$store.state.training.prdType == '01') {
this.userRole = 'STATION_SUPERVISOR';
} else if (this.$store.state.training.prdType == '04') {
this.userRole = 'DRIVER';
} else if (this.$store.state.training.prdType == '05') {
this.userRole = 'DEPOT_DISPATCHER';
} else {
this.userRole = 'AUDIENCE';
}
},
beforeDestroy() { beforeDestroy() {
if (this.time) { if (this.time) {
this.setTryTime(); this.setTryTime();
@ -183,8 +195,10 @@ export default {
this.$store.dispatch('map/resetActiveTrainList', true); this.$store.dispatch('map/resetActiveTrainList', true);
}, },
mounted() { mounted() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.$route.query.prdType]);
this.$nextTick(() => { this.$nextTick(() => {
this.menuClick(); this.$refs.demonMenu.menuClick();
}); });
}, },
methods: { methods: {
@ -193,7 +207,6 @@ export default {
if (this.try != '0') { if (this.try != '0') {
this.loadInitData(); this.loadInitData();
} }
this.change3dname();
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
@ -238,9 +251,6 @@ export default {
this.$store.dispatch('training/simulationStart').then(() => { this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)); this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
this.$store.dispatch('map/setShowCentralizedStationNum'); this.$store.dispatch('map/setShowCentralizedStationNum');
if (this.$route.query.lineCode == '06') {
this.$emit('switchStationMode', this.showStation); // 线
}
}); });
}).catch(error => { }).catch(error => {
this.isDisable = false; this.isDisable = false;
@ -271,7 +281,7 @@ export default {
}, },
setRuning(run) { setRuning(run) {
this.runing = run; this.runing = run;
this.$emit('hideScheduling', run); this.$refs.demonMenu.hideScheduling(run);
}, },
end() { end() {
this.isDisable = false; this.isDisable = false;
@ -302,8 +312,71 @@ export default {
this.$messageBox(this.$t('display.demon.exitTaskFail')); this.$messageBox(this.$t('display.demon.exitTaskFail'));
}); });
}, },
//
async selectQuest({row, id, mapLocation, roleName}) {
try {
let userRole = 'AUDIENCE';
if (id) {
this.$store.dispatch('training/setPrdType', this.$route.query.prdType);
if (this.$route.query.prdType) {
if (this.$route.query.prdType == '02') {
userRole = 'DISPATCHER';
} else if (this.$route.query.prdType == '01') {
userRole = 'STATION_SUPERVISOR';
} else if (this.$route.query.prdType == '04') {
userRole = 'DRIVER';
} else if (this.$route.query.prdType == '05') {
userRole = 'DEPOT_DISPATCHER';
} else {
userRole = 'AUDIENCE';
}
}
this.$store.dispatch('training/setRoles', userRole);
} else {
this.$store.dispatch('training/setRoles', 'AUDIENCE');
this.$store.dispatch('training/setPrdType', '');
}
this.userRole = userRole;
this.$store.dispatch('scriptRecord/updateBgSet', true);
this.$refs.chatbox.setMembers(id);
const res = await loadScriptNew(row.id, id, this.group);
if (res && res.code == 200) {
if (mapLocation) {
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
this.isScriptRun = true;
// this.initLoadPage();
}
} catch (error) {
this.$messageBox(error.message);
}
// if (this.isScript) {
// this.$refs.menuScript.initLoadPage();
// }
},
quitQuest() { quitQuest() {
this.$emit('quitQuest'); this.isScriptRun = false;
let userRole = '';
if (this.$route.query.prdType) {
if (this.$route.query.prdType == '02') {
userRole = 'DISPATCHER';
} else if (this.$route.query.prdType == '01') {
userRole = 'STATION_SUPERVISOR';
} else if (this.$route.query.prdType == '04') {
userRole = 'DRIVER';
} else if (this.$route.query.prdType == '05') {
userRole = 'DEPOT_DISPATCHER';
} else {
userRole = 'AUDIENCE';
}
}
this.userRole = userRole;
this.$refs.chatbox.setMembers(this.$store.state.training.orignalUserRoleId);
this.$refs.chatbox.clearAllData();
console.log(this.userRole, '11111111');
this.$store.dispatch('training/setPrdType', this.$route.query.prdType);
this.$store.dispatch('training/setRoles', userRole);
this.$store.dispatch('scriptRecord/updateSimulationPause', false); this.$store.dispatch('scriptRecord/updateSimulationPause', false);
}, },
clearAllData() { clearAllData() {
@ -327,24 +400,6 @@ export default {
} }
}, },
jumpjl3dpassflow() {
this.$emit('passflow');
},
// jumpjl3dstation() {
// this.$emit('jl3dstation');
// },
jumpjlmap3d() {
this.$emit('hidepanel');
},
jumpjlmap3dmodel() {
this.$emit('devicemodel');
},
jumpScheduling() {
this.$emit('showScheduling');
},
schedulingView() {
this.$emit('schedulingView');
},
setTryTime() { setTryTime() {
if (this.try) { if (this.try) {
const data = { time: this.tryTime, goodsId: this.goodsId }; const data = { time: this.tryTime, goodsId: this.goodsId };
@ -353,24 +408,6 @@ export default {
} }
} }
},
change3dname() {
if (this.$route.query.prdType == '04') {
this.jl3dname = this.$t('display.demon.driverPerspective'); //
} else {
this.jl3dname = this.$t('display.demon.threeDimensionalView'); //
this.isShow3dmodel = true;
}
},
menuClick() {
this.hoverBtn = !this.hoverBtn;
if (this.hoverBtn) {
// this.$refs.button_group_box.$el.clientWidth ||
this.btnWidth = 500; //
} else {
// button_group_box
this.btnWidth = 0;
}
} }
} }
}; };
@ -436,35 +473,4 @@ export default {
} }
} }
.display_top_draft{
position: absolute;
left: 5px;
top: 15px;
height: 32px;
overflow: hidden;
padding-left: 44px;
z-index: 35;
.btn_hover{
position: absolute;
left: 0;
top: 0;
z-index: 2;
color: #4e4d4d;
font-size: 14px;
background: #fff;
padding: 8px;
border-radius: 5px;
display: table;
cursor: pointer;
float: left;
height: 32px;
}
.button_group_box{
float: left;
transition: all 0.5s;
overflow: hidden;
margin-left: -700px;
// transform: translateX(0px);
}
}
</style> </style>

View File

@ -3,9 +3,6 @@
<div class="display-card" :style="{top: offset + 'px'}"> <div class="display-card" :style="{top: offset + 'px'}">
<el-row style="vertical-align:middle; "> <el-row style="vertical-align:middle; ">
<span class="display-time">{{ formatUsedTime }}</span> <span class="display-time">{{ formatUsedTime }}</span>
<!--<el-select v-if="showSelectStation" v-model="showStation" style="width: 100px;position: fixed; right: 10px;" size="small" @change="switchStationMode">-->
<!--<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />-->
<!--</el-select>-->
</el-row> </el-row>
</div> </div>
<div class="display-draft" :style="{bottom: offsetBottom + 'px'}"> <div class="display-draft" :style="{bottom: offsetBottom + 'px'}">
@ -20,6 +17,7 @@
</template> </template>
<script> <script>
import { getTrainingDetailNew } from '@/api/jmap/training';
import TipExamList from './tipExamList'; import TipExamList from './tipExamList';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
import { startTrainingNew } from '@/api/jmap/training'; import { startTrainingNew } from '@/api/jmap/training';
@ -41,24 +39,6 @@ export default {
type: Number, type: Number,
required: true required: true
}, },
showSelectStation: {
type: Boolean,
default() {
return false;
}
},
stationList: {
type: Array,
default() {
return [];
}
},
showStation: {
type: String,
default() {
return '';
}
},
dataError: { dataError: {
type: Boolean, type: Boolean,
default() { default() {
@ -74,6 +54,12 @@ export default {
id: '', id: '',
name: '', name: '',
remarks: '' remarks: ''
},
prdTypeMap: {
'01': '01', // =>
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
} }
}; };
}, },
@ -88,8 +74,14 @@ export default {
watch: { watch: {
'$store.state.map.mapViewLoadedCount': function() { '$store.state.map.mapViewLoadedCount': function() {
this.$store.dispatch('exam/countUsedTime'); this.$store.dispatch('exam/countUsedTime');
},
$route() {
this.initData();
} }
}, },
mounted() {
this.initData();
},
methods: { methods: {
tipInfo(opt) { tipInfo(opt) {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) { if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
@ -181,8 +173,30 @@ export default {
this.isDisable = false; this.isDisable = false;
this.$store.dispatch('training/end', null); this.$store.dispatch('training/end', null);
}, },
switchStationMode(val) { //
this.$emit('switchStationMode', val); async initData() {
this.$store.dispatch('training/end', null);
if (parseInt(this.$route.query.trainingId)) {
//
//
const resp = await getTrainingDetailNew(this.$route.query.trainingId);
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
if (resp && resp.code == 200) {
const detail = resp.data;
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
} else {
this.$messageBox(`获取实训步骤数据失败`);
this.endViewLoading();
}
} else {
this.endViewLoading();
}
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
} }
} }
}; };
@ -194,8 +208,7 @@ export default {
z-index: 9; z-index: 9;
display: inline; display: inline;
position: absolute; position: absolute;
// float: left; left: 10px;
left: 160px;
} }
.display-time { .display-time {

View File

@ -9,9 +9,6 @@
</el-radio-group> </el-radio-group>
<span class="display-time">{{ formatUsedTime }}</span> <span class="display-time">{{ formatUsedTime }}</span>
<span v-if="demoMode === TrainingMode.TEST" class="display-score">{{ $t('display.lesson.score') }}{{ formatScore }}</span> <span v-if="demoMode === TrainingMode.TEST" class="display-score">{{ $t('display.lesson.score') }}{{ formatScore }}</span>
<el-select v-if="showSelectStation" v-model="showStation" style="width: 100px; position: fixed; right: 10px;" size="small" @change="switchStationMode">
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-row> </el-row>
</div> </div>
<div id="teachGroupButton" class="display-draft" :style="{bottom: offsetBottom + 'px'}"> <div id="teachGroupButton" class="display-draft" :style="{bottom: offsetBottom + 'px'}">
@ -27,6 +24,7 @@
</template> </template>
<script> <script>
import { getTrainingDetailNew } from '@/api/jmap/training';
import TipTrainingDetail from './tipTrainingDetail'; import TipTrainingDetail from './tipTrainingDetail';
import LeftSlider from '@/views/newMap/displayNew/LeftSlider'; import LeftSlider from '@/views/newMap/displayNew/LeftSlider';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
@ -56,24 +54,6 @@ export default {
type: Number, type: Number,
default: 0 default: 0
}, },
showSelectStation: {
type: Boolean,
default() {
return false;
}
},
stationList: {
type: Array,
default() {
return [];
}
},
showStation: {
type: String,
default() {
return '';
}
},
dataError: { dataError: {
type: Boolean, type: Boolean,
default() { default() {
@ -89,7 +69,13 @@ export default {
demoMode: TrainingMode.TEACH, demoMode: TrainingMode.TEACH,
isDisable: false, isDisable: false,
backDisable: false, backDisable: false,
startLoading: false startLoading: false,
prdTypeMap: {
'01': '01', // =>
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
}
}; };
}, },
computed: { computed: {
@ -110,6 +96,9 @@ export default {
}, },
isShowLeftSlider() { isShowLeftSlider() {
return this.$route.query.lessonId != '0'; return this.$route.query.lessonId != '0';
},
prdType() {
return this.$route.query.prdType;
} }
}, },
watch: { watch: {
@ -119,7 +108,6 @@ export default {
this.$store.dispatch('training/setStopCountTime'); this.$store.dispatch('training/setStopCountTime');
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('menuOperation/setButtonOperation', null); this.$store.dispatch('menuOperation/setButtonOperation', null);
this.isDisable = false; this.isDisable = false;
}, },
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
@ -142,6 +130,9 @@ export default {
this.tipInfo({ color: val.color, message: val.errMsg }); this.tipInfo({ color: val.color, message: val.errMsg });
} }
}, },
mounted() {
this.initData();
},
methods: { methods: {
tipInfo(opt) { tipInfo(opt) {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) { if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
@ -169,7 +160,7 @@ export default {
this.isDisable = true; this.isDisable = true;
startTrainingNew(this.trainingObj, this.group).then(response => { startTrainingNew(this.trainingObj, this.group).then(response => {
this.$store.dispatch('map/clearJlmapTrainView').then(() => { this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/teachModeStart'); this.$store.dispatch('training/teachModeStart', this.demoMode);
this.$store.dispatch('training/countTime', 'Lesson'); // this.$store.dispatch('training/countTime', 'Lesson'); //
this.$store.dispatch('training/setMapDefaultState').then(() => { this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
@ -194,10 +185,10 @@ export default {
lessonId: this.$route.query.lessonId, lessonId: this.$route.query.lessonId,
usedTime: this.usedTime usedTime: this.usedTime
}; };
endTrainingNew(mode, this.group).then(response => { endTrainingNew(mode, this.group).then(response => {
const data = response.data; const data = response.data;
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/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}).catch(() => { }).catch(() => {
@ -238,9 +229,7 @@ export default {
} }
}, },
back() { back() {
this.$emit('quit');
Notification.closeAll(); Notification.closeAll();
if (this.$route.params.mode == 'record') { if (this.$route.params.mode == 'record') {
/** 如果是演示返回时,需要重新创建仿真*/ /** 如果是演示返回时,需要重新创建仿真*/
trainingNotifyNew({ trainingId: this.$route.query.trainingId }).then(resp => { trainingNotifyNew({ trainingId: this.$route.query.trainingId }).then(resp => {
@ -252,8 +241,30 @@ export default {
history.go(-1); history.go(-1);
} }
}, },
switchStationMode(val) { //
this.$emit('switchStationMode', val); async initData() {
this.$store.dispatch('training/end', null);
if (parseInt(this.$route.query.trainingId)) {
//
//
const resp = await getTrainingDetailNew(this.$route.query.trainingId);
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
if (resp && resp.code == 200) {
const detail = resp.data;
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
} else {
this.$messageBox(`获取实训步骤数据失败`);
this.endViewLoading();
}
} else {
this.endViewLoading();
}
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
} }
} }
}; };

View File

@ -4,9 +4,7 @@
<el-select v-model="swch" size="small" :placeholder="$t('display.schema.selectProduct')" @change="switchMode"> <el-select v-model="swch" size="small" :placeholder="$t('display.schema.selectProduct')" @change="switchMode">
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" /> <el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" />
</el-select> </el-select>
<el-select v-if="showSelectStation&&swch=='01'" v-model="showStationContent" style="width: 100px;" size="small" @change="switchStationModeInfo"> <select-station ref="selectStation" :style-css="'width: 100px;'" />
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</div> </div>
<div class="practice-bottom" :style="{bottom: offsetBottom + 'px'}"> <div class="practice-bottom" :style="{bottom: offsetBottom + 'px'}">
<el-button-group> <el-button-group>
@ -19,13 +17,16 @@
</div> </div>
</template> </template>
<script> <script>
import SelectStation from './selectStation';
import { TrainingMode } from '@/scripts/ConstDic';
import SetTime from '@/views/newMap/displayNew/demon/setTime'; import SetTime from '@/views/newMap/displayNew/demon/setTime';
import { ranAsPlan, exitRunPlan } from '@/api/simulation'; import { ranAsPlan, exitRunPlan } from '@/api/simulation';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
export default { export default {
name: 'MenuPractice', name: 'MenuPractice',
components:{ components:{
SetTime SetTime,
SelectStation
}, },
props: { props: {
offset: { offset: {
@ -41,24 +42,6 @@ export default {
default() { default() {
return false; return false;
} }
},
showSelectStation: {
type: Boolean,
default() {
return false;
}
},
showStation: {
type: String,
default() {
return '';
}
},
stationList: {
type: Array,
default() {
return [];
}
} }
}, },
data() { data() {
@ -128,7 +111,7 @@ export default {
}); });
}, },
switchMode(swch) { switchMode(swch) {
this.$emit('switchMode', swch); this.$store.dispatch('training/setPrdType', swch); // prdType
this.switchModeInner(swch); this.switchModeInner(swch);
}, },
switchModeInner(swch) { switchModeInner(swch) {
@ -149,18 +132,6 @@ export default {
} }
}); });
this.$jlmap.updateShowMode(list, showMode); this.$jlmap.updateShowMode(list, showMode);
if (swch == '02') {
this.switchStationMode('');
} else {
this.switchStationMode(null);
}
},
switchStationModeInfo(val) {
this.showStationContent = val;
this.$emit('switchStationMode', val);
},
switchStationMode(val) {
this.$emit('switchStationMode', val);
}, },
end() { end() {
this.isDisable = false; this.isDisable = false;
@ -175,6 +146,17 @@ export default {
this.isDisable = true; this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail')); this.$messageBox(this.$t('display.demon.endSimulationFail'));
}); });
},
//
async initData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/setPrdType', '01'); // prdType
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
} }
} }
}; };

View File

@ -1,9 +1,7 @@
<template> <template>
<div> <div>
<div class="schema" :style="{top: offset+'px'}"> <div class="schema" :style="{top: offset+'px'}">
<el-select v-if="showSelectStation && isLocalStation && !isScript" v-model="showStationContent" style="width: 100px;" size="small" @change="switchStationModeInfo"> <select-station v-if="isLocalStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" />
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<template v-if="!dataError"> <template v-if="!dataError">
<el-button-group> <el-button-group>
<el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编辑</el-button> <el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编辑</el-button>
@ -27,6 +25,7 @@
</div> </div>
</template> </template>
<script> <script>
import SelectStation from './selectStation';
import RunPlanLoad from './demon/runPlanLoad'; import RunPlanLoad from './demon/runPlanLoad';
import RunPlanView from './demon/runPlanView'; import RunPlanView from './demon/runPlanView';
import FaultChoose from './demon/faultChoose'; import FaultChoose from './demon/faultChoose';
@ -34,8 +33,7 @@ import AddQuest from './demon/addQuest';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { getByGroupStationList } from '@/api/jmap/map'; import { getByGroupStationList } from '@/api/jmap/map';
import RunPlanEdit from './demon/runPlanEdit'; import RunPlanEdit from './demon/runPlanEdit';
import { getEveryDayRunPlanNew, loadScriptNew } from '@/api/simulation'; import { getEveryDayRunPlanNew } from '@/api/simulation';
import Vue from 'vue';
// //
export default { export default {
@ -45,31 +43,14 @@ export default {
RunPlanView, RunPlanView,
FaultChoose, FaultChoose,
AddQuest, AddQuest,
RunPlanEdit RunPlanEdit,
SelectStation
}, },
props: { props: {
offset: { offset: {
type: Number, type: Number,
required: true required: true
}, },
showSelectStation: {
type: Boolean,
default() {
return false;
}
},
stationList: {
type: Array,
default() {
return [];
}
},
showStation: {
type: String,
default() {
return '';
}
},
dataError: { dataError: {
type: Boolean, type: Boolean,
default() { default() {
@ -83,7 +64,6 @@ export default {
OperateMode: OperateMode, OperateMode: OperateMode,
viewDisabled: true, viewDisabled: true,
swch: '02', swch: '02',
showStationContent:'',
isScriptCommand:false, isScriptCommand:false,
faultMode: false, faultMode: false,
firstLoad: true firstLoad: true
@ -143,9 +123,6 @@ export default {
if (val == '01') { this.switchModeInner('01'); } else { this.switchModeInner('02'); } if (val == '01') { this.switchModeInner('01'); } else { this.switchModeInner('02'); }
} }
}, },
async mounted() {
// await this.loadRunData();
},
methods: { methods: {
loadRunData() { loadRunData() {
this.$store.dispatch('runPlan/clear').then(() => { this.$store.dispatch('runPlan/clear').then(() => {
@ -201,21 +178,8 @@ export default {
viewRunQuest() { viewRunQuest() {
this.$refs.addQuest.doShow(); this.$refs.addQuest.doShow();
}, },
async selectQuest(row, id, mapLocation, roleName) { selectQuest(row, id, mapLocation, roleName) {
try { this.$emit('selectQuest', {row, id, mapLocation, roleName});
const res = await loadScriptNew(row.id, id, this.group);
if (res && res.code == 200) {
this.questId = parseInt(row.id);
if (mapLocation) {
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
}
this.$emit('selectQuest', {row, roleName, id});
this.$store.dispatch('scriptRecord/updateBgSet', true);
} catch (error) {
this.$messageBox(error.message);
}
}, },
switchModeInner(swch) { switchModeInner(swch) {
let showMode = '03'; let showMode = '03';
@ -241,10 +205,6 @@ export default {
} }
this.$jlmap.updateShowMode(list, showMode); // this.$jlmap.updateShowMode(list, showMode); //
}, },
switchStationModeInfo(val) {
this.showStationContent = val;
this.$emit('switchStationMode', val);
},
runPlanEditShow() { runPlanEditShow() {
this.$refs.runPlanEdit.doShow(); this.$refs.runPlanEdit.doShow();
} }

View File

@ -7,22 +7,26 @@
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button> <el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<div v-if="!dataError" class="display_top_draft" :style="{top: offset+textStatusHeight+'px'}"> <demon-menu
<div class="btn_hover" @click="menuClick">菜单</div> ref="demonMenu"
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`"> :is-all-show="!dataError"
<!-- 地图错误判断 --> :jl3dmodel-show="false"
<!-- 设备视图 --> :jl3dname-show="!isShowScheduling&&!isDriver"
<!-- <el-button v-if="isShow3dmodel && !isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button> --> :cctv-show="false"
<!-- 三维视图 --> :schedule-load-show="false"
<el-button v-if="!isShowScheduling&&!isDriver" size="small" @click="jumpjlmap3d">{{ $t('display.demon.threeDimensionalView') }}</el-button> :schedule-preview-show="false"
<!-- 故障设备视图 --> :jlmap3d-fault-show="isStation"
<el-button v-if="isStation" size="small" @click="jumpjlmap3dFault">故障设备</el-button> :driver-show="isDriver"
<!-- cctv视图 --> :all-style="'top:'+(offset+textStatusHeight)+'px'"
<!-- <el-button v-if="!isShowScheduling" size="small" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button> --> />
<!-- 司机视角 -->
<el-button v-if="isDriver" size="small" type="jumpjlmap3d" @click="jumpjlmap3dDriver">{{ $t('joinTraining.driverPerspective') }}</el-button> <menu-schema
</el-button-group> ref="menuSchema"
</div> :offset="offset"
:data-error="dataError"
:offset-bottom="offsetBottom"
/>
<script-chat ref="chatbox" :group="group" :user-role="userRole" /> <script-chat ref="chatbox" :group="group" :user-role="userRole" />
<set-time ref="setTime" @ConfirmSelectBeginTime="start" /> <set-time ref="setTime" @ConfirmSelectBeginTime="start" />
<tip-script-record-new ref="tipTaskRecordNew" :group="group" :offset-bottom="offsetBottom" :offset="offset" /> <tip-script-record-new ref="tipTaskRecordNew" :group="group" :offset-bottom="offsetBottom" :offset="offset" />
@ -31,7 +35,9 @@
<!-- 单人仿真 --> <!-- 单人仿真 -->
<script> <script>
import { getToken } from '@/utils/auth'; import { TrainingMode } from '@/scripts/ConstDic';
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
import DemonMenu from './demonMenu';
import ScriptChat from './scriptChat'; import ScriptChat from './scriptChat';
import TipScriptRecordNew from '@/views/scriptManage/tipScriptRecord'; import TipScriptRecordNew from '@/views/scriptManage/tipScriptRecord';
import SetTime from './demon/setTime'; import SetTime from './demon/setTime';
@ -44,6 +50,8 @@ export default {
components: { components: {
SetTime, SetTime,
ScriptChat, ScriptChat,
MenuSchema,
DemonMenu,
TipScriptRecordNew TipScriptRecordNew
}, },
props: { props: {
@ -77,9 +85,7 @@ export default {
data() { data() {
return { return {
isDisable: false, isDisable: false,
isScriptCommand:false, isScriptCommand:false
hoverBtn: false,
btnWidth: 0
}; };
}, },
@ -119,8 +125,10 @@ export default {
// if (!this.isScriptCommand) { // if (!this.isScriptCommand) {
// this.$store.dispatch('training/setPrdType', '02'); // this.$store.dispatch('training/setPrdType', '02');
// } // }
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/setPrdType', '01');
this.$nextTick(() => { this.$nextTick(() => {
this.menuClick(); this.$refs.demonMenu.menuClick();
}); });
}, },
methods: { methods: {
@ -133,16 +141,6 @@ export default {
resetBeginTime() { resetBeginTime() {
this.isDisable = false; this.isDisable = false;
}, },
menuClick() {
this.hoverBtn = !this.hoverBtn;
if (this.hoverBtn) {
// this.$refs.button_group_box.$el.clientWidth ||
this.btnWidth = 500; //
} else {
// button_group_box
this.btnWidth = 0;
}
},
start(model) { start(model) {
this.isDisable = true; this.isDisable = true;
const data = { const data = {
@ -198,35 +196,6 @@ export default {
history.go(-1); history.go(-1);
Notification.closeAll(); Notification.closeAll();
}); });
},
jumpjlmap3dDriver() {
this.$emit('script3ddriveshow');
},
jumpjlmap3d() {
const routeData = this.$router.resolve({
path:'/jlmap3d/sandbox',
query:{
mapid:this.$route.query.mapId,
group:this.group,
token:getToken(),
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
jumpjlmap3dFault() {
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainer',
query:{
mapid:this.$route.query.mapId,
group:this.group,
token:getToken(),
project: this.project,
noPreLogout: true
}
});
this.openWindow = window.open(routeData.href);
} }
} }
}; };

View File

@ -87,14 +87,16 @@ export default {
member.disabled = false; member.disabled = false;
} else { } else {
member.disabled = true; member.disabled = true;
member.userName = this.$store.state.user.nickname;
} }
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name; const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) { if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) { if (device) {
if (device._type == 'Train') { if (device._type == 'Train') {
member.label = member.type + device.groupNumber + name; member.deviceName = device.deviceCode;
member.deviceName = member.deviceCode; member.label = member.type + device.groupNumber + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
if (this.activeTrainList.length > 0) { if (this.activeTrainList.length > 0) {
if (this.activeTrainList.includes(member.deviceCode)) { if (this.activeTrainList.includes(member.deviceCode)) {
@ -105,7 +107,7 @@ export default {
} }
} else { } else {
member.deviceName = device.name; member.deviceName = device.name;
member.label = member.type + device.name + name; member.label = member.type + device.name + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
if (device._type == 'Station') { if (device._type == 'Station') {
stationSupervisorList.push(member); stationSupervisorList.push(member);
@ -113,11 +115,12 @@ export default {
} }
} else { } else {
member.deviceName = member.deviceCode; member.deviceName = member.deviceCode;
member.label = member.type + member.deviceCode + name; member.label = member.type + member.deviceCode + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
} }
} else { } else {
member.label = member.type + name; member.label = member.type + name + userName;
member.deviceName = '';
if (member.type == '行调') { if (member.type == '行调') {
dispatcherList.push(member); dispatcherList.push(member);
} else if (member.type == '通号') { } else if (member.type == '通号') {
@ -160,6 +163,14 @@ export default {
this.$messageBox('获取仿真成员列表失败!'); this.$messageBox('获取仿真成员列表失败!');
}); });
}, },
'$store.state.training.addMemberInScript':function(val, oldval) {
this.memberData.push(val);
const roleList = ['行调', '车站值班员', '司机', '通号', '车辆段'];
const roleIndex = roleList.indexOf(val.type);
if (roleIndex >= 0) {
this.treeData[roleIndex].children.push(val);
}
},
'userRole':function(val, oldval) { 'userRole':function(val, oldval) {
// //
this.changeRole(oldval, val); this.changeRole(oldval, val);

View File

@ -28,11 +28,18 @@ export default {
this.scriptTipMessage = '请说:' + val.content; this.scriptTipMessage = '请说:' + val.content;
} else if (val.type == 'Operation') { } else if (val.type == 'Operation') {
const commandName = val.operationType; const commandName = val.operationType;
let operateName = {};
if (commandName == 'Set_Fault') {
operateName.label = '设置故障';
} else if (commandName == 'Cancel_Fault') {
operateName.label = '取消故障';
} else {
let device = val.operationType.split('_')[0]; let device = val.operationType.split('_')[0];
if (device == 'CM') { if (device == 'CM') {
device = 'ControlConvertMenu'; device = 'ControlConvertMenu';
} }
const operateName = Object.values(CMD[device]).find(res=>{ return res.value == commandName; }); operateName = Object.values(CMD[device]).find(res=>{ return res.value == commandName; });
}
this.scriptTipMessage = '请执行【' + operateName.label + '】操作'; this.scriptTipMessage = '请执行【' + operateName.label + '】操作';
} else if (val.type == 'Over_Conversation') { } else if (val.type == 'Over_Conversation') {
this.scriptTipMessage = '请结束当前会话'; this.scriptTipMessage = '请结束当前会话';

View File

@ -7,6 +7,7 @@
<script-button-group <script-button-group
ref="scriptButtonGroup" ref="scriptButtonGroup"
:offset="offset" :offset="offset"
:text-status-height="textStatusHeight"
:group="group" :group="group"
@viewScriptRoles="viewScriptRoles" @viewScriptRoles="viewScriptRoles"
@viewRunPlan="viewRunPlan" @viewRunPlan="viewRunPlan"
@ -36,7 +37,7 @@ import { getToken } from '@/utils/auth';
import RunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad'; import RunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
import RunPlanView from '@/views/newMap/displayNew/demon/runPlanView'; import RunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
import SelectRole from './selectRole'; import SelectRole from '../component/selectRole';
import ScriptPreviewChat from './scriptPreviewChat.vue'; import ScriptPreviewChat from './scriptPreviewChat.vue';
import MapSystemDraft from '@/views/newMap/mapsystemNew/index'; import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import ScriptButtonGroup from './scriptButtonGroup'; import ScriptButtonGroup from './scriptButtonGroup';
@ -69,6 +70,7 @@ export default {
trainingObj: {}, trainingObj: {},
timeDemonNum: 0, timeDemonNum: 0,
offset: 15, offset: 15,
textStatusHeight: 0,
panelShow: true, panelShow: true,
memberData:[], memberData:[],
mapLocation:{}, mapLocation:{},
@ -196,13 +198,31 @@ export default {
this.memberData.map(member=>{ this.memberData.map(member=>{
if (member.id == role.id) { if (member.id == role.id) {
member.userId = this.$store.state.user.id; member.userId = this.$store.state.user.id;
member.name = this.$store.state.user.nickname; member.userName = this.$store.state.user.nickname;
member.disabled = true; member.disabled = true;
} else {
member.userId = '';
member.userName = '';
member.disabled = false;
} }
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name;
member.label = member.type + member.deviceName + name + userName;
}); });
} else { } else {
this.userRole = 'AUDIENCE'; this.userRole = 'AUDIENCE';
this.$store.dispatch('training/setRoles', 'AUDIENCE');
this.memberData.map(member=>{
if (member.userId) {
member.userId = '';
member.userName = '';
member.disabled = false;
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name;
member.label = member.type + member.deviceName + name + userName;
}
});
this.switchMode(''); this.switchMode('');
} }
} catch (error) { } catch (error) {
@ -214,6 +234,11 @@ export default {
const menuBar = document.getElementById('menuBar'); const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool'); const menuTool = document.getElementById('menuTool');
this.offset = 15 + (menuBar ? menuBar.offsetHeight || 0 : 0) + (menuTool ? menuTool.offsetHeight || 0 : 0); this.offset = 15 + (menuBar ? menuBar.offsetHeight || 0 : 0) + (menuTool ? menuTool.offsetHeight || 0 : 0);
const textStatus = document.getElementById('textStatus');
if (textStatus) {
this.textStatusHeight = textStatus.offsetHeight || 0;
textStatus.style.top = this.offset - 15 + 'px';
}
}); });
}, },
switchMode(prdType) { switchMode(prdType) {

View File

@ -5,7 +5,7 @@
<el-button v-if="isscriptRun&&!dataError" type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button> <el-button v-if="isscriptRun&&!dataError" type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
<el-button type="primary" @click="back">{{ $t('display.demon.back') }}</el-button> <el-button type="primary" @click="back">{{ $t('display.demon.back') }}</el-button>
</div> </div>
<!-- 上角按钮列表 --> <!-- 上角按钮列表 -->
<div class="schema" :style="{top: offset+'px'}"> <div class="schema" :style="{top: offset+'px'}">
<template v-if="!dataError"> <template v-if="!dataError">
<el-button-group> <el-button-group>
@ -19,15 +19,27 @@
</template> </template>
</div> </div>
<!-- 菜单按钮列表 --> <!-- 菜单按钮列表 -->
<demon-menu
ref="demonMenu"
:is-all-show="!dataError"
:jl3dmodel-show="false"
:jl3dname-show="!isScheduling&&!isDriver"
:cctv-show="false"
:schedule-load-show="false"
:schedule-preview-show="false"
:jlmap3d-fault-show="isStation"
:driver-show="isDriver"
:all-style="'top:'+(offset+textStatusHeight)+'px'"
/>
</div> </div>
</template> </template>
<script> <script>
import DemonMenu from '@/views/newMap/displayNew/demonMenu';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation'; import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { quitScriptNew, scriptRePreview } from '@/api/simulation'; import { scriptRePreview } from '@/api/simulation';
import {getDraftScriptByGroupNew } from '@/api/script'; import {getDraftScriptByGroupNew } from '@/api/script';
import { loadNewMapDataByGroup } from '@/utils/loaddata'; import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { getByGroupStationList } from '@/api/jmap/map'; import { getByGroupStationList } from '@/api/jmap/map';
@ -37,6 +49,9 @@ import Cookies from 'js-cookie';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
export default { export default {
name:'ScriptButtonGroup', name:'ScriptButtonGroup',
components:{
DemonMenu
},
props:{ props:{
offset: { offset: {
type: Number, type: Number,
@ -45,6 +60,12 @@ export default {
group: { group: {
type: String, type: String,
required: true required: true
},
textStatusHeight: {
type: Number,
default() {
return 0;
}
} }
}, },
data() { data() {
@ -67,6 +88,12 @@ export default {
}, },
height() { height() {
return this.$store.state.app.height; return this.$store.state.app.height;
},
isDriver() {
return this.$store.state.scriptRecord.userRole == 'DRIVER';
},
isStation() {
return this.$store.state.training.prdType == '01';
} }
}, },
watch:{ watch:{
@ -100,6 +127,7 @@ export default {
methods:{ methods:{
// //
async initLoadData() { async initLoadData() {
this.$store.dispatch('training/setPrdType', '');
this.setWindowSize(); this.setWindowSize();
this.$store.dispatch('training/reset'); this.$store.dispatch('training/reset');
try { try {
@ -190,28 +218,40 @@ export default {
const maintainerList = []; const maintainerList = [];
this.treeData = []; this.treeData = [];
lastData.forEach((member, index)=>{ lastData.forEach((member, index)=>{
if (!member.userId) {
member.userId = '';
member.disabled = false;
} else {
member.disabled = true;
member.userName = this.$store.state.user.nickname;
}
if (member.type != '观众') { if (member.type != '观众') {
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name; const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) { if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) { if (device) {
if (device._type == 'Train') { if (device._type == 'Train') {
member.label = member.type + device.groupNumber + name; member.deviceName = device.groupNumber;
member.label = member.type + device.groupNumber + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
driverList.push(member); driverList.push(member);
} else { } else {
member.label = member.type + device.name + name; member.deviceName = device.name;
member.label = member.type + device.name + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
if (device._type == 'Station') { if (device._type == 'Station') {
stationSupervisorList.push(member); stationSupervisorList.push(member);
} }
} }
} else { } else {
member.label = member.type + member.deviceCode + name; member.deviceName = member.deviceCode;
member.label = member.type + member.deviceCode + name + userName;
lastMemberList.push(member); lastMemberList.push(member);
} }
} else { } else {
member.label = member.type + name; member.label = member.type + name + userName;
member.deviceName = '';
if (member.type == '行调') { if (member.type == '行调') {
dispatcherList.push(member); dispatcherList.push(member);
} else if (member.type == '通号') { } else if (member.type == '通号') {
@ -322,13 +362,14 @@ export default {
}, },
// 退 // 退
handleQuitQuest() { handleQuitQuest() {
quitScriptNew(this.group).then(resp => {
scriptRePreview(this.group).then(resp=>{ scriptRePreview(this.group).then(resp=>{
getSimulationInfoNew(this.group).then(()=>{ getSimulationInfoNew(this.group).then(()=>{
this.isscriptRun = false; this.isscriptRun = false;
this.$store.dispatch('scriptRecord/updateSimulationPause', false); this.$store.dispatch('scriptRecord/updateSimulationPause', false);
this.$store.dispatch('scriptRecord/updateBgSet', false); this.$store.dispatch('scriptRecord/updateBgSet', false);
this.userRole = ''; // this.userRole = '';
this.$store.dispatch('training/setRoles', '');
this.$store.dispatch('training/setPrdType', '');
this.$emit('clearAllData'); this.$emit('clearAllData');
// if (resp.data.planRunning) { // if (resp.data.planRunning) {
// this.$store.dispatch('training/start');// 仿 // this.$store.dispatch('training/start');// 仿
@ -341,9 +382,6 @@ export default {
}).catch(()=>{ }).catch(()=>{
this.$messageBox(this.$t('display.demon.exitTaskFail')); this.$messageBox(this.$t('display.demon.exitTaskFail'));
}); });
}).catch(() => {
this.$messageBox(this.$t('display.demon.exitTaskFail'));
});
}, },
async back() { async back() {
await clearSimulation(this.group); await clearSimulation(this.group);

View File

@ -18,7 +18,7 @@
</template> </template>
<script> <script>
import ChatBox from '@/views/newMap/chatView/chatBox.vue'; import ChatBox from '@/views/newMap/chatView/chatBox.vue';
import ScriptTip from '../scriptTip'; import ScriptTip from '@/views/newMap/displayNew/scriptDisplay/component/scriptTip';
export default { export default {
name:'ScriptPreviewChat', name:'ScriptPreviewChat',
components:{ components:{
@ -70,7 +70,6 @@ export default {
watch:{ watch:{
// //
'$store.state.socket.createConversition':function(val) { '$store.state.socket.createConversition':function(val) {
// debugger;
if (this.memberData.length > 0) { if (this.memberData.length > 0) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; }); const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member && member.userId == this.$store.state.user.id) { if (member && member.userId == this.$store.state.user.id) {
@ -86,7 +85,8 @@ export default {
memberList.push(member); memberList.push(member);
} else { } else {
const member = this.memberData.find(member=>{ return member.id == id; }); const member = this.memberData.find(member=>{ return member.id == id; });
member.connect = false; // member.connect = false;
member.connect = true;
member && memberList.push(member); member && memberList.push(member);
} }
}); });
@ -123,8 +123,13 @@ export default {
memberList.push(this.inviteUser); memberList.push(this.inviteUser);
this.inviteUser = {}; this.inviteUser = {};
this.isStartRecord = true; this.isStartRecord = true;
if (member.userId != this.inviteUser.userId) {
this.isQuitShow = false;
} else {
this.isQuitShow = true; this.isQuitShow = true;
} }
this.isHasCoversition = true;
}
} }
} }
this.currentMemberList = memberList; this.currentMemberList = memberList;
@ -155,13 +160,22 @@ export default {
}, },
// //
'$store.state.socket.inviteSimulationConversition':function(val) { '$store.state.socket.inviteSimulationConversition':function(val) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; }); const invitemember = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member) { if (invitemember) {
this.inviteUserName = member.label; this.inviteUserName = invitemember.label;
this.conversitionId = val.id; this.conversitionId = val.id;
invitemember.connect = true;
this.inviteUser = invitemember;
this.currentMemberList.push(invitemember);
const member = this.memberData.find(member=>{ return member.id == val.memberId; });
member.connect = true; member.connect = true;
this.inviteUser = member; const userName = member.userName ? '-' + member.userName : '';
this.$refs.chatbox.inviteMember(); const name = member.name == undefined ? '' : '-' + member.name;
member.label = member.type + member.deviceName + name + userName;
this.currentMemberList.push(member);
this.isStartRecord = true;
// this.$refs.chatbox.inviteMember();
this.$message.success(this.inviteUserName + '与你开启会话');
} }
} }
}, },

View File

@ -0,0 +1,102 @@
<template>
<el-select v-if="showSelectStation" v-model="showStation" :style="styleCss" size="small" @change="switchStationMode">
<el-option v-for="item in stationListMode" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
name:'SelectStation',
props:{
styleCss: {
type: String,
required: true
}
},
data() {
return {
stationListMode: [], //
showStation: '', //
showSelectStation: false // select
};
},
computed:{
...mapGetters('map', [
'map',
'stationList'
])
},
watch:{
'stationList': function () {
this.setStationList();
},
'$store.state.map.mapViewLoadedCount': function (val) { //
this.setMode();
this.setStationList();
this.switchStationMode(this.showStation);
},
'$store.state.training.centerStationCode': function(code) {
if (code) {
this.showStation = code;
}
},
'$store.state.training.prdType': function (val) { //
this.setMode();
},
'$store.state.socket.simulationStart':function(val) {
if (val) {
if (this.$route.query.lineCode == '06') {
this.switchStationMode(this.showStation);// 线
}
}
}
},
methods:{
setMode() {
if (this.map) {
this.showSelectStation = this.map.skinVO.code === '06' && this.$store.state.training.prdType === '01';
}
},
switchStationMode(val) {
if (this.stationListMode.length > 0) {
if (val == null) {
this.showStation = this.stationListMode[0].value;
} else {
this.showStation = val;
}
const nameList = Object.keys(this.$store.state.map.map);
let list = [];
nameList.forEach(item => {
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) {
if (item === 'trainList') {
this.$store.state.map.map[item].forEach(elem => {
elem && list.push(elem);
});
} else {
list = [...list, ...this.$store.state.map.map[item]];
}
}
});
this.$jlmap.updateShowStation(list, this.showStation);
this.setCenter(this.showStation);
// this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation);
// this.$store.dispatch('map/setShowCentralizedStationNum');
}
},
setCenter(code) {
this.$jlmap.setCenter(code);
},
setStationList() {
this.stationListMode = [];
(this.stationList || []).forEach(item => {
if (item.centralized) {
this.stationListMode.push({value: item.code, name: item.name});
}
});
if (this.stationListMode.length && this.showSelectStation) {
this.showStation = this.stationListMode[0].value;
}
}
}
};
</script>

View File

@ -39,8 +39,9 @@ export default {
watch:{ watch:{
'$store.state.socket.inviteSimulationConversition':function(val) { '$store.state.socket.inviteSimulationConversition':function(val) {
this.userName = this.coverName(val); this.userName = this.coverName(val);
this.dialogVisible = true; // this.dialogVisible = true;
this.conversationId = val.id; // this.conversationId = val.id;
this.$message.success(this.userName + '与你开启会话');
} }
}, },
methods:{ methods:{

View File

@ -19,9 +19,12 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="仿真成员名称:" prop="name">
<el-input v-model="formModel.name" placeholder="请输入成员名称" />
</el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button type="primary" :lodaing="lodaing" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button> <el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -34,13 +37,18 @@ export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
lodaing:false,
formModel: { formModel: {
type: '' type: '',
name:''
}, },
rules: { rules: {
type: [ type: [
{ required: true, message: '请选择显示位置', trigger: 'change' } { required: true, message: '请选择成员类型', trigger: 'change' }
] ]
// name:[
// { required: true, message: '', trigger: 'blur' }
// ]
}, },
typeList: [{label: '行调', value: 'DISPATCHER'}, {label: '通号', value: 'MAINTAINER'}] typeList: [{label: '行调', value: 'DISPATCHER'}, {label: '通号', value: 'MAINTAINER'}]
}; };
@ -59,20 +67,26 @@ export default {
this.dialogVisible = true; this.dialogVisible = true;
}, },
doSave() { doSave() {
this.$refs.form.validate(() => { this.$refs.form.validate((valid) => {
if (valid) {
this.lodaing = true;
addSimulationMember(this.formModel, this.$route.query.group).then((res) => { addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
this.lodaing = false;
this.$message.success('添加仿真角色成员成功!'); this.$message.success('添加仿真角色成员成功!');
this.$emit('addScriptMember', res.data); this.$emit('addScriptMember', res.data);
this.handleClose(); this.handleClose();
}).catch(() => { }).catch(() => {
this.lodaing = false;
this.$message.error('添加仿真角色成员失败!'); this.$message.error('添加仿真角色成员失败!');
}); });
}
}); });
}, },
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false;
this.formModel = { this.formModel = {
type: '' type: '',
name:''
}; };
this.$refs.form.resetFields(); this.$refs.form.resetFields();
} }

View File

@ -145,7 +145,7 @@ export default {
{ {
// const command = CommandHandler.getScriptDefinition(element.operationType); // const command = CommandHandler.getScriptDefinition(element.operationType);
const commandName = element.operationType; const commandName = element.operationType;
if (commandName != 'Set_Fault') { if (commandName != 'Set_Fault' && commandName != 'Cancel_Fault' ) {
let operateType = commandName.split('_')[0]; let operateType = commandName.split('_')[0];
if (operateType == 'CM') { if (operateType == 'CM') {
operateType = 'ControlConvertMenu'; operateType = 'ControlConvertMenu';
@ -158,7 +158,11 @@ export default {
// deviceFaultType // deviceFaultType
// element.operationParamMap.faultType; // element.operationParamMap.faultType;
// '(' + operateName.label + ')' // '(' + operateName.label + ')'
if (commandName == 'Set_Fault') {
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: '设置故障', row: element, visible: false}); this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: '设置故障', row: element, visible: false});
} else if (commandName == 'Cancel_Fault') {
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: '取消故障', row: element, visible: false});
}
} }
break; break;
} }

View File

@ -167,13 +167,12 @@ export default {
}, },
addScriptMember(member) { addScriptMember(member) {
member.userId = ''; member.userId = '';
member.name = '';
member.disabled = false; member.disabled = false;
this.$store.dispatch('training/addMemberListInScript', member);
const lastData = JSON.stringify([member]); const lastData = JSON.stringify([member]);
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
covertmember.forEach(each=>{ covertmember.forEach(each=>{
this.memberList.push(each); this.memberList.push(each);
this.$store.dispatch('training/addMemberListInScript', each);
}); });
}, },
@ -249,7 +248,7 @@ export default {
deviceName = each.deviceCode; deviceName = each.deviceCode;
} }
} }
each.name = each.type + deviceName; each.name = each.type + deviceName + (each.name ? '' + each.name : '');
each.label = each.name; each.label = each.name;
}); });
return lastData; return lastData;