This commit is contained in:
fan 2020-08-17 18:16:31 +08:00
commit 19b4b48c3f
56 changed files with 4377 additions and 5105 deletions

View File

@ -66,10 +66,20 @@ export function getPublishMapExport(mapId) {
}
/** 发布地图数据导出*/
export function getPublishMapExportNew(mapId, list) {
export function getPublishMapExportNew(mapId, params) {
return request({
url: `/api/map/${mapId}/export/new?configs=${list}`,
method: 'get'
url: `/api/map/${mapId}/export/new`,
method: 'get',
params
});
}
/** 发布地图数据导出*/
export function getPublishMapImportNew(mapId, data) {
return request({
url: `/api/map/${mapId}/import/new`,
method: 'put',
data
});
}

View File

@ -134,16 +134,32 @@
>
<template slot-scope="scope">
<template v-for="(button, idx) in column.buttons">
<el-button
v-if="button.show === undefined ? ((button.showControl === undefined) ? true: button.showControl(scope.row)): button.show"
:key="idx"
size="mini"
style="margin-top: 5px;"
:loading="scope.row['loading'+idx]"
:type="button.type ? button.type : 'primary'"
:disabled="isTableBtnDisabled(button, scope.$index, scope.row)"
@click="button.handleClick(scope.$index, scope.row, idx) "
>{{ getTableBtnName(button.name, scope.$index, scope.row) }}</el-button>
<template v-if="button.type == 'file'">
<el-button
v-if="button.show === undefined ? ((button.showControl === undefined) ? true: button.showControl(scope.row)): button.show"
:key="idx"
:type="button.type ? button.type: 'primary'"
size="mini"
class="button_style uploadDemo"
:disabled="isTableBtnDisabled(button, scope.$index, scope.row)"
:loading="scope.row['loading'+idx]"
>
<input :id="button.id" type="file" class="file_box" accept=".json, application/json" @change="button.handleClick(scope.$index, scope.row, idx)">
{{ getTableBtnName(button.name, scope.$index, scope.row) }}
</el-button>
</template>
<template v-else>
<el-button
v-if="button.show === undefined ? ((button.showControl === undefined) ? true: button.showControl(scope.row)): button.show"
:key="idx"
size="mini"
style="margin-top: 5px;"
:loading="scope.row['loading'+idx]"
:type="button.type ? button.type : 'primary'"
:disabled="isTableBtnDisabled(button, scope.$index, scope.row)"
@click="button.handleClick(scope.$index, scope.row, idx) "
>{{ getTableBtnName(button.name, scope.$index, scope.row) }}</el-button>
</template>
</template>
</template>
</el-table-column>
@ -530,3 +546,24 @@ export default {
};
</script>
<style lang="scss" scoped>
.uploadDemo {
position: relative;
overflow: hidden;
margin-right: 3px;
cursor: pointer;
padding: 0 15px;
height: 32px;
.file_box {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
z-index: 100;
}
}
</style>

View File

@ -231,8 +231,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
vrwebworker.postMessage(connectmsg);
vrwebworker.onmessage = function (event) {
console.log(event.data.type);
console.log(event.data);
if(event.data.type == "Device_Fault_Set_3D"){
let newfault = {
code:event.data.body.code,
@ -409,7 +408,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
if(scope.stationtexture["stationlist"]){
vrPlane.setStationPlane(stationList,scope.stationtexture);
console.log(scope.nowStationModel.getObjectByName("zhantailiebiao"));
scope.nowStationModel.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
scope.nowStationModel.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
if(scope.nowStationModel.getObjectByName("menkuangyanse")){
@ -420,7 +418,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
scope.nowStationModel.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
trainControl.inittrain(scope.scene,scope.modelmanager.train.mesh,mixers);
trainControl.inittrain(scope.scene,scope.modelmanager.train.mesh,scope.modelmanager.train.animations,mixers);
scope.scene.add(scope.modelmanager.otherDevice.mesh);
scope.scene.add( vrPlane.group );
vrwebworker.postMessage("connect");
@ -443,7 +441,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
let intersects = raycaster.intersectObjects( vrPlane.group.children,true);
if(intersects[0]){
console.log(intersects[0]);
var object = intersects[0].object;
if(object.name == "buttonHome"){
@ -744,9 +741,9 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
var intersections = getIntersections( controller );
// console.log(intersections);
if ( intersections.length > 0 ) {
console.log(intersections);
// console.log(intersections);
var intersection = intersections[ 0 ];
console.log(intersection);
// console.log(intersection);
var object = intersection.object;
// object.matrix.premultiply( tempMatrix );
@ -809,7 +806,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
}
function squeezeStart(){
console.log("squeez");
scope.modelmanager.otherDevice.action.play();
if(vrPlaneStatus){
vrPlaneStatus = false;
@ -1029,7 +1025,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
}
scope.nowstation = stationList[0];
console.log(scope.nowstation);
}

View File

@ -3,14 +3,14 @@ export function TrainControl(){
this.toptrain = null;
this.downtrain = null;
this.inittrain = function(scene,object,mixers){
this.inittrain = function(scene,object,animations,mixers){
let ntracks1,ntracks2,tclip,fclip;
console.log(object);
ntracks1 = object.animations.slice(16,27);
ntracks1 = animations.slice(16,27);
tclip = new THREE.AnimationClip("three",2,ntracks1);
ntracks2 = object.animations.slice(0,15);
ntracks2 = animations.slice(0,15);
fclip = new THREE.AnimationClip("four",2,ntracks2);
@ -45,16 +45,17 @@ export function TrainControl(){
inittrainanimation(scope.downtrain,tclip,fclip,mixers);
scope.toptrain.position.z = -20;
scope.toptrain.position.y = -20000;
scope.toptrain.position.z = 8.8;
// scope.toptrain.position.y = -20000;
scope.toptrain.rotation.y = Math.PI;
scope.downtrain.position.z = 40;
scope.downtrain.position.y = -20000;
scope.downtrain.position.z = -8.3;
// scope.downtrain.position.y = -20000;
scene.add(scope.toptrain);
scene.add(scope.downtrain);
}
function inittrainanimation(train,tclip,fclip,mixers){
for(let j=0;j<train.children.length;j++){
if(train.children[j].name == "c1" || train.children[j].name == "c6"){
for(let n=0,lenn = train.children[j].children.length;n<lenn;n++){
@ -97,6 +98,7 @@ export function TrainControl(){
if(train.children[j].children[n].name == "down"){
train.children[j].children[n].animations = [];
train.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
mixers.push(mixer);
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );

View File

@ -287,7 +287,7 @@ export function VrGui(){
}
posY = Math.floor(i/4)*0.16;
console.log(posY);
setTextStation(stations[i],scope.stationListGroup,posX-0.5,0.6-posY,"stationList");
}
setTextMsg(stations[0],scope.homeGroup,0,0,"stationMsg");
@ -363,7 +363,6 @@ export function VrGui(){
nowGroupComponent = scope.faultListGroup;
plane.add(nowGroupComponent);
console.log(scope.faultListGroup.children);
}
this.updataDeviceFaultMsg = function(faultData){

View File

@ -20,7 +20,7 @@ export function ModelManagerVR(){
code:"stationOut",
locateType:"2",
mesh:null,
url:"../../static/vrtest/stationOut.FBX"
url:"../../static/vrtest/stationIn.FBX"
};
this.otherDevice = {
@ -71,16 +71,39 @@ function fbxpromise(mixers,model){
let mixer = new THREE.AnimationMixer( object );
object.animacode = model.code;
model.mesh = object;
if(object.animations.length>0 && model.code != "train"){
// model.mesh = object;
if(model.code == "train"){
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){
let name = "c"+j;
for(let i=0;i<object.children.length;i++){
if(object.children[i].name == name){
object.children[i].position.x = object.children[i].position.x;
//object.children[i].position.y = j*10;
realtrain.add(object.children[i]);
i--;
}
}
}
model.mesh = realtrain;
model.animations = object.animations[0].tracks;
}else{
model.mesh = object;
model.action = mixer.clipAction( object.animations[ 0 ] );
model.action.setLoop(THREE.LoopOnce);
model.action.clampWhenFinished = true;
mixers.push(mixer);
//model.action.play();
}
// if(object.animations.length>0 && model.code != "train"){
//
//
// //model.action.play();
// }
resolve(model.locateType);
} );

View File

@ -278,6 +278,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 8, // 站台默认字体大小

View File

@ -387,6 +387,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示

View File

@ -207,6 +207,10 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 10, // 站台默认字体大小

View File

@ -408,6 +408,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示

View File

@ -441,6 +441,11 @@ class SkinCode extends defaultStyle {
extendLength: 8 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.LcControl] = {
text: {
fontSize: 10, // 灯字体大小

View File

@ -420,6 +420,10 @@ class SkinCode extends defaultStyle {
strokeColor: 'red', // 线条颜色
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: true
};
this[deviceType.Switch] = {
text: {

View File

@ -458,6 +458,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.StationDelayUnlock] = {
text: {
distance: 3, // 延迟解锁和设备之间的距离

View File

@ -411,6 +411,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示

View File

@ -534,6 +534,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: '03', // 显示条件 prdType

View File

@ -103,6 +103,12 @@ class Status {
fault: device.fault /** 非故障*/
};
}
handleOverAp(device) {
this.statusObj = {
remainTime: device.remainTime
};
}
handleZcControl(device) {
this.statusObj = { };
}

View File

@ -444,6 +444,7 @@ class Jlmap {
overlapRoute['points'] = { x: model.points[model.points.length - 1].x, y: model.points[model.points.length - 1].y };
}
overlapRoute['offsetRight'] = overlapRoute.pathList[0].right;
overlapRoute['sectionName'] = model.name;
this.$painter.update(overlapRoute);
} else if (elem.deviceType === 'CYCLE') {
store.dispatch('map/updateAutoReentryState', elem);

View File

@ -164,6 +164,7 @@ class MouseController extends Eventful {
click(e) {
var em = this.checkEvent(e);
// console.log(e, em, '====');
this.trigger(this.events.Selected, em);
}

View File

@ -43,13 +43,13 @@ export default class OverAp extends Group {
setState(model) {
this.text && this.text.hide();
if (model.remainTime) {
if (model.remainTime && this.style.OverAp.show) { // 目前哈尔滨线路显示
// console.log(model, model.remainTime, model.sectionName, '=====');
this.text && this.text.show();
let offset = 40;
if (!model.offsetRight) {
offset = -40;
}
// console.log(model.offsetRight, 'model');
this.text && this.text.attr({
style: {
text: model.remainTime,

View File

@ -795,7 +795,6 @@ export default class Section extends Group {
showRemainTime(number) { // 区段延时保护倒计时显示
this.releaseName && this.releaseName.show();
// this.releaseName && this.releaseName.setStyle({ text: number });
console.log(number, this.model.name, '====');
let pointX = this.model.points[0].x + 45;
let pointY = this.model.points[0].y;
if (!this.model.timeRight) {
@ -884,9 +883,12 @@ export default class Section extends Group {
getBoundingRect() {
if (this.section) {
return this.section.getBoundingRect();
// if (this.model.code == 'T197' || this.model.code == 'T189') {
// console.log(this.section.getBoundingRect().clone(), this.model, this.model.name);
// }
return this.section.getBoundingRect().clone();
} else if (this.name) {
return this.name.getBoundingRect();
return this.name.getBoundingRect().clone();
}
}

View File

@ -137,7 +137,7 @@ class ESigLamp extends Group {
}
getBoundingRect() {
return this.lamp.getBoundingRect();
return this.lamp.getBoundingRect().clone();
}
setAnimationStart(color) {

View File

@ -17,6 +17,8 @@ import Rect from 'zrender/src/graphic/shape/Rect';
import Polygon from 'zrender/src/graphic/shape/Polygon';
import Text from 'zrender/src/graphic/Text';
import Isogon from 'zrender/src/graphic/shape/Isogon';
// import BoundingRect from 'zrender/src/core/BoundingRect';
// import background from './../../../ibp/shape/background';
class Signal extends Group {
constructor(model, style) {
@ -39,12 +41,13 @@ class Signal extends Group {
this.cbtcStatus = '';
this.create();
this.createMouseEvent();
this.checkIsDrawMap();
this.transformRotation(this);
if (model.previewOrMapDraw) {
this.setShowMode();
}
this.setState(model);
this.checkIsDrawMap();
// this.checkIsDrawMap();
}
create() {
@ -151,12 +154,12 @@ class Signal extends Group {
this.add(this.insideTriangle);
}
if (style.Signal.sigBack) {
const signalRect = this.sigPost.getBoundingRect();
const signalRect = this.sigPost.getBoundingRect().clone();
this.lamps.forEach(elem => {
signalRect.union(elem.getBoundingRect());
signalRect.union(elem.getBoundingRect().clone());
});
if (this.insideTriangle) {
signalRect.union(this.insideTriangle.getBoundingRect());
signalRect.union(this.insideTriangle.getBoundingRect().clone());
}
// 信号的背景
this.sigBack = new Rect({
@ -693,11 +696,12 @@ class Signal extends Group {
getBoundingRect() {
const rect = this.sigPost.getBoundingRect().clone();
this.lamps.forEach(elem => {
rect.union(elem.getBoundingRect().clone());
});
if (this.insideTriangle) {
rect.union(this.insideTriangle.getBoundingRect().clone());
} else {
this.lamps.forEach(elem => {
rect.union(elem.getBoundingRect().clone());
});
}
return rect;
}
@ -705,7 +709,7 @@ class Signal extends Group {
getShapeTipPoint() { // 判断第一步 或 第二部步骤 获取元素包围框
var drict = this.model.right ? 1 : -1; // 朝向 右:左
var offsetY = this.model.positionType == '01' ? this.style.Signal.text.fontSize : 0; // 位置 上:下
const rect = this.sigPost.getBoundingRect();
const rect = this.sigPost.getBoundingRect().clone();
return {
x: rect.x + drict * this.style.Signal.post.standardWidth,
@ -728,6 +732,9 @@ class Signal extends Group {
this.highlight = new EHighlight(this);
this.add(this.highlight);
}
if (this.highlight) {
this.transformRotation(this.highlight);
}
}
/* 始端信号机选择后信号机变为三角形 */
setLampToTriangle() {

View File

@ -1,129 +0,0 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm switch-control" :title="title" :visible.sync="show" width="300px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="11"><span>设备:</span></el-col>
<el-col :span="11" :offset="2"><span>故障类型:</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="deviceName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-select v-model="faultType" style="height: 32px;" placeholder="请选择">
<el-option
v-for="item in faultList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">取消</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationName: '',
switchName: '',
activeShow: false,
deviceName: '',
faultType: '',
faultList: []
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '设置故障';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
if (!this.dialogShow) {
this.switchName = '';
this.stationName = '';
this.operation = operate.operation;
this.deviceName = deviceType[selected._type] + '-' + selected.name;
this.faultList = deviceFaultType[selected._type];
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
},
sendCommand(operate) { //
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
});
},
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>

View File

@ -17,12 +17,10 @@
:default-expand-all="true"
style="background: #f0f0f0;"
>
<div slot-scope="{ node, data }" style="height: 24px; width: 100%;">
<div slot-scope="{ data }" style="height: 24px; width: 100%;">
<div v-if="data.level == 1" style="line-height: 26px;">{{ data.name }}</div>
<div v-if="data.level == 2" style="background: lightgray; overflow: hidden; height: 100%;">
<div
style="width: 46%;float: left; height: 24px; line-height: 24px; padding-left: 5px; border-right: 1px solid #f0f0f0;"
>
<div style="width: 46%;float: left; height: 24px; line-height: 24px; padding-left: 5px; border-right: 1px solid #f0f0f0;">
{{ data.name }}</div>
<div style="width: 54%;float: left; height: 24px; line-height: 24px; padding-left: 5px;">
{{ data.value }}</div>
@ -108,11 +106,6 @@ export default {
},
{
children: [
// {
// name: '',
// value: '',
// level: 2
// },
{
name: '站台',
value: '',
@ -179,19 +172,15 @@ export default {
//
this.treeData[1].children[1].value = selected.stationHoldTrain ? '已设置' : '未设置';
//
this.treeData[0].children[2].value = selected.parkingTime == 0 ? '自动' : `${selected.parkingTime}`;
this.treeData[0].children[2].value = selected.parkingTime >= 0 ? `${selected.parkingTime}` : '自动';
//
this.treeData[0].children[3].value = selected.allSkip || selected.assignSkip ? '已设置' : '未设置';
// if (selected.direction == '01') {
//
// }
if (!stationStand || !station) {
this.treeData[2].children[0].value = `自动`;
} else {
this.treeData[2].children[0].value = selected.runLevelTime > 0 ? `${station.name}${stationStand.name}:人工` : `${station.name}${stationStand.name}:自动`;
}
//
// this.tempData.push({ item: '', status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : '' });
},
doShow(operate, selected) {
this.selected = selected;

View File

@ -15,8 +15,8 @@
<template slot-scope="scope">
<span v-if="scope.row.controlMode == 'Center'">遥控</span>
<span v-else-if="scope.row.controlMode == 'Local'">站控</span>
<span v-else-if="scope.row.controlMode == 'Local' && $route.query.prdType == '02'">中心请求站控</span>
<span v-else-if="scope.row.controlMode == 'Center' && $route.query.prdType == '01'">现地请求遥控</span>
<!-- <span v-else-if="scope.row.controlMode == 'Local' && $route.query.prdType == '02'">中心请求站控</span>
<span v-else-if="scope.row.controlMode == 'Center' && $route.query.prdType == '01'">现地请求遥控</span> -->
<span v-else>获取状态中...</span>
</template>
</el-table-column>

View File

@ -1,169 +0,0 @@
<template>
<!-- <el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="640px" :before-close="doClose" :zIndex="2000" -->
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-set-plan"
:title="title"
:visible.sync="show"
width="380px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="overflow: hidden;">
<div style="width: 98%; float: left; padding: 10px 15px; margin: 20px 0px; height: 120px;">
<!-- <span class="base-label">目的</span> -->
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandGoal">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandGoal" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="trainGoal" style="width:280px">
<el-input v-model="addModel.trainGoal" />
</el-form-item>
</div>
</div>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'TrainMove',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
// trainNo: '',
trainSource: '',
// stationStandSource: '',
trainGoal: '',
stationStandGoal: ''
},
rules: {
// trainNo: [
// { required: true, message: '', trigger: 'blur' }
// ],
trainSource: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
// stationStandSource: [
// { required: true, message: '', trigger: 'change' }
// ],
trainGoal: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: '请选择车站', trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '删除计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
//
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
// operation: OperationEvent.Train.moveTrainId.menu.operation,
operation: OperationEvent.Train.deletePlanTrainId.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.fuzhou_01 .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -1,181 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-edit"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">新车组号</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">车站</el-col>
<el-col :span="11" :offset="1">车次窗</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.stationName" :disabled="true" />
</el-col>
<el-col :span="11" :offset="1">
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'TrainEdit',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
groupNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.editTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return '修改计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.input.operation,
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.groupNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -1,160 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-flag"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">车组号:</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.groupNumber" />
</el-col>
</el-row>
<el-row style="margin-top: 15px; margin-bottom: 30px">
<el-col :span="24">
<el-radio-group v-model="addModel.type" :disabled="true">
<el-radio label="01">备选项</el-radio>
<el-radio label="02">备选项</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'TrainFlag',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
type: '01',
groupNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return 'ATP切除功能';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.tripNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -1,189 +0,0 @@
<template>
<!-- <el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="640px" :before-close="doClose" :zIndex="2000" -->
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-set-plan"
:title="title"
:visible.sync="show"
width="640px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<!-- <div style="width: 46%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainNo">
<el-input v-model="addModel.trainNo" disabled></el-input>
</el-form-item>
</div> -->
<div style="overflow: hidden;">
<div style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px; margin-right: 4%;">
<span class="base-label"></span>
<div style="position: relative; top:-10px;">
<!-- <el-form-item prop="stationStandSource">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandSource" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="车 次 号:" prop="trainSource">
<el-input v-model="addModel.trainSource" />
</el-form-item>
</div>
</div>
<div style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">目的</span>
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandGoal">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandGoal" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="trainGoal">
<el-input v-model="addModel.trainGoal" />
</el-form-item>
</div>
</div>
</div>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'TrainMove',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
// trainNo: '',
trainSource: '',
// stationStandSource: '',
trainGoal: '',
stationStandGoal: ''
},
rules: {
// trainNo: [
// { required: true, message: '', trigger: 'blur' }
// ],
trainSource: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
// stationStandSource: [
// { required: true, message: '', trigger: 'change' }
// ],
trainGoal: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: '请选择车站', trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '平移计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
//
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
// operation: OperationEvent.Train.moveTrainId.menu.operation,
operation: OperationEvent.Train.moveEventlyTrainId.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.fuzhou_01 .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -5,10 +5,7 @@
<train-delete ref="trainDelete" />
<train-define ref="trainDefine" />
<train-move ref="trainMove" />
<!-- <train-edit ref="trainEdit" /> -->
<train-set-plan ref="trainSetPlan" />
<!-- <train-move-evently ref="trainMoveEvently" /> -->
<!-- <train-delete-plan ref="trainDeletePlan" /> -->
<train-set-head ref="trainSetHead" />
<train-set-work ref="trainSetWork" />
<trainSetWorkATP ref="trainSetWorkATP" />

View File

@ -1,162 +0,0 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="xian-01__systerm route-detail"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="10"><span>车站</span></el-col>
<el-col :span="10" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>进路列表</span>
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column label="进路">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="控制状态" width="180">
<template slot-scope="scope">
{{ scope.row.atsControl == '0' ? '人工' : '自动' }}
</template>
</el-table-column>
</el-table>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
name: 'RouteDetail',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
stationName: '',
signalName: ''
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
},
title() {
return '查询进路状态';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.tempData = tempData || [];
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
send: true,
operation: OperationEvent.Signal.detail.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
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>

View File

@ -1,335 +0,0 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="xian-01__systerm route-hand-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column label="选择" width="55" style="margin-left:50px; text-align: right;">
<template slot-scope="scope">
<el-checkbox
v-model="changeList[scope.$index]"
style="text-align: center; display: block;"
:disabled="scope.row.disabled"
@change="changeCheck(changeList[scope.$index],scope.row.code)"
/>
</template>
</el-table-column>
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
</template>
</el-table-column>
</el-table>
</div>
<el-row>
<el-col :span="22" :offset="1">
<el-checkbox v-model="allSelect" size="small" @change="allSelectChange">全选</el-checkbox>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button
:id="domIdConfirm"
type="primary"
:disabled="commitDisabled"
:loading="loading"
@click="commit"
>确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'RouteHandControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
operation: null,
selection: [],
stationName: '',
signalName: '',
allSelect: false,
changeList:[],
commitDisabled: true,
disabledLength: 0
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return OperationEvent.Signal.humanControl.choose.domId;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return OperationEvent.Signal.atsAutoControl.choose.domId;
} else {
return '';
}
} else {
return '';
}
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交自动控';
} else {
return '';
}
}
},
watch: {
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
this.allSelect = false;
this.changeList = [];
this.commitDisabled = true;
this.selection = [];
this.disabledLength = 0;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
if (tempData && tempData.length > 0) {
tempData.forEach(elem => {
this.changeList.push(false);
elem.disabled = false;
//
if (operate.operation == OperationEvent.Signal.humanControl.menu.operation &&
(elem.atsControl == 0)) {
elem.disabled = true;
this.disabledLength++;
} if (operate.operation == OperationEvent.Signal.atsAutoControl.menu.operation &&
(elem.atsControl != 0)) {
elem.disabled = true;
this.disabledLength++;
}
});
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.tempTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
changeCheck(check, code) {
if (check) {
this.selection.push(code);
} else {
this.selection.splice(this.selection.indexOf(code), 1);
}
if (this.selection.length >= (this.tempData.length - this.disabledLength) ) {
this.allSelect = true;
} else {
this.allSelect = false;
}
if (this.selection.length > 0) {
this.commitDisabled = false;
} else {
this.commitDisabled = true;
}
const operate = {val:code};
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
allSelectChange() {
this.changeList = [];
if (this.allSelect) {
this.tempData.forEach((item, index)=> {
if (!item.disabled) {
this.changeList.push(true);
this.selection.push(item.code);
} else {
this.changeList.push('');
}
});
this.allSelect = true;
if (this.selection.length > 0) {
this.commitDisabled = false;
}
} else {
this.tempData.forEach((item, index) => {
if (!item.disabled) {
this.changeList.push(false);
this.selection.splice(this.selection.indexOf(item.code), 1);
}
});
this.allSelect = false;
this.commitDisabled = true;
}
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
repeat: true,
operation: '',
selection: selection
};
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(`请选择一条数据`);
}
},
commit() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
this.atsAutoControl();
}
},
//
humanControl() {
this.loading = true;
commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
//
atsAutoControl() {
this.loading = true;
commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
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>

View File

@ -1,14 +1,14 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" :pop-menu-class="systemName" />
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="xian-01__systerm" />
<route-selection ref="routeSelection" />
<route-lock ref="routeLock" />
<route-control ref="routeControl" :pop-class="systemName" />
<route-control ref="routeControl" pop-class="xian-01__systerm" />
<route-cmd-control ref="routeCmdControl" />
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
<route-hand-control ref="routeHandControl" :system-name="systemName" />
<route-detail ref="routeDetail" :system-name="systemName" />
<set-fault ref="setFault" :pop-class="systemName" />
<route-hand-control ref="routeHandControl" system-name="xian-01__systerm" />
<route-detail ref="routeDetail" system-name="xian-01__systerm" />
<set-fault ref="setFault" pop-class="xian-01__systerm" />
</div>
</template>
@ -52,7 +52,6 @@ export default {
data() {
return {
menu: [],
systemName:'xian-01__systerm',
menuNormal: {
Local: [
{

View File

@ -750,10 +750,12 @@ const map = {
setActiveTrainList:(state) => {
state.activeTrainListUpdate++;
},
resetActiveTrainList:(state) => {
resetActiveTrainList:(state, isBack) => {
state.activeTrainList = [];
state.activeTrainListUpdate = 0;
state.activeTrainListChange = 0;
if (!isBack) {
state.activeTrainListUpdate = 0;
state.activeTrainListChange = 0;
}
},
setDeleteCount: (state) => {
state.deleteCount++;
@ -1047,8 +1049,8 @@ const map = {
setActiveTrainList: ({ commit }) => {
commit('setActiveTrainList');
},
resetActiveTrainList: ({ commit }) => {
commit('resetActiveTrainList');
resetActiveTrainList: ({ commit }, isBack) => {
commit('resetActiveTrainList', isBack);
},
setUpdateCount: ({ commit }) => {
commit('setUpdateCount');

View File

@ -26,8 +26,11 @@ function handle(state, data) {
case 'Simulation_User': // 仿真-进出仿真消息
handleSimulationUserinfo(state, msg); // 用户进出仿真消息
break;
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息
case 'Simulation_Script_Action_Tip': // 剧本提示消息
handleSimulationScriptTipInfo(state, msg); // 剧本提示消息
break;
case 'Simulation_Script_Action_Finish':
state.simulationScriptTipFinish++; // 剧本某一部操作完成提示
break;
case 'Simulation_PlayBack_Finish': // 竞赛裁判系统裁判员回放结束推送
state.playBackFinish++; // 竞赛裁判系统裁判员回放结束推送
@ -208,6 +211,7 @@ const socket = {
roleList: [], // 设置角色信息
simulationRoleList:[], // 设置仿真的聊天角色信息
simulationScriptTip:{}, // 剧本推送提示信息
simulationScriptTipFinish:0, // 剧本某一步完成的消息
scriptFinish:0, // 剧本执行完成提示信息
autoFaultTrigger:0, // 自动故障触发操作推送消息
scriptAction:{}, // 剧本编制添加指令的推送消息

View File

@ -50,13 +50,11 @@
<div v-if="isShow">
<div class="userString">{{ userString }}</div>
<el-button :loading="loading" size="mini" type="primary" class="chat-box-create-coversite" @click="doCreate">创建会话</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
<div v-else>
<div class="chat-box-footer-tool" />
<el-button v-if="isQuitShow" size="mini" type="danger" class="chat-box-footer-quit" :loading="loading" @click="quitConversition()">结束会话</el-button>
<el-button v-if="isStartRecord" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
</div>
</div>
@ -105,10 +103,6 @@ export default {
type:Array,
required: true
},
scriptTip:{
type:String,
required:true
},
isStartRecord:{
type:Boolean,
required:true
@ -185,7 +179,6 @@ export default {
},
//
startRecording() {
this.$emit('setScriptTip', '');
const that = this;
if (!this.recordSending && !this.recorders && !this.microphone) {
this.$refs.chatSetting.doClose();
@ -454,30 +447,6 @@ export default {
cursor: no-drop;
}
.scriptTip{
position: absolute;
width: 260px;
padding: 10px;
background: rgb(250, 246, 3);
right: 7px;
bottom:45px;
border-radius: 5px;
font-size: 14px;
color: #000000;
z-index: 2;
}
.scriptTip::after{
content: '';
position: absolute;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 8px solid #faf603;
right: 16px;
bottom: -7px;
}
.userString{
height: 50px;
width: 409px;

View File

@ -53,7 +53,7 @@
<script>
import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig';
import {getScriptPageListOnlineNew, getDraftScriptByGroupNew, getScriptByIdNew } from '@/api/script';
import {getScriptPageListOnlineNew, getScriptByIdNew } from '@/api/script';
//
export default {
@ -175,7 +175,7 @@ export default {
},
async handleLoad(index, row) {
this.row = row;
const res = this.$route.fullPath.includes('design/displayNew/demon') ? await getDraftScriptByGroupNew(row.group) : await getScriptByIdNew(row.id);
const res = await getScriptByIdNew(row.id);
let newMemberList = [];
if (res.code == 200) {
if (res.data.memberList && res.data.memberList.length > 0) {

View File

@ -7,18 +7,15 @@
:conversition-id="conversitionId"
:current-member-list="currentMemberList"
:chat-content-list="chatContentList"
:script-tip="scriptTip"
:is-start-record="isStartRecord"
:invite-user-name="inviteUserName"
:is-quit-show="isQuitShow"
@setScriptTip="setScriptTip"
@resetCoversition="resetCoversition"
/>
</template>
<script>
import ChatBox from '../chatView/chatBox.vue';
import ConstConfig from '@/scripts/ConstConfig';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Cookies from 'js-cookie';
import { getSimulationMemberList} from '@/api/simulation';
import {getAllConversition} from '@/api/chat';
@ -39,7 +36,6 @@ export default {
},
data() {
return {
scriptTip:'',
isHasCoversition:false,
conversitionId:'',
currentMemberList:[],
@ -165,7 +161,6 @@ export default {
},
//
'$store.state.socket.createConversition':function(val) {
this.scriptTip = '';
if (this.memberData.length > 0) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member && member.userId == this.$store.state.user.id) {
@ -231,46 +226,6 @@ export default {
this.currentMemberList = memberList;
}
},
//
'$store.state.socket.simulationScriptTip':function(val, old) {
if (val) {
if (val.type == 'Conversation') {
this.scriptTip = '请说:' + val.content;
} else if (val.type == 'Operation') {
const commandName = val.operationType;
let device = val.operationType.split('_')[0];
if (device == 'CM') {
device = 'ControlConvertMenu';
}
const operateName = Object.values(CMD[device]).find(res=>{ return res.value == commandName; });
this.$messageBox('请执行【' + operateName.label + '】操作');
} else if (val.type == 'Over_Conversation') {
this.scriptTip = '请结束当前会话';
} else if (val.type == 'Start_Conversation' ) {
const inviteMember = [];
this.createCoversition = true;
val.conversationMemberIds.forEach(id=>{
if (val.memberId != id) {
inviteMember.push((this.memberData.find(member=>{ return member.id == id; }) || {label:''}).label );
}
});
this.scriptTip = '请创建会话,选择' + inviteMember.toString();
} else if (val.type == 'Command') {
const targetName = this.memberData.find(member=>{ return member.id == val.commandInitiateVO.targetMemberId; });
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
};
this.$messageBox('请对【' + targetName.label + '】下达【' + CommandList[val.commandInitiateVO.commandType] + '】指令');
}
}
},
//
'$store.state.socket.conversationInfo':function (val, old) { // 仿
const simulationText = this.$store.state.socket.conversationInfo;
@ -306,7 +261,6 @@ export default {
'$store.state.socket.overConversition': function (val) {
if (val.id === this.conversitionId) {
this.conversitionId = '';
this.scriptTip = '';
this.currentMemberList = [];
this.chatContentList = [];
this.isHasCoversition = false;
@ -330,9 +284,6 @@ export default {
mounted() {
},
methods:{
setScriptTip(scriptTip) {
this.scriptTip = scriptTip;
},
addContent(simulationText) {
const text = {};
const member = this.currentMemberList.find(member=>{
@ -353,7 +304,6 @@ export default {
},
resetCoversition() {
this.conversitionId = '';
this.scriptTip = '';
this.isHasCoversition = false;
this.currentMemberList = [];
this.chatContentList = [];

View File

@ -5,48 +5,57 @@
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<script-preview-chat ref="chatbox" :group="group" :user-role="userRole" :member-data="memberData" :tree-data="treeData" />
<script-preview-chat ref="chatbox" :group="group" :user-role="userRole" :member-data="memberData" :tree-data="treeData" :offset="offset" />
<div class="display-draft">
<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>
</div>
<menu-schema
v-if="isDemon"
ref="menuSchema"
:offset="offset"
:offset-bottom="offsetBottom"
:show-station="showStation"
:station-list="stationListMode"
:show-select-station="showSelectStation"
@switchMode="switchMode"
@selectQuest="selectQuest"
@switchStationMode="switchStationMode"
/>
<div class="schema" :style="{top: offset+'px'}">
<template v-if="!dataError">
<el-button-group>
<el-button size="small" :disabled="viewDisabled || isscriptRun" type="success" @click="viewScriptRoles">{{ $t('display.schema.selectRoles') }}</el-button>
<!-- 运行图加载 -->
<el-button v-if="running" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
<el-button v-if="faultMode" size="small" type="danger" @click="setFault">自动故障设置</el-button>
</el-button-group>
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式':'切换到故障模式' }}</el-button>
</template>
</div>
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
</div>
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
<!-- <Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" /> -->
<select-role ref="selectRole" :member-list="memberList" @selectRole="selectRole" />
<run-plan-Load ref="runPlanLoad" :group="group" />
<run-plan-view ref="runPlanView" :group="group" />
<fault-choose ref="faultChoose" :group="group" :offset="offset" />
</div>
</template>
<script>
// 稿
import SelectRole from './selectRole';
import { getToken } from '@/utils/auth';
import RunPlanLoad from './demon/runPlanLoad';
import RunPlanView from './demon/runPlanView';
import ScriptPreviewChat from './scriptPreviewChat.vue';
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import { quitScriptNew, scriptRePreview } from '@/api/simulation';
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
import FaultChoose from './demon/faultChoose';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { mapGetters } from 'vuex';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { OperateMode } from '@/scripts/ConstDic';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import { Notification } from 'element-ui';
import { getByGroupStationList } from '@/api/jmap/map';
import { getEveryDayRunPlanNew } from '@/api/simulation';
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
import {getDraftScriptByGroupNew } from '@/api/script';
import Vue from 'vue';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
@ -54,7 +63,6 @@ import Cookies from 'js-cookie';
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
// import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import { timeFormat } from '@/utils/date';
export default {
name: 'DisplayDraft',
components: {
@ -62,8 +70,9 @@ export default {
RunPlanView,
ScriptPreviewChat,
MapSystemDraft,
MenuSchema,
MenuSystemTime
FaultChoose,
MenuSystemTime,
SelectRole
// Jl3dDrive
},
data() {
@ -76,6 +85,10 @@ export default {
dataError: false,
panelShow: true,
memberData:[],
faultMode: false,
viewDisabled: true,
mapLocation:{},
firstLoad: true,
// simulationShow: false,
// drivingShow: false,
isscriptRun:false, //
@ -91,7 +104,8 @@ export default {
},
userRole:'',
isDrive: this.prdType == '04',
treeData:[]
treeData:[],
memberList:[]
};
},
computed: {
@ -119,7 +133,6 @@ export default {
return this.$route.query.mapId;
},
prdType() {
// return this.$route.query.prdType;
return this.$store.state.training.prdType;
},
isDemon() {
@ -128,6 +141,12 @@ export default {
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
},
running() {
return this.$store.state.training.started;
},
isScheduling() {
return this.$store.state.training.prdType === '05';
}
// isDrive() {
// return this.prdType == '04';
@ -149,12 +168,6 @@ export default {
this.setPosition();
this.setMode();
},
// '$store.state.training.prdType': function(val) {
// debugger;
// // this.prdType=val;
// this.isDrive = (val == '04');
// this.isShowScheduling = (val == '05');
// },
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
@ -165,6 +178,16 @@ export default {
// this.$nextTick(() => {
this.initLoadData();
// });
},
'$store.state.training.switchcount': async function () {
if (this.group) {
if (this.$store.state.training.started && !this.firstLoad) {
await this.loadRunData();
} else if (this.firstLoad) {
await this.loadRunData(this.$route.query);
}
this.firstLoad = false;
}
}
},
created() {
@ -181,6 +204,79 @@ export default {
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
},
methods: {
viewScriptRoles() {
this.$refs.selectRole.doShow();
},
async selectRole(role) {
try {
const res = this.drawWay ? await loadDraftScriptNew(role.id, this.group) : await loadDraftScript(this.$route.query.scriptId, role.id, this.group);
if (res && res.code == 200) {
if (this.querymapLocation) {
const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
}
this.$store.dispatch('scriptRecord/updateBgSet', true);
this.isscriptRun = true;
if (role.type) {
const typeList = ConstConfig.ConstSelect.roleTypeNew;
typeList.forEach(type=>{
if (role.type == type.label) {
this.userRole = type.value;
}
});
let prdType;
if (this.userRole == '行值') {
prdType = '01';
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
this.$store.dispatch('training/setRoleDeviceCode', role.deviceCode);
} else if (this.userRole == '行调') {
prdType = '02';
this.$store.dispatch('training/setRoles', 'DISPATCHER');
} else if (this.userRole == '司机') {
prdType = '04';
} else if (this.userRole == '通号') {
prdType = '';
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);
} else {
prdType = '';
}
this.switchMode(prdType);
this.memberData.map(member=>{
if (member.id == role.id) {
member.userId = this.$store.state.user.id;
member.name = this.$store.state.user.nickname;
member.disabled = true;
}
});
} else {
this.userRole = 'AUDIENCE';
this.switchMode('');
}
} catch (error) {
this.$messageBox(error.message);
}
},
changeOperateMode() {
this.faultMode = !this.faultMode;
let mode = OperateMode.NORMAL;
if (this.faultMode) {
mode = OperateMode.FAULT;
}
this.$store.dispatch('training/changeOperateMode', { mode: mode });
},
//
async initLoadData() {
this.setWindowSize();
@ -208,6 +304,11 @@ export default {
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
if (resp.data.planRunning) {
this.$store.dispatch('training/start');// 仿
} else {
this.$store.dispatch('training/over');// 仿
}
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;
@ -217,15 +318,151 @@ export default {
// 仿
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
// this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (this.group) {
await this.loadNewMapDataByGroup(this.group);
await this.getDraftScriptByGroupNew(this.group);
this.switchMode('02');
} else {
this.endViewLoading();
}
},
async getDraftScriptByGroupNew(group) {
const resp = await getDraftScriptByGroupNew(group);
if (resp.code == 200) {
if (resp.data.memberList && resp.data.memberList.length > 0) {
this.$store.dispatch('training/setMemberList', {memberList:resp.data.memberList, userId:this.$store.state.user.id});
//
const memberList = this.$store.state.training.memberData;
// if (data.id) {
// memberList[data.id].userId = this.$store.state.user.id;
// memberList[data.id].name = this.$store.state.user.nickname;
// memberList[data.id].disabled = true;
// }
let lastData = JSON.stringify(memberList);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData = Object.values(lastData);
const lastMemberList = [];
const dispatcherList = [];
// const electricDispatcherList = [];
// const depotDispatcherList = [];
const stationSupervisorList = [];
const driverList = [];
const maintainerList = [];
this.treeData = [];
lastData.forEach((member, index)=>{
if (member.type != '观众') {
const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) {
if (device._type == 'Train') {
member.label = member.type + device.groupNumber + name;
lastMemberList.push(member);
driverList.push(member);
} else {
member.label = member.type + device.name + name;
lastMemberList.push(member);
if (device._type == 'Station') {
stationSupervisorList.push(member);
}
}
} else {
member.label = member.type + member.deviceCode + name;
lastMemberList.push(member);
}
} else {
member.label = member.type + name;
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
}
lastMemberList.push(member);
}
}
});
this.treeData = [{
label: '行调',
id: 'dispatcher',
type: 'role',
children: dispatcherList
}, {
label: '车站值班员',
id: 'stationSupervisor',
type: 'role',
children: stationSupervisorList
}, {
label: '司机',
id: 'driver',
type: 'role',
children: driverList
}, {
label: '通号',
id: 'maintainer',
type: 'role',
children: maintainerList
}];
this.memberData = lastMemberList;
}
let newMemberList = [];
const activeMemberList = [];
resp.data.actionList.forEach((activeMember)=>{
if (!(activeMemberList.length > 0 && activeMemberList.includes(activeMember.memberId))) {
activeMemberList.push(activeMember.memberId);
}
});
const playerList = resp.data.memberList.filter(member=>{
return activeMemberList.includes(member.id);
});
playerList.map(member=>{
if (!member.deviceName && member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device.name) {
member.deviceName = device.name;
} else {
member.deviceName = member.deviceCode;
}
}
});
const lastData = JSON.stringify(playerList);
newMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
if (resp.data.mapLocation) {
this.mapLocation = resp.data.mapLocation;
}
this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', label: this.$t('display.script.none'), role: 'no', disabled:false });
}
},
covert(data, roleTypeList) {
let lastData = data;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData.forEach(each=>{
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.label = each.type + deviceName + name;
each.disabled = false;
});
return lastData;
},
// id
async loadNewMapDataByGroup(group) {
@ -238,6 +475,33 @@ export default {
}
},
loadRunData() {
this.$store.dispatch('runPlan/clear').then(() => {
if (this.group) {
this.viewDisabled = true;
//
getByGroupStationList(this.group).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
getEveryDayRunPlanNew(this.group).then(resp => { // 仿
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$store.dispatch('runPlan/setInitialPlanData', resp.data);
this.viewDisabled = false;
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else {
!this.dataError && this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}
});
});
}).catch(() => {
this.$messageBox(this.$t('display.schema.getStationListFail'));
});
}
});
},
//
endViewLoading() {
this.$store.dispatch('map/mapClear');
@ -261,103 +525,6 @@ export default {
Notification.closeAll();
});
},
//
async selectQuest(data) {
this.isscriptRun = true;
if (data.roleName) {
const typeList = ConstConfig.ConstSelect.roleTypeNew;
typeList.forEach(type=>{
if (data.roleName == type.label) {
this.userRole = type.value;
}
});
} else {
this.userRole = 'AUDIENCE';
}
//
const memberList = this.$store.state.training.memberData;
if (data.id) {
memberList[data.id].userId = this.$store.state.user.id;
memberList[data.id].name = this.$store.state.user.nickname;
memberList[data.id].disabled = true;
}
let lastData = JSON.stringify(memberList);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData = Object.values(lastData);
const lastMemberList = [];
const dispatcherList = [];
// const electricDispatcherList = [];
// const depotDispatcherList = [];
const stationSupervisorList = [];
const driverList = [];
const maintainerList = [];
this.treeData = [];
lastData.forEach((member, index)=>{
if (member.type != '观众') {
const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) {
if (device._type == 'Train') {
member.label = member.type + device.groupNumber + name;
lastMemberList.push(member);
driverList.push(member);
} else {
member.label = member.type + device.name + name;
lastMemberList.push(member);
if (device._type == 'Station') {
stationSupervisorList.push(member);
}
}
} else {
member.label = member.type + member.deviceCode + name;
lastMemberList.push(member);
}
} else {
member.label = member.type + name;
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
}
lastMemberList.push(member);
}
}
});
this.treeData = [{
label: '行调',
id: 'dispatcher',
type: 'role',
children: dispatcherList
}, {
label: '车站值班员',
id: 'stationSupervisor',
type: 'role',
children: stationSupervisorList
}, {
label: '司机',
id: 'driver',
type: 'role',
children: driverList
}, {
label: '通号',
id: 'maintainer',
type: 'role',
children: maintainerList
}];
this.memberData = lastMemberList;
//
},
// 退
handleQuitQuest() {
quitScriptNew(this.group).then(resp => {
@ -368,6 +535,11 @@ export default {
this.$store.dispatch('scriptRecord/updateBgSet', false);
this.userRole = '';
this.$refs.chatbox.clearAllData();
// if (resp.data.planRunning) {
// this.$store.dispatch('training/start');// 仿
// } else {
// this.$store.dispatch('training/over');// 仿
// }
}).catch(()=>{
this.$messageBox(this.$t('display.demon.exitTaskFail'));
});
@ -408,12 +580,15 @@ export default {
// this.panelShow = true;
// this.drivingShow = false;
// },
runPlanViewShow() {
viewRunPlan() {
this.$refs.runPlanView.doShow();
},
runPlanLoadShow() {
loadRunPlan() {
this.$refs.runPlanLoad.doShow();
},
setFault() {
this.$refs.faultChoose.doShow();
},
switchStationMode(val) {
if (val == null && this.stationListMode.length > 0) {
this.showStation = this.stationListMode[0].value;
@ -453,9 +628,20 @@ export default {
user-select: none;
}
.display-draft {
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
.schema {
z-index: 36;
display: inline;
position: absolute;
right: 5px;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-button+.el-button {
margin-left: 0px;
}
</style>

View File

@ -180,6 +180,7 @@ export default {
clearTimeout(this.time);
}
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
this.$store.dispatch('map/resetActiveTrainList', true);
},
mounted() {
this.$nextTick(() => {
@ -277,7 +278,7 @@ export default {
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/resetActiveTrainList', false);
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/setTrainWindowShow', false);
});

View File

@ -1,18 +1,14 @@
<template>
<div>
<div class="schema" :style="{top: offset+'px'}">
<el-select v-if="isDesignPlatform" 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-select>
<el-select v-if="showSelectStation && isLocalStation && !isScript" v-model="showStationContent" style="width: 100px;" size="small" @change="switchStationModeInfo">
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<template v-if="!dataError">
<el-button-group>
<el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编制</el-button>
<el-button v-if="isDemon && isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewScriptRoles">{{ $t('display.schema.selectRoles') }}</el-button>
<el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编辑</el-button>
<!-- 加载剧本 -->
<el-button v-if="isDemon && !isDesignPlatform && !isScheduling" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
<el-button v-if="isDemon && !isScheduling" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
<!-- 运行图加载 -->
<el-button v-if="notScript && running" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="notScript && !running" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
@ -38,7 +34,6 @@ import AddQuest from './demon/addQuest';
import { OperateMode } from '@/scripts/ConstDic';
import { getByGroupStationList } from '@/api/jmap/map';
import RunPlanEdit from './demon/runPlanEdit';
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
import { getEveryDayRunPlanNew, loadScriptNew } from '@/api/simulation';
import Vue from 'vue';
@ -91,10 +86,6 @@ export default {
showStationContent:'',
isScriptCommand:false,
faultMode: false,
swchList: [
{ value: '01', name: '现地' },
{ value: '02', name: '行调' }
],
firstLoad: true
};
},
@ -111,9 +102,6 @@ export default {
isDemon() {
return this.$route.params.mode === 'demon';
},
isDesignPlatform() { //
return this.$route.fullPath.includes('design/displayNew/demon');
},
isScheduling() {
return this.$route.query.prdType === '05';
},
@ -213,18 +201,9 @@ export default {
viewRunQuest() {
this.$refs.addQuest.doShow();
},
viewScriptRoles() {
const row = {id: this.$route.query.scriptId, group:this.$route.query.group, drawWay:this.$route.query.drawWay};
this.$refs.addQuest.handleLoad(1, row);
},
async selectQuest(row, id, mapLocation, roleName) {
try {
let res;
if (this.isDesignPlatform) {
res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group);
} else {
res = await loadScriptNew(row.id, id, this.group);
}
const res = await loadScriptNew(row.id, id, this.group);
if (res && res.code == 200) {
this.questId = parseInt(row.id);
if (mapLocation) {
@ -238,10 +217,6 @@ export default {
this.$messageBox(error.message);
}
},
switchMode(swch) {
this.$emit('switchMode', swch);
this.switchModeInner(swch);
},
switchModeInner(swch) {
let showMode = '03';
if (swch == '01') {

View File

@ -1,7 +1,6 @@
<template>
<div>
<div class="display-draft">
<!-- :style="{bottom: offsetBottom + 'px'}" -->
<el-button-group>
<el-button v-if="!isScriptCommand" type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('scriptRecord.drivingByPlan') }}</el-button>
<el-button v-if="!isScriptCommand" type="danger" :disabled="dataError" @click="end">初始化</el-button>
@ -41,7 +40,7 @@ import { ranAsPlan, exitRunPlan } from '@/api/simulation';
import { mapGetters } from 'vuex';
export default {
name: 'MenuTask',
name: 'MenuScript',
components: {
SetTime,
ScriptChat,
@ -185,7 +184,7 @@ export default {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/resetActiveTrainList', false);
this.$store.dispatch('map/setTrainWindowShow', false);
});
});
@ -196,7 +195,6 @@ export default {
},
back() {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('map/resetActiveTrainList');
history.go(-1);
Notification.closeAll();
});

View File

@ -7,11 +7,9 @@
:conversition-id="conversitionId"
:current-member-list="currentMemberList"
:chat-content-list="chatContentList"
:script-tip="scriptTip"
:is-start-record="isStartRecord"
:invite-user-name="inviteUserName"
:is-quit-show="isQuitShow"
@setScriptTip="setScriptTip"
@resetCoversition="resetCoversition"
/>
</template>
@ -38,7 +36,6 @@ export default {
},
data() {
return {
scriptTip:'',
isHasCoversition:false,
conversitionId:'',
currentMemberList:[],
@ -249,9 +246,6 @@ export default {
}
},
methods:{
setScriptTip(scriptTip) {
this.scriptTip = scriptTip;
},
addContent(simulationText) {
const text = {};
const member = this.currentMemberList.find(member=>{
@ -268,7 +262,6 @@ export default {
},
resetCoversition() {
this.conversitionId = '';
this.scriptTip = '';
this.isHasCoversition = false;
this.currentMemberList = [];
this.chatContentList = [];

View File

@ -1,27 +1,29 @@
<template>
<chat-box
ref="chatbox"
:group="group"
:is-show="isShow"
:tree-data="treeData"
:conversition-id="conversitionId"
:current-member-list="currentMemberList"
:chat-content-list="chatContentList"
:script-tip="scriptTip"
:is-start-record="isStartRecord"
:invite-user-name="inviteUserName"
:is-quit-show="isQuitShow"
@setScriptTip="setScriptTip"
@resetCoversition="resetCoversition"
/>
<div>
<chat-box
ref="chatbox"
:group="group"
:is-show="isShow"
:tree-data="treeData"
:conversition-id="conversitionId"
:current-member-list="currentMemberList"
:chat-content-list="chatContentList"
:is-start-record="isStartRecord"
:invite-user-name="inviteUserName"
:is-quit-show="isQuitShow"
@resetCoversition="resetCoversition"
/>
<script-tip ref="scriptTip" :offset="offset" :member-data="memberData" @allowCreatCoversition="allowCreatCoversition" />
</div>
</template>
<script>
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ChatBox from '../chatView/chatBox.vue';
import ScriptTip from './scriptTip';
export default {
name:'ScriptPreviewChat',
components:{
ChatBox
ChatBox,
ScriptTip
},
props: {
group: {
@ -39,11 +41,14 @@ export default {
treeData:{
type: Array,
required: true
},
offset: {
type: Number,
required: true
}
},
data() {
return {
scriptTip:'',
isHasCoversition:false,
conversitionId:'',
currentMemberList:[],
@ -65,7 +70,7 @@ export default {
watch:{
//
'$store.state.socket.createConversition':function(val) {
this.scriptTip = '';
debugger;
if (this.memberData.length > 0) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member && member.userId == this.$store.state.user.id) {
@ -125,46 +130,6 @@ export default {
this.currentMemberList = memberList;
}
},
//
'$store.state.socket.simulationScriptTip':function(val, old) {
if (val) {
if (val.type == 'Conversation') {
this.scriptTip = '请说:' + val.content;
} else if (val.type == 'Operation') {
const commandName = val.operationType;
let device = val.operationType.split('_')[0];
if (device == 'CM') {
device = 'ControlConvertMenu';
}
const operateName = Object.values(CMD[device]).find(res=>{ return res.value == commandName; });
this.$messageBox('请执行【' + operateName.label + '】操作');
} else if (val.type == 'Over_Conversation') {
this.scriptTip = '请结束当前会话';
} else if (val.type == 'Start_Conversation' ) {
const inviteMember = [];
this.createCoversition = true;
val.conversationMemberIds.forEach(id=>{
if (val.memberId != id) {
inviteMember.push((this.memberData.find(member=>{ return member.id == id; }) || {label:''}).label );
}
});
this.scriptTip = '请创建会话,选择' + inviteMember.toString();
} else if (val.type == 'Command') {
const targetName = this.memberData.find(member=>{ return member.id == val.commandInitiateVO.targetMemberId; });
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
};
this.$messageBox('请对【' + targetName.label + '】下达【' + CommandList[val.commandInitiateVO.commandType] + '】指令');
}
}
},
//
'$store.state.socket.conversationInfo':function (val, old) { // 仿
const simulationText = this.$store.state.socket.conversationInfo;
@ -175,12 +140,12 @@ export default {
//
'$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成');
this.$refs.scriptTip.resetScriptTip();
},
// 退
'$store.state.socket.overConversition': function (val) {
if (val.id === this.conversitionId) {
this.conversitionId = '';
this.scriptTip = '';
this.currentMemberList = [];
this.chatContentList = [];
this.isHasCoversition = false;
@ -201,9 +166,6 @@ export default {
}
},
methods:{
setScriptTip(scriptTip) {
this.scriptTip = scriptTip;
},
addContent(simulationText) {
const text = {};
const member = this.currentMemberList.find(member=>{
@ -224,7 +186,6 @@ export default {
},
resetCoversition() {
this.conversitionId = '';
this.scriptTip = '';
this.isHasCoversition = false;
this.currentMemberList = [];
this.chatContentList = [];
@ -232,6 +193,9 @@ export default {
this.inviteUserName = '';
this.inviteUser = {};
this.isQuitShow = false;
},
allowCreatCoversition() {
this.createCoversition = true;
}
}

View File

@ -0,0 +1,92 @@
<template>
<div v-if="scriptTipMessage!=''" class="scriptTipMessage" :style="{top:offset+'px'}">{{ scriptTipMessage }}</div>
</template>
<script>
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name:'ScriptTip',
props: {
offset: {
type: Number,
required: true
},
memberData:{
type: Array,
required: true
}
},
data() {
return {
scriptTipMessage:''
};
},
watch:{
//
'$store.state.socket.simulationScriptTip':function(val, old) {
if (val) {
if (val.type == 'Conversation') {
this.scriptTipMessage = '请说:' + val.content;
} else if (val.type == 'Operation') {
const commandName = val.operationType;
let device = val.operationType.split('_')[0];
if (device == 'CM') {
device = 'ControlConvertMenu';
}
const operateName = Object.values(CMD[device]).find(res=>{ return res.value == commandName; });
this.scriptTipMessage = '请执行【' + operateName.label + '】操作';
} else if (val.type == 'Over_Conversation') {
this.scriptTipMessage = '请结束当前会话';
} else if (val.type == 'Start_Conversation' ) {
const inviteMember = [];
this.$emit('allowCreatCoversition');
val.conversationMemberIds.forEach(id=>{
if (val.memberId != id) {
inviteMember.push((this.memberData.find(member=>{ return member.id == id; }) || {label:''}).label );
}
});
this.scriptTipMessage = '请创建会话,选择' + inviteMember.toString();
} else if (val.type == 'Command') {
const targetName = this.memberData.find(member=>{ return member.id == val.commandInitiateVO.targetMemberId; });
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
};
this.scriptTipMessage = '请对【' + targetName.label + '】下达【' + CommandList[val.commandInitiateVO.commandType] + '】指令';
}
}
},
'$store.state.socket.simulationScriptTipFinish':function(val, old) {
//
this.scriptTipMessage = '';
}
},
methods:{
resetScriptTip() {
this.scriptTipMessage = '';
}
}
};
</script>
<style lang="scss" scoped>
.scriptTipMessage{
position: absolute;
width: 400px;
padding: 15px 15px 20px 15px;
background: rgba(255,255,255,0.97);
top: 100px;
left: 50%;
border-radius: 8px;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
color: #000;
line-height: 180%;
z-index: 10;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,68 @@
<template>
<el-dialog
v-dialogDrag
:title="$t('display.script.roleSelect')"
:visible.sync="roleShow"
top="50px"
width="350px"
:before-do-close="roleDoClose"
:close-on-click-modal="false"
:z-index="5000"
>
<div>
<el-form ref="ruleForm" :model="form" label-width="50px">
<el-form-item :label="$t('display.script.role')" prop="role">
<el-select v-model="form.type" :placeholder="$t('display.script.pleaseSelect')">
<el-option
v-for="item in memberList"
:key="item.id"
:label="item.label"
:value="item.id"
:disabled="item.disabled"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="roleDoClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="confirm">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name:'SelectRole',
props:{
memberList:{
type: Array,
default() {
return [];
}
}
},
data() {
return {
roleShow:false,
form: {
type: ''
}
};
},
methods:{
roleDoClose() {
this.$refs['ruleForm'].resetFields();
this.roleShow = false;
},
doShow() {
this.roleShow = true;
},
confirm() {
const role = this.memberList.find(elem=>{ return elem.id == this.form.type; });
this.$emit('selectRole', role);
this.roleDoClose();
}
}
};
</script>

View File

@ -218,7 +218,7 @@ export default {
this.$store.dispatch('training/setSimulationUserList', []);
this.$store.dispatch('training/over').then(() => {
this.backLoading = true;
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/resetActiveTrainList', true);
if (this.$route.query.projectDevice) {
this.$store.dispatch('LogOut').then(() => {
location.reload();
@ -326,11 +326,11 @@ export default {
this.isDisable = false;
exitRunPlan(this.group).then(()=>{
this.$store.dispatch('map/setTrainWindowShow', false);
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/resetActiveTrainList', false);
}).catch(() => {
this.$store.dispatch('training/over').then(() => {
this.isDisable = true;
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/resetActiveTrainList', false);
this.$messageBox(this.$t('error.endSimulationFailed'));
});
});
@ -347,7 +347,7 @@ export default {
this.$store.dispatch('training/setSimulationUserList', []);
this.$store.dispatch('training/over').then(() => {
this.backLoading = true;
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/resetActiveTrainList', true);
if (this.$route.query.projectDevice) {
this.$store.dispatch('LogOut').then(() => {
location.reload();

View File

@ -78,7 +78,6 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
delete this.editModel.children;
this.verifyMapName();
}
});
@ -93,12 +92,13 @@ export default {
}
} catch (error) {
console.log(error);
this.loading = false;
}
},
confirmPublish() {
this.$confirm(this.$t('map.verifyMapName'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
this.$confirm('地图名称重复,您确认发布此地图将会覆盖公共地图?', '提示', {
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning'
}).then(() => {
this.publishMap();

View File

@ -45,7 +45,15 @@ export default {
this.dialogVisible = false;
this.$set(this.row, 'loading' + this.idx, true);
try {
const res = await getPublishMapExportNew(this.row.id, this.checkList);
const data = {
mapData: this.checkList.includes('MAP_DATA'),
runPlan: this.checkList.includes('RUN_PLAN'),
map3dData: this.checkList.includes('MAP_3D_DATA'),
map3dModel: this.checkList.includes('MAP_3D_MODEL'),
commandDefinition: this.checkList.includes('COMMAND_DEFINITION'),
realLineConfig: this.checkList.includes('REAL_LINE_CONFIG')
};
const res = await getPublishMapExportNew(this.row.id, data);
const resultData = res.data;
if (resultData === false) {
return;

View File

@ -12,7 +12,7 @@
<script>
// getPublishMapExport
import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo, getPublishMapExport } from '@/api/jmap/map';
import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo, getPublishMapExport, getPublishMapImportNew } from '@/api/jmap/map';
import { getLineCodeList } from '@/api/management/mapline';
import localStore from 'storejs';
import UpdateOperate from './draft.vue';
@ -133,8 +133,9 @@ export default {
},
{
name: '导入',
handleClick: this.handleExportMap,
type: 'default'
handleClick: this.handleImportMap,
type: 'file',
id: 'queryPagesFilesInput'
},
{
name: '导出',
@ -354,42 +355,64 @@ export default {
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j]));
},
//
queryExportData(data) {
return new Promise((resolve, reject) => {
const result = {
base: []
};
const obj = {};
const list = ['graphData', 'logicData'];
for (const i in data) {
if (list.includes(i)) {
for (const v in data[i]) {
if (data[i][v].length) {
result[v] = [...data[i][v]];
} else if (v == 'skinVO') {
result[v] = [data[i][v]];
}
}
} else if (data[i] instanceof Object || typeof data[i] != 'object') {
obj[i] = data[i];
} else if (data[i] instanceof Array) {
if (data[i].length) {
obj[i] = [...data[i]];
}
}
}
// //
// queryExportData(data) {
// return new Promise((resolve, reject) => {
// const result = {
// base: []
// };
// const obj = {};
// const list = ['graphData', 'logicData'];
// for (const i in data) {
// if (list.includes(i)) {
// for (const v in data[i]) {
// if (data[i][v].length) {
// result[v] = [...data[i][v]];
// } else if (v == 'skinVO') {
// result[v] = [data[i][v]];
// }
// }
// } else if (data[i] instanceof Object || typeof data[i] != 'object') {
// obj[i] = data[i];
// } else if (data[i] instanceof Array) {
// if (data[i].length) {
// obj[i] = [...data[i]];
// }
// }
// }
result.base.push(obj);
resolve(result);
});
},
// result.base.push(obj);
// resolve(result);
// });
// },
mapSort() {
this.$router.push({ path: `/publish/mapSort`});
},
localExport() {
this.$refs['localMap'].doShow();
},
handleImportMap(index, row, idx) {
setTimeout(() => {
this.$set(row, 'loading' + idx, true);
const obj = document.getElementById('queryPagesFilesInput');
if (!obj.files) return;
const f = obj.files[0];
const reader = new FileReader();
const that = this;
reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result;
getPublishMapImportNew(row.id, JSON.parse(data)).then(res => {
that.$message.success('导入成功!');
that.$set(row, 'loading' + idx, false);
}).catch(error => {
that.$message.error('导入失败' + error.message);
that.$set(row, 'loading' + idx, false);
});
obj.value = '';
};
});
},
localImport() {
const loading = this.$loading({
lock: true,
@ -417,124 +440,124 @@ export default {
obj.value = '';
};
});
},
//
queryExportDataSame(data) {
const mapProps = {};
mapProps['stationStandList'] = {
filter: item => { return true; },
propList: {
'direction': item => {
switch (item.direction) {
case '01': return '下行';
case '02': return '上行';
default: return '未知';
}
},
'name': (item, devices) =>{
let name = '';
if (item.stationCode) {
const stationList = devices['stationList'];
const station = stationList.find(elem => { return item.stationCode == elem.code; });
if (station) {
name = station.name;
}
}
return name;
},
'code': item => {
return item.code;
}
}
};
mapProps['switchList'] = {
filter: item => { return true; },
propList: {
'name': item =>{
return item.name;
},
'code': item => {
return item.code;
}
}
};
mapProps['signalList'] = {
filter: item => { return true; },
propList: {
'name': item =>{
return item.name;
},
'code': item => {
return item.code;
}
}
};
mapProps['sectionList'] = {
filter: item => { return item.type == '01'; },
propList: {
'name': (item, devices) =>{
let name = item.name;
if (item.isSwitchSection) {
const swchList = devices['switchList'];
const swch = swchList.find(elem => { return item.relSwitchCode == elem.code; });
if (swch) {
if (item.code == swch.sectionACode) {
name = `${name} (${swch.name}-A)`;
} else if (item.code == swch.sectionBCode) {
name = `${name} (${swch.name}-B)`;
} else if (item.code == swch.sectionCCode) {
name = `${name} (${swch.name}-C)`;
}
}
}
return name;
},
'code': item => {
return item.code;
}
}
};
return new Promise((resolve, reject) => {
const result = {
base: []
};
const obj = {};
const list = ['graphData', 'logicData'];
for (const i in data) {
if (list.includes(i)) {
for (const v in data[i]) {
if (data[i][v].length) {
if (mapProps[v]) {
const list = [];
data[i][v].forEach(device => {
if (mapProps[v].filter(device)) {
const obj = {};
Object.keys(mapProps[v].propList || []).forEach(key => {
obj[key] = mapProps[v].propList[key](device, data[i]);
});
list.push(obj);
}
});
result[v] = list;
}
}
}
} else if (data[i] instanceof Object || typeof data[i] != 'object') {
obj[i] = data[i];
} else if (data[i] instanceof Array) {
if (data[i].length) {
obj[i] = [...data[i]];
}
}
}
result.base.push(obj);
resolve(result);
});
}
// //
// queryExportDataSame(data) {
// const mapProps = {};
// mapProps['stationStandList'] = {
// filter: item => { return true; },
// propList: {
// 'direction': item => {
// switch (item.direction) {
// case '01': return '';
// case '02': return '';
// default: return '';
// }
// },
// 'name': (item, devices) =>{
// let name = '';
// if (item.stationCode) {
// const stationList = devices['stationList'];
// const station = stationList.find(elem => { return item.stationCode == elem.code; });
// if (station) {
// name = station.name;
// }
// }
// return name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['switchList'] = {
// filter: item => { return true; },
// propList: {
// 'name': item =>{
// return item.name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['signalList'] = {
// filter: item => { return true; },
// propList: {
// 'name': item =>{
// return item.name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['sectionList'] = {
// filter: item => { return item.type == '01'; },
// propList: {
// 'name': (item, devices) =>{
// let name = item.name;
// if (item.isSwitchSection) {
// const swchList = devices['switchList'];
// const swch = swchList.find(elem => { return item.relSwitchCode == elem.code; });
// if (swch) {
// if (item.code == swch.sectionACode) {
// name = `${name} (${swch.name}-A)`;
// } else if (item.code == swch.sectionBCode) {
// name = `${name} (${swch.name}-B)`;
// } else if (item.code == swch.sectionCCode) {
// name = `${name} (${swch.name}-C)`;
// }
// }
// }
// return name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// return new Promise((resolve, reject) => {
// const result = {
// base: []
// };
// const obj = {};
// const list = ['graphData', 'logicData'];
// for (const i in data) {
// if (list.includes(i)) {
// for (const v in data[i]) {
// if (data[i][v].length) {
// if (mapProps[v]) {
// const list = [];
// data[i][v].forEach(device => {
// if (mapProps[v].filter(device)) {
// const obj = {};
// Object.keys(mapProps[v].propList || []).forEach(key => {
// obj[key] = mapProps[v].propList[key](device, data[i]);
// });
// list.push(obj);
// }
// });
// result[v] = list;
// }
// }
// }
// } else if (data[i] instanceof Object || typeof data[i] != 'object') {
// obj[i] = data[i];
// } else if (data[i] instanceof Array) {
// if (data[i].length) {
// obj[i] = [...data[i]];
// }
// }
// }
// result.base.push(obj);
// resolve(result);
// });
// }
}
};
</script>

View File

@ -107,7 +107,7 @@ export default {
beforeDestroy() {
// this.clearAutoSave();
this.$store.dispatch('training/setMemberList', {memberList:[], userId:this.$store.state.user.id});
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/resetActiveTrainList', true);
this.$store.dispatch('scriptRecord/updateBgSet', false);
this.$store.dispatch('scriptRecord/updateRole', null);
},

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.