调整宁波一号线右键菜单流程
This commit is contained in:
parent
6e0ab142f7
commit
3d8fcd305a
@ -12,8 +12,8 @@
|
||||
append-to-body
|
||||
>
|
||||
<div class="context">
|
||||
<template v-for="message in messages">
|
||||
<span>{{ message }}</span>
|
||||
<template v-for="(message, index) in messages">
|
||||
<span :key="index">{{ message }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
@ -55,6 +55,7 @@ export default {
|
||||
if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return '信号关灯';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
@ -66,6 +67,7 @@ export default {
|
||||
return OperationEvent.Signal.signalClose.confirm.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -112,7 +114,7 @@ export default {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
@ -127,7 +129,7 @@ export default {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
|
@ -1,141 +1,103 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="ningbo-01__systerm alxe-effective"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:zIndex="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
v-dialogDrag
|
||||
>
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;">
|
||||
<span class="base-label">准备</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="9">车站</el-col>
|
||||
<el-col :span="9">轨道/计轴</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="9">
|
||||
<el-input
|
||||
:type="type"
|
||||
v-model="model.stationName"
|
||||
size="mini"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-input
|
||||
:type="type"
|
||||
v-model="model.sectionName"
|
||||
size="mini"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button
|
||||
:id="domIdConfirm1"
|
||||
size="mini"
|
||||
@click="commitOnce"
|
||||
:disabled="type==='password'"
|
||||
>确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;margin-top: 10px">
|
||||
<span class="base-label">确认</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="9">车站</el-col>
|
||||
<el-col :span="9">轨道/计轴</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="9">
|
||||
<el-select
|
||||
:id="domIdChoose1"
|
||||
v-model="model.confirmStationName"
|
||||
filterable
|
||||
size="mini"
|
||||
@change="stationSelectChange"
|
||||
:disabled="type==='text'"
|
||||
>
|
||||
<el-option
|
||||
v-for="(option,index) in filterStationList"
|
||||
:key="index"
|
||||
:label="option.name"
|
||||
:value="option.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-select
|
||||
:id="domIdChoose2"
|
||||
v-model="model.confirmSectionName"
|
||||
filterable
|
||||
size="mini"
|
||||
@change="sectionSelectChange"
|
||||
:disabled="type==='text'"
|
||||
>
|
||||
<el-option
|
||||
v-for="(option,index) in randomSectionList"
|
||||
:key="index"
|
||||
:label="option.name"
|
||||
:value="option.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button
|
||||
:id="domIdConfirm2"
|
||||
size="mini"
|
||||
:loading="loading"
|
||||
@click="commit"
|
||||
:disabled="type==='text'"
|
||||
>确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<el-row type="flex" justify="left" style="margin-top:20px;margin-bottom: 10px;">
|
||||
<el-col :span="6" :offset="1">操作倒计时</el-col>
|
||||
<el-col :span="16">
|
||||
<el-input v-model="model.time" size="mini" :readonly="true"></el-input>
|
||||
</el-col>
|
||||
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm alxe-effective" :title="title" :visible.sync="show" width="420px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;">
|
||||
<span class="base-label">准备</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="9">车站</el-col>
|
||||
<el-col :span="9">轨道/计轴</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1">状态</el-col>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="9">
|
||||
<el-input v-model="model.stationName" :type="type" size="mini" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-input v-model="model.sectionName" :type="type" size="mini" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm1" size="mini" :disabled="type==='password'" @click="commitOnce">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1" :span="23">
|
||||
<el-input type="textarea" :rows="2" placeholder v-model="model.status"></el-input>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;margin-top: 10px">
|
||||
<span class="base-label">确认</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="9">车站</el-col>
|
||||
<el-col :span="9">轨道/计轴</el-col>
|
||||
</el-row>
|
||||
<el-row class="botton-group" style="margin-top:20px">
|
||||
<el-col :span="4" :offset="10">
|
||||
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
|
||||
</el-col>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="9">
|
||||
<el-select
|
||||
:id="domIdChoose1"
|
||||
v-model="model.confirmStationName"
|
||||
filterable
|
||||
size="mini"
|
||||
:disabled="type==='text'"
|
||||
@change="stationSelectChange"
|
||||
>
|
||||
<el-option v-for="(option,index) in filterStationList" :key="index" :label="option.name" :value="option.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-select
|
||||
:id="domIdChoose2"
|
||||
v-model="model.confirmSectionName"
|
||||
filterable
|
||||
size="mini"
|
||||
:disabled="type==='text'"
|
||||
@change="sectionSelectChange"
|
||||
>
|
||||
<el-option v-for="(option,index) in randomSectionList" :key="index" :label="option.name" :value="option.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button
|
||||
:id="domIdConfirm2"
|
||||
size="mini"
|
||||
:loading="loading"
|
||||
:disabled="type==='text'"
|
||||
@click="commit"
|
||||
>确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<popup-alarm ref="popupAlarm"></popup-alarm>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
<el-row type="flex" justify="left" style="margin-top:20px;margin-bottom: 10px;">
|
||||
<el-col :span="6" :offset="1">操作倒计时</el-col>
|
||||
<el-col :span="16">
|
||||
<el-input v-model="model.time" size="mini" :readonly="true" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1">状态</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1" :span="23">
|
||||
<el-input v-model="model.status" type="textarea" :rows="2" placeholder />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="botton-group" style="margin-top:20px">
|
||||
<el-col :span="4" :offset="10">
|
||||
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
<popup-alarm ref="popupAlarm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import {
|
||||
MapDeviceType,
|
||||
OperationEvent,
|
||||
getDomIdByOperation
|
||||
} from "@/scripts/ConstDic";
|
||||
import { mouseCancelState } from "../utils/menuItemStatus";
|
||||
import NoticeInfo from "./childDialog/childDialog/noticeInfo";
|
||||
import PopupAlarm from "./childDialog/popupAlarm";
|
||||
import { mapGetters } from 'vuex';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import PopupAlarm from './childDialog/popupAlarm';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: "AlxeEffective",
|
||||
name: 'AlxeEffective',
|
||||
components: {
|
||||
NoticeInfo,
|
||||
PopupAlarm
|
||||
@ -144,30 +106,29 @@ export default {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
type: "text",
|
||||
type: 'text',
|
||||
timeout: 1000,
|
||||
timenum: 30,
|
||||
stepNum: 0,
|
||||
task: null,
|
||||
model: {
|
||||
stationName: "",
|
||||
sectionName: "",
|
||||
confirmStationName: "",
|
||||
confirmSectionName: "",
|
||||
status: "",
|
||||
stationName: '',
|
||||
sectionName: '',
|
||||
confirmStationName: '',
|
||||
confirmSectionName: '',
|
||||
status: '',
|
||||
time: 0
|
||||
},
|
||||
selected: null,
|
||||
operate: null,
|
||||
operation: "",
|
||||
operation: '',
|
||||
randomSectionList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("map", ["stationList", "sectionList"]),
|
||||
...mapGetters('map', ['stationList', 'sectionList']),
|
||||
filterStationList() {
|
||||
let i = 0,
|
||||
list = [];
|
||||
const list = [];
|
||||
if (this.stationList) {
|
||||
this.stationList.forEach(elem => {
|
||||
if (
|
||||
@ -185,94 +146,58 @@ export default {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation
|
||||
) {
|
||||
return OperationEvent.Section.alxeEffective.confirm1.domId;
|
||||
} else if (
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
return OperationEvent.Switch.alxeEffective.confirm1.domId;
|
||||
}
|
||||
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
|
||||
return OperationEvent.Section.alxeEffective.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
|
||||
return OperationEvent.Switch.alxeEffective.confirm1.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation
|
||||
) {
|
||||
return OperationEvent.Section.alxeEffective.confirm2.domId;
|
||||
} else if (
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
return OperationEvent.Switch.alxeEffective.confirm2.domId;
|
||||
}
|
||||
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
|
||||
return OperationEvent.Section.alxeEffective.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
|
||||
return OperationEvent.Switch.alxeEffective.confirm2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdChoose1() {
|
||||
if (this.dialogShow) {
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation
|
||||
) {
|
||||
return OperationEvent.Section.alxeEffective.choose1.domId;
|
||||
} else if (
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
return OperationEvent.Switch.alxeEffective.choose1.domId;
|
||||
}
|
||||
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
|
||||
return OperationEvent.Section.alxeEffective.choose1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
|
||||
return OperationEvent.Switch.alxeEffective.choose1.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdChoose2() {
|
||||
if (this.dialogShow) {
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation
|
||||
) {
|
||||
return OperationEvent.Section.alxeEffective.choose2.domId;
|
||||
} else if (
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
return OperationEvent.Switch.alxeEffective.choose2.domId;
|
||||
}
|
||||
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
|
||||
return OperationEvent.Section.alxeEffective.choose2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
|
||||
return OperationEvent.Switch.alxeEffective.choose2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow
|
||||
? OperationEvent.Command.cancel.menu.domId
|
||||
: "";
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
this.earlyDepar = false;
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation ||
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
return "确认计轴恢复工作";
|
||||
if ( this.operation == OperationEvent.Section.alxeEffective.menu.operation || this.operation == OperationEvent.Switch.alxeEffective.menu.operation ) {
|
||||
return '确认计轴恢复工作';
|
||||
}
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"model.sectionName": function(name) {
|
||||
let index = Math.floor(Math.random(1) * 5);
|
||||
'model.sectionName': function(name) {
|
||||
const index = Math.floor(Math.random(1) * 5);
|
||||
for (var i = 0; i < 5; i++) {
|
||||
if (i == index) {
|
||||
this.randomSectionList.push({ name });
|
||||
} else {
|
||||
let section = this.sectionList[
|
||||
const section = this.sectionList[
|
||||
Math.floor(Math.random(1) * this.sectionList.length)
|
||||
];
|
||||
if (section.type != "02") {
|
||||
if (section.type != '02') {
|
||||
if (
|
||||
this.randomSectionList.findIndex(it => {
|
||||
return it.name == section.name;
|
||||
@ -291,7 +216,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch("training/tipReload");
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
@ -302,38 +227,31 @@ export default {
|
||||
}
|
||||
|
||||
if (this.stepNum < 3) {
|
||||
this.$store.dispatch("training/backSteps", this.stepNum);
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
this.model.name = "";
|
||||
this.model.time = "";
|
||||
this.type = "text";
|
||||
this.$store.dispatch('training/backSteps', this.stepNum);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.model.name = '';
|
||||
this.model.time = '';
|
||||
this.type = 'text';
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.status = "";
|
||||
this.model.stationName = "";
|
||||
this.model.sectionName = "";
|
||||
this.model.confirmStationName = "";
|
||||
this.model.confirmSectionName = "";
|
||||
this.status = '';
|
||||
this.model.stationName = '';
|
||||
this.model.sectionName = '';
|
||||
this.model.confirmStationName = '';
|
||||
this.model.confirmSectionName = '';
|
||||
if (selected) {
|
||||
if (
|
||||
selected &&
|
||||
selected._type.toUpperCase() === "Section".toUpperCase()
|
||||
) {
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.isSwitchSection) {
|
||||
let section = this.$store.getters[
|
||||
"map/getDeviceByCode"
|
||||
](selected.parentCode);
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
}
|
||||
} else {
|
||||
let section = this.$store.getters[
|
||||
"map/getDeviceByCode"
|
||||
](selected.parentCode);
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
this.model.sectionName = `${section.name}-${selected.name}`;
|
||||
@ -341,20 +259,14 @@ export default {
|
||||
this.model.sectionName = `${selected.name}`;
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
selected._type.toUpperCase() === "Switch".toUpperCase()
|
||||
) {
|
||||
let section = this.$store.getters["map/getDeviceByCode"](
|
||||
selected.switchSectionCode
|
||||
);
|
||||
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.switchSectionCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
}
|
||||
}
|
||||
|
||||
let station = this.$store.getters["map/getDeviceByCode"](
|
||||
selected.stationCode
|
||||
);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.model.stationName = station.name;
|
||||
}
|
||||
@ -365,12 +277,12 @@ export default {
|
||||
this.dialogShow = true;
|
||||
this.stopTask();
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch("training/emitTipFresh");
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
waitSelectEvent() {
|
||||
@ -383,183 +295,125 @@ export default {
|
||||
},
|
||||
commitOnce() {
|
||||
this.stepNum = 1;
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: ""
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation
|
||||
) {
|
||||
operate.operation =
|
||||
OperationEvent.Section.alxeEffective.confirm1.operation;
|
||||
} else if (
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
operate.operation =
|
||||
OperationEvent.Switch.alxeEffective.confirm1.operation;
|
||||
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.alxeEffective.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.alxeEffective.confirm1.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch("training/next", operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", {
|
||||
break: true
|
||||
});
|
||||
this.type = "password";
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.type = 'password';
|
||||
this.model.time = this.timenum;
|
||||
this.task = setInterval(this.waitSelectEvent, this.timeout);
|
||||
}
|
||||
});
|
||||
},
|
||||
stationSelectChange(val) {
|
||||
stationSelectChange() {
|
||||
if (this.model.confirmStationName === this.model.stationName) {
|
||||
this.stepNum = 2;
|
||||
} else {
|
||||
this.model.time = 0;
|
||||
}
|
||||
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: "",
|
||||
val: val
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation
|
||||
) {
|
||||
operate.operation =
|
||||
OperationEvent.Section.alxeEffective.choose1.operation;
|
||||
} else if (
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
operate.operation =
|
||||
OperationEvent.Switch.alxeEffective.choose1.operation;
|
||||
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.alxeEffective.choose1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.alxeEffective.choose1.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch("training/next", operate).then(({ valid }) => {
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", {
|
||||
break: true
|
||||
});
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
});
|
||||
},
|
||||
sectionSelectChange(val) {
|
||||
sectionSelectChange() {
|
||||
if (this.model.confirmSectionName === this.model.sectionName) {
|
||||
this.stepNum = 2;
|
||||
} else {
|
||||
this.model.time = 0;
|
||||
}
|
||||
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: "",
|
||||
val: val
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation
|
||||
) {
|
||||
operate.operation =
|
||||
OperationEvent.Section.alxeEffective.choose2.operation;
|
||||
} else if (
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
operate.operation =
|
||||
OperationEvent.Switch.alxeEffective.choose2.operation;
|
||||
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.alxeEffective.choose2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.alxeEffective.choose2.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch("training/next", operate).then(({ valid }) => {
|
||||
this.$store.dispatch("menuOperation/handleBreakFlag", {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', {
|
||||
break: true
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 确认计轴恢复工作*/
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: "",
|
||||
val: this.selected.code
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: '',
|
||||
cmdType: ''
|
||||
};
|
||||
|
||||
if (
|
||||
this.operation ==
|
||||
OperationEvent.Section.alxeEffective.menu.operation
|
||||
) {
|
||||
operate.operation =
|
||||
OperationEvent.Section.alxeEffective.confirm2.operation;
|
||||
} else if (
|
||||
this.operation ==
|
||||
OperationEvent.Switch.alxeEffective.menu.operation
|
||||
) {
|
||||
operate.operation =
|
||||
OperationEvent.Switch.alxeEffective.confirm2.operation;
|
||||
if (this.operation == OperationEvent.Section.alxeEffective.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.alxeEffective.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_COMFIRMATION_AXLE;
|
||||
} else if (this.operation == OperationEvent.Switch.alxeEffective.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.alxeEffective.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE;
|
||||
}
|
||||
|
||||
this.model.status = "";
|
||||
if (
|
||||
this.model.stationName == this.model.confirmStationName &&
|
||||
this.model.sectionName == this.model.confirmSectionName
|
||||
) {
|
||||
this.model.status = '';
|
||||
if (this.model.stationName == this.model.confirmStationName && this.model.sectionName == this.model.confirmSectionName) {
|
||||
this.stepNum = 3;
|
||||
|
||||
this.loading = true;
|
||||
this.$store
|
||||
.dispatch("training/next", operate)
|
||||
.then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.type = "text";
|
||||
this.stopTask();
|
||||
this.$store.dispatch(
|
||||
"menuOperation/handleBreakFlag",
|
||||
{
|
||||
break: true
|
||||
}
|
||||
);
|
||||
this.$refs.popupAlarm.doShow(
|
||||
Object.assign(this.operate, {
|
||||
val: operate.val
|
||||
}),
|
||||
[
|
||||
`集中站 ${this.model.stationName} 区段 ${this.model.sectionName}报告恢复计轴有效`
|
||||
]
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.type = 'text';
|
||||
this.stopTask();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.popupAlarm.doShow(
|
||||
Object.assign(this.operate, {val: operate.val}), [`集中站 ${this.model.stationName} 区段 ${this.model.sectionName}报告恢复计轴有效`]
|
||||
);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
if (this.model.stationName != this.model.confirmStationName) {
|
||||
this.model.status = "车站选择错误";
|
||||
this.model.status = '车站选择错误';
|
||||
} else if (
|
||||
this.model.sectionName != this.model.confirmSectionName
|
||||
) {
|
||||
this.model.status = "区段选择错误";
|
||||
this.model.status = '区段选择错误';
|
||||
}
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store
|
||||
.dispatch("training/next", operate)
|
||||
.dispatch('training/nextNew', operate)
|
||||
.then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
.catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
@ -567,7 +421,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.alxe-effective .context {
|
||||
height: 80px !important;
|
||||
}
|
||||
</style>
|
||||
.alxe-effective .context {
|
||||
height: 80px !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -19,342 +19,262 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/noticeInfo'
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'ConfirmControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null
|
||||
export default {
|
||||
name: 'ConfirmControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
return '进路设置';
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return '信号关灯';
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
return '信号重开';
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
return '取消进路';
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return '进路交人工控';
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return '进路交ATS自动控';
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
return '设置运行等级';
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
return '停站时间';
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
return '设置折返策略';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
return '进路设置';
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return '信号关灯';
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
return '信号重开';
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
return '取消进路';
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return '进路交人工控';
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return '进路交ATS自动控'
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
return '设置运行等级';
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
return '停站时间';
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
return '设置折返策略';
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
return OperationEvent.Signal.arrangementRoute.confirm.domId
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
return OperationEvent.Signal.signalClose.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
return OperationEvent.Signal.reopenSignal.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
return OperationEvent.Signal.cancelTrainRoute.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
return OperationEvent.Signal.humanControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
return OperationEvent.Signal.atsAutoControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
return OperationEvent.StationStand.setRunLevel.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 设置停战时间*/
|
||||
return OperationEvent.StationStand.setStopTime.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
return OperationEvent.StationStand.setBackStrategy.confirm.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.messages = operate.messages;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
domIdConfirm() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
return OperationEvent.Signal.arrangementRoute.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
return OperationEvent.Signal.signalClose.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
return OperationEvent.Signal.reopenSignal.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
return OperationEvent.Signal.cancelTrainRoute.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
return OperationEvent.Signal.humanControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
return OperationEvent.Signal.atsAutoControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
return OperationEvent.StationStand.setRunLevel.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 设置停战时间*/
|
||||
return OperationEvent.StationStand.setStopTime.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
return OperationEvent.StationStand.setBackStrategy.confirm.domId;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
this.signalClose();
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
this.cancelTrainRoute();
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
this.humanControl();
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
this.atsAutoControl();
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
this.setRunLevel();
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 停站时间*/
|
||||
this.setStopTime();
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
this.setBackStrategy();
|
||||
}
|
||||
},
|
||||
//进路设置
|
||||
routeSetting() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.confirm.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//信号关灯
|
||||
signalClose() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.signalClose.confirm.operation
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//信号重开
|
||||
reopenSignal() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.reopenSignal.confirm.operation
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消进路
|
||||
cancelTrainRoute() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//进路交人工控
|
||||
humanControl() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.humanControl.menu.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//进路交ATS自动控
|
||||
atsAutoControl() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//设置运行等级
|
||||
setRunLevel() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
|
||||
val: this.operate.val
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//停站时间
|
||||
setStopTime() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.confirm.operation,
|
||||
val: this.operate.val,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//设置折返策略
|
||||
setBackStrategy() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.confirm.operation,
|
||||
val: this.operate.val,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
this.operate = operate || {};
|
||||
this.messages = operate.messages;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
this.signalClose();
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
this.cancelTrainRoute();
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
this.humanControl();
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
this.atsAutoControl();
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
this.setRunLevel();
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 停站时间*/
|
||||
this.setStopTime();
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
this.setBackStrategy();
|
||||
}
|
||||
},
|
||||
// 进路设置
|
||||
routeSetting() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.arrangementRoute.confirm.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 信号关灯
|
||||
signalClose() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.signalClose.confirm.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 信号重开
|
||||
reopenSignal() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.reopenSignal.confirm.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 取消进路
|
||||
cancelTrainRoute() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 进路交人工控
|
||||
humanControl() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.humanControl.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 进路交ATS自动控
|
||||
atsAutoControl() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 设置运行等级
|
||||
setRunLevel() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 停站时间
|
||||
setStopTime() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.StationStand.setStopTime.confirm.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.confirm.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
sendCommand(operate) {
|
||||
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(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.confirm-control .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
||||
.confirm-control .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
||||
|
@ -45,6 +45,7 @@ import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RouteControl',
|
||||
@ -136,53 +137,23 @@ export default {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation == OperationEvent.Signal.singalPassModel.menu.operation) {
|
||||
this.reopenSignal();
|
||||
this.singalPassModel(); // 设置/取消通过模式
|
||||
}
|
||||
},
|
||||
// 取消列车进路
|
||||
cancelTrainRoute() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
/** 现地工作站*/
|
||||
this.cancelTrainRouteByLocal();
|
||||
} else if (this.$store.state.training.prdType == '02') {
|
||||
/** 行调工作站*/
|
||||
this.cancelTrainRouteByCentral();
|
||||
}
|
||||
},
|
||||
// 现地工作站取消进路
|
||||
cancelTrainRouteByLocal() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
// 行调工作站取消进路
|
||||
cancelTrainRouteByCentral() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.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();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
@ -191,11 +162,12 @@ export default {
|
||||
signalClose() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Signal.signalClose.menu.operation,
|
||||
messages: [`信号关灯: ${this.signalName}`]
|
||||
messages: [`信号关灯: ${this.signalName}`],
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
@ -209,12 +181,36 @@ export default {
|
||||
// 信号重开
|
||||
reopenSignal() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.Signal.reopenSignal.menu.operation
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.reopenSignal.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
// 设置/取消通过模式
|
||||
singalPassModel() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.singalPassModel.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_PASS_MODEL,
|
||||
param: {
|
||||
Pass_Auto: this.passRadio
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
@ -231,7 +227,7 @@ export default {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
<el-row style="margin-top: 10px; line-height: 30px;">
|
||||
<el-col :span="11"><span>进路列表</span></el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-button class="expand" @click="expandPath">展开进路预览</el-button>
|
||||
<!-- <el-button class="expand" @click="expandPath">展开进路预览</el-button> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table ref="table" :data="tempData" border :cell-style="tableStyle" style="width: 100%; margin-top:10px" size="mini" height="120" highlight-current-row :show-header="false" @row-click="clickEvent">
|
||||
@ -34,9 +34,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RouteSelection',
|
||||
@ -170,12 +171,10 @@ export default {
|
||||
|
||||
// 设置选中指令
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
|
||||
val: row.code
|
||||
operation: OperationEvent.Signal.arrangementRoute.choose.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
@ -186,13 +185,16 @@ export default {
|
||||
commit() {
|
||||
if (this.row && this.row.canSetting) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.menu.operation
|
||||
over: true,
|
||||
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
|
||||
param: {
|
||||
Route_Code: this.row.code
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
@ -206,11 +208,10 @@ export default {
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
|
@ -1,435 +1,338 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="ningbo-01__systerm section-cmd-control" :title="title" :visible.sync="show" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">命令信息</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option v-for="option in typeList" :key="option.code" :label="option.name"
|
||||
:value="option.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="车站名称" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="区段名称" label-width="100px">
|
||||
<el-input v-model="sectionName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
|
||||
highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="50" label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" :width="160" label="时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="context" :width="180" label="执行过程">
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" label="执行结果">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="notice">{{message}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
|
||||
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
|
||||
v-show="timeCountConfirm>0">({{timeCountConfirm}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdClose" @click="close">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm alxe-effective" :title="title" :visible.sync="show" width="420px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;">
|
||||
<span class="base-label">准备</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">区段设备</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">
|
||||
<el-input v-model="model.sectionName" :type="type" size="mini" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm1" size="mini" :disabled="type==='password'" @click="commitOnce">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;margin-top: 10px">
|
||||
<span class="base-label">确认</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">区段</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">
|
||||
<el-select :id="domIdChoose2" v-model="model.confirmSectionName" filterable size="mini" :disabled="type==='text'" @change="sectionSelectChange">
|
||||
<el-option v-for="(option,index) in randomSectionList" :key="index" :label="option.name" :value="option.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm2" size="mini" :loading="loading" :disabled="type==='text'" @click="commit">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<el-row type="flex" justify="left" style="margin-top:20px;margin-bottom: 10px;">
|
||||
<el-col :span="6" :offset="1">操作倒计时</el-col>
|
||||
<el-col :span="16">
|
||||
<el-input v-model="model.time" size="mini" :readonly="true" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1">状态</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1" :span="23">
|
||||
<el-input v-model="model.status" type="textarea" :rows="2" placeholder />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="botton-group" style="margin-top:20px">
|
||||
<el-col :span="4" :offset="10">
|
||||
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
<popup-alarm ref="popupAlarm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import { now } from '@/utils/date';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import PopupAlarm from './childDialog/popupAlarm';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SectionCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
sectionName: ''
|
||||
export default {
|
||||
name: 'AlxeEffective',
|
||||
components: {
|
||||
NoticeInfo,
|
||||
PopupAlarm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
type: 'text',
|
||||
timeout: 1000,
|
||||
timenum: 30,
|
||||
stepNum: 0,
|
||||
task: null,
|
||||
model: {
|
||||
sectionName: '',
|
||||
confirmSectionName: '',
|
||||
status: '',
|
||||
time: 0
|
||||
},
|
||||
selected: null,
|
||||
operate: null,
|
||||
operation: '',
|
||||
randomSectionList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', ['stationList', 'sectionList']),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return OperationEvent.Section.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return OperationEvent.Section.unlock.confirm1.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Section.unlock.menu.operation, name: '区段解封' },
|
||||
{ code: OperationEvent.Section.fault.menu.operation, name: '区段故障解锁' },
|
||||
{ code: OperationEvent.Section.axlePreReset.menu.operation, name: '区段计轴预复位' },
|
||||
]
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return '区段解封';
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return '区段故障解锁';
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
return '区段计轴预复位';
|
||||
}
|
||||
}
|
||||
domIdConfirm2() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return OperationEvent.Section.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return OperationEvent.Section.unlock.confirm2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && 1 <= index && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
domIdChoose2() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return OperationEvent.Section.fault.choose2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return OperationEvent.Section.unlock.choose2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000)
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
let section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name
|
||||
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation || '';
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage('请点击“下达”按钮,下达命令!');
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation ||
|
||||
this.operation == OperationEvent.Section.unlock.menu.operation ||
|
||||
this.operation == OperationEvent.Section.cancelSpeed.menu.operation ||
|
||||
this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return '区故解';
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return '解除封锁';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'model.sectionName': function(name) {
|
||||
const index = Math.floor(Math.random(1) * 5);
|
||||
for (var i = 0; i < 5; i++) {
|
||||
if (i == index) {
|
||||
this.randomSectionList.push({ name });
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.order.operation
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.order.operation
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.order.operation
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认1”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
|
||||
const section = this.sectionList[
|
||||
Math.floor(Math.random(1) * this.sectionList.length)
|
||||
];
|
||||
if (section.type != '02') {
|
||||
if (
|
||||
this.randomSectionList.findIndex(it => {
|
||||
return it.name == section.name;
|
||||
}) < 0
|
||||
) {
|
||||
this.randomSectionList.push({ name: section.name });
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
stopTask() {
|
||||
if (this.task) {
|
||||
clearInterval(this.task);
|
||||
this.task = null;
|
||||
}
|
||||
|
||||
if (this.stepNum < 3) {
|
||||
this.$store.dispatch('training/backSteps', this.stepNum);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.model.name = '';
|
||||
this.model.time = '';
|
||||
this.type = 'text';
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.status = '';
|
||||
this.model.sectionName = '';
|
||||
this.model.confirmSectionName = '';
|
||||
if (selected) {
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.isSwitchSection) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
}
|
||||
} else {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
this.model.sectionName = `${section.name}-${selected.name}`;
|
||||
} else {
|
||||
this.model.sectionName = `${selected.name}`;
|
||||
}
|
||||
}
|
||||
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.switchSectionCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.stepNum = 0;
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.stopTask();
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
waitSelectEvent() {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
this.model.time -= 1;
|
||||
if (this.model.time <= 0) {
|
||||
this.stopTask();
|
||||
}
|
||||
}
|
||||
},
|
||||
commitOnce() {
|
||||
this.stepNum = 1;
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.confirm1.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.type = 'password';
|
||||
this.model.time = this.timenum;
|
||||
this.task = setInterval(this.waitSelectEvent, this.timeout);
|
||||
}
|
||||
});
|
||||
},
|
||||
sectionSelectChange() {
|
||||
if (this.model.confirmSectionName === this.model.sectionName) {
|
||||
this.stepNum = 2;
|
||||
} else {
|
||||
this.model.time = 0;
|
||||
}
|
||||
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.choose2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.choose2.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', {
|
||||
break: true
|
||||
});
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: '',
|
||||
cmdType: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_FAULT_UNLOCK;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_UNBLOCK;
|
||||
}
|
||||
|
||||
this.model.status = '';
|
||||
if (this.model.sectionName == this.model.confirmSectionName) {
|
||||
this.stepNum = 3;
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.type = 'text';
|
||||
this.stopTask();
|
||||
this.doClose();
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.popupAlarm.doShow(Object.assign(this.operate, {val: operate.val}), [`区段 ${this.model.sectionName}报告恢复计轴有效`]);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
}
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
this.model.status = '区段选择错误';
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认2”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm2.operation;
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
stop() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
close() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store
|
||||
.dispatch('training/nextNew', operate)
|
||||
.then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.alxe-effective .context {
|
||||
height: 80px !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,207 +1,222 @@
|
||||
<template>
|
||||
<el-dialog class="ningbo-01__systerm section-control" :title="title" :visible.sync="show" width="300px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<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-input>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="sectionName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
|
||||
激活</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="radio" label="2" :disabled="radio == 1" style="display: block; text-align: center;">
|
||||
切除</el-radio>
|
||||
</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"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm section-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="sectionName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
|
||||
激活</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="radio" label="2" :disabled="radio == 1" style="display: block; text-align: center;">
|
||||
切除</el-radio>
|
||||
</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" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SectionControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
export default {
|
||||
name: 'SectionControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
sectionName: '',
|
||||
radio: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
sectionName: '',
|
||||
radio: '',
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
return '区段封锁';
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
return '区段控制';
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
return '区段控制';
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
return '区段封锁';
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name;
|
||||
}
|
||||
}
|
||||
this.sectionName += `-${selected.name}`;
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.operation = operate.operation || '';
|
||||
|
||||
if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
this.radio = '2';
|
||||
return '区段控制';
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
this.radio = '1';
|
||||
return '区段控制';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
let section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name;
|
||||
}
|
||||
}
|
||||
this.sectionName += `-${selected.name}`;
|
||||
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.operation = operate.operation || '';
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
/** 区段封锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
/** 轨道区段切除*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
/** 轨道区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
//道岔单锁
|
||||
lock() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.lock.menu.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//轨道区段切除
|
||||
split() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.split.menu.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//轨道区段激活
|
||||
active() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.active.menu.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
/** 区段封锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
/** 轨道区段切除*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
/** 轨道区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
// 区段封锁
|
||||
lock() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.lock.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_BLOCK
|
||||
};
|
||||
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
// 轨道区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.split.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
|
||||
};
|
||||
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
// 轨道区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.active.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_ACTIVE
|
||||
};
|
||||
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
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>
|
||||
};
|
||||
</script>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -94,6 +94,7 @@
|
||||
v-model="radio2"
|
||||
label="1"
|
||||
style="display: block; text-align: left;"
|
||||
:disabled="radio2 == 2"
|
||||
@change="changeRadio"
|
||||
>
|
||||
本站台上行</el-radio>
|
||||
@ -104,6 +105,7 @@
|
||||
v-model="radio2"
|
||||
label="2"
|
||||
style="display: block; text-align: left;"
|
||||
:disabled="radio2 == 1"
|
||||
@change="changeRadio"
|
||||
>
|
||||
本站台下行</el-radio>
|
||||
@ -149,7 +151,6 @@ export default {
|
||||
earlyDepar: false, // 提前发车
|
||||
buckle: true, // 设置扣车
|
||||
AutomaticBuckle: false, // 区间自动扣车
|
||||
standCode: '',
|
||||
autoRadio: '1',
|
||||
autoRadio1: '1'
|
||||
};
|
||||
@ -213,7 +214,6 @@ export default {
|
||||
|
||||
this.operation = operate.operation;
|
||||
this.setDefaultItems();
|
||||
this.standCode = operate.code;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
@ -232,7 +232,7 @@ export default {
|
||||
this.radio1 = '2';
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
this.earlyDepar = true;
|
||||
if (this.selected.direction == '01') {
|
||||
if (!this.selected.right) {
|
||||
this.radio2 = '2';
|
||||
} else {
|
||||
this.radio2 = '1';
|
||||
@ -240,9 +240,17 @@ export default {
|
||||
} else if (this.operation == OperationEvent.StationStand.setDetainTrainAuto.menu.operation) {
|
||||
this.AutomaticBuckle = true;
|
||||
this.autoRadio1 = '1';
|
||||
this.autoRadio = '1';
|
||||
if (!this.selected.right) {
|
||||
this.autoRadio = '2';
|
||||
}
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation) {
|
||||
this.AutomaticBuckle = true;
|
||||
this.autoRadio1 = '2';
|
||||
this.autoRadio = '1';
|
||||
if (!this.selected.right) {
|
||||
this.autoRadio = '2';
|
||||
}
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
@ -281,17 +289,66 @@ export default {
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
/** 提前发车*/
|
||||
this.earlyDeparture();
|
||||
} else if (this.operation == OperationEvent.StationStand.setDetainTrainAuto.menu.operation) {
|
||||
/** 区间自动扣车*/
|
||||
this.setDetainTrainAuto();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation) {
|
||||
/** 取消区间自动扣车*/
|
||||
this.cancelDetainTrainAuto();
|
||||
}
|
||||
},
|
||||
setDetainTrainAuto() { // 区间自动扣车
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setDetainTrainAuto.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO,
|
||||
param: {
|
||||
Direction: this.autoRadio // 1 上行 2 下行
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancelDetainTrainAuto() { // 取消区间自动扣车
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO,
|
||||
param: {
|
||||
Direction: this.autoRadio // 1 上行 2 下行
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
|
||||
param: {
|
||||
StationStand_Code: this.standCode
|
||||
}
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
@ -312,10 +369,7 @@ export default {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
|
||||
param: {
|
||||
StationStand_Code: this.standCode
|
||||
}
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
@ -336,10 +390,7 @@ export default {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART,
|
||||
param: {
|
||||
StationStand_Code: this.standCode
|
||||
}
|
||||
cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
|
@ -1,20 +1,35 @@
|
||||
<template>
|
||||
<el-dialog class="ningbo-01__systerm stand-detail" :title="title" :visible.sync="show" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-tree :data="treeData" :lazy="false" class="tree-height-max" :default-expand-all="true"
|
||||
style="background: #f0f0f0;">
|
||||
<div slot-scope="{ node, 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;">
|
||||
{{ data.name }}</div>
|
||||
<div style="width: 54%;float: left; height: 24px; line-height: 24px; padding-left: 5px;">
|
||||
{{ data.value }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tree>
|
||||
<!-- <el-row class="header">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm stand-detail"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
:lazy="false"
|
||||
class="tree-height-max"
|
||||
:default-expand-all="true"
|
||||
style="background: #f0f0f0;"
|
||||
>
|
||||
<div slot-scope="{ node, 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;"
|
||||
>
|
||||
{{ data.name }}</div>
|
||||
<div style="width: 54%;float: left; height: 24px; line-height: 24px; padding-left: 5px;">
|
||||
{{ data.value }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tree>
|
||||
<!-- <el-row class="header">
|
||||
<el-col :span="10"><span>车站名称</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>站台</span></el-col>
|
||||
</el-row>
|
||||
@ -35,227 +50,226 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div> -->
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<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" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'StandDetail',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
stationName: '',
|
||||
standName: '',
|
||||
strategyMap: {
|
||||
'01': '无折返',
|
||||
'02': '无人折返',
|
||||
'03': '自动换端',
|
||||
'04': '默认'
|
||||
},
|
||||
treeData: [
|
||||
{
|
||||
children: [
|
||||
{
|
||||
name: '车站',
|
||||
value: '',
|
||||
level: 2,
|
||||
},
|
||||
{
|
||||
name: '站台',
|
||||
value: '',
|
||||
level: 2,
|
||||
},
|
||||
{
|
||||
name: '停站时间',
|
||||
value: '',
|
||||
level: 2,
|
||||
},
|
||||
{
|
||||
name: '跳停',
|
||||
value: '',
|
||||
level: 2,
|
||||
}
|
||||
],
|
||||
name: '站台基本信息',
|
||||
level: 1,
|
||||
},
|
||||
{
|
||||
children: [
|
||||
{
|
||||
name: '中心扣车',
|
||||
value: '',
|
||||
level: 2,
|
||||
},
|
||||
{
|
||||
name: '车站扣车',
|
||||
value: '',
|
||||
level: 2,
|
||||
}
|
||||
],
|
||||
name: '扣车',
|
||||
level: 1,
|
||||
},
|
||||
{
|
||||
children: [
|
||||
{
|
||||
name: '上行站台',
|
||||
value: '',
|
||||
level: 2,
|
||||
},
|
||||
{
|
||||
name: '下行站台',
|
||||
value: '',
|
||||
level: 2,
|
||||
}
|
||||
],
|
||||
name: '运行等级',
|
||||
level: 1,
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
export default {
|
||||
name: 'StandDetail',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
stationName: '',
|
||||
standName: '',
|
||||
strategyMap: {
|
||||
'01': '无折返',
|
||||
'02': '无人折返',
|
||||
'03': '自动换端',
|
||||
'04': '默认'
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '站台详细信息';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
|
||||
let stationList = this.stationList.slice();
|
||||
let index = this.stationList.findIndex(n => n.code == selected.stationCode);
|
||||
let stationStand, station;
|
||||
if (selected.direction == '01') { // 下行
|
||||
//下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
} else {
|
||||
//上行时,此站不是最后一站
|
||||
if (index != this.stationList.length - 1) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
}
|
||||
|
||||
/** 01: 未设置扣车 02: 车站扣车 03: 中心扣车 04: 中心+车站扣车*/
|
||||
// this.tempData.push({ item: '车站扣车', status: opts.holdStatus == '02' || opts.holdStatus == '04' ? '已设置' : '未设置' });
|
||||
// this.tempData.push({ item: '中心扣车', status: opts.holdStatus == '03' || opts.holdStatus == '04' ? '已设置' : '未设置' });
|
||||
// 中心扣车
|
||||
this.treeData[1].children[0].value = opts.holdStatus == '03' || opts.holdStatus == '04' ? '已设置' : '未设置';
|
||||
// 车站扣车
|
||||
this.treeData[1].children[1].value = opts.holdStatus == '02' || opts.holdStatus == '04' ? '已设置' : '未设置';
|
||||
// this.tempData.push({ item: '停站时间', status: opts.parkingTime != -1 ? opts.parkingTime : '自动' });
|
||||
// 停站时间
|
||||
this.treeData[0].children[2].value = opts.parkingTime != -1 ? opts.parkingTime : '自动';
|
||||
// 跳停
|
||||
this.treeData[0].children[3].value = opts.jumpStopStatus != '01' ? '已设置' : '未设置';
|
||||
if (!stationStand || !station) {
|
||||
this.tempData.push({ item: '运行等级', status: `自动` });
|
||||
} else {
|
||||
this.tempData.push({ item: '运行等级', status: opts.intervalRunTime > 0 ? `至${station.name}${stationStand.name}:人工` : `至${station.name}${stationStand.name}:自动` });
|
||||
}
|
||||
// this.tempData.push({ item: '跳停', status: opts.jumpStopStatus != '01' ? '已设置' : '未设置' });
|
||||
this.tempData.push({ item: '下行折返策略', status: this.strategyMap[opts.reentryStrategy] ? this.strategyMap[opts.reentryStrategy] : '默认' });
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
// this.standName = '';
|
||||
// this.stationName = '';
|
||||
this.treeData[0].children[0].value = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
// this.standName = selected.name;
|
||||
this.treeData[0].children[1].value = selected.name;
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
// this.stationName = station.name;
|
||||
this.treeData[0].children[0].value = station.name;
|
||||
// this.treeData[0].children[1].value = station.runPlanName
|
||||
treeData: [
|
||||
{
|
||||
children: [
|
||||
{
|
||||
name: '车站',
|
||||
value: '',
|
||||
level: 2
|
||||
},
|
||||
{
|
||||
name: '站台',
|
||||
value: '',
|
||||
level: 2
|
||||
},
|
||||
{
|
||||
name: '停站时间',
|
||||
value: '',
|
||||
level: 2
|
||||
},
|
||||
{
|
||||
name: '跳停',
|
||||
value: '',
|
||||
level: 2
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
],
|
||||
name: '站台基本信息',
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
children: [
|
||||
{
|
||||
name: '中心扣车',
|
||||
value: '',
|
||||
level: 2
|
||||
},
|
||||
{
|
||||
name: '车站扣车',
|
||||
value: '',
|
||||
level: 2
|
||||
}
|
||||
],
|
||||
name: '扣车',
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
children: [
|
||||
{
|
||||
name: '上行站台',
|
||||
value: '',
|
||||
level: 2
|
||||
},
|
||||
{
|
||||
name: '下行站台',
|
||||
value: '',
|
||||
level: 2
|
||||
}
|
||||
],
|
||||
name: '运行等级',
|
||||
level: 1
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '站台详细信息';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
|
||||
let stationStand, station;
|
||||
if (selected.direction == '01') { // 下行
|
||||
// 下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
} else {
|
||||
// 上行时,此站不是最后一站
|
||||
if (index != this.stationList.length - 1) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
|
||||
/** 01: 未设置扣车 02: 车站扣车 03: 中心扣车 04: 中心+车站扣车*/
|
||||
// this.tempData.push({ item: '车站扣车', status: opts.holdStatus == '02' || opts.holdStatus == '04' ? '已设置' : '未设置' });
|
||||
// this.tempData.push({ item: '中心扣车', status: opts.holdStatus == '03' || opts.holdStatus == '04' ? '已设置' : '未设置' });
|
||||
// 中心扣车
|
||||
this.treeData[1].children[0].value = opts.holdStatus == '03' || opts.holdStatus == '04' ? '已设置' : '未设置';
|
||||
// 车站扣车
|
||||
this.treeData[1].children[1].value = opts.holdStatus == '02' || opts.holdStatus == '04' ? '已设置' : '未设置';
|
||||
// this.tempData.push({ item: '停站时间', status: opts.parkingTime != -1 ? opts.parkingTime : '自动' });
|
||||
// 停站时间
|
||||
this.treeData[0].children[2].value = opts.parkingTime != -1 ? opts.parkingTime : '自动';
|
||||
// 跳停
|
||||
this.treeData[0].children[3].value = opts.jumpStopStatus != '01' ? '已设置' : '未设置';
|
||||
if (!stationStand || !station) {
|
||||
this.tempData.push({ item: '运行等级', status: `自动` });
|
||||
} else {
|
||||
this.tempData.push({ item: '运行等级', status: opts.intervalRunTime > 0 ? `至${station.name}${stationStand.name}:人工` : `至${station.name}${stationStand.name}:自动` });
|
||||
}
|
||||
// this.tempData.push({ item: '跳停', status: opts.jumpStopStatus != '01' ? '已设置' : '未设置' });
|
||||
this.tempData.push({ item: '下行折返策略', status: this.strategyMap[opts.reentryStrategy] ? this.strategyMap[opts.reentryStrategy] : '默认' });
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
// this.standName = '';
|
||||
// this.stationName = '';
|
||||
this.treeData[0].children[0].value = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
// this.standName = selected.name;
|
||||
this.treeData[0].children[1].value = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
// this.stationName = station.name;
|
||||
this.treeData[0].children[0].value = station.name;
|
||||
// this.treeData[0].children[1].value = station.runPlanName
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.close.confirm.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();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
};
|
||||
</script>
|
||||
|
@ -1,180 +0,0 @@
|
||||
<template>
|
||||
<el-dialog class="ningbo-01__systerm stand-detain-train-all" :title="title" :visible.sync="show" width="340px" :before-close="doClose"
|
||||
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray; ">
|
||||
<span class="base-label">范围</span>
|
||||
<el-row>
|
||||
<el-radio-group v-model="upDown" @change="choose">
|
||||
<el-col :span="10">
|
||||
<el-radio label="02" :id="upDown == '01' ? domIdChoose : ''">上行全线</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="8">
|
||||
<el-radio label="01" :id="upDown == '02' ? domIdChoose : ''">下行全线</el-radio>
|
||||
</el-col>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div class="table">
|
||||
<span>扣车站台列表(中心设置)</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" empty-text="所有站台都无扣车状态!" height="160" highlight-current-row>
|
||||
<el-table-column prop="stationName" label="车站名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="standName" :width="140" label="扣车站台">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrainAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
upDown: '01',
|
||||
tempData: [],
|
||||
disabled: true,
|
||||
operation: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList',
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
// if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.menu.operation) {
|
||||
if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) {
|
||||
return '全线取消扣车';
|
||||
} else {
|
||||
return '全线取消跳停';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadTableData() {
|
||||
this.tempData = [];
|
||||
this.stationStandList.forEach(elem => {
|
||||
/** status 01: 未扣车*/
|
||||
let stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).state;
|
||||
let station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {}).model;
|
||||
if (station && stand && stand.holdStatus != '01' && Number(elem.direction) === Number(this.upDown)) {
|
||||
this.tempData.push({ stationName: station.name, standName: elem.name });
|
||||
}
|
||||
});
|
||||
|
||||
//如果存在未扣车的情况,才可以做此操作
|
||||
if (this.tempData.length > 0) {
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
//不是断点激活的菜单应该将状态初始化
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.upDown = selected.direction;
|
||||
this.loadTableData();
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
choose(upDown) {
|
||||
//重新设置扣车站台
|
||||
this.loadTableData();
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
|
||||
val: `${upDown}`,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
|
||||
val: this.upDown,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -92,258 +92,260 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrains',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
selected: null,
|
||||
operation: null,
|
||||
trainList: [],
|
||||
radio1: '',
|
||||
model: {
|
||||
val1: '',
|
||||
val2: '',
|
||||
tripNumber: '',
|
||||
direction: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
selectTrainId() {
|
||||
if (this.radio1 == this.JumpStopSet) {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.select.domId : '';
|
||||
} else {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.select.domId : '';
|
||||
}
|
||||
},
|
||||
selfStationStandId() {
|
||||
if (this.radio1 == this.JumpStopSet) {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.selfStationStand.domId : '';
|
||||
} else {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.selfStationStand.domId : '';
|
||||
}
|
||||
},
|
||||
otherStationStandId() {
|
||||
if (this.radio1 == this.JumpStopSet) {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.otherStationStand.domId : '';
|
||||
} else {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.otherStationStand.domId : '';
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
return '跳停';
|
||||
},
|
||||
upstream() {
|
||||
return '02'; // 上行
|
||||
},
|
||||
downstream() {
|
||||
return '01'; // 下行
|
||||
},
|
||||
JumpStopSet() {
|
||||
return OperationEvent.StationStand.setJumpStop.menu.operation;
|
||||
},
|
||||
JumpStopCancel() {
|
||||
return OperationEvent.StationStand.cancelJumpStop.menu.operation;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'model.val1'(val) {
|
||||
if (val) this.model.val2 = '';
|
||||
},
|
||||
'model.val2'(val) {
|
||||
if (val) this.model.val1 = '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.radio1 = '',
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected) {
|
||||
this.standName = selected.name;
|
||||
}
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.model.direction = '01';
|
||||
this.model.val1 = '01'; // 站台的上下行方向, 01:下行 /02:上行
|
||||
if (this.selected.right) {
|
||||
this.model.direction = '02';
|
||||
this.model.val1 = '02';
|
||||
}
|
||||
this.radio1 = operate.operation;
|
||||
|
||||
this.model.val2 = '';
|
||||
this.model.tripNumber = '';
|
||||
name: 'StandDetainTrains',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
selected: null,
|
||||
operation: null,
|
||||
trainList: [],
|
||||
radio1: '',
|
||||
model: {
|
||||
val1: '',
|
||||
val2: '',
|
||||
tripNumber: '',
|
||||
direction: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
selectTrainId() {
|
||||
if (this.radio1 == this.JumpStopSet) {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.select.domId : '';
|
||||
} else {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.select.domId : '';
|
||||
}
|
||||
},
|
||||
selfStationStandId() {
|
||||
if (this.radio1 == this.JumpStopSet) {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.selfStationStand.domId : '';
|
||||
} else {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.selfStationStand.domId : '';
|
||||
}
|
||||
},
|
||||
otherStationStandId() {
|
||||
if (this.radio1 == this.JumpStopSet) {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setJumpStop.otherStationStand.domId : '';
|
||||
} else {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelJumpStop.otherStationStand.domId : '';
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
return '跳停';
|
||||
},
|
||||
upstream() {
|
||||
return '02'; // 上行
|
||||
},
|
||||
downstream() {
|
||||
return '01'; // 下行
|
||||
},
|
||||
JumpStopSet() {
|
||||
return OperationEvent.StationStand.setJumpStop.menu.operation;
|
||||
},
|
||||
JumpStopCancel() {
|
||||
return OperationEvent.StationStand.cancelJumpStop.menu.operation;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'model.val1'(val) {
|
||||
if (val) this.model.val2 = '';
|
||||
},
|
||||
'model.val2'(val) {
|
||||
if (val) this.model.val1 = '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.radio1 = '';
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected) {
|
||||
this.standName = selected.name;
|
||||
}
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.model.direction = '01';
|
||||
this.model.val1 = '01'; // 站台的上下行方向, 01:下行 /02:上行
|
||||
if (this.selected.right) {
|
||||
this.model.direction = '02';
|
||||
this.model.val1 = '02';
|
||||
}
|
||||
this.radio1 = operate.operation;
|
||||
|
||||
/** 加载列车数据*/
|
||||
this.trainList = this.map.trainList;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
/** 设置跳停*/
|
||||
this.setJumpStop();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
|
||||
/** 取消跳停*/
|
||||
this.cancelJumpStop();
|
||||
}
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
let val = this.model.val1;
|
||||
if (this.model.val2) {
|
||||
val = this.model.val2 + '::' + this.model.tripNumber;
|
||||
}
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
|
||||
// val: this.selected.direction //站台的上下行方向, 01:下行 /02:上行
|
||||
val: val
|
||||
};
|
||||
this.model.val2 = '';
|
||||
this.model.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(operate);
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
let val = this.model.val1;
|
||||
if (this.model.val2) {
|
||||
val = this.model.val2 + '::' + this.model.tripNumber;
|
||||
}
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
|
||||
val: val // 站台的上下行方向, 01:下行 /02:上行
|
||||
};
|
||||
/** 加载列车数据*/
|
||||
this.trainList = this.map.trainList;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
/** 设置跳停*/
|
||||
this.setJumpStop();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
|
||||
/** 取消跳停*/
|
||||
this.cancelJumpStop();
|
||||
}
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
let val = this.model.val1;
|
||||
if (this.model.val2) {
|
||||
val = this.model.val2;
|
||||
}
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP,
|
||||
param: {
|
||||
Is_This_Platform: val,
|
||||
Trip_Number: this.model.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(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.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(operate);
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
let val = this.model.val1;
|
||||
if (this.model.val2) {
|
||||
val = this.model.val2;
|
||||
}
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
|
||||
param: {
|
||||
Is_This_Platform: val,
|
||||
Trip_Number: this.model.tripNumber
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = false;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
upAndDownStreamChangeVal1(val) {
|
||||
const operation = this.radio1 == this.JumpStopSet
|
||||
? OperationEvent.StationStand.setJumpStop.selfStationStand.operation : OperationEvent.StationStand.cancelJumpStop.selfStationStand.operation;
|
||||
this.model.val2 = '';
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
upAndDownStreamChange(val) {
|
||||
const operation = this.radio1 == this.JumpStopSet
|
||||
? OperationEvent.StationStand.setJumpStop.otherStationStand.operation : OperationEvent.StationStand.cancelJumpStop.otherStationStand.operation;
|
||||
this.model.val1 = '';
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainNoSelectChange(val) {
|
||||
const operation = this.radio1 == this.JumpStopSet
|
||||
? OperationEvent.StationStand.setJumpStop.select.operation : OperationEvent.StationStand.cancelJumpStop.select.operation;
|
||||
this.model.val1 = '';
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: operation,
|
||||
val: val
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.loading = false;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
upAndDownStreamChangeVal1(val) {
|
||||
const operation = this.radio1 == this.JumpStopSet
|
||||
? OperationEvent.StationStand.setJumpStop.selfStationStand.operation : OperationEvent.StationStand.cancelJumpStop.selfStationStand.operation;
|
||||
this.model.val2 = '';
|
||||
const operate = {
|
||||
operation: operation
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
upAndDownStreamChange(val) {
|
||||
const operation = this.radio1 == this.JumpStopSet
|
||||
? OperationEvent.StationStand.setJumpStop.otherStationStand.operation : OperationEvent.StationStand.cancelJumpStop.otherStationStand.operation;
|
||||
this.model.val1 = '';
|
||||
const operate = {
|
||||
operation: operation
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainNoSelectChange(val) {
|
||||
const operation = this.radio1 == this.JumpStopSet
|
||||
? OperationEvent.StationStand.setJumpStop.select.operation : OperationEvent.StationStand.cancelJumpStop.select.operation;
|
||||
this.model.val1 = '';
|
||||
const operate = {
|
||||
operation: operation
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,336 +1,333 @@
|
||||
<template>
|
||||
<el-dialog class="ningbo-01__systerm stand-run-level" :title="title" :visible.sync="show" width="500px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>集中站</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>站台</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>站台状态</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
|
||||
<el-table-column prop="name" :width="180" label="下一站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.level" size="mini" @change="levelSelectChange(scope.row)"
|
||||
:id='chooseLevelId'>
|
||||
<el-option v-for="item in levelList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="time" label="区间运行时间">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.time" size="mini" @change="timeSelectChange"
|
||||
:disabled="scope.row.level == 0" :id='domIdChoose'>
|
||||
<el-option v-for="item in timeList[scope.row.level]" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="check" label="一直有效">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="check" v-model="scope.row.check" @change="checkChange" :id='domIdCheck'>
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- <el-row class="button-group">
|
||||
<span v-if="isSelect && tempData.length">提示: 未选中要设置运行等级的下一站台</span>
|
||||
<span v-if="isConfirm && tempData.length">提示: 选中要设置运行等级的下一站台为{{tempData[0].name}}</span>
|
||||
</el-row> -->
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
</el-dialog>
|
||||
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm stand-run-level" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :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="standName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>站台状态</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
|
||||
<el-table-column prop="name" :width="180" label="下一站台" />
|
||||
<el-table-column prop="level" label="运行等级">
|
||||
<template slot-scope="scope">
|
||||
<el-select :id="chooseLevelId" v-model="scope.row.level" size="mini" @change="levelSelectChange(scope.row)">
|
||||
<el-option
|
||||
v-for="item in levelList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="time" label="区间运行时间">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
:id="domIdChoose"
|
||||
v-model="scope.row.time"
|
||||
size="mini"
|
||||
:disabled="scope.row.level == 0"
|
||||
@change="timeSelectChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in timeList[scope.row.level]"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="check" label="一直有效">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox :id="domIdCheck" ref="check" v-model="scope.row.check" @change="checkChange" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- <el-row class="button-group">
|
||||
<span v-if="isSelect && tempData.length">提示: 未选中要设置运行等级的下一站台</span>
|
||||
<span v-if="isConfirm && tempData.length">提示: 选中要设置运行等级的下一站台为{{tempData[0].name}}</span>
|
||||
</el-row> -->
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StandRunLevel',
|
||||
components: {
|
||||
ConfirmControl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
tempData: [],
|
||||
maxRunLevel: 300,
|
||||
stationName: '',
|
||||
standName: '',
|
||||
selection: [],
|
||||
levelList: [
|
||||
{
|
||||
value: '0',
|
||||
label: '自动',
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '1',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '2',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '3',
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '4',
|
||||
},
|
||||
],
|
||||
isSelect: true,
|
||||
isConfirm: false,
|
||||
time: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
//深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
export default {
|
||||
name: 'StandRunLevel',
|
||||
components: {
|
||||
ConfirmControl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
tempData: [],
|
||||
maxRunLevel: 300,
|
||||
stationName: '',
|
||||
standName: '',
|
||||
selection: [],
|
||||
levelList: [
|
||||
{
|
||||
value: '0',
|
||||
label: '自动'
|
||||
},
|
||||
deep: true
|
||||
{
|
||||
value: '1',
|
||||
label: '1'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '2'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '3'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '4'
|
||||
}
|
||||
],
|
||||
isSelect: true,
|
||||
isConfirm: false,
|
||||
time: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
chooseLevelId() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.chooseLevel.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.choose.domId : '';
|
||||
},
|
||||
domIdCheck() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.check.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '设置运行等级';
|
||||
},
|
||||
timeList() {
|
||||
const list = {
|
||||
'0': [{ value: 0, label: '0' }],
|
||||
'1': [], // 120 - 110
|
||||
'2': [], // 100 - 90
|
||||
'3': [], // 80 - 70
|
||||
'4': [] // 60 - 50
|
||||
};
|
||||
for (let i = 110; i <= 120; i++) {
|
||||
list['1'].push({ value: i, label: `${i}` });
|
||||
}
|
||||
for (let i = 90; i <= 100; i++) {
|
||||
list['2'].push({ value: i, label: `${i}` });
|
||||
}
|
||||
for (let i = 70; i <= 80; i++) {
|
||||
list['3'].push({ value: i, label: `${i}` });
|
||||
}
|
||||
for (let i = 50; i <= 60; i++) {
|
||||
list['4'].push({ value: i, label: `${i}` });
|
||||
}
|
||||
return list;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getLevelByTime(time) {
|
||||
return Object.keys(this.timeList).findIndex(key => {
|
||||
return this.timeList[key].findIndex(obj => {
|
||||
return obj.value === time;
|
||||
}) >= 0;
|
||||
}).toString();
|
||||
},
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
|
||||
if (selected.direction == '01') { // 下行
|
||||
// 下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(opts.intervalRunTime), time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
} else {
|
||||
// 上行时,此站不是最后一站
|
||||
if (index != this.stationList.length) {
|
||||
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(opts.intervalRunTime), time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
chooseLevelId() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.chooseLevel.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.choose.domId : '';
|
||||
},
|
||||
domIdCheck() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.check.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '设置运行等级';
|
||||
},
|
||||
timeList() {
|
||||
let list = {
|
||||
'0': [{ value: 0, label: '0' }],
|
||||
'1': [], // 120 - 110
|
||||
'2': [], // 100 - 90
|
||||
'3': [], // 80 - 70
|
||||
'4': [], // 60 - 50
|
||||
doShow(operate, selected, opts) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活窗口,而是第一次显示窗口时,需要初始化窗口数据
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
for (var i = 110; i <= 120; i++) {
|
||||
list['1'].push({ value: i, label: `${i}` })
|
||||
}
|
||||
for (var i = 90; i <= 100; i++) {
|
||||
list['2'].push({ value: i, label: `${i}` })
|
||||
}
|
||||
for (var i = 70; i <= 80; i++) {
|
||||
list['3'].push({ value: i, label: `${i}` })
|
||||
}
|
||||
for (var i = 50; i <= 60; i++) {
|
||||
list['4'].push({ value: i, label: `${i}` })
|
||||
}
|
||||
return list;
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getLevelByTime(time) {
|
||||
return Object.keys(this.timeList).findIndex(key => {
|
||||
return this.timeList[key].findIndex(obj => {
|
||||
return obj.value === time;
|
||||
}) >= 0;
|
||||
}).toString();
|
||||
},
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
let stationList = this.stationList.slice();
|
||||
let index = this.stationList.findIndex(n => n.code == selected.stationCode)
|
||||
if (selected.direction == '01') { // 下行
|
||||
//下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
let stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
let station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(opts.intervalRunTime), time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
} else {
|
||||
//上行时,此站不是最后一站
|
||||
if (index != this.stationList.length) {
|
||||
let stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
let station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(opts.intervalRunTime), time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
}
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
this.selected = selected;
|
||||
//如果不是断点激活窗口,而是第一次显示窗口时,需要初始化窗口数据
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
let selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.disabledSend = selection.length ? false : true;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
timeSelectChange(time) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.choose.operation,
|
||||
val: time.toString(),
|
||||
}
|
||||
|
||||
this.time = time.toString();
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
levelSelectChange(row) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.chooseLevel.operation,
|
||||
val: row.level.toString(),
|
||||
}
|
||||
|
||||
this.time = row.time = this.timeList[row.level][0].value;
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
checkChange(check) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.check.operation,
|
||||
val: check.toString(),
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
let forver = this.tempData[0].check ? true : false;
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
|
||||
// operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
|
||||
// messages: [`设置运行等级:${this.tempData[0].name}-${this.standName},${this.tempData[0].time == 0 ? `运行时间自动` : `运行时间为${this.tempData[0].time}s`},有效次数为${this.tempData[0].check ? '一直有效' : '一次有效'}`],
|
||||
val: [this.time, forver].join('::'),
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) { // 深度监测
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
})
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
timeSelectChange(time) {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setRunLevel.choose.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.time = time.toString();
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
levelSelectChange(row) {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setRunLevel.chooseLevel.operation
|
||||
};
|
||||
|
||||
this.time = row.time = this.timeList[row.level][0].value;
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
checkChange(check) {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setRunLevel.check.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
|
||||
param: {
|
||||
Time: this.time,
|
||||
Forver: this.tempData[0].check
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
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>
|
||||
};
|
||||
</script>
|
||||
|
@ -1,238 +1,236 @@
|
||||
<template>
|
||||
<el-dialog class="ningbo-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="340px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="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-input>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 73px;">
|
||||
<span class="base-label" style="left: -9px;">模式</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="control" @change='chooseControl' style="width: 40%;float: left;">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<el-radio label="01" :id="control === '01'? '': domIdChoose1">自动</el-radio>
|
||||
</div>
|
||||
<el-radio label="02" :id="control === '02'? '': domIdChoose1">全人工</el-radio>
|
||||
</el-radio-group>
|
||||
<el-input-number v-model="time" @change="inputTime" :disabled="disabledInput" :id="domIdInput"
|
||||
controls-position="right" :min="0" size="mini"
|
||||
style="width: 130px; padding-left:30px;display: block; float: left; margin-top: 15px;">
|
||||
</el-input-number>
|
||||
<div style="float: left;margin-top: 22px; margin-left: 5px;">秒</div>
|
||||
</div>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm stand-stop-time" :zIndex="2000" :title="title" :visible.sync="show" width="340px" :before-close="doClose" :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-input>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 73px;">
|
||||
<span class="base-label" style="left: -9px;">模式</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="control" @change='chooseControl' style="width: 40%;float: left;">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<el-radio label="01" :id="control === '01'? '': domIdChoose1">自动</el-radio>
|
||||
</div>
|
||||
<el-radio label="02" :id="control === '02'? '': domIdChoose1">全人工</el-radio>
|
||||
</el-radio-group>
|
||||
<el-input-number v-model="time" @change="inputTime" :disabled="disabledInput" :id="domIdInput"
|
||||
controls-position="right" :min="0" size="mini"
|
||||
style="width: 130px; padding-left:30px;display: block; float: left; margin-top: 15px;">
|
||||
</el-input-number>
|
||||
<div style="float: left;margin-top: 22px; margin-left: 5px;">秒</div>
|
||||
</div>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; height: 60px;">
|
||||
<span class="base-label" style="left: -9px;">有效次数</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="effective" @change="chooseEffective" :disabled="disabledTime">
|
||||
<el-radio :label="false" :id="effective === false? '': domIdChoose2">一次有效</el-radio>
|
||||
<el-radio :label="true" :id="effective === true? '': domIdChoose2">一直有效</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; height: 60px;">
|
||||
<span class="base-label" style="left: -9px;">有效次数</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="effective" @change="chooseEffective" :disabled="disabledTime">
|
||||
<el-radio :label="false" :id="effective === false? '': domIdChoose2">一次有效</el-radio>
|
||||
<el-radio :label="true" :id="effective === true? '': domIdChoose2">一直有效</el-radio>
|
||||
</el-radio-group>
|
||||
</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>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</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>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StandStopTime',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
export default {
|
||||
name: 'StandStopTime',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
time: 0,
|
||||
control: '01',
|
||||
direction: '01',
|
||||
effective: false,
|
||||
selected: null,
|
||||
standName: '',
|
||||
stationName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
time: 0,
|
||||
control: '01',
|
||||
direction: '01',
|
||||
effective: false,
|
||||
selected: null,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.menu.domId : '';
|
||||
},
|
||||
domIdChoose1() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose1.domId : '';
|
||||
},
|
||||
domIdChoose2() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose2.domId : '';
|
||||
},
|
||||
domIdInput() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
|
||||
},
|
||||
disabledUp() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '02';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.menu.domId : '';
|
||||
},
|
||||
domIdChoose1() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose1.domId : '';
|
||||
},
|
||||
domIdChoose2() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose2.domId : '';
|
||||
},
|
||||
domIdInput() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
|
||||
},
|
||||
disabledUp() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '02'
|
||||
}
|
||||
return true;
|
||||
},
|
||||
disabledDown() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '01'
|
||||
}
|
||||
return true;
|
||||
},
|
||||
disabledInput() {
|
||||
return this.control === '01'; //如果是自动则不可以设置
|
||||
},
|
||||
disabledTime() {
|
||||
return this.control === '01'; //如果是自动则不可以设置
|
||||
},
|
||||
title() {
|
||||
return '停站时间';
|
||||
disabledDown() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '01';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
disabledInput() {
|
||||
return this.control === '01'; // 如果是自动则不可以设置
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempDate) {
|
||||
this.selected = selected || {};
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
disabledTime() {
|
||||
return this.control === '01'; // 如果是自动则不可以设置
|
||||
},
|
||||
title() {
|
||||
return '停站时间';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempDate) {
|
||||
this.selected = selected || {};
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.deviceStationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
|
||||
this.control = Number(tempDate.parkingTime) === -1 ? '01' : '02';
|
||||
this.time = Number(tempDate.parkingTime) === -1 ? 15 : Number(tempDate.parkingTime);
|
||||
this.effective = tempDate.parkingValidStatus ? true : false;
|
||||
this.direction = selected.direction;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
|
||||
this.control = Number(tempDate.parkingTime) === -1 ? '01' : '02';
|
||||
this.time = Number(tempDate.parkingTime) === -1 ? 15 : Number(tempDate.parkingTime);
|
||||
// this.effective = tempDate.parkingValidStatus ? true : false;
|
||||
this.effective = tempDate.parkingValidStatus;
|
||||
this.direction = selected.direction;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
chooseControl(control) {
|
||||
/** 自动时的默认时间*/
|
||||
if (control == '01') {
|
||||
this.inputTime = 15;
|
||||
this.effective = true;
|
||||
}
|
||||
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.choose1.operation,
|
||||
val: `${control}`
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseEffective(effective) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.choose2.operation,
|
||||
val: `${effective}`
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
inputTime(time) {
|
||||
let operate = {
|
||||
repeat: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.input.operation,
|
||||
val: `${time}`
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation,
|
||||
val: [`${this.control}`, this.time, this.effective].join('::'),
|
||||
// messages: [`停站时间: ${this.stationName} - ${this.standName}, 停站时间为${this.control == '01' ? '自动' : this.time + '秒'}, 有效次数为${this.effective == false ? '一次有效' : '一直有效'}`]
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
chooseControl(control) {
|
||||
/** 自动时的默认时间*/
|
||||
if (control == '01') {
|
||||
this.inputTime = 15;
|
||||
this.effective = true;
|
||||
}
|
||||
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setStopTime.choose1.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseEffective() {
|
||||
const operate = {
|
||||
operation: OperationEvent.StationStand.setStopTime.choose2.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
inputTime() {
|
||||
const operate = {
|
||||
repeat: true,
|
||||
operation: OperationEvent.StationStand.setStopTime.input.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation,
|
||||
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
|
||||
param: {
|
||||
Is_Control: this.control,
|
||||
Time: this.time,
|
||||
Effective: this.effective
|
||||
}
|
||||
// messages: [`停站时间: ${this.stationName} - ${this.standName}, 停站时间为${this.control == '01' ? '自动' : this.time + '秒'}, 有效次数为${this.effective == false ? '一次有效' : '一直有效'}`]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
};
|
||||
</script>
|
||||
|
@ -1,459 +1,323 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="ningbo-01__systerm switch-cmd-control" :title="title" :visible.sync="show" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">命令信息</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option v-for="option in typeList" :key="option.code" :label="option.name"
|
||||
:value="option.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="车站名称" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="道岔名称" label-width="80px">
|
||||
<el-input v-model="switchName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
|
||||
highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="50" label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" :width="160" label="时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="context" :width="180" label="执行过程">
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" label="执行结果">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="notice">{{message}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
|
||||
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
|
||||
v-show="timeCountConfirm>0">({{timeCountConfirm}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdClose" @click="close">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm alxe-effective" :title="title" :visible.sync="show" width="420px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;">
|
||||
<span class="base-label">准备</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">操作设备</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">
|
||||
<el-input v-model="model.switchName" :type="type" size="mini" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm1" size="mini" :disabled="type==='password'" @click="commitOnce">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;margin-top: 10px">
|
||||
<span class="base-label">确认</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">操作设备</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">
|
||||
<el-select :id="domIdChoose2" v-model="model.confirmSwitchName" filterable size="mini" :disabled="type==='text'" @change="sectionSelectChange">
|
||||
<el-option v-for="(option,index) in randomSectionList" :key="index" :label="option.name" :value="option.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm2" size="mini" :loading="loading" :disabled="type==='text'" @click="commit">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<el-row type="flex" justify="left" style="margin-top:20px;margin-bottom: 10px;">
|
||||
<el-col :span="6" :offset="1">操作倒计时</el-col>
|
||||
<el-col :span="16">
|
||||
<el-input v-model="model.time" size="mini" :readonly="true" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1">状态</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1" :span="23">
|
||||
<el-input v-model="model.status" type="textarea" :rows="2" placeholder />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="botton-group" style="margin-top:20px">
|
||||
<el-col :span="4" :offset="10">
|
||||
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
<popup-alarm ref="popupAlarm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import { now } from '@/utils/date';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import PopupAlarm from './childDialog/popupAlarm';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SwitchCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
switchName: ''
|
||||
export default {
|
||||
name: 'AlxeEffective',
|
||||
components: {
|
||||
NoticeInfo,
|
||||
PopupAlarm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
type: 'text',
|
||||
timeout: 1000,
|
||||
timenum: 30,
|
||||
stepNum: 0,
|
||||
task: null,
|
||||
model: {
|
||||
switchName: '',
|
||||
confirmSwitchName: '',
|
||||
status: '',
|
||||
time: 0
|
||||
},
|
||||
selected: null,
|
||||
operate: null,
|
||||
operation: '',
|
||||
randomSectionList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', ['stationList', 'switchList']),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return OperationEvent.Switch.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return OperationEvent.Switch.unblock.confirm1.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Switch.unlock.menu.operation, name: '道岔单解' },
|
||||
{ code: OperationEvent.Switch.unblock.menu.operation, name: '道岔解封' },
|
||||
{ code: OperationEvent.Switch.fault.menu.operation, name: '道岔故障解锁' },
|
||||
{ code: OperationEvent.Switch.axlePreReset.menu.operation, name: '道岔计轴预复位' },
|
||||
]
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '道岔单解';
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return '道岔解封';
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
return '道岔故障解锁';
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
return '道岔计轴复位';
|
||||
}
|
||||
}
|
||||
domIdConfirm2() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return OperationEvent.Switch.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return OperationEvent.Switch.unblock.confirm2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && 1 <= index && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
domIdChoose2() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return OperationEvent.Switch.unlock.choose2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return OperationEvent.Switch.unblock.choose2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000)
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage('请点击“下达”按钮,下达命令!');
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
command() {
|
||||
/** 道岔单解/道岔解封/道岔故障解锁/道岔计轴复位*/
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.unblock.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.fault.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.axlePreReset.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '区故解';
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return '解除封锁';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'model.switchName': function(name) {
|
||||
const index = Math.floor(Math.random(1) * 5);
|
||||
for (var i = 0; i < 5; i++) {
|
||||
if (i == index) {
|
||||
this.randomSectionList.push({ name });
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
|
||||
},
|
||||
commandNoPopUp() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认1”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
|
||||
const section = this.switchList[
|
||||
Math.floor(Math.random(1) * this.switchList.length)
|
||||
];
|
||||
if (section.type != '02') {
|
||||
if (
|
||||
this.randomSectionList.findIndex(it => {
|
||||
return it.name == section.name;
|
||||
}) < 0
|
||||
) {
|
||||
this.randomSectionList.push({ name: section.name });
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
stopTask() {
|
||||
if (this.task) {
|
||||
clearInterval(this.task);
|
||||
this.task = null;
|
||||
}
|
||||
|
||||
if (this.stepNum < 3) {
|
||||
this.$store.dispatch('training/backSteps', this.stepNum);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.model.name = '';
|
||||
this.model.time = '';
|
||||
this.type = 'text';
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.status = '';
|
||||
this.model.switchName = '';
|
||||
this.model.confirmSwitchName = '';
|
||||
if (selected) {
|
||||
if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
if (section) {
|
||||
this.model.switchName = section.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.stepNum = 0;
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.stopTask();
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
waitSelectEvent() {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
this.model.time -= 1;
|
||||
if (this.model.time <= 0) {
|
||||
this.stopTask();
|
||||
}
|
||||
}
|
||||
},
|
||||
commitOnce() {
|
||||
this.stepNum = 1;
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm1.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.type = 'password';
|
||||
this.model.time = this.timenum;
|
||||
this.task = setInterval(this.waitSelectEvent, this.timeout);
|
||||
}
|
||||
});
|
||||
},
|
||||
sectionSelectChange() {
|
||||
if (this.model.confirmSwitchName === this.model.switchName) {
|
||||
this.stepNum = 2;
|
||||
} else {
|
||||
this.model.time = 0;
|
||||
}
|
||||
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.choose2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.choose2.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', {
|
||||
break: true
|
||||
});
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: '',
|
||||
cmdType: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK; // 解锁
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK; // 解封
|
||||
}
|
||||
|
||||
this.model.status = '';
|
||||
if (this.model.switchName == this.model.confirmSwitchName) {
|
||||
this.stepNum = 3;
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.type = 'text';
|
||||
this.stopTask();
|
||||
this.doClose();
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.popupAlarm.doShow(Object.assign(this.operate, {val: operate.val}), [`区段 ${this.model.switchName}报告恢复计轴有效`]);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
this.model.status = '区段选择错误';
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm1.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认2”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm2.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm2.operation;
|
||||
}
|
||||
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
stop() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.stop.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
|
||||
})
|
||||
},
|
||||
close() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store
|
||||
.dispatch('training/nextNew', operate)
|
||||
.then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.alxe-effective .context {
|
||||
height: 80px !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,259 +1,303 @@
|
||||
<template>
|
||||
<el-dialog class="ningbo-01__systerm switch-control" :title="title" :visible.sync="show" width="300px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<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-input>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="switchName" size="small" disabled></el-input>
|
||||
</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"></notice-info>
|
||||
</el-dialog>
|
||||
<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="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="switchName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="isActive" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="activeRadio" label="1" :disabled="activeRadio == 2" style="display: block; text-align: center;">
|
||||
激活</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="activeRadio" label="2" :disabled="activeRadio == 1" style="display: block; text-align: center;">
|
||||
切除</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="isLock" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="lockRadio" label="1" style="display: block; text-align: center;">
|
||||
道岔单锁</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="lockRadio" label="2" disabled style="display: block; text-align: center;">
|
||||
道岔解单锁</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="isTurnBlock" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="turnRadio" label="1" :disabled="turnRadio == 2" style="display: block; text-align: center;">
|
||||
道岔定位</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="turnRadio" label="2" :disabled="turnRadio == 1" style="display: block; text-align: center;">
|
||||
道岔反位</el-radio>
|
||||
</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" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
isLock: false,
|
||||
isTurnBlock: false,
|
||||
isActive: false,
|
||||
turnRadio: '1',
|
||||
lockRadio: '1',
|
||||
activeRadio: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
return '道岔控制';
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
return '道岔封锁';
|
||||
} else if (this.operation == OperationEvent.Switch.locate.menu.operation || this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
return '道岔控制';
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
return '道岔强扳';
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
return '区段控制';
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
return '区段控制';
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
return '道岔单锁';
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
return '道岔封锁';
|
||||
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
|
||||
return '道岔转动';
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
return '道岔强扳';
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
return '区段切除'
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
return '区段激活'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.operation = operate.operation;
|
||||
this.isLock = false;
|
||||
this.isTurnBlock = false;
|
||||
this.isActive = false;
|
||||
if (this.operation == OperationEvent.Switch.locate.menu.operation) {
|
||||
this.isTurnBlock = true;
|
||||
this.turnRadio = '1';
|
||||
} else if (this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
this.isTurnBlock = true;
|
||||
this.turnRadio = '2';
|
||||
} else if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
this.isLock = true;
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
this.isActive = true;
|
||||
this.activeRadio = '2';
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
this.isActive = true;
|
||||
this.activeRadio = '1';
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
/** 道岔单锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
/** 道岔封锁*/
|
||||
this.block();
|
||||
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
|
||||
/** 道岔转动*/
|
||||
this.turnout(this.operation);
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
/** 道岔强扳*/
|
||||
this.turnoutForce();
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
//道岔单锁
|
||||
lock() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.lock.menu.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//道岔封锁
|
||||
block() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.block.menu.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//道岔转动
|
||||
turnout(operation) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.turnout.menu.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//道岔强扮
|
||||
turnoutForce() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.turnoutForce.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//区段切除
|
||||
split() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.split.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
//区段激活
|
||||
active() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.active.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
/** 道岔单锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
/** 道岔封锁*/
|
||||
this.block();
|
||||
} else if (this.operation == OperationEvent.Switch.locate.menu.operation || this.operation == OperationEvent.Switch.reverse.menu.operation) {
|
||||
/** 道岔转动*/
|
||||
this.turnout(this.operation);
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.lock.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
|
||||
};
|
||||
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.block.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
|
||||
};
|
||||
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
// 道岔转动
|
||||
turnout() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.turnout.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_TURN
|
||||
};
|
||||
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
// 区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.split.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
|
||||
};
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
// 区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Switch.active.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
||||
};
|
||||
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(operate);
|
||||
});
|
||||
},
|
||||
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>
|
||||
};
|
||||
</script>
|
||||
|
@ -251,7 +251,7 @@ export default {
|
||||
code: `${this.selected.code}`,
|
||||
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
|
||||
param: {
|
||||
Signal_Code: `${this.selected.code}`
|
||||
Signal_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -293,7 +293,7 @@ export default {
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.atsAutoControlALL.menu.operation
|
||||
operation: OperationEvent.Station.stationSetRouteControlAll.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
|
@ -6,10 +6,9 @@
|
||||
<stand-detail ref="standDetail" />
|
||||
<stand-run-level ref="standRunLevel" />
|
||||
<stand-stop-time ref="standStopTime" />
|
||||
<stand-detain-train-all ref="standDetainTrainAll" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<stand-back-strategy ref="standBackStrategy" />
|
||||
<StandBulkBuckleTrain ref="standBulkBuckleTrain" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -22,10 +21,9 @@ import StandDetail from './dialog/standDetail';
|
||||
import StandRunLevel from './dialog/standRunLevel';
|
||||
import StandStopTime from './dialog/standStopTime';
|
||||
import StandBulkBuckleTrain from './dialog/standBulkBuckleTrain';
|
||||
import StandDetainTrainAll from './dialog/standDetainTrainAll';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
import Handler from '@/scripts/cmdPlugin/Handler';
|
||||
// import Handler from '@/scripts/cmdPlugin/Handler';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
@ -43,8 +41,7 @@ export default {
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll
|
||||
StandStopTime
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -353,10 +350,10 @@ export default {
|
||||
setJumpStop() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
|
||||
param: {
|
||||
StationStand_Code: `${this.selected.code}`
|
||||
StationStand_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
@ -370,10 +367,10 @@ export default {
|
||||
cancelJumpStop() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
|
||||
param: {
|
||||
StationStand_Code: `${this.selected.code}`
|
||||
StationStand_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
@ -387,10 +384,10 @@ export default {
|
||||
setStopTime() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation,
|
||||
param: {
|
||||
StationStand_Code: `${this.selected.code}`
|
||||
StationStand_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => {
|
||||
@ -410,10 +407,10 @@ export default {
|
||||
setRunLevel() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
|
||||
param: {
|
||||
StationStand_Code: `${this.selected.code}`
|
||||
StationStand_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => {
|
||||
@ -433,10 +430,10 @@ export default {
|
||||
earlyDeparture() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
|
||||
param: {
|
||||
StationStand_Code: `${this.selected.code}`
|
||||
StationStand_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
@ -450,10 +447,10 @@ export default {
|
||||
detail() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation,
|
||||
param: {
|
||||
StationStand_Code: `${this.selected.code}`
|
||||
StationStand_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => {
|
||||
|
@ -95,11 +95,11 @@ export default {
|
||||
handler: this.active,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
|
||||
},
|
||||
{
|
||||
label: '确认计轴有效',
|
||||
handler: this.alxeEffective,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
|
||||
},
|
||||
// {
|
||||
// label: '确认计轴有效',
|
||||
// handler: this.alxeEffective,
|
||||
// cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
|
||||
// },
|
||||
{
|
||||
label: '设置临时限速',
|
||||
handler: this.setSpeed,
|
||||
@ -211,6 +211,38 @@ export default {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 单操到定位
|
||||
locate() {
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.Switch.locate.menu.operation,
|
||||
param: {
|
||||
Switch_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 单操到反位
|
||||
reverse() {
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.Switch.reverse.menu.operation,
|
||||
param: {
|
||||
Switch_Code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
@ -228,7 +260,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔解封
|
||||
// 道岔解锁
|
||||
unlock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
|
@ -1,26 +0,0 @@
|
||||
<template>
|
||||
<div id="statusBar" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'StatusBar',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
@ -1,26 +0,0 @@
|
||||
<template>
|
||||
<div id="statusDownTrainDetail" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'StatusDownTrainDetail',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
@ -1,31 +0,0 @@
|
||||
<template>
|
||||
<div id="statusUpTrainDetail"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'StatusUpTrainDetail',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
#statusUpTrainDetail {
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
border-radius: 0px !important;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
</style>
|
@ -84,7 +84,7 @@ export default {
|
||||
CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER: {value:'Signal_Cancel_CI_Auto_Trigger', label: '取消联锁自动触发'},
|
||||
/** 设置/取消通过模式 */
|
||||
CMD_SIGNAL_PASS_MODEL: {value:'Signal_Pass_Model', label: '设置/取消通过模式'},
|
||||
/** 设置/取消通过模式 */
|
||||
/** 查询进路状态 */
|
||||
CMD_SIGNAL_DETAIL: {value:'Signal_Detail', label: '查询进路状态'}
|
||||
},
|
||||
|
||||
|
@ -23,7 +23,6 @@ class CommandHandle {
|
||||
getDefinition(cmdType) {
|
||||
if (cmdType) {
|
||||
const simulationRole = Handler.getSimulationRole();
|
||||
// const simulationRole = 'Center';
|
||||
return this.definitionMap[simulationRole][cmdType.value] || null;
|
||||
} else {
|
||||
return null;
|
||||
|
@ -881,7 +881,7 @@ export const OperationEvent = {
|
||||
domId: '_Tips-Signal-Detail-Menu'
|
||||
}
|
||||
},
|
||||
// 查询进路状态
|
||||
// 设置/取消通过模式
|
||||
singalPassModel: {
|
||||
menu: {
|
||||
operation: '317',
|
||||
@ -918,7 +918,7 @@ export const OperationEvent = {
|
||||
domId: '_Tips-Section-Query-Menu'
|
||||
}
|
||||
},
|
||||
// 区故解
|
||||
// 区故解 (故障解锁)
|
||||
fault: {
|
||||
button: {
|
||||
operation: '4020',
|
||||
|
@ -3,11 +3,11 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user