This commit is contained in:
lVAL 2020-11-10 18:25:29 +08:00
commit 9b4039daab
48 changed files with 808 additions and 641 deletions

View File

@ -4,18 +4,18 @@
export function traverseLineElements(currentType, elementTypeList, model, style, obj) {
const currentTypeList = currentType.elemnetType;
currentTypeList.forEach(element => {
const ClassName = elementTypeList[element];
if (ClassName) {
obj[element] = new ClassName({
zlevel: model.zlevel,
z: 1 + currentType[element].z,
style: style,
modelData:model
});
obj.add(obj[element]);
} else {
console.error(`not find class name: ${ClassName}`);
}
const ClassName = elementTypeList[element];
if (ClassName) {
obj[element] = new ClassName({
zlevel: model.zlevel,
z: 1 + currentType[element].z,
style: style,
modelData:model
});
obj.add(obj[element]);
} else {
console.error(`not find class name: ${ClassName}`);
}
});
}
// 遍历后端返回的状态控制的绘图

View File

@ -151,10 +151,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -132,10 +132,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -129,10 +129,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -1,39 +1,79 @@
<template>
<el-dialog v-dialogDrag :class="popClass" :title="title" :visible.sync="show" width="350px" :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-form ref="form" :model="form" :rules="rules">
<el-col :span="11">
<el-form-item>
<el-input v-model="deviceName" size="small" style="height: 32px;line-height: 32px;" disabled />
</el-form-item>
</el-col>
<el-col :span="11" :offset="2">
<el-form-item prop="faultType">
<el-select v-model="form.faultType" size="small" style="height: 32px;line-height: 32px;" placeholder="请选择">
<el-option
v-for="item in faultList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-form>
</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>
</el-dialog>
<div v-dialogDrag>
<!-- <el-dialog v-dialogDrag :class="popClass" :title="title" :visible.sync="show" width="350px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> -->
<div
v-show="show"
class="iscs_fuzhou-01__systerm route-detail el-dialog"
>
<div class="el-dialog__header">
<span class="el-dialog__title">{{ title }}</span>
<button type="button" aria-label="Close" class="el-dialog__headerbtn" @click="doClose">
<i class="el-dialog__close el-icon el-icon-close" />
</button>
</div>
<div class="el-dialog__body">
<template v-if="judge">
<el-row>
<el-form ref="form" :model="formModel" :rules="rules">
<el-col :span="24">
<el-form-item prop="targetDeviceCode" label="目的地:">
<el-select v-model="formModel.targetDeviceCode" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
<el-option
v-for="item in selectedList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type="field == 'selectedCode' ? 'danger' : 'primary'"
size="small"
@click="hover('selectedCode')"
>激活</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
</template>
<template v-else>
<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-form ref="form" :model="form" :rules="rules">
<el-col :span="11">
<el-form-item>
<el-input v-model="deviceName" size="small" style="height: 32px;line-height: 32px;" disabled />
</el-form-item>
</el-col>
<el-col :span="11" :offset="2">
<el-form-item prop="faultType">
<el-select v-model="form.faultType" size="small" style="height: 32px;line-height: 32px;" placeholder="请选择">
<el-option
v-for="item in faultList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-form>
</el-row>
</template>
<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>
</div>
</div>
<!-- </el-dialog> -->
</div>
</template>
<script>
@ -41,6 +81,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
import { menuOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
name: 'SwitchControl',
@ -60,9 +101,15 @@ export default {
stationName: '',
switchName: '',
activeShow: false,
judge: false,
deviceName: '',
faultList: [],
form: { faultType: ''},
formModel: {
targetDeviceCode: ''
},
groupNumber: '',
field: '',
rules: {
faultType: [
{ required: true, message: '请选择故障类型', trigger: 'change'}
@ -71,6 +118,19 @@ export default {
};
},
computed: {
...mapGetters('map', [
'sectionList',
'trainList'
]),
selectedList() {
let list = [];
let sectionList = [];
if (this.sectionList && this.sectionList.length) {
sectionList = this.sectionList.filter(elem => { return (elem.standTrack || elem.reentryTrack || elem.transferTrack); });
}
list = [...sectionList, ...this.trainList];
return list;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -85,6 +145,8 @@ export default {
return '设置故障';
} else if (this.operation == OperationEvent.MixinCommand.cancelStoppage.menu.operation) {
return '取消故障';
} else if (this.operation == OperationEvent.MixinCommand.collocation.menu.operation) {
return '设置托管';
}
return '';
}
@ -94,6 +156,14 @@ export default {
if (this.dialogShow && this.popClass === 'ningbo-01__systerm') {
this.commit();
}
},
'$store.state.menuOperation.selectedCount':function(em) {
const device = this.$store.state.menuOperation.selected;
if (device && device.code && this.judge && this.field) {
if (device._type == 'Section' || device._type == 'Train') {
this.deviceSelect(device);
}
}
}
},
mounted() {
@ -102,7 +172,10 @@ export default {
});
},
methods: {
doShow(operate, selected) {
hover(field) {
this.field = field == this.field ? '' : field;
},
doShow(operate, selected, judge) {
if (!this.dialogShow) {
this.switchName = '';
this.stationName = '';
@ -128,6 +201,11 @@ export default {
if (this.faultList && this.faultList.length) {
this.form.faultType = this.faultList[0].value;
}
this.judge = false;
if (judge) {
this.judge = judge;
this.groupNumber = selected.groupNumber;
}
}
if (selected._type) {
this.dialogShow = true;
@ -150,6 +228,8 @@ export default {
this.sendInstructions();
} else if (this.operation == OperationEvent.MixinCommand.cancelStoppage.menu.operation) {
this.cancelCommand();
} else if (this.operation == OperationEvent.MixinCommand.collocation.menu.operation) {
this.handleCollocation();
}
}
});
@ -176,6 +256,18 @@ export default {
};
this.sendCommand(setp);
},
handleCollocation() { //
const setp = {
over: true,
operation: menuOperate.Common.collocation.operation,
cmdType: menuOperate.Common.collocation.cmdType,
param: {
groupNumber: this.groupNumber,
targetDeviceCode: this.formModel.targetDeviceCode
}
};
this.sendCommand(setp);
},
sendCommand(setp) {
this.loading = true;
this.$store.dispatch('training/nextNew', setp).then(({ valid }) => {
@ -206,6 +298,15 @@ export default {
}).catch(() => {
this.doClose();
});
},
deviceSelect(em) {
if (this.field == 'selectedCode' && em._type == 'Section') {
this.formModel.targetDeviceCode = em.code;
this.field = '';
} else if (this.field == 'selectedCode' && em._type == 'Train') {
this.formModel.targetDeviceCode = em.code;
this.field = '';
}
}
}
};
@ -216,3 +317,44 @@ export default {
margin-top: 5px;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.route-detail{
position: absolute;
left: calc(50% - 175px);
margin-top: 15vh;
width: 350px;
z-index: 2000;
box-sizing: border-box;
background: rgba(100, 100, 100, 0.3);
border: 2px solid rgba(144, 144, 144, 0.8);
border-radius: 6px;
color: #000;
font-size: 14px;
.el-dialog__header{
padding: 0px 8px;
height: 26px;
.el-dialog__title{
color: #fff;
}
.el-dialog__headerbtn{
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 4px;
right: 12px;
line-height: 16px;
color: #fff;
.el-icon{
color: #fff;
}
}
}
.el-dialog__body{
background: #fff;
margin: 5px;
margin-top: 0;
padding: 10px;
}
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div v-dialogDrag>
<!-- <el-dialog v-dialogDrag :class="popClass" :title="title" :visible.sync="show" width="350px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false"> -->
<div
v-show="show"
class="iscs_fuzhou-01__systerm route-detail el-dialog"
>
<div class="el-dialog__header">
<span class="el-dialog__title">{{ title }}</span>
<button type="button" aria-label="Close" class="el-dialog__headerbtn" @click="doClose">
<i class="el-dialog__close el-icon el-icon-close" />
</button>
</div>
<div class="el-dialog__body">
<el-row>
<el-form ref="form" :model="formModel" :rules="rules">
<el-col :span="24">
<el-form-item prop="groupNumber1" label="主动车:">
<el-select v-model="formModel.groupNumber1" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
<el-option
v-for="item in selectedList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type="field == 'selectedCode1' ? 'danger' : 'primary'"
size="small"
@click="hover('selectedCode1')"
>激活</el-button>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item prop="groupNumber2" label="被动车:">
<el-select v-model="formModel.groupNumber2" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
<el-option
v-for="item in selectedList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type="field == 'selectedCode2' ? 'danger' : 'primary'"
size="small"
@click="hover('selectedCode2')"
>激活</el-button>
</el-form-item>
</el-col>
</el-form>
</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>
</div>
</div>
<!-- </el-dialog> -->
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
// import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
import { menuOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
name: 'SwitchControl',
props: {
popClass: {
type: String,
default() {
return '';
}
}
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
formModel: {
groupNumber1: '',
groupNumber2: ''
},
groupNumber: '',
field: '',
rules: {
faultType: [
{ required: true, message: '请选择故障类型', trigger: 'change'}
]
}
};
},
computed: {
...mapGetters('map', [
'trainList'
]),
selectedList() {
let list = [];
list = [...this.trainList];
return list;
},
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() {
if (this.operation == OperationEvent.MixinCommand.setLink.menu.operation) {
return '设置连挂';
}
return '';
}
},
watch:{
'$store.state.map.keyboardEnterCount': function (val) {
if (this.dialogShow && this.popClass === 'ningbo-01__systerm') {
this.commit();
}
},
'$store.state.menuOperation.selectedCount':function(em) {
const device = this.$store.state.menuOperation.selected;
if (device && device.code && this.field) {
if (device._type == 'Train') {
this.deviceSelect(device);
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
hover(field) {
this.field = field == this.field ? '' : field;
},
doShow(operate, selected) {
if (!this.dialogShow) {
this.operation = operate.operation;
this.cmdType = operate.cmdType;
}
if (selected._type) {
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
}
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.form.resetFields();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.operation == OperationEvent.MixinCommand.setLink.menu.operation) {
this.handleLink();
}
}
});
},
handleLink() { //
const setp = {
over: true,
operation: menuOperate.Common.setLink.operation,
cmdType: menuOperate.Common.setLink.cmdType,
param: {
groupNumber1: this.formModel.groupNumber1,
groupNumber2: this.formModel.groupNumber2
}
};
this.sendCommand(setp);
},
sendCommand(setp) {
this.loading = true;
this.$store.dispatch('training/nextNew', setp).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
} else {
this.doClose();
this.$messageBox('设置或取消故障操作失败!');
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$messageBox(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();
});
},
deviceSelect(em) {
if (this.field == 'selectedCode1' && em._type == 'Train') {
this.formModel.groupNumber1 = em.code;
this.field = '';
} else if (this.field == 'selectedCode2' && em._type == 'Train') {
this.formModel.groupNumber2 = em.code;
this.field = '';
}
}
}
};
</script>
<style>
.el-select-dropdown.el-popper{
margin-top: 5px;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.route-detail{
position: absolute;
left: calc(50% - 175px);
margin-top: 15vh;
width: 350px;
z-index: 2000;
box-sizing: border-box;
background: rgba(100, 100, 100, 0.3);
border: 2px solid rgba(144, 144, 144, 0.8);
border-radius: 6px;
color: #000;
font-size: 14px;
.el-dialog__header{
padding: 0px 8px;
height: 26px;
.el-dialog__title{
color: #fff;
}
.el-dialog__headerbtn{
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 4px;
right: 12px;
line-height: 16px;
color: #fff;
.el-icon{
color: #fff;
}
}
}
.el-dialog__body{
background: #fff;
margin: 5px;
margin-top: 0;
padding: 10px;
}
}
</style>

View File

@ -66,7 +66,7 @@ export const menuOperate = {
cmdType: CMD.Section.CMD_SECTION_DETAILS
},
loadSpareTrain: {
// 添加备用车
// 添加备用车
operation: OperationEvent.Section.loadSpareTrain.menu.operation,
cmdType: CMD.Section.CMD_TRAIN_LOAD_SPARE_TRAIN
}
@ -370,6 +370,16 @@ export const menuOperate = {
cancelFault: {
operation: OperationEvent.MixinCommand.cancelStoppage.menu.operation,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
},
// 设置托管
collocation: {
operation: OperationEvent.MixinCommand.collocation.menu.operation,
cmdType: CMD.Train.CMD_TRAIN_TRUST
},
// 设置连挂
setLink: {
operation: OperationEvent.MixinCommand.setLink.menu.operation,
cmdType: CMD.Train.CMD_TRAIN_LINK
}
},
Station:{

View File

@ -164,9 +164,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -199,10 +199,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -107,10 +107,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -169,9 +169,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -151,9 +151,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -129,6 +129,18 @@ export default {
handler: this.loadSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_SPARE_TRAIN
}
],
faultList: [
{
label: '设置故障',
handler: this.setStoppage,
cmdType: CMD.Fault.CMD_SET_FAULT
},
{
label: '取消故障',
handler: this.cancelStoppage,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
}
]
};
},
@ -169,11 +181,18 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode == OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
if (this.operatemode == OperateMode.FAULT && this.selected.type == '04') {
this.menu = this.faultList;
}
},
doShow(point) {
this.clickEvent();

View File

@ -11,6 +11,7 @@
<trainSetWorkATP ref="trainSetWorkATP" />
<SpeedLimit ref="speedLimit" pop-class="ningbo-01__systerm" />
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
<set-train-operation ref="setTrainOperation" pop-class="ningbo-01__systerm" />
</div>
</template>
@ -26,6 +27,7 @@ import TrainSetHead from './dialog/trainSetHead';
import TrainSetWork from './dialog/trainSetWork';
import trainSetWorkATP from './dialog/trainSetWorkATP';
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
import SetTrainOperation from '@/jmapNew/theme/components/menus/dialog/setTrainOperation';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@ -47,7 +49,8 @@ export default {
TrainSetWork,
trainSetWorkATP,
SetFault,
SpeedLimit
SpeedLimit,
SetTrainOperation
},
props: {
selected: {
@ -207,6 +210,14 @@ export default {
{
label: '取消故障',
handler: this.cancelStoppage
},
{
label: '托管',
handler: this.setCollocation
},
{
label: '连挂',
handler: this.setLink
}
],
menuDirective: [
@ -321,6 +332,22 @@ export default {
}
});
},
//
setCollocation() {
commitOperate(menuOperate.Common.collocation, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.collocation, this.selected, true);
}
});
},
//
setLink() {
commitOperate(menuOperate.Common.setLink, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setTrainOperation.doShow(menuOperate.Common.setLink, this.selected, true);
}
});
},
nextStation() {
// commitOperate(menuOperate.Train.nextStation, { groupNumber: this.selected.code }, 3).then(({valid, operate})=>{
// }).catch((error) => {

View File

@ -177,11 +177,13 @@ export default {
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
if (this.selected.type != '04') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -182,9 +182,13 @@ export default {
initMenu() {
//
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = this.menuNormal.Center;
if (this.selected.type != '04') {
this.menu = this.menuNormal.Center;
} else {
this.menu = [];
}
//
if (this.operatemode === OperateMode.FAULT) {
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
},

View File

@ -94,12 +94,11 @@ export default {
{label: '观众', value: 'AUDIENCE', enLabel: 'Audience '},
{label: '司机', value: 'DRIVER', enLabel: 'Driver '},
{label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '},
{label: '车辆段调度', value: 'DEPOT_DISPATCHER', enLabel: 'Depot dispatcher '},
{label: '车辆段信号楼', value: 'DEPOT_DISPATCHER', enLabel: 'Depot dispatcher '},
{label: '电力调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'},
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '},
{label: '上级部门', value: 'PARENT_DEPARTMENT', enLabel: 'Parent department'},
{label: '停车场信号楼', value: 'PARKING_LOT_SIGNAL_BUILDING', enLabel: 'Parking Signal Building'}
],
SimulationType: [
{ label: '实训', value: 'Training'},

View File

@ -229,7 +229,9 @@ export default {
CMD_TRAIN_CANCEL_HOLD: {value:'Train_Cancel_Hold', label: '列车发车'},
CMD_TRAIN_CHANGE_TRIP_NUMBER: {value:'Train_Change_Trip_Number', label: '更改列车车次'},
CMD_TRAIN_DELETE_SERVICE_NUMBER: {value:'Train_Delete_Service_Number', label: '删除车次号'},
CMD_TRAIN_CHANGE_DESTINATION_CODE: {value:'Train_Change_Destination_Code', label: '更改目的地码'}
CMD_TRAIN_CHANGE_DESTINATION_CODE: {value:'Train_Change_Destination_Code', label: '更改目的地码'},
CMD_TRAIN_TRUST: {value: 'Train_Trust', label: '设置托管'},
CMD_TRAIN_LINK: {value: 'Train_Link', label: '设置连挂'}
},
TrainWindow: {
/** 修改列车识别号 */

View File

@ -32,6 +32,20 @@ class CommandHandle {
simulationRole: 'Center',
controlMode: ['OperateCenterControl'],
conditionList: []
},
Train_Trust: {
operate: 'Train_Trust',
paramList:[{name: 'groupNumber'}, {name: 'targetDeviceCode'}],
simulationRole: 'Center',
controlMode: ['OperateCenterControl'],
conditionList: []
},
Train_Link: {
operate: 'Train_Link',
paramList:[{name: 'groupNumber1'}, {name: 'groupNumber2'}],
simulationRole: 'Center',
controlMode: ['OperateCenterControl'],
conditionList: []
}
}
};

View File

@ -38,8 +38,8 @@ export const deviceFaultType = {
Switch: [
{label: '失表', value: 'SPLIT'},
{label: '定位失表', value: 'NORMAL_SPLIT'},
{label: '反位失表', value: 'REVERSE_SPLIT'},
{label: '道岔区段计轴故障', value: 'AXLE_FAULT'}
{label: '反位失表', value: 'REVERSE_SPLIT'}
// {label: '道岔区段计轴故障', value: 'AXLE_FAULT'}
],
StationStand: [
{label: '屏蔽门无法关闭', value: 'PSD_CANNOT_BE_CLOSED'},
@ -49,7 +49,8 @@ export const deviceFaultType = {
{label: 'zc故障', value: 'FAULT'}
],
Train: [
{label: '通信异常', value: 'COMMUNICATION_ABNORMAL'}
{label: '通信异常', value: 'COMMUNICATION_ABNORMAL'},
{label: '驾驶故障', value: 'DRIVE_FAULT'}
],
Power:[
{label: '供电故障', value: 'FAULT'}

View File

@ -2442,6 +2442,18 @@ export const OperationEvent = {
menu: {
operation: '2996'
}
},
// 设置托管
collocation: {
menu: {
operation: '2997'
}
},
// 设置连挂
setLink: {
menu: {
operation: '2999'
}
}
}

View File

@ -874,11 +874,10 @@ const map = {
let isExist = false;
state.activeTrainList.forEach(elem => {
if (elem == data.code) {
isExist = true;
if (data.dispose) {
state.activeTrainList.splice(state.activeTrainList.indexOf(data.code), 1);
state.activeTrainListChange += 1;
} else {
isExist = true;
}
}
});

View File

@ -22,36 +22,6 @@ const runPlan = {
},
draftStations: (state) => {
return state.draftStations || [];
},
convertPlanData: (state) => () => {
const data = { serviceNumberDataList: [] };
const serviceNumberList = Object.keys(state.editData).sort((a, b) => {
return state.editData[a].oldIndex - state.editData[b].oldIndex;
});
serviceNumberList.forEach(serviceNumber => {
const serviceObj = {
serviceNumber: serviceNumber,
tripNumberDataList: []
};
if (state.editData[serviceNumber].backup) {
serviceObj['backup'] = state.editData[serviceNumber].backup;
}
const trainMap = state.editData[serviceNumber].trainMap;
const tripNumberList = Object.keys(trainMap).sort((a, b) => {
return trainMap[a].oldIndex - trainMap[b].oldIndex;
});
tripNumberList.forEach(tripNumber => {
serviceObj.tripNumberDataList.push(trainMap[tripNumber]);
});
data.serviceNumberDataList.push(serviceObj);
});
return data;
}
},
mutations: {
@ -77,7 +47,6 @@ const runPlan = {
const trainList = service.tripNumberDataList;
state.initialPlanData[service.serviceNumber] = { oldIndex: i, serviceNumber: service.serviceNumber, backup: service.backup, trainMap: {} };
trainList.forEach((train, j) => {
// ${train.directionCode}
state.initialPlanData[service.serviceNumber].trainMap[`${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList };
});
});

View File

@ -103,7 +103,7 @@ export default {
};
},
created() {
getScriptPageListOnlineNew().then(response=>{
getScriptPageListOnlineNew({pageSize:999, pageNum:1}).then(response=>{
this.scriptList = response.data.list.map(elem => { return { value: parseInt(elem.id), label: elem.name }; });
// this.queryForm.queryObject.scriptId.config.data = this.scriptList;
});

View File

@ -4,17 +4,6 @@
v-show="show"
class="iscs_fuzhou-01__systerm route-detail el-dialog"
>
<!-- <el-dialog
v-dialogDrag
class="iscs_fuzhou-01__systerm route-detail"
title="报警浏览"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
> -->
<div class="el-dialog__header">
<span class="el-dialog__title">报警浏览</span>
<button type="button" aria-label="Close" class="el-dialog__headerbtn" @click="doClose">
@ -34,7 +23,6 @@
</el-col>
</el-row>
</div>
<!-- </el-dialog> -->
</div>
</div>
</template>
@ -80,7 +68,6 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped>
.route-detail{
position: absolute;
// top: 300px;
left: calc(50% - 250px);
margin-top: 15vh;
width: 500px;

View File

@ -394,8 +394,8 @@ export default {
electricDispatcherList[item.id] = this.memberData[item.id];
break;
case 'DEPOT_DISPATCHER':
this.memberData[item.id].label = '车辆段';
this.memberData[item.id].labelName = '车辆段' + (item.name || '');
this.memberData[item.id].label = '车辆段信号楼';
this.memberData[item.id].labelName = '车辆段信号楼' + (item.name || '');
depotDispatcherList[item.id] = this.memberData[item.id];
break;
case 'STATION_SUPERVISOR':
@ -451,7 +451,7 @@ export default {
type: 'role',
children: maintainerList
}, {
label: '车辆段',
label: '车辆段信号楼',
id: 'depotDispatcher',
type: 'role',
children: depotDispatcherList

View File

@ -188,7 +188,7 @@ export default {
},
'$store.state.menuOperation.selectedCount':function(em) {
const device = this.$store.state.menuOperation.selected;
if (device.code) {
if (device && device.code) {
this.deviceSelect(device);
}
}
@ -232,8 +232,8 @@ export default {
return name;
},
formatTriggerStatus(condition) {
if (!condition.triggerDeviceType) {
return '';
if (!condition.triggerDeviceType) {
return '';
}
const faultStatus = FaultStatusEnum[condition.triggerDeviceType];
return faultStatus[condition.triggerDeviceStatus];
@ -248,7 +248,7 @@ export default {
handleDelete(row) {
cancelFailureModeNew(row.id, this.$route.query.group).then(resp => {
this.getSimulationFaultRules();
}).catch(error => {
}).catch(() => {
this.$message.error('取消故障失败!');
});
},

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" width="550px" :before-close="doClose" modal-append-to-body>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" width="550px" :before-close="doClose">
<el-form ref="form" label-width="120px" :model="formModel" :rules="rules">
<el-form-item :label="$t('display.setTime.systemTime')" prop="initTime">
<el-time-picker

View File

@ -1,5 +1,4 @@
<template>
<!-- {} -->
<div>
<div v-if="isAllShow" class="display_top_draft" :style="allStyle">
<div class="btn_hover" @click="menuClick">菜单</div>

View File

@ -1,15 +1,10 @@
<template>
<div>
<demon-chat ref="chatbox" :group="group" :user-role="userRole" :offset="offset" />
<div class="display-card" :style="{top: offset+'px'}">
<el-row>
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
</el-row>
</div>
<demon-menu
ref="demonMenu"
:is-all-show="!dataError"
:jl3dmodel-show="isShow3dmodel && !isShowScheduling"
:jl3dmodel-show="false"
:jl3dname-show="!isShowScheduling&&!isDrive"
:cctv-show="!isShowScheduling"
:schedule-load-show="isShowScheduling && !runing"
@ -92,14 +87,14 @@ import TheoryExamSelect from './theoryExamSelect';
import TheoryExam from './theoryExam';
// import TheoryQuiz from './quiz';
// import ThroryResult from './result';
import { getGoodsTryUse } from '@/api/management/goods';
// import { getGoodsTryUse } from '@/api/management/goods';
import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { PermissionType } from '@/scripts/ConstDic';
import { getCountTime } from '@/utils/index';
// import { PermissionType } from '@/scripts/ConstDic';
// import { getCountTime } from '@/utils/index';
import { prefixIntrger } from '@/utils/date';
import { ScriptMode, TrainingMode } from '@/scripts/ConstDic';
import SelectRole from '@/views/newMap/displayNew/scriptDisplay/component/selectRole';
import { setGoodsTryUse } from '@/api/management/goods';
// import { setGoodsTryUse } from '@/api/management/goods';
import {competitionPracticalSceneStart, competitionPracticalSceneExit, competitionPracticalSceneFinish, getEmptyOperationalStatistics} from '@/api/competition';
import { launchFullscreen } from '@/utils/screen';
@ -149,34 +144,34 @@ export default {
},
data() {
return {
tryTime: 0, //
timeNow: 0, //
time: null, //
countTime: 0, //
remainingTime: 0,
userRole:'AUDIENCE',
goodsId: this.$route.query.goodsId,
try: this.$route.query.try, //
training: {
id: '',
name: '',
remarks: ''
},
isScriptLoad:false,
isScriptRun:false,
// tryTime: 0, //
// timeNow: 0, //
// time: null, //
// countTime: 0, //
// remainingTime: 0,
userRole: 'AUDIENCE',
// goodsId: this.$route.query.goodsId,
// try: this.$route.query.try, //
// training: {
// id: '',
// name: '',
// remarks: ''
// },
isScriptLoad: false,
isScriptRun: false,
scriptMode: ScriptMode.TEACH,
mapLocation:{},
playerList:[],
currentPlayList:[],
mapLocation: {},
playerList: [],
currentPlayList: [],
// formatUsedTime:'',
formatScore:0,
jl3dpassflow:this.$t('display.demon.passengerflow'),
jl3dname: this.$t('display.demon.threeDimensionalView'),
jl3dstation: this.$t('display.demon.threeDimensionalStation'),
jl3dmodel: this.$t('display.demon.deviceView'),
isShow3dmodel :false,
// formatScore: 0,
// jl3dpassflow: this.$t('display.demon.passengerflow'),
// jl3dname: this.$t('display.demon.threeDimensionalView'),
// jl3dstation: this.$t('display.demon.threeDimensionalStation'),
// jl3dmodel: this.$t('display.demon.deviceView'),
// isShow3dmodel: false,
isGoback: false,
runing:false,
runing: false,
prdTypeMap: {
'01': '01', // =>
'02': '02', // =>
@ -262,10 +257,10 @@ export default {
}
},
beforeDestroy() {
if (this.time) {
this.setTryTime();
clearTimeout(this.time);
}
// if (this.time) {
// this.setTryTime();
// clearTimeout(this.time);
// }
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
this.$store.dispatch('map/resetActiveTrainList', true);
},
@ -292,28 +287,28 @@ export default {
const ss = prefixIntrger(initTime.getSeconds(), 2);
return `${hh}:${mm}:${ss}`;
},
loadInitData() {
const data = {
mapId: this.$route.query.mapId,
prdType: this.$route.query.prdType,
permissionType: PermissionType.SIMULATION
};
getGoodsTryUse(data).then(res => {
this.remainingTime = res.data.tryTime;
this.timeNow = Date.parse(new Date()) / 1000 + this.remainingTime;
if (this.try) {
this.time = setInterval(() => {
this.tryTime += 1;
this.countTime = getCountTime(this.timeNow);
if (this.countTime == -1) {
this.back();
}
}, 1000);
}
}).catch(() => {
this.$messageBox(this.$t('display.demon.getTimeFail'));
});
},
// loadInitData() {
// const data = {
// mapId: this.$route.query.mapId,
// prdType: this.$route.query.prdType,
// permissionType: PermissionType.SIMULATION
// };
// getGoodsTryUse(data).then(res => {
// this.remainingTime = res.data.tryTime;
// this.timeNow = Date.parse(new Date()) / 1000 + this.remainingTime;
// if (this.try) {
// this.time = setInterval(() => {
// this.tryTime += 1;
// this.countTime = getCountTime(this.timeNow);
// if (this.countTime == -1) {
// this.back();
// }
// }, 1000);
// }
// }).catch(() => {
// this.$messageBox(this.$t('display.demon.getTimeFail'));
// });
// },
selectBeginTime() {
this.$refs.setTime.doShow();
},
@ -595,15 +590,15 @@ export default {
this.$message.error('结束仿真失败!');
});
},
setTryTime() {
if (this.try) {
const data = { time: this.tryTime, goodsId: this.goodsId };
if (data.goodsId) {
setGoodsTryUse(data);
}
// setTryTime() {
// if (this.try) {
// const data = { time: this.tryTime, goodsId: this.goodsId };
// if (data.goodsId) {
// setGoodsTryUse(data);
// }
}
},
// }
// },
fieldPractice() {
this.$refs.sceneList.doShow();
},
@ -630,18 +625,6 @@ export default {
position: absolute;
left: 5px;
}
.display-card {
z-index: 9;
display: inline-block;
position: absolute;
top: 17px;
left: 160px;
height: 32px;
}
.display-card .el-row {
line-height: 32px !important;
}
.display-score {
background-color: black;

View File

@ -185,6 +185,10 @@ export default {
member.label = '通号' + (member.name ? member.name : '');
break;
}
case 'DEPOT_DISPATCHER': {
member.label = '车辆段信号楼' + (member.name ? member.name : '');
break;
}
case 'PARENT_DEPARTMENT': {
member.label = '上级部门' + (member.name ? member.name : '');
break;

View File

@ -146,7 +146,6 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
this.$emit('quit');
if (this.$route.query.noPreLogout) {
this.$router.replace({path: `/device/exam/${this.$route.query.examId}`, query: {mapId: this.$route.query.mapId, noPreLogout: this.$route.query.noPreLogout}});
} else {

View File

@ -4,26 +4,10 @@
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<status-icon v-if="($route.query.lineCode == '11' || $route.query.lineCode == '10') && isDemon" ref="statusIcon" />
<menu-demon v-if="isDemon" ref="menuDemon" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" />
<menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" :tip-bottom="tipBottom" />
<menu-exam v-if="isExam" ref="menuExam" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" />
<menu-script
v-if="isScript"
ref="menuScript"
:offset-bottom="offsetBottom"
:offset="offset"
:project="project"
:text-status-height="textStatusHeight"
:data-error="dataError"
/>
<menu-practice
v-if="isPractice"
ref="menuPractice"
:offset="offset"
:offset-bottom="offsetBottom"
:data-error="dataError"
/>
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" />
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" />
</template>
<menu-train-list v-if="isDemon||isContest||isScript" @setCenter="setCenter" />
@ -35,12 +19,11 @@ import { getSessionStorage } from '@/utils/auth';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { timeFormat } from '@/utils/date';
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import StatusIcon from '@/views/components/StatusIcon/statusIcon';
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
import MenuExam from './exam/index';
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import MenuLesson from './lesson/index';
import MenuDemon from './menuDemon';
import MenuExam from './exam/index';
import MenuScript from './scriptDisplay/scriptRecord/index';
import MenuDispatherContest from './dispatherContest/index';
@ -50,11 +33,11 @@ import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'DisplayDraft',
components: {
MapSystemDraft,
StatusIcon,
MenuDemon,
MenuExam,
MenuLesson,
@ -99,9 +82,6 @@ export default {
isScript() {
return this.mode === 'script';
},
isPractice() {
return this.mode === 'practice';
},
mapId() {
return this.$route.query.mapId;
},
@ -140,12 +120,11 @@ export default {
}
},
beforeDestroy() {
this.quit(this.group);
clearSimulation(this.group);
this.$store.dispatch('training/reset');
this.$store.dispatch('map/mapClear');
},
async mounted() {
this.setWindowSize();
this.initLoadData();
},
methods:{
@ -158,11 +137,6 @@ export default {
EventBus.$emit('viewLoading', false);
});
},
// 仿
quit(group) {
clearSimulation(group);
this.$store.dispatch('training/over');
},
// 仿退
async back() {
if (this.isExam) {
@ -227,18 +201,19 @@ export default {
// 仿group仿
async loadSimulationInfo() {
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
this.dataError = false;
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); //
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.planRunning = resp.data.planRunning;
if (resp.data.planRunning) {
this.$store.commit('training/start');
if (resp && resp.code == 200 && resp.data) {
if (!resp.data.dataError) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); //
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.planRunning = resp.data.planRunning;
if (resp.data.planRunning) {
this.$store.commit('training/start');
}
} else {
this.$messageBox('此地图数据正在维护中,无法运行!');
}
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;
this.$messageBox('此地图数据正在维护中,无法运行!');
this.dataError = resp.data.dataError;
}
},
//

View File

@ -1,5 +1,6 @@
<template>
<div>
<status-icon v-if="$route.query.lineCode == '11' || $route.query.lineCode == '10'" ref="statusIcon" />
<demon-chat ref="chatbox" :group="group" :user-role="userRole" :offset="offset" />
<div class="display-card" :style="{top: offset+'px'}">
<el-row>
@ -56,13 +57,14 @@ import DemonChat from './demonChat';
import { Notification } from 'element-ui';
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
import { getGoodsTryUse } from '@/api/management/goods';
import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { ranAsPlan, exitRunPlan, getSimulationInfoNew } from '@/api/simulation';
import { PermissionType } from '@/scripts/ConstDic';
import { getCountTime } from '@/utils/index';
import { TrainingMode } from '@/scripts/ConstDic';
import { quitScriptNew } from '@/api/simulation';
import { setGoodsTryUse } from '@/api/management/goods';
import {loadScriptNew } from '@/api/simulation';
import StatusIcon from '@/views/components/StatusIcon/statusIcon';
import Vue from 'vue';
import { EventBus } from '@/scripts/event-bus';
@ -72,7 +74,8 @@ export default {
SetTime,
DemonChat,
MenuSchema,
DemonMenu
DemonMenu,
StatusIcon
},
props: {
offset: {
@ -383,14 +386,10 @@ export default {
});
});
} else {
await clearSimulation(this.group);
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('map/setShowCentralizedStationCode', '');
history.go(-1);
Notification.closeAll();
});
this.$store.dispatch('map/setShowCentralizedStationCode', '');
history.go(-1);
Notification.closeAll();
}
},
setTryTime() {
if (this.try) {

View File

@ -1,178 +0,0 @@
<template>
<div class="menuPractice">
<div class="practice-schema" :style="{top: offset+'px'}">
<el-select v-model="swch" size="small" :placeholder="$t('display.schema.selectProduct')" @change="switchMode">
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<select-station ref="selectStation" :style-css="'width: 100px;'" />
</div>
<div class="practice-bottom" :style="{bottom: offsetBottom + 'px'}">
<el-button-group>
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime">按计划行车</el-button>
<el-button type="danger" :disabled="dataError" @click="end">初始化</el-button>
<el-button type="primary" @click="back">返回</el-button>
</el-button-group>
</div>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
</div>
</template>
<script>
import SelectStation from './selectStation';
import { TrainingMode } from '@/scripts/ConstDic';
import SetTime from '@/views/newMap/displayNew/demon/setTime';
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
import { Notification } from 'element-ui';
export default {
name: 'MenuPractice',
components:{
SetTime,
SelectStation
},
props: {
offset: {
type: Number,
required: true
},
offsetBottom: {
type: Number,
required: true
},
dataError: {
type: Boolean,
default() {
return false;
}
}
},
data() {
return {
isDisable: false,
swch: '01',
showStationContent:'',
swchList: [
{ value: '01', name: '现地' },
{ value: '02', name: '行调' }
]
};
},
computed:{
group() {
return this.$route.query.group;
}
},
watch:{
'showStation':function(val) {
this.showStationContent = this.showStation;
}
},
methods:{
back() {
this.$store.dispatch('training/over').then(() => {
history.go(-1);
Notification.closeAll();
});
},
selectBeginTime() {
this.$refs.setTime.doShow();
},
start(model) {
this.isDisable = true;
const data = {
time: model.initTime
};
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
this.$store.dispatch('map/setShowCentralizedStationNum');
});
}).catch((error) => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5003') {
this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5004') {
this.$messageBox(this.$t('error.runningDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5000') {
this.$messageBox(this.$t('error.systemError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4000') {
this.$messageBox(this.$t('error.simulationDoesNotExist') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4001') {
this.$messageBox(this.$t('error.simulationOperationIsNotDefined') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4002') {
this.$messageBox(this.$t('error.simulationOperationProcessingMethodNotFound') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4003') {
this.$messageBox(this.$t('error.simulationOperationFailed') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '4004') {
this.$messageBox(this.$t('error.operationConflict') + ',' + this.$t('error.startSimulationFailed'));
}
});
},
switchMode(swch) {
this.$store.dispatch('training/setPrdType', swch); // prdType
this.switchModeInner(swch);
},
switchModeInner(swch) {
let showMode = '03';
if (swch == '01') {
showMode = '03';
} else if (swch == '02') {
showMode = '02';
}
const nameList = Object.keys(this.$store.state.map.map || {});
let list = [];
nameList.forEach(item => {
if (item !== 'skinVO') {
const data = this.$store.state.map.map[item];
if (data && data.constructor === Array) {
list = [...list, ...data];
}
}
});
this.$jlmap.updateShowMode(list, showMode);
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/setTrainWindowShow', false);
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
//
async initData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/setPrdType', '01'); // prdType
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
}
}
};
</script>
<style lang="scss" scoped>
.practice-schema {
z-index: 9;
display: inline;
position: absolute;
right: 15px;
}
.practice-bottom {
position: absolute;
float: right;
right: 15px;
bottom: 15px;
}
</style>

View File

@ -67,8 +67,8 @@ export default {
viewDisabled: true,
swch: '02',
isScriptCommand:false,
faultMode: false,
firstLoad: true
faultMode: false
// firstLoad: true
};
},
computed: {

View File

@ -233,7 +233,7 @@ export default {
type: 'role',
children: result.deviceListData[1]
}, {
label: '车辆段',
label: '车辆段信号楼',
id: 'depotDispatcher',
type: 'role',
children: result.deviceListData[4]

View File

@ -88,12 +88,6 @@ export default {
default() {
return 0;
}
},
project:{
type: String,
default() {
return '';
}
}
},
data() {
@ -228,10 +222,8 @@ export default {
});
},
back() {
this.$store.dispatch('training/over').then(() => {
history.go(-1);
Notification.closeAll();
});
history.go(-1);
Notification.closeAll();
},
resetChat() {
// this.$refs.chatbox.resetCoversition();

View File

@ -37,7 +37,7 @@ export function covertMemberData (activeTrainList, resp) {
member.label = member.type + name + userName;
member.normalName = member.type + name;
}
const deviceType = ['行调', '通号', '行值', '司机', '车辆段调度', '上级部门', '电力调度', '停车场信号楼'];
const deviceType = ['行调', '通号', '行值', '司机', '车辆段信号楼', '上级部门', '电力调度', '停车场信号楼'];
const deviceTypeIndex = deviceType.indexOf(member.type);
if (deviceTypeIndex >= 0) {
if (deviceTypeIndex == 3) {

View File

@ -158,7 +158,7 @@ export default {
electricDispatcherList.push(this.memberData[item.id]);
break;
case 'DEPOT_DISPATCHER':
this.memberData[item.id].labelName = '车辆段调度' + (item.name || '');
this.memberData[item.id].labelName = '车辆段信号楼' + (item.name || '');
depotDispatcherList.push(this.memberData[item.id]);
break;
case 'STATION_SUPERVISOR':
@ -192,7 +192,7 @@ export default {
id: 'maintainer',
children: maintainerList
}, {
labelName: '车辆段',
labelName: '车辆段信号楼',
id: 'depotDispatcher',
children: depotDispatcherList
}, {

View File

@ -83,9 +83,9 @@ export default {
if (device._type == 'Section' && device.type == '03') { // model
device = this.$store.getters['map/getDeviceByCode'](device.switch.code);
}
if (device._type == 'Section' && device.type == '04') {
device = null;
}
// if (device._type == 'Section' && device.type == '04') {
// device = null;
// }
return device;
},
clickEvent(em) {
@ -180,12 +180,14 @@ export default {
},
checkShouldPop(device) {
const lineCode = this.$store.getters['map/lineCode'];
if (device._type === 'Signal') {
return device._viewVal === '3';
} else if (device._type === 'StationControl' && lineCode == '01') { //
return device._viewVal === '1';
} else {
return true;
if (device) {
if (device._type === 'Signal') {
return device._viewVal === '3';
} else if (device._type === 'StationControl' && lineCode == '01') { //
return device._viewVal === '1';
} else {
return true;
}
}
},
mapViewLoaded(loading) {

View File

@ -467,8 +467,8 @@ export default {
});
},
updateMapModel(data) {
this.$emit('updateMapModel', data);
this.field = '';
this.$emit('updateMapModel', data);
this.field = '';
},
deleteObj() {
this.$refs.dataform.deleteObj();

View File

@ -136,7 +136,7 @@ export default {
watch: {
'$store.state.menuOperation.selectedCount':function(em) {
const device = this.$store.state.menuOperation.selected;
if (device.code) {
if (device && device.code) {
this.deviceSelect(device);
}
}

View File

@ -195,7 +195,7 @@ export default {
type: 'role',
children: result.deviceListData[1]
}, {
label: '车辆段',
label: '车辆段信号楼',
id: 'depotDispatcher',
type: 'role',
children: result.deviceListData[4]
@ -273,7 +273,7 @@ export default {
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
const newMember = covertmember[0];
this.memberList.push(newMember);
const deviceTypeList = ['行调', '行值', '司机', '通号', '车辆段调度', '上级部门', '电力调度', '停车场信号楼'];
const deviceTypeList = ['行调', '行值', '司机', '通号', '车辆段信号楼', '上级部门', '电力调度', '停车场信号楼'];
const index = deviceTypeList.indexOf(newMember.type);
if (index >= 0) {
const treeDataIn = this.treeData[index];
@ -479,7 +479,7 @@ export default {
}
});
this.openWindow = window.open(routeData.href);
} else if (role.type == '车辆段调度') {
} else if (role.type == '车辆段信号楼') {
prdType = '05';
role.type = 'DEPOT_DISPATCHER';
this.$store.dispatch('training/setRoles', 'DEPOT_DISPATCHER');
@ -520,7 +520,7 @@ export default {
'DISPATCHER':'行调',
'DRIVER':'司机',
'MAINTAINER':'通号',
'DEPOT_DISPATCHER':'车辆段调度',
'DEPOT_DISPATCHER':'车辆段信号楼',
'PARENT_DEPARTMENT':'上级部门',
'ELECTRIC_DISPATCHER':'电力调度',
'PARKING_LOT_SIGNAL_BUILDING':'停车场信号楼'

View File

@ -19,6 +19,12 @@ export default {
default() {
return [];
}
},
deviceTypeList:{
type: Array,
default() {
return [];
}
}
},
data() {
@ -30,9 +36,7 @@ export default {
targetIds: '',
deviceType: []
},
deviceTypeList: [],
targetList: [],
lineCode: ''
targetList: []
};
},
computed: {
@ -58,36 +62,17 @@ export default {
};
}
},
watch: {
taskStatusList(list) {
this.targetList = [];
list.forEach(item => {
if (item.value != this.lineCode) {
this.targetList.push(item);
}
});
}
},
created() {
this.deviceTypeList = [];
this.$ConstSelect.deviceTypeList.forEach(item => {
this.deviceTypeList.push(item);
});
},
methods: {
doShow(lineCode) {
this.dialogVisible = true;
if (lineCode) {
this.lineCode = lineCode;
this.targetList = [];
this.taskStatusList.forEach(item => {
item.value = item.code;
item.label = item.name;
if (item.code != lineCode) {
if (item.value != lineCode) {
this.targetList.push(item);
} else {
this.formModel.fromCode = item.code;
this.formModel.fromName = item.name;
this.formModel.fromCode = item.value;
this.formModel.fromName = item.label;
}
});
}

View File

@ -27,10 +27,14 @@
<div style="overflow: hidden;">
<div class="param-title">指令参数:</div>
<el-table :data="formModel.paramList" border class="param-table">
<el-table-column prop="name" label="参数名" />
<el-table-column prop="name" label="参数名">
<template slot-scope="scope">
<input :id="'param'+scope.$index" v-model="scope.row.name" type="text" class="paramCode">
</template>
</el-table-column>
<el-table-column :label="this.$t('global.operate')" width="180">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editParam(scope.$index, scope.row)">修改</el-button>
<el-button type="text" size="small" @click="editParam(scope.$index)">修改</el-button>
<el-button type="text" size="small" @click="delParam(scope.$index)">删除</el-button>
</template>
</el-table-column>
@ -44,9 +48,6 @@
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleBack">返回</el-button>
</div>
<command-edit ref="create" type="ADD" @addData="addData" />
<command-edit ref="edit" type="EDIT" @editData="editData" />
<edit-condition ref="addCondition" type="ADD" @addData="addCondition" />
<edit-condition ref="editCondition" type="EDIT" @editData="editCondition" />
</div>
@ -56,7 +57,6 @@
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { createCommand, editCommand, getCommandDetail } from '@/api/management/dictionary';
import CommandEdit from './editParam';
import { getLineCodeList } from '@/api/management/mapline';
import EditCondition from './editCondition';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -64,7 +64,6 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'DictionaryEdit',
components: {
CommandEdit,
EditCondition
},
props: {
@ -165,6 +164,9 @@ export default {
},
doSave() {
this.$refs.dataform.validateForm(() => {
this.formModel.paramList = this.formModel.paramList.filter(param=>{
return param.name != '';
});
if (this.type == 'add') {
this.create();
} else {
@ -191,21 +193,16 @@ export default {
});
},
handleBack() {
this.$router.push({ path: `/system/commands`, query: { } });
},
editData(data) {
this.formModel.paramList.splice(this.editIndex, 1, data);
},
addData(data) {
this.formModel.paramList.push(data);
this.$router.go(-1);
},
addParam() {
this.$refs.create.doShow();
this.formModel.paramList.push({name:''});
this.$nextTick(()=>{
document.querySelector('#param' + (this.formModel.paramList.length - 1)).focus();
});
},
editParam(index, row) {
this.$refs.edit.doShow(row);
this.editIndex = index;
editParam(index) {
document.querySelector('#param' + index).focus();
},
delParam(index) {
this.formModel.paramList.splice(index, 1);
@ -274,4 +271,15 @@ export default {
justify-content: center;
}
}
.paramCode{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
border: none;
text-indent: 10px;
outline: none;
color: #606266;
}
</style>

View File

@ -1,96 +0,0 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="400px" :before-close="handleClose" center :close-on-click-modal="false">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name: 'DictionaryEdit',
props: {
type: {
type: String,
required: true
}
},
data() {
return {
dialogVisible: false,
formModel: {
id: '',
name: ''
}
};
},
computed: {
form() {
const form = {
labelWidth: '100px',
items: [
{ prop: 'name', label: '参数名', type: 'text' }
]
};
return form;
},
rules() {
return {
name: [
{ required: true, message: '请输入内容', trigger: 'blur' }
]
};
},
title() {
if (this.type === 'ADD') {
return this.$t('system.createDirectory');
} else {
return this.$t('system.editDictionary');
}
}
},
methods: {
doShow(data) {
this.dialogVisible = true;
if (data) {
this.formModel = {
name: data.name,
pattern: data.pattern,
val: data.val
};
}
},
doSave() {
const self = this;
this.$refs.dataform.validateForm(() => {
if (self.type === 'ADD') {
self.create();
} else {
self.update();
}
});
},
getData() {
return {
id: this.formModel.id,
name: this.formModel.name
};
},
create() {
this.$emit('addData', this.getData());
this.handleClose();
},
update() {
this.$emit('editData', this.getData());
this.handleClose();
},
handleClose() {
this.$refs.dataform.resetForm();
this.dialogVisible = false;
}
}
};
</script>

View File

@ -2,7 +2,7 @@
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<show-condition ref="showCondition" />
<copy-param ref="copyParam" :task-status-list="taskStatusList" />
<copy-param ref="copyParam" :task-status-list="taskStatusList" :device-type-list="deviceTypeList" />
</div>
</template>
@ -22,6 +22,7 @@ export default {
data() {
return {
taskStatusList: [],
deviceTypeList:[],
operateList: [],
pagerConfig: {
pageSize: 'pageSize',
@ -57,14 +58,14 @@ export default {
title: this.$t('system.lineCode'), // 线
prop: 'lineCode',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.lineCode, this.taskStatusList, ['code', 'name']); },
columnValue: (row) => { return this.convertField(this.taskStatusList, row.lineCode); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.simulationRole'), // 仿
prop: 'simulationRole',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.simulationRole, this.$ConstSelect.simulationRole, ['value', 'label']); },
columnValue: (row) => { return this.convertField(this.$ConstSelect.simulationRole, row.simulationRole); },
tagType: (row) => { return 'success'; }
},
{
@ -78,7 +79,7 @@ export default {
title: this.$t('system.deviceType'), //
prop: 'operateObject',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.operateObject, this.$ConstSelect.deviceTypeList, ['value', 'label']); },
columnValue: (row) => { return this.convertField( this.deviceTypeList, row.operateObject); },
tagType: (row) => { return ''; }
},
{
@ -130,7 +131,6 @@ export default {
currentModel: {}
};
},
mounted () {
this.loadInitData();
},
@ -140,13 +140,14 @@ export default {
this.taskStatusList = [];
this.mapList = [];
const list = await getLineCodeList();
this.taskStatusList = list.data;
list.data.forEach(elem => {
this.queryForm.queryObject.lineCode.config.data.push({ value: elem.code, label: elem.name });
this.taskStatusList.push({ value: elem.code, label: elem.name });
});
this.queryForm.queryObject.lineCode.config.data = this.taskStatusList;
this.$ConstSelect.deviceTypeList.forEach(elem => {
this.queryForm.queryObject.operateObject.config.data.push(elem);
this.deviceTypeList.push(elem);
});
this.queryForm.queryObject.operateObject.config.data = this.deviceTypeList;
} catch (error) {
console.log(error);
}
@ -161,13 +162,11 @@ export default {
},
replace(fieldValue) {
const arr = [];
if (fieldValue && fieldValue.length) {
fieldValue.forEach((v, j) => {
if (v.name) {
arr.push(v.name);
}
});
}
fieldValue.forEach((v, j) => {
if (v.name) {
arr.push(v.name);
}
});
return arr;
},
//
@ -192,7 +191,6 @@ export default {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
@ -218,6 +216,10 @@ export default {
},
reloadTable() {
this.queryList.reload();
},
convertField(list, status) {
console.log(list, typeof list, status);
if (list && list.length > 0) { return list.find(each=>{ return status == each.value; }).label; }
}
}
};