diff --git a/babel.config.js b/babel.config.js index 689cda254..0d2f44737 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,9 +1,9 @@ module.exports = { presets: [ '@vue/app' - ], - plugins: [ - '@babel/plugin-transform-runtime', - '@babel/plugin-syntax-dynamic-import' ] + // plugins: [ + // '@babel/plugin-transform-runtime', + // '@babel/plugin-syntax-dynamic-import' + // ] }; diff --git a/src/App.vue b/src/App.vue index 726c946b5..3f4e9e915 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,13 +6,12 @@ + + diff --git a/src/directive/dialogLoading/index.js b/src/directive/dialogLoading/index.js new file mode 100644 index 000000000..8ee614b58 --- /dev/null +++ b/src/directive/dialogLoading/index.js @@ -0,0 +1,8 @@ +import Vue from 'vue'; +import install from './dialogLoading'; + +const dialogLoading = function(Vue) { + Vue.directive('dialogLoading', install); +}; + +Vue.use(dialogLoading); diff --git a/src/directive/drag/drag.js b/src/directive/drag/drag.js index 69979448d..0da4db205 100644 --- a/src/directive/drag/drag.js +++ b/src/directive/drag/drag.js @@ -1,106 +1,106 @@ export default { - bind(el) { - const dragDom = el.querySelector('.reminder-box'); - const dragRight = el.querySelector('.drag-right'); - const dragLeft = el.querySelector('.drag-left'); - const dragBottom = el.querySelector('.drag-bottom'); - const dragTop = el.querySelector('.drag-top'); - const dragBody = el.querySelector('.tip-body'); - const body = el.querySelector('.tip-body-box'); + bind(el) { + const dragDom = el.querySelector('.reminder-box'); + const dragRight = el.querySelector('.drag-right'); + const dragLeft = el.querySelector('.drag-left'); + const dragBottom = el.querySelector('.drag-bottom'); + const dragTop = el.querySelector('.drag-top'); + const dragBody = el.querySelector('.tip-body'); + const body = el.querySelector('.tip-body-box'); - dragRight.onmousedown = (e) => { - document.onselectstart = function () { - return false; - }; - // 宽度拖拽 - var iEvent = e || event; - var disX = iEvent.clientX; - var disW = dragDom.offsetWidth; - document.onmousemove = function (e) { + dragRight.onmousedown = (e) => { + document.onselectstart = function () { + return false; + }; + // 宽度拖拽 + var iEvent = e || event; + var disX = iEvent.clientX; + var disW = dragDom.offsetWidth; + document.onmousemove = function (e) { - var iEvent = e || event; - if (disW + (iEvent.clientX - disX) > 350) { - dragDom.style.width = disW + (iEvent.clientX - disX) + 'px'; - } - }; + var iEvent = e || event; + if (disW + (iEvent.clientX - disX) > 350) { + dragDom.style.width = disW + (iEvent.clientX - disX) + 'px'; + } + }; - document.onmouseup = function () { - document.onmousemove = null; - document.onmouseup = null; - document.onselectstart = null; - }; - }; - dragLeft.onmousedown = (e) => { - document.onselectstart = function () { - return false; - }; - // 宽度拖拽 - var iEvent = e || event; - var disX = iEvent.clientX; - var disW = dragDom.offsetWidth; - var OFFLeft = dragDom.offsetLeft; - document.onmousemove = function (e) { - const iEvent = e || event; - const width = disW - (iEvent.clientX - disX); - if (width > 350) { - dragDom.style.width = disW - (iEvent.clientX - disX) + 'px'; - dragDom.style.left = OFFLeft + (iEvent.clientX - disX) + 'px'; - } - }; + document.onmouseup = function () { + document.onmousemove = null; + document.onmouseup = null; + document.onselectstart = null; + }; + }; + dragLeft.onmousedown = (e) => { + document.onselectstart = function () { + return false; + }; + // 宽度拖拽 + var iEvent = e || event; + var disX = iEvent.clientX; + var disW = dragDom.offsetWidth; + var OFFLeft = dragDom.offsetLeft; + document.onmousemove = function (e) { + const iEvent = e || event; + const width = disW - (iEvent.clientX - disX); + if (width > 350) { + dragDom.style.width = disW - (iEvent.clientX - disX) + 'px'; + dragDom.style.left = OFFLeft + (iEvent.clientX - disX) + 'px'; + } + }; - document.onmouseup = function () { - document.onmousemove = null; - document.onmouseup = null; - document.onselectstart = null; - }; - }; - dragBottom.onmousedown = (e) => { - document.onselectstart = function () { - return false; - }; - // 宽度拖拽 - var iEvent = e || event; - var disY = iEvent.clientY; - var disH = dragDom.offsetHeight; - document.onmousemove = function (e) { - var iEvent = e || event; - if (disH + (iEvent.clientY - disY) > 200) { - dragDom.style.height = disH + (iEvent.clientY - disY) + 'px'; - body.style.height = disH + (iEvent.clientY - disY) - 40 + 'px'; - dragBody.style.height = disH + (iEvent.clientY - disY) - 100 + 'px'; - } - }; + document.onmouseup = function () { + document.onmousemove = null; + document.onmouseup = null; + document.onselectstart = null; + }; + }; + dragBottom.onmousedown = (e) => { + document.onselectstart = function () { + return false; + }; + // 宽度拖拽 + var iEvent = e || event; + var disY = iEvent.clientY; + var disH = dragDom.offsetHeight; + document.onmousemove = function (e) { + var iEvent = e || event; + if (disH + (iEvent.clientY - disY) > 200) { + dragDom.style.height = disH + (iEvent.clientY - disY) + 'px'; + body.style.height = disH + (iEvent.clientY - disY) - 40 + 'px'; + dragBody.style.height = disH + (iEvent.clientY - disY) - 100 + 'px'; + } + }; - document.onmouseup = function () { - document.onmousemove = null; - document.onmouseup = null; - document.onselectstart = null; - }; - }; - dragTop.onmousedown = (e) => { - document.onselectstart = function () { - return false; - }; - // 宽度拖拽 - var iEvent = e || event; - var disY = iEvent.clientY; - var disH = dragDom.offsetHeight; - var OOFTop = dragDom.offsetTop; - document.onmousemove = function (e) { - var iEvent = e || event; - if (disH - (iEvent.clientY - disY) > 200) { - dragDom.style.height = disH - (iEvent.clientY - disY) + 'px'; - body.style.height = disH - (iEvent.clientY - disY) - 40 + 'px'; - dragBody.style.height = disH - (iEvent.clientY - disY) - 100 + 'px'; - dragDom.style.top = OOFTop + (iEvent.clientY - disY) + 'px'; - } - }; + document.onmouseup = function () { + document.onmousemove = null; + document.onmouseup = null; + document.onselectstart = null; + }; + }; + dragTop.onmousedown = (e) => { + document.onselectstart = function () { + return false; + }; + // 宽度拖拽 + var iEvent = e || event; + var disY = iEvent.clientY; + var disH = dragDom.offsetHeight; + var OOFTop = dragDom.offsetTop; + document.onmousemove = function (e) { + var iEvent = e || event; + if (disH - (iEvent.clientY - disY) > 200) { + dragDom.style.height = disH - (iEvent.clientY - disY) + 'px'; + body.style.height = disH - (iEvent.clientY - disY) - 40 + 'px'; + dragBody.style.height = disH - (iEvent.clientY - disY) - 100 + 'px'; + dragDom.style.top = OOFTop + (iEvent.clientY - disY) + 'px'; + } + }; - document.onmouseup = function () { - document.onmousemove = null; - document.onmouseup = null; - document.onselectstart = null; - }; - }; - } + document.onmouseup = function () { + document.onmousemove = null; + document.onmouseup = null; + document.onselectstart = null; + }; + }; + } }; diff --git a/src/directive/waves/index.js b/src/directive/waves/index.js index 44264f6f0..0e48ddb83 100644 --- a/src/directive/waves/index.js +++ b/src/directive/waves/index.js @@ -2,7 +2,7 @@ import Vue from 'vue'; import install from './waves'; const waves = function(Vue) { - Vue.directive('waves', install); + Vue.directive('waves', install); }; Vue.use(waves); diff --git a/src/directive/waves/waves.js b/src/directive/waves/waves.js index eb2fa2cb6..f88a7f1f5 100644 --- a/src/directive/waves/waves.js +++ b/src/directive/waves/waves.js @@ -3,70 +3,70 @@ import './waves.css'; const context = '@@wavesContext'; function handleClick(el, binding) { - function handle(e) { - const customOpts = Object.assign({}, binding.value); - const opts = Object.assign({ - ele: el, // 波纹作用元素 - type: 'hit', // hit 点击位置扩散 center中心点扩展 - color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色 - }, - customOpts - ); - const target = opts.ele; - if (target) { - target.style.position = 'relative'; - target.style.overflow = 'hidden'; - const rect = target.getBoundingClientRect(); - let ripple = target.querySelector('.waves-ripple'); - if (!ripple) { - ripple = document.createElement('span'); - ripple.className = 'waves-ripple'; - ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'; - target.appendChild(ripple); - } else { - ripple.className = 'waves-ripple'; - } - switch (opts.type) { - case 'center': - ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px'; - ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px'; - break; - default: - ripple.style.top = + function handle(e) { + const customOpts = Object.assign({}, binding.value); + const opts = Object.assign({ + ele: el, // 波纹作用元素 + type: 'hit', // hit 点击位置扩散 center中心点扩展 + color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色 + }, + customOpts + ); + const target = opts.ele; + if (target) { + target.style.position = 'relative'; + target.style.overflow = 'hidden'; + const rect = target.getBoundingClientRect(); + let ripple = target.querySelector('.waves-ripple'); + if (!ripple) { + ripple = document.createElement('span'); + ripple.className = 'waves-ripple'; + ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'; + target.appendChild(ripple); + } else { + ripple.className = 'waves-ripple'; + } + switch (opts.type) { + case 'center': + ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px'; + ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px'; + break; + default: + ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px'; - ripple.style.left = + ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px'; - } - ripple.style.backgroundColor = opts.color; - ripple.className = 'waves-ripple z-active'; - return false; - } - } + } + ripple.style.backgroundColor = opts.color; + ripple.className = 'waves-ripple z-active'; + return false; + } + } - if (!el[context]) { - el[context] = { - removeHandle: handle - }; - } else { - el[context].removeHandle = handle; - } + if (!el[context]) { + el[context] = { + removeHandle: handle + }; + } else { + el[context].removeHandle = handle; + } - return handle; + return handle; } export default { - bind(el, binding) { - el.addEventListener('click', handleClick(el, binding), false); - }, - update(el, binding) { - el.removeEventListener('click', el[context].removeHandle, false); - el.addEventListener('click', handleClick(el, binding), false); - }, - unbind(el) { - el.removeEventListener('click', el[context].removeHandle, false); - el[context] = null; - delete el[context]; - } + bind(el, binding) { + el.addEventListener('click', handleClick(el, binding), false); + }, + update(el, binding) { + el.removeEventListener('click', el[context].removeHandle, false); + el.addEventListener('click', handleClick(el, binding), false); + }, + unbind(el) { + el.removeEventListener('click', el[context].removeHandle, false); + el[context] = null; + delete el[context]; + } }; diff --git a/src/i18n/langs/en/tip.js b/src/i18n/langs/en/tip.js index 10f0363fb..0569dc208 100644 --- a/src/i18n/langs/en/tip.js +++ b/src/i18n/langs/en/tip.js @@ -1,6 +1,8 @@ export default { confirm: 'confirm', cancel: 'cancel', + confirmLogin: 'Relanding', + logoutTips: 'You have been signed out. Please sign in again!', creatingSuccessful: 'Created successfully!', creatingFailed: 'Create a failure', confirmDeletion: 'Confirm deletion?', diff --git a/src/i18n/langs/zh/tip.js b/src/i18n/langs/zh/tip.js index d52b1e3e8..29bb64cf3 100644 --- a/src/i18n/langs/zh/tip.js +++ b/src/i18n/langs/zh/tip.js @@ -1,6 +1,8 @@ export default { confirm: '确 定', cancel: '取 消', + confirmLogin: '重新登陆', + logoutTips: '你已被登出,请重新登录', creatingSuccessful: '创建成功!', creatingFailed: '创建失败', confirmDeletion: '是否确认删除?', diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js index 492920ed4..c01f4fbdf 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js @@ -3,7 +3,7 @@ import StompClient from '@/utils/sock'; import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation'; import { creatSubscribe, clearSubscribe, displayTopic } from '@/utils/stomp'; -import { handleToken } from '@/utils/auth'; +import { getToken } from '@/utils/auth'; import router from '@/router'; // 定于仿真socket接口 @@ -41,7 +41,7 @@ export function Jl3dDriving(updatemmi, sound) { var datatype = '00'; this.teststomp = new StompClient(); this.topic = '/user/queue/simulation/jl3d'; - const header = {'X-Token': handleToken() }; + const header = {'X-Token': getToken() }; this.updatamap = function(mapdata, materiallist, nowaction, scene) { // console.log(mapdata); diff --git a/src/jlmap3d/jl3dsimulation/connect/TrainingConnect.js b/src/jlmap3d/jl3dsimulation/connect/TrainingConnect.js index be8b34995..50630ea5a 100644 --- a/src/jlmap3d/jl3dsimulation/connect/TrainingConnect.js +++ b/src/jlmap3d/jl3dsimulation/connect/TrainingConnect.js @@ -3,7 +3,7 @@ import StompClient from '@/utils/sock'; import { getTrainingCbtcDemon, runDiagramStart, runDiagramOver, setTrainingCbtcInitTime } from '@/api/simulation'; import { creatSubscribe, clearSubscribe, displayTopic } from '@/utils/stomp'; -import { handleToken } from '@/utils/auth'; +import { getToken } from '@/utils/auth'; import router from '@/router'; // 定于仿真socket接口 @@ -41,7 +41,7 @@ export function Jlmap3dSubscribe(jlmap3d) { var datatype = '00'; this.teststomp = new StompClient(); this.topic = '/user/queue/simulation/jl3d'; - const header = {'X-Token': handleToken() }; + const header = {'X-Token': getToken() }; this.updatamap = function(mapdata, materiallist, nowaction, scene) { // console.log(mapdata); diff --git a/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js b/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js index 26bc040d7..151f4a7e5 100644 --- a/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js +++ b/src/jlmap3d/jl3dsimulation/connect/TrainingConnectTest.js @@ -1,6 +1,6 @@ import StompClient from '@/utils/sock'; import { displayTopic } from '@/utils/stomp'; -import { handleToken } from '@/utils/auth'; +import { getToken } from '@/utils/auth'; import router from '@/router'; // 定于仿真socket接口 @@ -23,7 +23,7 @@ export function Jlmap3dSubscribe(worker) { this.teststomp = new StompClient(); this.topic = displayTopic; - const header = { group: router.currentRoute.query.group, 'X-Token': handleToken() }; + const header = { group: router.currentRoute.query.group, 'X-Token': getToken() }; this.updatamap = function (mapdata, materiallist, nowaction, scene) { // console.log(mapdata); diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/childDialog/noticeInfo.vue b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/childDialog/noticeInfo.vue index ece241e2b..c85893d53 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/childDialog/noticeInfo.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/childDialog/noticeInfo.vue @@ -28,53 +28,53 @@ import { OperationEvent } from '@/scripts/ConstDic'; export default { - name: 'NoticeInfo', - data() { - return { - dialogShow: false, - messages: [this.$t('tip.commandFailed')], - operate: null - }; - }, - computed: { - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - title() { - return this.$t('tip.hint'); - }, - domIdSure() { - return this.dialogShow ? OperationEvent.Command.close.notice.domId : ''; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, messages) { - this.operate = operate || {}; - this.dialogShow = true; - this.messages = [this.$t('tip.commandFailed')]; - if (messages) { - this.messages = messages; - } - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - commit() { - this.doClose(); - }, - cancel() { - this.doClose(); - } - } + name: 'NoticeInfo', + data() { + return { + dialogShow: false, + messages: [this.$t('tip.commandFailed')], + operate: null + }; + }, + computed: { + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + title() { + return this.$t('tip.hint'); + }, + domIdSure() { + return this.dialogShow ? OperationEvent.Command.close.notice.domId : ''; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, messages) { + this.operate = operate || {}; + this.dialogShow = true; + this.messages = [this.$t('tip.commandFailed')]; + if (messages) { + this.messages = messages; + } + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + }, + commit() { + this.doClose(); + }, + cancel() { + this.doClose(); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmControl.vue index be10310c0..b9216b44b 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmControl.vue @@ -33,334 +33,334 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import NoticeInfo from './childDialog/noticeInfo'; 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 this.$t('menu.accessSetting'); - } else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) { - return this.$t('menu.menuSignal.signalOff'); - } else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) { - return this.$t('menu.menuSignal.signalReopen'); - } else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) { - return this.$t('menu.cancelTheWay'); - } else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) { - return this.$t('menu.approachManualControl'); - } else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) { - return this.$t('menu.accessToATSAutomaticControl'); - } else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) { - return this.$t('menu.menuStationStand.setRunLevel'); - } else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) { - return this.$t('menu.stopTime'); - } else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) { - return this.$t('menu.setSwitchbackStrategy'); - } - 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; - } - } - return ''; - } - }, - 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; - } + 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 this.$t('menu.accessSetting'); + } else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) { + return this.$t('menu.menuSignal.signalOff'); + } else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) { + return this.$t('menu.menuSignal.signalReopen'); + } else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) { + return this.$t('menu.cancelTheWay'); + } else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) { + return this.$t('menu.approachManualControl'); + } else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) { + return this.$t('menu.accessToATSAutomaticControl'); + } else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) { + return this.$t('menu.menuStationStand.setRunLevel'); + } else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) { + return this.$t('menu.stopTime'); + } else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) { + return this.$t('menu.setSwitchbackStrategy'); + } + 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; + } + } + return ''; + } + }, + 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() { - 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, - type: this.operate.type, - operation: OperationEvent.Signal.arrangementRoute.confirm.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, + 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 信号关灯 - signalClose() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 信号关灯 + signalClose() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 信号重开 - reopenSignal() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 信号重开 + reopenSignal() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 取消进路 - cancelTrainRoute() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 取消进路 + cancelTrainRoute() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 进路交人工控 - humanControl() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 进路交人工控 + humanControl() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 进路交ATS自动控 - atsAutoControl() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 进路交ATS自动控 + atsAutoControl() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 设置运行等级 - setRunLevel() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 设置运行等级 + setRunLevel() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 停站时间 - setStopTime() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 停站时间 + setStopTime() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 设置折返策略 - setBackStrategy() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 设置折返策略 + setBackStrategy() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - cancel() { - const operate = { - type: this.operate.type, - operation: OperationEvent.Command.cancel.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); + }); + }, + cancel() { + const operate = { + type: this.operate.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmControlSpeed.vue b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmControlSpeed.vue index 80a351ead..1fd034f26 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmControlSpeed.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmControlSpeed.vue @@ -29,131 +29,131 @@ import { OperationEvent } from '@/scripts/ConstDic'; export default { - name: 'ConfirmControlSpeed', - data() { - return { - dialogShow: false, - loading: false, - type: '', - operation: '', - message: '' - }; - }, - computed: { - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - title() { - if (this.dialogShow) { - if (this.operation === OperationEvent.Section.setSpeed.order.operation) { - return this.$t('menu.menuSection.sectionSetSpeedLimit'); - } else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) { - return this.$t('menu.menuSection.sectionCancelSpeedLimit'); - } else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) { - return this.$t('menu.switchSettingSpeedLimit'); - } else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) { - return this.$t('menu.menuSection.sectionCancelSpeedLimit'); - } - } - return ''; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdConfirm() { - if (this.dialogShow) { - if (this.operation === OperationEvent.Section.setSpeed.order.operation) { - /** 区段设置限速*/ - return OperationEvent.Section.setSpeed.confirm.domId; - } else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) { - /** 区段取消限速*/ - return OperationEvent.Section.cancelSpeed.confirm.domId; - } else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) { - /** 道岔设置限速*/ - return OperationEvent.Switch.setSpeed.confirm.domId; - } else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) { - /** 道岔取消限速*/ - return OperationEvent.Switch.cancelSpeed.confirm.domId; - } - } - return ''; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate) { - if (!this.dialogShow) { - this.type = operate.type; - this.operation = operate.operation; - this.message = operate.message; - } + name: 'ConfirmControlSpeed', + data() { + return { + dialogShow: false, + loading: false, + type: '', + operation: '', + message: '' + }; + }, + computed: { + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + title() { + if (this.dialogShow) { + if (this.operation === OperationEvent.Section.setSpeed.order.operation) { + return this.$t('menu.menuSection.sectionSetSpeedLimit'); + } else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) { + return this.$t('menu.menuSection.sectionCancelSpeedLimit'); + } else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) { + return this.$t('menu.switchSettingSpeedLimit'); + } else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) { + return this.$t('menu.menuSection.sectionCancelSpeedLimit'); + } + } + return ''; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdConfirm() { + if (this.dialogShow) { + if (this.operation === OperationEvent.Section.setSpeed.order.operation) { + /** 区段设置限速*/ + return OperationEvent.Section.setSpeed.confirm.domId; + } else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) { + /** 区段取消限速*/ + return OperationEvent.Section.cancelSpeed.confirm.domId; + } else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) { + /** 道岔设置限速*/ + return OperationEvent.Switch.setSpeed.confirm.domId; + } else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) { + /** 道岔取消限速*/ + return OperationEvent.Switch.cancelSpeed.confirm.domId; + } + } + return ''; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate) { + if (!this.dialogShow) { + this.type = operate.type; + this.operation = operate.operation; + this.message = operate.message; + } - this.loading = false; - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - commit() { - const operate = { - type: this.type - }; + this.loading = false; + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + }, + commit() { + const operate = { + type: this.type + }; - if (this.operation === OperationEvent.Section.setSpeed.order.operation) { - /** 区段设置限速*/ - operate.operation = OperationEvent.Section.setSpeed.confirm.operation; - } else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) { - /** 区段取消限速*/ - operate.operation = OperationEvent.Section.cancelSpeed.confirm.operation; - } else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) { - /** 道岔设置限速*/ - operate.operation = OperationEvent.Switch.setSpeed.confirm.operation; - } else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) { - /** 道岔取消限速*/ - operate.operation = OperationEvent.Switch.cancelSpeed.confirm.operation; - } + if (this.operation === OperationEvent.Section.setSpeed.order.operation) { + /** 区段设置限速*/ + operate.operation = OperationEvent.Section.setSpeed.confirm.operation; + } else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) { + /** 区段取消限速*/ + operate.operation = OperationEvent.Section.cancelSpeed.confirm.operation; + } else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) { + /** 道岔设置限速*/ + operate.operation = OperationEvent.Switch.setSpeed.confirm.operation; + } else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) { + /** 道岔取消限速*/ + operate.operation = OperationEvent.Switch.cancelSpeed.confirm.operation; + } - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - this.$emit('setOperate', { step: 1, success: true }); - this.doClose(); - } - }).catch(() => { - this.loading = false; - this.$emit('setOperate', { step: 0, success: false }); - this.doClose(); - }); - }, - cancel() { - const operate = { - type: this.type, - operation: OperationEvent.Command.cancel.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.loading = false; + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$emit('setOperate', { step: 1, success: true }); + this.doClose(); + } + }).catch(() => { + this.loading = false; + this.$emit('setOperate', { step: 0, success: false }); + this.doClose(); + }); + }, + cancel() { + const operate = { + type: this.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - this.$emit('setOperate', { step: 0, success: false }); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$emit('setOperate', { step: 0, success: false }); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmSignalUnlock.vue b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmSignalUnlock.vue index 6febec5e8..7ee9783b4 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmSignalUnlock.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmSignalUnlock.vue @@ -29,94 +29,94 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; export default { - name: 'RouteUnlockConfirm', - data() { - return { - dialogShow: false, - loading: false, - signalName: '', - stationName: '' - }; - }, - computed: { - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - title() { - return this.$t('menu.signalDeblocking'); - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdConfirm() { - return this.dialogShow ? OperationEvent.Signal.unlock.confirm.domId : ''; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected) { - this.stationName = ''; - this.signalName = ''; - if (selected) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } + name: 'RouteUnlockConfirm', + data() { + return { + dialogShow: false, + loading: false, + signalName: '', + stationName: '' + }; + }, + computed: { + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + title() { + return this.$t('menu.signalDeblocking'); + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdConfirm() { + return this.dialogShow ? OperationEvent.Signal.unlock.confirm.domId : ''; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected) { + this.stationName = ''; + this.signalName = ''; + if (selected) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } - this.loading = false; - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - commit() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.unlock.confirm.operation - }; + this.loading = false; + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + }, + commit() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.unlock.confirm.operation + }; - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - this.$emit('setOperate', { step: 1, success: true }); - this.doClose(); - } - }).catch(() => { - this.loading = false; - this.$emit('setOperate', { step: 0, success: false }); - this.doClose(); - }); - }, - cancel() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Command.cancel.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.loading = false; + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$emit('setOperate', { step: 1, success: true }); + this.doClose(); + } + }).catch(() => { + this.loading = false; + this.$emit('setOperate', { step: 0, success: false }); + this.doClose(); + }); + }, + cancel() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - this.$emit('setOperate', { step: 0, success: false }); - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$emit('setOperate', { step: 0, success: false }); + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmTrain.vue b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmTrain.vue index 50a9065da..7a690368f 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmTrain.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/childDialog/confirmTrain.vue @@ -33,142 +33,142 @@ import { OperationEvent } from '@/scripts/ConstDic'; import NoticeInfo from './childDialog/noticeInfo'; export default { - name: 'ConfirmTrain', - 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.Train.addTrainId.menu.operation) { - return this.$t('menu.menuTrain.addTrainId'); - } else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) { - return this.$t('menu.menuTrain.editTrainId'); - } else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) { - return this.$t('menu.menuTrain.deleteTrainId'); - } else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) { - return this.$t('menu.menuTrain.moveTrainId'); - } else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) { - return this.$t('menu.menuTrain.switchTrainId'); - } else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) { - return this.$t('menu.menuTrain.editTrainNo'); - } - return ''; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdConfirm() { - if (this.dialogShow) { - if (this.operation === OperationEvent.Train.addTrainId.menu.operation) { - /** 添加列车识别号*/ - return OperationEvent.Train.addTrainId.confirm.domId; - } else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) { - /** 修改列车识别号*/ - return OperationEvent.Train.editTrainId.confirm.domId; - } else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) { - /** 删除列车识别号*/ - return OperationEvent.Train.delTrainId.confirm.domId; - } else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) { - /** 移动列车识别号*/ - return OperationEvent.Train.moveTrainId.confirm.domId; - } else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) { - /** 交换列车识别号*/ - return OperationEvent.Train.switchTrainId.confirm.domId; - } else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) { - /** 修改车组号*/ - return OperationEvent.Train.editTrainNo.confirm.domId; - } - } - return ''; - } - }, - 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; - } + name: 'ConfirmTrain', + 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.Train.addTrainId.menu.operation) { + return this.$t('menu.menuTrain.addTrainId'); + } else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) { + return this.$t('menu.menuTrain.editTrainId'); + } else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) { + return this.$t('menu.menuTrain.deleteTrainId'); + } else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) { + return this.$t('menu.menuTrain.moveTrainId'); + } else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) { + return this.$t('menu.menuTrain.switchTrainId'); + } else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) { + return this.$t('menu.menuTrain.editTrainNo'); + } + return ''; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdConfirm() { + if (this.dialogShow) { + if (this.operation === OperationEvent.Train.addTrainId.menu.operation) { + /** 添加列车识别号*/ + return OperationEvent.Train.addTrainId.confirm.domId; + } else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) { + /** 修改列车识别号*/ + return OperationEvent.Train.editTrainId.confirm.domId; + } else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) { + /** 删除列车识别号*/ + return OperationEvent.Train.delTrainId.confirm.domId; + } else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) { + /** 移动列车识别号*/ + return OperationEvent.Train.moveTrainId.confirm.domId; + } else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) { + /** 交换列车识别号*/ + return OperationEvent.Train.switchTrainId.confirm.domId; + } else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) { + /** 修改车组号*/ + return OperationEvent.Train.editTrainNo.confirm.domId; + } + } + return ''; + } + }, + 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() { - this.loading = false; - this.dialogShow = false; - this.$store.dispatch('map/setTrainWindowShow', false); - this.$store.dispatch('training/emitTipFresh'); - }, - commit() { - if (this.operation === OperationEvent.Train.addTrainId.menu.operation) { - this.routeSetting(); - } else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) { - this.routeSetting(); - } else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) { - this.routeSetting(); - } else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) { - this.routeSetting(); - } else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) { - this.routeSetting(); - } else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) { - this.routeSetting(); - } - }, - // 进路设置 - routeSetting() { - const operate = { - send: true, - type: this.operate.type, - operation: OperationEvent.Train.addTrainId.confirm.operation - }; + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.$store.dispatch('map/setTrainWindowShow', false); + this.$store.dispatch('training/emitTipFresh'); + }, + commit() { + if (this.operation === OperationEvent.Train.addTrainId.menu.operation) { + this.routeSetting(); + } else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) { + this.routeSetting(); + } else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) { + this.routeSetting(); + } else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) { + this.routeSetting(); + } else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) { + this.routeSetting(); + } else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) { + this.routeSetting(); + } + }, + // 进路设置 + routeSetting() { + const operate = { + send: true, + type: this.operate.type, + operation: OperationEvent.Train.addTrainId.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(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - cancel() { - const operate = { - type: this.operate.type, - operation: OperationEvent.Command.cancel.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); + }); + }, + cancel() { + const operate = { + type: this.operate.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/routeCmdControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/routeCmdControl.vue index 75895a74d..330b23760 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/routeCmdControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/routeCmdControl.vue @@ -88,366 +88,366 @@ import { now } from '@/utils/date'; import ConfirmSignalUnlock from './childDialog/confirmSignalUnlock'; export default { - name: 'RouteCmdControl', - components: { - ConfirmSignalUnlock - }, - 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: '', - signalName: '' - }; - }, - computed: { - typeList() { - return [ - { code: OperationEvent.Signal.unlock.menu.operation, name: this.$t('menu.menuSignal.signalDeblock') }, - { code: OperationEvent.Signal.guide.menu.operation, name: this.$t('menu.menuSignal.guideRouteHandle') } - ]; - }, - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCommand() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - return OperationEvent.Signal.unlock.order.domId; - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 办理引导进路*/ - return OperationEvent.Signal.guide.order.domId; - } - } - return ''; - }, - domIdConfirm1() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - return OperationEvent.Signal.unlock.confirm1.domId; - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 办理引导进路*/ - return OperationEvent.Signal.guide.confirm1.domId; - } - } - return ''; - }, - domIdConfirm2() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - return OperationEvent.Signal.unlock.confirm2.domId; - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 办理引导进路*/ - return OperationEvent.Signal.guide.confirm2.domId; - } - } - return ''; - }, - domIdStop() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - return OperationEvent.Signal.unlock.stop.domId; - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 办理引导进路*/ - return OperationEvent.Signal.guide.stop.domId; - } - } - return ''; - }, - domIdClose() { - if (this.dialogShow) { - return OperationEvent.Command.close.menu.domId; - } - return ''; - }, - title() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - return '信号解封'; - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - return '办理引导进路'; - } - } - return ''; - } - }, - watch: { - cmdDisabled: { - handler(val, oldVal) { - this.stpDisabled = true; - val.forEach((elem, index) => { - // 在确定1之前的操作才可以终止 - if (elem == false && index >= 1 && index <= 2) { - this.stpDisabled = false; - } - }); - }, - deep: true - } - }, - 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); - }, - beforeDestroy() { - clearInterval(this.timer); - this.timer = null; - }, - methods: { - doShow(operate, selected) { - if (!this.dialogShow) { - this.signalName = ''; - this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - this.selected = selected; - } + name: 'RouteCmdControl', + components: { + ConfirmSignalUnlock + }, + 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: '', + signalName: '' + }; + }, + computed: { + typeList() { + return [ + { code: OperationEvent.Signal.unlock.menu.operation, name: this.$t('menu.menuSignal.signalDeblock') }, + { code: OperationEvent.Signal.guide.menu.operation, name: this.$t('menu.menuSignal.guideRouteHandle') } + ]; + }, + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCommand() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + return OperationEvent.Signal.unlock.order.domId; + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 办理引导进路*/ + return OperationEvent.Signal.guide.order.domId; + } + } + return ''; + }, + domIdConfirm1() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + return OperationEvent.Signal.unlock.confirm1.domId; + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 办理引导进路*/ + return OperationEvent.Signal.guide.confirm1.domId; + } + } + return ''; + }, + domIdConfirm2() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + return OperationEvent.Signal.unlock.confirm2.domId; + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 办理引导进路*/ + return OperationEvent.Signal.guide.confirm2.domId; + } + } + return ''; + }, + domIdStop() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + return OperationEvent.Signal.unlock.stop.domId; + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 办理引导进路*/ + return OperationEvent.Signal.guide.stop.domId; + } + } + return ''; + }, + domIdClose() { + if (this.dialogShow) { + return OperationEvent.Command.close.menu.domId; + } + return ''; + }, + title() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + return '信号解封'; + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + return '办理引导进路'; + } + } + return ''; + } + }, + watch: { + cmdDisabled: { + handler(val, oldVal) { + this.stpDisabled = true; + val.forEach((elem, index) => { + // 在确定1之前的操作才可以终止 + if (elem == false && index >= 1 && index <= 2) { + this.stpDisabled = false; + } + }); + }, + deep: true + } + }, + 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); + }, + beforeDestroy() { + clearInterval(this.timer); + this.timer = null; + }, + methods: { + doShow(operate, selected) { + if (!this.dialogShow) { + this.signalName = ''; + this.stationName = ''; + if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + this.selected = selected; + } - this.order = 0; - this.operation = operate.operation; + this.order = 0; + this.operation = operate.operation; - this.tempData = []; - this.timeCountCommand = -1; - this.timeCountConfirm = -1; - this.cmdDisabled = [false, true, true]; - } - this.dialogShow = true; - this.stpDisabled = true; - this.setMessage(this.$t('tip.releaseTip')); - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - command() { - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 第一步带弹框处理*/ - this.commandHasPopUp(); - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 第一步不带弹框处理*/ - this.commandNoPopUp(); - } - }, - commandHasPopUp() { - const operate = { - type: MapDeviceType.Signal.type - }; + this.tempData = []; + this.timeCountCommand = -1; + this.timeCountConfirm = -1; + this.cmdDisabled = [false, true, true]; + } + this.dialogShow = true; + this.stpDisabled = true; + this.setMessage(this.$t('tip.releaseTip')); + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + }, + command() { + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 第一步带弹框处理*/ + this.commandHasPopUp(); + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 第一步不带弹框处理*/ + this.commandNoPopUp(); + } + }, + commandHasPopUp() { + const operate = { + type: MapDeviceType.Signal.type + }; - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - operate.operation = OperationEvent.Signal.unlock.order.operation; - } + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + operate.operation = OperationEvent.Signal.unlock.order.operation; + } - this.setMessage(this.$t('tip.firstConfirmTip')); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - this.$refs.confirmSignalUnlock.doShow(operate, this.selected); - } - } - }); - }, - commandNoPopUp() { - const operate = { - type: MapDeviceType.Signal.type - }; + this.setMessage(this.$t('tip.firstConfirmTip')); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + this.$refs.confirmSignalUnlock.doShow(operate, this.selected); + } + } + }); + }, + commandNoPopUp() { + const operate = { + type: MapDeviceType.Signal.type + }; - if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 办理引导进路*/ - operate.operation = OperationEvent.Signal.guide.order.operation; - } + if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 办理引导进路*/ + operate.operation = OperationEvent.Signal.guide.order.operation; + } - this.setMessage(this.$t('tip.firstConfirmTip')); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), 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: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') }); - }); - }, - confirm1() { - const operate = { - type: MapDeviceType.Signal.type - }; + this.setMessage(this.$t('tip.firstConfirmTip')); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), 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: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') }); + }); + }, + confirm1() { + const operate = { + type: MapDeviceType.Signal.type + }; - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - operate.operation = OperationEvent.Signal.unlock.confirm1.operation; - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 办理引导进路*/ - operate.operation = OperationEvent.Signal.guide.confirm1.operation; - } + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + operate.operation = OperationEvent.Signal.unlock.confirm1.operation; + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 办理引导进路*/ + operate.operation = OperationEvent.Signal.guide.confirm1.operation; + } - this.setMessage(this.$t('tip.secondConfirmTip')); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), 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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') }); - }); - }, - confirm2() { - const operate = { - send: true, - type: MapDeviceType.Signal.type - }; + this.setMessage(this.$t('tip.secondConfirmTip')); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), 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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') }); + }); + }, + confirm2() { + const operate = { + send: true, + type: MapDeviceType.Signal.type + }; - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - operate.operation = OperationEvent.Signal.unlock.confirm2.operation; - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 办理引导进路*/ - operate.operation = OperationEvent.Signal.guide.confirm2.operation; - } - this.setMessage(''); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.timeCountCommand = -1; - this.timeCountConfirm = -1; - this.setButtonEnable({ step: -1 }); - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') }); - }); - }, - stop() { - const operate = { - type: MapDeviceType.Signal.type - }; + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + operate.operation = OperationEvent.Signal.unlock.confirm2.operation; + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 办理引导进路*/ + operate.operation = OperationEvent.Signal.guide.confirm2.operation; + } + this.setMessage(''); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.timeCountCommand = -1; + this.timeCountConfirm = -1; + this.setButtonEnable({ step: -1 }); + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') }); + }); + }, + stop() { + const operate = { + type: MapDeviceType.Signal.type + }; - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - operate.operation = OperationEvent.Signal.unlock.stop.operation; - } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { - /** 办理引导进路*/ - operate.operation = OperationEvent.Signal.guide.stop.operation; - } + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + operate.operation = OperationEvent.Signal.unlock.stop.operation; + } else if (this.operation == OperationEvent.Signal.guide.menu.operation) { + /** 办理引导进路*/ + operate.operation = OperationEvent.Signal.guide.stop.operation; + } - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), 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: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') }); - }); - }, - close() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Command.close.menu.operation - }; + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), 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: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') }); + }); + }, + close() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Command.close.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - }, - getOperate(operate) { - /** 弹框返回值处理*/ - if (this.operation == OperationEvent.Signal.unlock.menu.operation) { - /** 信号解封*/ - this.backOperate = operate; - this.setButtonEnable(operate); - if (operate.success) { - this.timeCountCommand = 30; - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.confirmedSuccess') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.cancelSuccess') }); - } - } - }, - 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]; - } - } - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + }, + getOperate(operate) { + /** 弹框返回值处理*/ + if (this.operation == OperationEvent.Signal.unlock.menu.operation) { + /** 信号解封*/ + this.backOperate = operate; + this.setButtonEnable(operate); + if (operate.success) { + this.timeCountCommand = 30; + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.confirmedSuccess') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.cancelSuccess') }); + } + } + }, + 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]; + } + } + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/routeControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/routeControl.vue index a947da893..0b5a45fe7 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/routeControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/routeControl.vue @@ -41,292 +41,292 @@ import ConfirmControl from './childDialog/confirmControl'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'RouteControl', - components: { - ConfirmControl, - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - selected: null, - operation: null, - stationName: '', - signalName: '' + name: 'RouteControl', + components: { + ConfirmControl, + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + selected: null, + operation: null, + stationName: '', + signalName: '' - }; - }, - computed: { - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.close.menu.domId : ''; - }, - domIdConfirm() { - return this.dialogShow ? getDomIdByOperation(this.operation) : ''; - }, - title() { - if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) { - return this.$t('menu.menuSignal.cancelTheTrainApproach'); - } else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) { - return this.$t('menu.menuSignal.signalOff'); - } else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) { - return this.$t('menu.menuSignal.reopenTrainSignal'); - } else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) { - return this.$t('menu.menuSignal.setInterlockAutoRoute'); - } else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) { - return this.$t('menu.menuSignal.cancelInterlockAutoRoute'); - } else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) { - return this.$t('menu.menuSignal.setInterlockAutoTrigger'); - } else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) { - return this.$t('menu.menuSignal.cancelInterlockAutoTrigger'); - } - return ''; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected) { - if (!this.dialogShow) { - this.signalName = ''; - this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } - this.selected = selected; - 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.cancelTrainRoute.menu.operation) { - /** 取消列车进路*/ - this.cancelTrainRoute(); - } 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.setAutoInterlock.menu.operation) { - /** 设置联锁自动进路*/ - this.setAutoInterlock(); - } else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) { - /** 取消联锁自动进路*/ - this.cancelAutoInterlock(); - } else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) { - /** 设置联锁自动触发*/ - this.setAutoTrigger(); - } else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) { - /** 取消联锁自动触发*/ - this.cancelAutoTrigger(); - } - }, - // 取消列车进路 - 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, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.cancelTrainRoute.menu.operation - }; + }; + }, + computed: { + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.close.menu.domId : ''; + }, + domIdConfirm() { + return this.dialogShow ? getDomIdByOperation(this.operation) : ''; + }, + title() { + if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) { + return this.$t('menu.menuSignal.cancelTheTrainApproach'); + } else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) { + return this.$t('menu.menuSignal.signalOff'); + } else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) { + return this.$t('menu.menuSignal.reopenTrainSignal'); + } else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) { + return this.$t('menu.menuSignal.setInterlockAutoRoute'); + } else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) { + return this.$t('menu.menuSignal.cancelInterlockAutoRoute'); + } else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) { + return this.$t('menu.menuSignal.setInterlockAutoTrigger'); + } else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) { + return this.$t('menu.menuSignal.cancelInterlockAutoTrigger'); + } + return ''; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected) { + if (!this.dialogShow) { + this.signalName = ''; + this.stationName = ''; + if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } + this.selected = selected; + 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.cancelTrainRoute.menu.operation) { + /** 取消列车进路*/ + this.cancelTrainRoute(); + } 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.setAutoInterlock.menu.operation) { + /** 设置联锁自动进路*/ + this.setAutoInterlock(); + } else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) { + /** 取消联锁自动进路*/ + this.cancelAutoInterlock(); + } else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) { + /** 设置联锁自动触发*/ + this.setAutoTrigger(); + } else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) { + /** 取消联锁自动触发*/ + this.cancelAutoTrigger(); + } + }, + // 取消列车进路 + 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, + type: MapDeviceType.Signal.type, + 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); - }); - }, - // 行调工作站取消进路 - cancelTrainRouteByCentral() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, - messages: [this.$t('tip.signalModeToManualModeTipPrefix') + this.signalName + this.$t('tip.signalModeToManualModeTipSuffix')] - }; + 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); + }); + }, + // 行调工作站取消进路 + cancelTrainRouteByCentral() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, + messages: [this.$t('tip.signalModeToManualModeTipPrefix') + this.signalName + this.$t('tip.signalModeToManualModeTipSuffix')] + }; - 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, this.selected); - } - }).catch(() => { - this.loading = false; - }); - }, - // 信号关灯 - signalClose() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.signalClose.menu.operation, - messages: [this.$t('menu.menuSignal.signalOff') + this.$t('global.colon') + this.signalName] - }; + 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, this.selected); + } + }).catch(() => { + this.loading = false; + }); + }, + // 信号关灯 + signalClose() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.signalClose.menu.operation, + messages: [this.$t('menu.menuSignal.signalOff') + this.$t('global.colon') + this.signalName] + }; - 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(() => { - this.loading = false; - }); - }, - // 信号重开 - reopenSignal() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.reopenSignal.menu.operation, - messages: [this.$t('menu.menuSignal.signalReopen') + this.$t('global.colon') + this.signalName] - }; + 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(() => { + this.loading = false; + }); + }, + // 信号重开 + reopenSignal() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.reopenSignal.menu.operation, + messages: [this.$t('menu.menuSignal.signalReopen') + this.$t('global.colon') + this.signalName] + }; - 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(() => { - this.loading = false; - }); - }, - // 设置联锁自动进路 - setAutoInterlock() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.setAutoInterlock.menu.operation - }; + 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(() => { + this.loading = false; + }); + }, + // 设置联锁自动进路 + setAutoInterlock() { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.setAutoInterlock.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); - }); - }, - // 取消联锁自动进路 - cancelAutoInterlock() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.cancelAutoInterlock.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); + }); + }, + // 取消联锁自动进路 + cancelAutoInterlock() { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.cancelAutoInterlock.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); - }); - }, - // 设置联锁自动触发 - setAutoTrigger() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.setAutoTrigger.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); + }); + }, + // 设置联锁自动触发 + setAutoTrigger() { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.setAutoTrigger.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); - }); - }, - // 取消联锁自动触发 - cancelAutoTrigger() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.cancelAutoTrigger.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); + }); + }, + // 取消联锁自动触发 + cancelAutoTrigger() { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation + }; - this.doClose(); - 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.Signal.type, - operation: OperationEvent.Command.close.menu.operation - }; + this.doClose(); + 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.Signal.type, + operation: OperationEvent.Command.close.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/routeDetail.vue b/src/jmap/theme/fuzhou_01/menus/dialog/routeDetail.vue index 8d2596faf..d9279fb05 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/routeDetail.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/routeDetail.vue @@ -66,100 +66,100 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'RouteDetail', - components: { - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - tempData: [], - stationName: '', - signalName: '' - }; - }, - computed: { - ...mapGetters('map', [ - 'signalList' - ]), - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdConfirm() { - return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : ''; - }, - title() { - return this.$t('menu.queryAccessControlMode'); - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected, tempData) { - // 如果不是因为断点激活则需要,初始化菜单初始值 - if (!this.dialogShow) { - this.signalName = ''; - this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } - this.tempData = tempData || []; - } + name: 'RouteDetail', + components: { + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + tempData: [], + stationName: '', + signalName: '' + }; + }, + computed: { + ...mapGetters('map', [ + 'signalList' + ]), + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdConfirm() { + return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : ''; + }, + title() { + return this.$t('menu.queryAccessControlMode'); + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected, tempData) { + // 如果不是因为断点激活则需要,初始化菜单初始值 + if (!this.dialogShow) { + this.signalName = ''; + this.stationName = ''; + if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } + this.tempData = tempData || []; + } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - commit() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.detail.menu.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() { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.detail.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); - }); - }, - cancel() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Command.cancel.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); + }); + }, + cancel() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/routeHandControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/routeHandControl.vue index 9d67be34c..019ea38fa 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/routeHandControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/routeHandControl.vue @@ -84,234 +84,234 @@ import ConfirmControl from './childDialog/confirmControl'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'RouteHandControl', - components: { - ConfirmControl, - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - tempData: [], - operation: null, - selection: [], - stationName: '', - signalName: '' - }; - }, - computed: { - ...mapGetters('map', [ - 'signalList' - ]), - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdChoose() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - return OperationEvent.Signal.humanControl.choose.domId; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - return OperationEvent.Signal.atsAutoControl.choose.domId; - } - } - return ''; - }, - domIdConfirm() { - return this.dialogShow ? getDomIdByOperation(this.operation) : ''; - }, - title() { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - return this.$t('menu.menuSignal.humanControl'); - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - return this.$t('menu.menuSignal.atsAutoControl'); - } - return ''; - }, - commitDisabled() { - let disabled = true; - if (this.selection && this.selection.length) { - disabled = false; - } + name: 'RouteHandControl', + components: { + ConfirmControl, + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + tempData: [], + operation: null, + selection: [], + stationName: '', + signalName: '' + }; + }, + computed: { + ...mapGetters('map', [ + 'signalList' + ]), + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdChoose() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + return OperationEvent.Signal.humanControl.choose.domId; + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + return OperationEvent.Signal.atsAutoControl.choose.domId; + } + } + return ''; + }, + domIdConfirm() { + return this.dialogShow ? getDomIdByOperation(this.operation) : ''; + }, + title() { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + return this.$t('menu.menuSignal.humanControl'); + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + return this.$t('menu.menuSignal.atsAutoControl'); + } + return ''; + }, + commitDisabled() { + let disabled = true; + if (this.selection && this.selection.length) { + disabled = false; + } - return disabled; - } - }, - watch: { - // 深度数据状态 - tempData: { - handler(val, oldVal) { - this.checkTableDataSelction(val); - }, - deep: true - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected, tempData) { - // 如果不是断点激活,而是第一次显示则初始化 - if (!this.dialogShow) { - this.signalName = ''; - this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } + return disabled; + } + }, + watch: { + // 深度数据状态 + tempData: { + handler(val, oldVal) { + this.checkTableDataSelction(val); + }, + deep: true + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected, tempData) { + // 如果不是断点激活,而是第一次显示则初始化 + if (!this.dialogShow) { + this.signalName = ''; + this.stationName = ''; + if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } - if (tempData && tempData.length > 0) { - tempData.forEach(elem => { - elem.check = false; - elem.disabled = false; - // 设置禁用状态 - if (operate.operation === OperationEvent.Signal.humanControl.menu.operation && + if (tempData && tempData.length > 0) { + tempData.forEach(elem => { + elem.check = false; + elem.disabled = false; + // 设置禁用状态 + if (operate.operation === OperationEvent.Signal.humanControl.menu.operation && elem.controlType != '01') { - elem.disabled = true; - } if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation && + elem.disabled = true; + } if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation && elem.controlType == '01') { - elem.disabled = true; - } - }); - } + elem.disabled = true; + } + }); + } - this.tempData = tempData || []; - this.operation = operate.operation; - } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.$refs.tempTable.setCurrentRow(); - this.$store.dispatch('training/emitTipFresh'); - }, - checkTableDataSelction(data) { - const selection = []; - if (data && data.length > 0) { - data.forEach(row => { - if (row.check && !row.disabled) { - selection.push(row); - } - }); - } + this.tempData = tempData || []; + this.operation = operate.operation; + } + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.$refs.tempTable.setCurrentRow(); + this.$store.dispatch('training/emitTipFresh'); + }, + checkTableDataSelction(data) { + const selection = []; + if (data && data.length > 0) { + data.forEach(row => { + if (row.check && !row.disabled) { + selection.push(row); + } + }); + } - if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { - this.handleChooseChange(selection); - this.selection = selection; - } - }, - serializeCodeListWithSeparator(sep) { - const codeList = []; - if (this.selection && this.selection.length) { - this.selection.forEach(elem => { - codeList.push(elem.code); - }); - } - return codeList.join(sep); - }, - handleChooseChange(selection) { - this.selection = selection; - if (selection && selection.length) { - const operate = { - repeat: true, - type: MapDeviceType.Signal.type, - operation: '', - val: this.serializeCodeListWithSeparator('::'), - selection: selection - }; + if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { + this.handleChooseChange(selection); + this.selection = selection; + } + }, + serializeCodeListWithSeparator(sep) { + const codeList = []; + if (this.selection && this.selection.length) { + this.selection.forEach(elem => { + codeList.push(elem.code); + }); + } + return codeList.join(sep); + }, + handleChooseChange(selection) { + this.selection = selection; + if (selection && selection.length) { + const operate = { + repeat: true, + type: MapDeviceType.Signal.type, + operation: '', + val: this.serializeCodeListWithSeparator('::'), + selection: selection + }; - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - /** 自排关*/ - operate.operation = OperationEvent.Signal.humanControl.choose.operation; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - /** 自排开*/ - operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation; - } + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + /** 自排关*/ + operate.operation = OperationEvent.Signal.humanControl.choose.operation; + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + /** 自排开*/ + operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation; + } - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - } else if (!selection) { - this.$messageBox(this.$t('tip.selectAPieceOfData')); - } - }, - commit() { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - /** 自排关*/ - this.humanControl(); - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - /** 自排开*/ - this.atsAutoControl(); - } - }, - // 自排关 - humanControl() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.humanControl.menu.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + } else if (!selection) { + this.$messageBox(this.$t('tip.selectAPieceOfData')); + } + }, + commit() { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + /** 自排关*/ + this.humanControl(); + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + /** 自排开*/ + this.atsAutoControl(); + } + }, + // 自排关 + humanControl() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 自排开 - atsAutoControl() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 自排开 + atsAutoControl() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - cancel() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Command.cancel.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); + }); + }, + cancel() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/routeLock.vue b/src/jmap/theme/fuzhou_01/menus/dialog/routeLock.vue index 3e49c2616..a2072d2fc 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/routeLock.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/routeLock.vue @@ -57,111 +57,111 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'RouteLock', - components: { - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - tempData: [], - operate: null, - stationName: '', - signalName: '' - }; - }, - computed: { - ...mapGetters('map', [ - 'signalList' - ]), - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdConfirm() { - return this.dialogShow ? OperationEvent.Signal.lock.menu.domId : ''; - }, - title() { - return this.$t('menu.blockSignalButton'); - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected) { - // 入股不是断点激活,而是第一次显示需要初始化 - if (!this.dialogShow) { - this.signalName = ''; - this.stationName = ''; + name: 'RouteLock', + components: { + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + tempData: [], + operate: null, + stationName: '', + signalName: '' + }; + }, + computed: { + ...mapGetters('map', [ + 'signalList' + ]), + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdConfirm() { + return this.dialogShow ? OperationEvent.Signal.lock.menu.domId : ''; + }, + title() { + return this.$t('menu.blockSignalButton'); + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected) { + // 入股不是断点激活,而是第一次显示需要初始化 + if (!this.dialogShow) { + this.signalName = ''; + this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } + if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } - /** status 04:封锁*/ - const signal = (selected || {}).status; - this.tempData = [{ code: selected.code, name: selected.name, status: signal.status != '04' ? this.$t('menu.unblocked') : this.$t('menu.blocked') }]; - const timer = setInterval(() => { - if (this.$refs.table) { - this.$refs.table.setCurrentRow(this.tempData[0]); - clearInterval(timer); - } - }, 300); - } + /** status 04:封锁*/ + const signal = (selected || {}).status; + this.tempData = [{ code: selected.code, name: selected.name, status: signal.status != '04' ? this.$t('menu.unblocked') : this.$t('menu.blocked') }]; + const timer = setInterval(() => { + if (this.$refs.table) { + this.$refs.table.setCurrentRow(this.tempData[0]); + clearInterval(timer); + } + }, 300); + } - this.dialogShow = true; - this.$nextTick(() => { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - commit() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.lock.menu.operation - }; + this.dialogShow = true; + this.$nextTick(() => { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + }, + commit() { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.lock.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); - }); - }, - cancel() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Command.cancel.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); + }); + }, + cancel() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/routeSelection.vue b/src/jmap/theme/fuzhou_01/menus/dialog/routeSelection.vue index b3661e51b..ca7261a8b 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/routeSelection.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/routeSelection.vue @@ -74,189 +74,189 @@ import ConfirmControl from './childDialog/confirmControl'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'RouteSelection', - components: { - ConfirmControl, - NoticeInfo - }, - data() { - return { - tempData: [], - beforeSectionList: [], - dialogShow: false, - loading: false, - row: null, - operation: '', - display: true, - stationName: '', - signalName: '' - }; - }, - computed: { - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdChoose() { - return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : ''; - }, - domIdConfirm() { - return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; - }, - title() { - return this.$t('menu.menuSignal.routeSelect'); - }, - commitDisabled() { - let disabled = true; - if (this.row) { - disabled = !this.row.canSetting; - } - return disabled; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - getProtectedSectionName(row) { - let name = ''; - if (row && + name: 'RouteSelection', + components: { + ConfirmControl, + NoticeInfo + }, + data() { + return { + tempData: [], + beforeSectionList: [], + dialogShow: false, + loading: false, + row: null, + operation: '', + display: true, + stationName: '', + signalName: '' + }; + }, + computed: { + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdChoose() { + return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : ''; + }, + domIdConfirm() { + return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; + }, + title() { + return this.$t('menu.menuSignal.routeSelect'); + }, + commitDisabled() { + let disabled = true; + if (this.row) { + disabled = !this.row.canSetting; + } + return disabled; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + getProtectedSectionName(row) { + let name = ''; + if (row && row.overlapSectionList && row.overlapSectionList && row.overlapSectionList.length > 0) { - const protect = row.overlapSectionList[0]; - name = `${protect.name}`; - if (protect.parentName) { - name = `${protect.parentName}${protect.name}`; - } - const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode); - if (station) { - name = `${name}(${station.name})`; - } - } - return name; - }, - doShow(operate, selected, tempData) { - // 如果不是断点激活,而是第一次显示,则需要设置初始值 - if (!this.dialogShow) { - this.signalName = ''; - this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } + const protect = row.overlapSectionList[0]; + name = `${protect.name}`; + if (protect.parentName) { + name = `${protect.parentName}${protect.name}`; + } + const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode); + if (station) { + name = `${name}(${station.name})`; + } + } + return name; + }, + doShow(operate, selected, tempData) { + // 如果不是断点激活,而是第一次显示,则需要设置初始值 + if (!this.dialogShow) { + this.signalName = ''; + this.stationName = ''; + if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } - this.tempData = tempData || []; - this.operation = operate.operation; - } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.restoreBeforeDevices(); - this.$refs.table.setCurrentRow(); - this.$store.dispatch('training/emitTipFresh'); - }, - restoreBeforeDevices() { - // 恢复之前选中设备 - if (this.beforeSectionList && this.beforeSectionList.length) { - this.beforeSectionList.forEach(elem => { - elem.cutOff = false; - }); - } + this.tempData = tempData || []; + this.operation = operate.operation; + } + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.restoreBeforeDevices(); + this.$refs.table.setCurrentRow(); + this.$store.dispatch('training/emitTipFresh'); + }, + restoreBeforeDevices() { + // 恢复之前选中设备 + if (this.beforeSectionList && this.beforeSectionList.length) { + this.beforeSectionList.forEach(elem => { + elem.cutOff = false; + }); + } - this.$store.dispatch('training/updateMapState', [... this.beforeSectionList]); - this.beforeSectionList = []; - }, - clickEvent(row, event, column) { - this.row = row; - if (row) { - // 恢复进路区段的切除状态 - this.restoreBeforeDevices(); + this.$store.dispatch('training/updateMapState', [... this.beforeSectionList]); + this.beforeSectionList = []; + }, + clickEvent(row, event, column) { + this.row = row; + if (row) { + // 恢复进路区段的切除状态 + this.restoreBeforeDevices(); - if (row.canSetting) { - // 设置选中区段为切除状态 - if (row.containSectionList && row.containSectionList.length) { - // 设置新选的进路区段为切除状态 - row.containSectionList.forEach(elem => { - elem.cutOff = true; - }); - } + if (row.canSetting) { + // 设置选中区段为切除状态 + if (row.containSectionList && row.containSectionList.length) { + // 设置新选的进路区段为切除状态 + row.containSectionList.forEach(elem => { + elem.cutOff = true; + }); + } - this.$store.dispatch('training/updateMapState', [...row.containSectionList]); - this.beforeSectionList = row.containSectionList || []; + this.$store.dispatch('training/updateMapState', [...row.containSectionList]); + this.beforeSectionList = row.containSectionList || []; - // 设置选中指令 - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.arrangementRoute.choose.operation, - val: row.code - }; + // 设置选中指令 + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.arrangementRoute.choose.operation, + val: row.code + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - } - } - }, - commit() { - if (this.row && this.row.canSetting) { - let names = ''; - if (this.row.overlapSectionList && this.row.overlapSectionList.length > 0) { - names = names + this.row.overlapSectionList.map(elem => { return elem.name; }).join(''); - } - if (this.row.overlapSwitchList && this.row.overlapSwitchList.length > 0) { - names = names + this.row.overlapSwitchList.map(elem => { return elem.name; }).join(''); - } - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.arrangementRoute.menu.operation, - messages: [this.$t('menu.accessSetting') + this.$t('global.colon') + `${this.row.name}${names}(${this.row.stationName})`] - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + } + } + }, + commit() { + if (this.row && this.row.canSetting) { + let names = ''; + if (this.row.overlapSectionList && this.row.overlapSectionList.length > 0) { + names = names + this.row.overlapSectionList.map(elem => { return elem.name; }).join(''); + } + if (this.row.overlapSwitchList && this.row.overlapSwitchList.length > 0) { + names = names + this.row.overlapSwitchList.map(elem => { return elem.name; }).join(''); + } + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.arrangementRoute.menu.operation, + messages: [this.$t('menu.accessSetting') + this.$t('global.colon') + `${this.row.name}${names}(${this.row.stationName})`] + }; - 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - } - }, - cancel() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Command.cancel.menu.operation - }; + 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + } + }, + cancel() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/sectionCmdControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/sectionCmdControl.vue index 0718706cd..59cf14ae0 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/sectionCmdControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/sectionCmdControl.vue @@ -86,372 +86,372 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { now } from '@/utils/date'; 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: '' - }; - }, - computed: { - typeList() { - return [ - { code: OperationEvent.Section.unlock.menu.operation, name: this.$t('menu.menuSection.sectionUnblock') }, - { code: OperationEvent.Section.fault.menu.operation, name: this.$t('menu.menuSection.sectionFaultUnlock') }, - { code: OperationEvent.Section.axlePreReset.menu.operation, name: this.$t('menu.menuSection.sectionAxisPreReset') } - ]; - }, - 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; - } - } - return ''; - }, - 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; - } - } - return ''; - }, - 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; - } - } - return ''; - }, - 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; - } - } - return ''; - }, - domIdClose() { - if (this.dialogShow) { - return OperationEvent.Command.close.menu.domId; - } - return ''; - }, - title() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Section.unlock.menu.operation) { - return this.$t('menu.menuSection.sectionUnblock'); - } else if (this.operation == OperationEvent.Section.fault.menu.operation) { - return this.$t('menu.menuSection.sectionFaultUnlock'); - } else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) { - return this.$t('menu.menuSection.sectionAxisPreReset'); - } - } - return ''; - } - }, - watch: { - cmdDisabled: { - handler(val, oldVal) { - this.stpDisabled = true; - val.forEach((elem, index) => { - // 在确定1之前的操作才可以终止 - if (elem == false && index >= 1 && index <= 2) { - this.stpDisabled = false; - } - }); - }, - deep: true - } - }, - 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); - }, - beforeDestroy() { - clearInterval(this.timer); - this.timer = null; - }, - methods: { - doShow(operate, 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; + 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: '' + }; + }, + computed: { + typeList() { + return [ + { code: OperationEvent.Section.unlock.menu.operation, name: this.$t('menu.menuSection.sectionUnblock') }, + { code: OperationEvent.Section.fault.menu.operation, name: this.$t('menu.menuSection.sectionFaultUnlock') }, + { code: OperationEvent.Section.axlePreReset.menu.operation, name: this.$t('menu.menuSection.sectionAxisPreReset') } + ]; + }, + 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; + } + } + return ''; + }, + 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; + } + } + return ''; + }, + 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; + } + } + return ''; + }, + 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; + } + } + return ''; + }, + domIdClose() { + if (this.dialogShow) { + return OperationEvent.Command.close.menu.domId; + } + return ''; + }, + title() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Section.unlock.menu.operation) { + return this.$t('menu.menuSection.sectionUnblock'); + } else if (this.operation == OperationEvent.Section.fault.menu.operation) { + return this.$t('menu.menuSection.sectionFaultUnlock'); + } else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) { + return this.$t('menu.menuSection.sectionAxisPreReset'); + } + } + return ''; + } + }, + watch: { + cmdDisabled: { + handler(val, oldVal) { + this.stpDisabled = true; + val.forEach((elem, index) => { + // 在确定1之前的操作才可以终止 + if (elem == false && index >= 1 && index <= 2) { + this.stpDisabled = false; + } + }); + }, + deep: true + } + }, + 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); + }, + beforeDestroy() { + clearInterval(this.timer); + this.timer = null; + }, + methods: { + doShow(operate, 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.selected = selected; - } + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + this.selected = selected; + } - 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.$t('tip.releaseTip')); - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - command() { - if (this.operation == OperationEvent.Section.fault.menu.operation || + 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.$t('tip.releaseTip')); + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + }, + 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(); - } else { - /** 第一步带弹框处理*/ - this.commandHasPopUp(); - } - }, - commandHasPopUp() { - }, - commandNoPopUp() { - const operate = { - type: MapDeviceType.Section.type - }; + /** 第一步不带弹框处理*/ + this.commandNoPopUp(); + } else { + /** 第一步带弹框处理*/ + this.commandHasPopUp(); + } + }, + commandHasPopUp() { + }, + commandNoPopUp() { + const 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; - } + 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(this.$t('tip.firstConfirmTip')); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), 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: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') }); - }); - }, - confirm1() { - const operate = { - type: MapDeviceType.Section.type - }; + this.setMessage(this.$t('tip.firstConfirmTip')); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), 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: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') }); + }); + }, + confirm1() { + const operate = { + type: MapDeviceType.Section.type + }; - 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; - } + 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(this.$t('tip.secondConfirmTip')); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), 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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') }); - }); - }, - confirm2() { - const operate = { - send: true, - type: MapDeviceType.Section.type - }; + this.setMessage(this.$t('tip.secondConfirmTip')); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), 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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') }); + }); + }, + confirm2() { + const 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: this.$t('menu.clickSecondConfirm'), 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.timeCountCommand = -1; - this.timeCountConfirm = -1; - this.setButtonEnable({ step: -1 }); - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') }); - }); - }, - stop() { - const operate = { - 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: this.$t('menu.clickSecondConfirm'), 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.timeCountCommand = -1; + this.timeCountConfirm = -1; + this.setButtonEnable({ step: -1 }); + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') }); + }); + }, + stop() { + const 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; - } + 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: this.$t('menu.clickSuspend'), 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: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') }); - }); - }, - close() { - const operate = { - type: MapDeviceType.Section.type, - operation: OperationEvent.Command.close.menu.operation - }; + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), 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: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') }); + }); + }, + close() { + const operate = { + type: MapDeviceType.Section.type, + operation: OperationEvent.Command.close.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).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]; - } - } - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).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]; + } + } + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/sectionControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/sectionControl.vue index 23f69788b..dc81675d1 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/sectionControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/sectionControl.vue @@ -39,162 +39,162 @@ import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/Co import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'SectionControl', - components: { - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - operation: '', - stationName: '', - sectionName: '' - }; - }, - 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 this.$t('menu.menuSection.sectionBlockade'); - } else if (this.operation == OperationEvent.Section.split.menu.operation) { - return this.$t('menu.menuSection.orbitalSectionResection'); - } else if (this.operation == OperationEvent.Section.active.menu.operation) { - return this.$t('menu.menuSection.orbitalSectionActive'); - } - return ''; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, 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; + name: 'SectionControl', + components: { + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + operation: '', + stationName: '', + sectionName: '' + }; + }, + 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 this.$t('menu.menuSection.sectionBlockade'); + } else if (this.operation == OperationEvent.Section.split.menu.operation) { + return this.$t('menu.menuSection.orbitalSectionResection'); + } else if (this.operation == OperationEvent.Section.active.menu.operation) { + return this.$t('menu.menuSection.orbitalSectionActive'); + } + return ''; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, 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 || ''; - } - 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.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 = { - send: true, - type: MapDeviceType.Section.type, - operation: OperationEvent.Section.lock.menu.operation - }; + 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.$store.dispatch('training/emitTipFresh'); + }, + 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 = { + 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 轨道区段切除 - split() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 轨道区段切除 + split() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 轨道区段激活 - active() { - const 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(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 轨道区段激活 + active() { + const 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(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - cancel() { - const operate = { - type: MapDeviceType.Section.type, - operation: OperationEvent.Command.cancel.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); + }); + }, + cancel() { + const operate = { + type: MapDeviceType.Section.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/speedCmdControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/speedCmdControl.vue index 196cf97e6..eaa7c36e2 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/speedCmdControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/speedCmdControl.vue @@ -101,483 +101,483 @@ import ConfirmControlSpeed from './childDialog/confirmControlSpeed'; import { now } from '@/utils/date'; export default { - name: 'SectionCmdSpeed', - components: { - ConfirmControlSpeed - }, - data() { - return { - dialogShow: false, - backOperate: '', - selected: '', - order: 0, - row: null, - timer: null, - type: '', - operation: '', - cmdDisabled: [true, true, true], - spdDisabled: false, - stpDisabled: true, - tableData: [], - message: '', - timeCountCommand: -1, - timeCountConfirm: -1, - maxSpeed: 80, - speedSpace: 5, - stationName: '', - name: '', - speed: '' - }; - }, - computed: { - nameLabel() { - if (this.operation == OperationEvent.Section.setSpeed.menu.operation || + name: 'SectionCmdSpeed', + components: { + ConfirmControlSpeed + }, + data() { + return { + dialogShow: false, + backOperate: '', + selected: '', + order: 0, + row: null, + timer: null, + type: '', + operation: '', + cmdDisabled: [true, true, true], + spdDisabled: false, + stpDisabled: true, + tableData: [], + message: '', + timeCountCommand: -1, + timeCountConfirm: -1, + maxSpeed: 80, + speedSpace: 5, + stationName: '', + name: '', + speed: '' + }; + }, + computed: { + nameLabel() { + if (this.operation == OperationEvent.Section.setSpeed.menu.operation || this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - return this.$t('menu.sectionName'); - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation || + return this.$t('menu.sectionName'); + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation || this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - return this.$t('menu.switchName'); - } - return null; - }, - speedList() { - const list = []; - for (var i = 0; i * this.speedSpace <= this.maxSpeed; i++) { - list.push(String(i * this.speedSpace)); - } - return list; - }, - typeList() { - return [ - { code: OperationEvent.Section.setSpeed.menu.operation, name: this.$t('menu.menuSection.sectionSetSpeedLimit') }, - { code: OperationEvent.Section.cancelSpeed.menu.operation, name: this.$t('menu.menuSection.sectionCancelSpeedLimit') }, - { code: OperationEvent.Switch.setSpeed.menu.operation, name: this.$t('menu.turnoutSettingSpeedLimit') }, - { code: OperationEvent.Switch.cancelSpeed.menu.operation, name: this.$t('menu.turnoutCancelsSpeedLimit') } - ]; - }, - title() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - return this.$t('menu.menuSection.sectionSetSpeedLimit'); - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - return this.$t('menu.menuSection.sectionCancelSpeedLimit'); - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - return this.$t('menu.turnoutSettingSpeedLimit'); - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - return this.$t('menu.turnoutCancelsSpeedLimit'); - } - } - return null; - }, - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdChoose() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - return OperationEvent.Section.setSpeed.choose.domId; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - return OperationEvent.Switch.setSpeed.choose.domId; - } - } - return null; - }, - domIdCommand() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - return OperationEvent.Section.setSpeed.order.domId; - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - /** 区段取消限速*/ - return OperationEvent.Section.cancelSpeed.order.domId; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - return OperationEvent.Switch.setSpeed.order.domId; - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - /** 道岔取消限速*/ - return OperationEvent.Switch.cancelSpeed.order.domId; - } - } - return null; - }, - domIdConfirm1() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - return OperationEvent.Section.setSpeed.confirm1.domId; - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - /** 区段取消限速*/ - return OperationEvent.Section.cancelSpeed.confirm1.domId; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - return OperationEvent.Switch.setSpeed.confirm1.domId; - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - /** 道岔取消限速*/ - return OperationEvent.Switch.cancelSpeed.confirm1.domId; - } - } - return null; - }, - domIdConfirm2() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - return OperationEvent.Section.setSpeed.confirm2.domId; - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - /** 区段取消限速*/ - return OperationEvent.Section.cancelSpeed.confirm2.domId; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - return OperationEvent.Switch.setSpeed.confirm2.domId; - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - /** 道岔设置限速*/ - return OperationEvent.Switch.cancelSpeed.confirm2.domId; - } - } - return null; - }, - domIdStop() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - return OperationEvent.Section.setSpeed.stop.domId; - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - /** 区段取消限速*/ - return OperationEvent.Section.cancelSpeed.stop.domId; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - return OperationEvent.Switch.setSpeed.stop.domId; - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - /** 道岔取消限速*/ - return OperationEvent.Switch.cancelSpeed.stop.domId; - } - } - return null; - }, - domIdClose() { - if (this.dialogShow) { - return OperationEvent.Command.close.menu.domId; - } - return null; - }, - isCancelSpeed() { - return this.operation == OperationEvent.Section.cancelSpeed.menu.operation || + return this.$t('menu.switchName'); + } + return null; + }, + speedList() { + const list = []; + for (var i = 0; i * this.speedSpace <= this.maxSpeed; i++) { + list.push(String(i * this.speedSpace)); + } + return list; + }, + typeList() { + return [ + { code: OperationEvent.Section.setSpeed.menu.operation, name: this.$t('menu.menuSection.sectionSetSpeedLimit') }, + { code: OperationEvent.Section.cancelSpeed.menu.operation, name: this.$t('menu.menuSection.sectionCancelSpeedLimit') }, + { code: OperationEvent.Switch.setSpeed.menu.operation, name: this.$t('menu.turnoutSettingSpeedLimit') }, + { code: OperationEvent.Switch.cancelSpeed.menu.operation, name: this.$t('menu.turnoutCancelsSpeedLimit') } + ]; + }, + title() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + return this.$t('menu.menuSection.sectionSetSpeedLimit'); + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + return this.$t('menu.menuSection.sectionCancelSpeedLimit'); + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + return this.$t('menu.turnoutSettingSpeedLimit'); + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + return this.$t('menu.turnoutCancelsSpeedLimit'); + } + } + return null; + }, + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdChoose() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + return OperationEvent.Section.setSpeed.choose.domId; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + return OperationEvent.Switch.setSpeed.choose.domId; + } + } + return null; + }, + domIdCommand() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + return OperationEvent.Section.setSpeed.order.domId; + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + /** 区段取消限速*/ + return OperationEvent.Section.cancelSpeed.order.domId; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + return OperationEvent.Switch.setSpeed.order.domId; + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + /** 道岔取消限速*/ + return OperationEvent.Switch.cancelSpeed.order.domId; + } + } + return null; + }, + domIdConfirm1() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + return OperationEvent.Section.setSpeed.confirm1.domId; + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + /** 区段取消限速*/ + return OperationEvent.Section.cancelSpeed.confirm1.domId; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + return OperationEvent.Switch.setSpeed.confirm1.domId; + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + /** 道岔取消限速*/ + return OperationEvent.Switch.cancelSpeed.confirm1.domId; + } + } + return null; + }, + domIdConfirm2() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + return OperationEvent.Section.setSpeed.confirm2.domId; + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + /** 区段取消限速*/ + return OperationEvent.Section.cancelSpeed.confirm2.domId; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + return OperationEvent.Switch.setSpeed.confirm2.domId; + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + /** 道岔设置限速*/ + return OperationEvent.Switch.cancelSpeed.confirm2.domId; + } + } + return null; + }, + domIdStop() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + return OperationEvent.Section.setSpeed.stop.domId; + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + /** 区段取消限速*/ + return OperationEvent.Section.cancelSpeed.stop.domId; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + return OperationEvent.Switch.setSpeed.stop.domId; + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + /** 道岔取消限速*/ + return OperationEvent.Switch.cancelSpeed.stop.domId; + } + } + return null; + }, + domIdClose() { + if (this.dialogShow) { + return OperationEvent.Command.close.menu.domId; + } + return null; + }, + isCancelSpeed() { + return this.operation == OperationEvent.Section.cancelSpeed.menu.operation || this.operation == OperationEvent.Switch.cancelSpeed.menu.operation; - } - }, - watch: { - cmdDisabled: { - handler(val, oldVal) { - this.stpDisabled = true; - this.spdDisabled = false; - val.forEach((elem, index) => { - // 取消操作禁止选择限速,并跳过该步骤 - if (elem == false && index >= 1 || this.isCancelSpeed) { - this.spdDisabled = true; - } + } + }, + watch: { + cmdDisabled: { + handler(val, oldVal) { + this.stpDisabled = true; + this.spdDisabled = false; + val.forEach((elem, index) => { + // 取消操作禁止选择限速,并跳过该步骤 + if (elem == false && index >= 1 || this.isCancelSpeed) { + this.spdDisabled = true; + } - // 在确定1之前的操作才可终止 - if (elem == false && index >= 1) { - this.stpDisabled = false; - } - }); - }, - deep: true - }, - 'speed': function (val) { - if (val) this.cmdDisabled[0] = false; - } - }, - 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); - }, - beforeDestroy() { - clearInterval(this.timer); - this.timer = null; - }, - methods: { - doShow(operate, selected, tempData) { - if (!this.dialogShow) { - this.name = ''; - this.stationName = ''; - if (selected) { - if (operate.operation == OperationEvent.Section.setSpeed.menu.operation || + // 在确定1之前的操作才可终止 + if (elem == false && index >= 1) { + this.stpDisabled = false; + } + }); + }, + deep: true + }, + 'speed': function (val) { + if (val) this.cmdDisabled[0] = false; + } + }, + 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); + }, + beforeDestroy() { + clearInterval(this.timer); + this.timer = null; + }, + methods: { + doShow(operate, selected, tempData) { + if (!this.dialogShow) { + this.name = ''; + this.stationName = ''; + if (selected) { + if (operate.operation == OperationEvent.Section.setSpeed.menu.operation || operate.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { - if (selected.type === '02') { - const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode); - if (section) { - this.name += section.name; - } - } - this.name += selected.name; - } - } else if (operate.operation == OperationEvent.Switch.setSpeed.menu.operation || + if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { + if (selected.type === '02') { + const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode); + if (section) { + this.name += section.name; + } + } + this.name += selected.name; + } + } else if (operate.operation == OperationEvent.Switch.setSpeed.menu.operation || operate.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) { - this.name = selected.name; - } - } + if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) { + this.name = selected.name; + } + } - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } - this.speed = ''; - this.tableData = []; - this.selected = selected; - this.timeCountCommand = -1; - this.timeCountConfirm = -1; - this.cmdDisabled = [true, true, true]; - this.stpDisabled = true; - this.order = 0; - this.type = operate.type; - this.operation = operate.operation; - this.setMessage(this.$t('tip.selectSpeedLimitValueTip')); - if (this.isCancelSpeed) { - this.speed = `${tempData}`; - this.spdDisabled = true; - this.cmdDisabled = [false, true, true]; - } - } + this.speed = ''; + this.tableData = []; + this.selected = selected; + this.timeCountCommand = -1; + this.timeCountConfirm = -1; + this.cmdDisabled = [true, true, true]; + this.stpDisabled = true; + this.order = 0; + this.type = operate.type; + this.operation = operate.operation; + this.setMessage(this.$t('tip.selectSpeedLimitValueTip')); + if (this.isCancelSpeed) { + this.speed = `${tempData}`; + this.spdDisabled = true; + this.cmdDisabled = [false, true, true]; + } + } - } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - speedSelectChange(val) { - const operate = { - type: this.type, - val: val - }; + } + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + }, + speedSelectChange(val) { + const operate = { + type: this.type, + val: val + }; - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - operate.operation = OperationEvent.Section.setSpeed.choose.operation; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - operate.operation = OperationEvent.Switch.setSpeed.choose.operation; - } + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + operate.operation = OperationEvent.Section.setSpeed.choose.operation; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + operate.operation = OperationEvent.Switch.setSpeed.choose.operation; + } - this.setMessage(this.$t('tip.releaseTip')); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.setButtonEnable({ step: 0 }); - } - }); - }, - command() { - const operate = { - type: this.type - }; + this.setMessage(this.$t('tip.releaseTip')); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.setButtonEnable({ step: 0 }); + } + }); + }, + command() { + const operate = { + type: this.type + }; - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - operate.operation = OperationEvent.Section.setSpeed.order.operation; - operate.message = this.$t('menu.in') + `【${this.name}】`+ this.$t('menu.sectionSetLimitPrefix') +`${this.speed}` + this.$t('menu.sectionLimitSuffix'); - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - /** 区段取消限速*/ - operate.operation = OperationEvent.Section.cancelSpeed.order.operation; - operate.message = this.$t('menu.in') + `【${this.name}】`+ this.$t('menu.sectionCancelLimitPrefix') +`${this.speed}` + this.$t('menu.sectionLimitSuffix'); - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - operate.operation = OperationEvent.Switch.setSpeed.order.operation; - operate.message = this.$t('menu.in') + `【${this.name}】`+ this.$t('menu.switchSetLimitPrefix') +`${this.speed}` + this.$t('menu.sectionLimitSuffix'); - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - /** 道岔取消限速*/ - operate.operation = OperationEvent.Switch.cancelSpeed.order.operation; - operate.message = this.$t('menu.in') + `【${this.name}】`+ this.$t('menu.switchCancelLimitPrefix') +`${this.speed}` + this.$t('menu.sectionLimitSuffix'); - } + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + operate.operation = OperationEvent.Section.setSpeed.order.operation; + operate.message = this.$t('menu.in') + `【${this.name}】` + this.$t('menu.sectionSetLimitPrefix') + `${this.speed}` + this.$t('menu.sectionLimitSuffix'); + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + /** 区段取消限速*/ + operate.operation = OperationEvent.Section.cancelSpeed.order.operation; + operate.message = this.$t('menu.in') + `【${this.name}】` + this.$t('menu.sectionCancelLimitPrefix') + `${this.speed}` + this.$t('menu.sectionLimitSuffix'); + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + operate.operation = OperationEvent.Switch.setSpeed.order.operation; + operate.message = this.$t('menu.in') + `【${this.name}】` + this.$t('menu.switchSetLimitPrefix') + `${this.speed}` + this.$t('menu.sectionLimitSuffix'); + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + /** 道岔取消限速*/ + operate.operation = OperationEvent.Switch.cancelSpeed.order.operation; + operate.message = this.$t('menu.in') + `【${this.name}】` + this.$t('menu.switchCancelLimitPrefix') + `${this.speed}` + this.$t('menu.sectionLimitSuffix'); + } - this.setMessage(this.$t('tip.firstConfirmTip')); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') }); - this.$refs.confirmControlSpeed.doShow(operate, this.selected); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') }); - }); - }, - confirm1() { - const operate = { - type: this.type - }; + this.setMessage(this.$t('tip.firstConfirmTip')); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') }); + this.$refs.confirmControlSpeed.doShow(operate, this.selected); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') }); + }); + }, + confirm1() { + const operate = { + type: this.type + }; - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - operate.operation = OperationEvent.Section.setSpeed.confirm1.operation; - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - /** 区段取消限速*/ - operate.operation = OperationEvent.Section.cancelSpeed.confirm1.operation; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - operate.operation = OperationEvent.Switch.setSpeed.confirm1.operation; - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - /** 道岔取消限速*/ - operate.operation = OperationEvent.Switch.cancelSpeed.confirm1.operation; - } + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + operate.operation = OperationEvent.Section.setSpeed.confirm1.operation; + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + /** 区段取消限速*/ + operate.operation = OperationEvent.Section.cancelSpeed.confirm1.operation; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + operate.operation = OperationEvent.Switch.setSpeed.confirm1.operation; + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + /** 道岔取消限速*/ + operate.operation = OperationEvent.Switch.cancelSpeed.confirm1.operation; + } - this.setMessage(this.$t('tip.secondConfirmTip')); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), 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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') }); - }); - }, - confirm2() { - const operate = { - send: true, - type: this.type, - val: this.speed - }; + this.setMessage(this.$t('tip.secondConfirmTip')); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), 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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') }); + }); + }, + confirm2() { + const operate = { + send: true, + type: this.type, + val: this.speed + }; - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - operate.operation = OperationEvent.Section.setSpeed.confirm2.operation; - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - /** 区段取消限速*/ - operate.operation = OperationEvent.Section.cancelSpeed.confirm2.operation; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - operate.operation = OperationEvent.Switch.setSpeed.confirm2.operation; - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - /** 道岔取消限速*/ - operate.operation = OperationEvent.Switch.cancelSpeed.confirm2.operation; - } + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + operate.operation = OperationEvent.Section.setSpeed.confirm2.operation; + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + /** 区段取消限速*/ + operate.operation = OperationEvent.Section.cancelSpeed.confirm2.operation; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + operate.operation = OperationEvent.Switch.setSpeed.confirm2.operation; + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + /** 道岔取消限速*/ + operate.operation = OperationEvent.Switch.cancelSpeed.confirm2.operation; + } - this.setMessage(''); - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.timeCountCommand = -1; - this.timeCountConfirm = -1; - this.setButtonEnable({ step: -1 }); - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') }); - }); - }, - stop() { - const operate = { - type: this.type - }; + this.setMessage(''); + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.timeCountCommand = -1; + this.timeCountConfirm = -1; + this.setButtonEnable({ step: -1 }); + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') }); + }); + }, + stop() { + const operate = { + type: this.type + }; - if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { - /** 区段设置限速*/ - operate.operation = OperationEvent.Section.setSpeed.stop.operation; - } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { - /** 区段取消限速*/ - operate.operation = OperationEvent.Section.cancelSpeed.stop.operation; - } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { - /** 道岔设置限速*/ - operate.operation = OperationEvent.Switch.setSpeed.stop.operation; - } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { - /** 道岔取消限速*/ - operate.operation = OperationEvent.Switch.cancelSpeed.stop.operation; - } + if (this.operation == OperationEvent.Section.setSpeed.menu.operation) { + /** 区段设置限速*/ + operate.operation = OperationEvent.Section.setSpeed.stop.operation; + } else if (this.operation == OperationEvent.Section.cancelSpeed.menu.operation) { + /** 区段取消限速*/ + operate.operation = OperationEvent.Section.cancelSpeed.stop.operation; + } else if (this.operation == OperationEvent.Switch.setSpeed.menu.operation) { + /** 道岔设置限速*/ + operate.operation = OperationEvent.Switch.setSpeed.stop.operation; + } else if (this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) { + /** 道岔取消限速*/ + operate.operation = OperationEvent.Switch.cancelSpeed.stop.operation; + } - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), 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: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') }); - } else { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') }); - } - }).catch(() => { - this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') }); - }); - }, - close() { - const operate = { - type: this.type, - operation: OperationEvent.Command.close.menu.operation - }; - this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickToClose'), result: '' }); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - }, - getOperate(operate) { - if (operate.step) { - this.setButtonEnable({ step: operate.step }); - } - }, - 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.tableData.push(param); - }, - editRecord(param) { - this.tableData.forEach(elem => { - if (elem.order == param.order) { - for (var prop in param) { - elem[prop] = param[prop]; - } - } - }); - } - } + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), 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: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') }); + } else { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') }); + } + }).catch(() => { + this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') }); + }); + }, + close() { + const operate = { + type: this.type, + operation: OperationEvent.Command.close.menu.operation + }; + this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickToClose'), result: '' }); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + }, + getOperate(operate) { + if (operate.step) { + this.setButtonEnable({ step: operate.step }); + } + }, + 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.tableData.push(param); + }, + editRecord(param) { + this.tableData.forEach(elem => { + if (elem.order == param.order) { + for (var prop in param) { + elem[prop] = param[prop]; + } + } + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/standBackStrategy.vue b/src/jmap/theme/fuzhou_01/menus/dialog/standBackStrategy.vue index 13ae1aa24..e1f941d26 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/standBackStrategy.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/standBackStrategy.vue @@ -86,166 +86,166 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { mapGetters } from 'vuex'; export default { - name: 'StandBackStrategy', - components: { - ConfirmControl, - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - tempData: [], - strategyList: [ - { - value: '01', - label: this.$t('menu.noSwitchback') - }, - { - value: '02', - label: this.$t('menu.noOneSwitchback') - }, - { - value: '03', - label: this.$t('menu.automaticChange') - }, - { - value: '04', - label: this.$t('menu.default') - } - ], - stationName: '', - standStatus: '', - selection: [], - isSelect: true, - isConfirm: false, - strategy: '' - }; - }, - 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.StationStand.setBackStrategy.menu.domId : ''; - }, - domIdChoose() { - return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.choose.domId : ''; - }, - title() { - return this.$t('menu.setSwitchbackStrategy'); - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - loadInitData(selected, opts) { - this.tempData = []; - const station = this.stationList.find(n => n.code == selected.stationCode); - this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy }); - }, - doShow(operate, selected, opts) { - if (!this.dialogShow) { - this.standStatus = ''; - this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { - this.standStatus = selected.direction; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } - this.loadInitData(selected, opts); - } + name: 'StandBackStrategy', + components: { + ConfirmControl, + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + tempData: [], + strategyList: [ + { + value: '01', + label: this.$t('menu.noSwitchback') + }, + { + value: '02', + label: this.$t('menu.noOneSwitchback') + }, + { + value: '03', + label: this.$t('menu.automaticChange') + }, + { + value: '04', + label: this.$t('menu.default') + } + ], + stationName: '', + standStatus: '', + selection: [], + isSelect: true, + isConfirm: false, + strategy: '' + }; + }, + 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.StationStand.setBackStrategy.menu.domId : ''; + }, + domIdChoose() { + return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.choose.domId : ''; + }, + title() { + return this.$t('menu.setSwitchbackStrategy'); + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + loadInitData(selected, opts) { + this.tempData = []; + const station = this.stationList.find(n => n.code == selected.stationCode); + this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy }); + }, + doShow(operate, selected, opts) { + if (!this.dialogShow) { + this.standStatus = ''; + this.stationName = ''; + if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { + this.standStatus = selected.direction; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } + this.loadInitData(selected, opts); + } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - checkTableDataSelction(data) { - const selection = []; - if (data && data.length > 0) { - data.forEach(row => { - if (row.check && !row.disabled) { - selection.push(row); - } - }); - } + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + checkTableDataSelction(data) { + const selection = []; + if (data && data.length > 0) { + data.forEach(row => { + if (row.check && !row.disabled) { + selection.push(row); + } + }); + } - this.disabledSend = !selection.length; - if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { - this.selection = selection; - } - }, - strategySelectChange(strategy) { - const operate = { - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.setBackStrategy.choose.operation, - val: `${strategy}` - }; + this.disabledSend = !selection.length; + if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { + this.selection = selection; + } + }, + strategySelectChange(strategy) { + const operate = { + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.setBackStrategy.choose.operation, + val: `${strategy}` + }; - this.strategy = strategy; - this.isSelect = false; - this.isConfirm = true; - 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.$store.dispatch('training/emitTipFresh'); - }, - commit() { - if (this.isConfirm) { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.setBackStrategy.menu.operation, - val: `${this.strategy}` - }; + this.strategy = strategy; + this.isSelect = false; + this.isConfirm = true; + 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.$store.dispatch('training/emitTipFresh'); + }, + commit() { + if (this.isConfirm) { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.setBackStrategy.menu.operation, + val: `${this.strategy}` + }; - 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); - }); - } else { - this.doClose(); - } - }, - cancel() { - const operate = { - type: MapDeviceType.StationStand.type, - operation: OperationEvent.Command.cancel.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); + }); + } else { + 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(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/standControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/standControl.vue index 03b589830..e98e938f1 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/standControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/standControl.vue @@ -30,237 +30,237 @@ import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/Co import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'StandDetainTrain', - components: { - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - standName: '', - selected: null, - operation: null - }; - }, - 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.StationStand.setDetainTrain.menu.operation) { - return this.$t('menu.menuStationStand.detainTrain'); - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { - return this.$t('menu.menuStationStand.cancelDetainTrain'); - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) { - return this.$t('menu.menuStationStand.cancelDetainTrainForce'); - } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { - return this.$t('menu.menuStationStand.earlyDeparture'); - } else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) { - return this.$t('menu.menuStationStand.setJumpStop'); - } else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) { - return this.$t('menu.menuStationStand.cancelJumpStop'); - } - return ''; - }, - preContext() { - return this.title + ':'; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected) { - if (!this.dialogShow) { - this.standName = ''; - if (selected) { - this.standName = selected.name; - } + name: 'StandDetainTrain', + components: { + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + standName: '', + selected: null, + operation: null + }; + }, + 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.StationStand.setDetainTrain.menu.operation) { + return this.$t('menu.menuStationStand.detainTrain'); + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { + return this.$t('menu.menuStationStand.cancelDetainTrain'); + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) { + return this.$t('menu.menuStationStand.cancelDetainTrainForce'); + } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { + return this.$t('menu.menuStationStand.earlyDeparture'); + } else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) { + return this.$t('menu.menuStationStand.setJumpStop'); + } else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) { + return this.$t('menu.menuStationStand.cancelJumpStop'); + } + return ''; + }, + preContext() { + return this.title + ':'; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected) { + if (!this.dialogShow) { + this.standName = ''; + if (selected) { + this.standName = selected.name; + } - this.selected = selected; - 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.StationStand.setDetainTrain.menu.operation) { - /** 设置扣车*/ - this.setDetainTrain(); - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { - /** 取消扣车*/ - this.cancelDetainTrain(); - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) { - /** 强制取消扣车*/ - this.cancelDetainTrainForce(); - } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { - /** 提前发车*/ - this.earlyDeparture(); - } else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) { - /** 设置跳停*/ - this.setJumpStop(); - } else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) { - /** 取消跳停*/ - this.cancelJumpStop(); - } - }, - // 设置扣车 - setDetainTrain() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation - }; + this.selected = selected; + 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.StationStand.setDetainTrain.menu.operation) { + /** 设置扣车*/ + this.setDetainTrain(); + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { + /** 取消扣车*/ + this.cancelDetainTrain(); + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) { + /** 强制取消扣车*/ + this.cancelDetainTrainForce(); + } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { + /** 提前发车*/ + this.earlyDeparture(); + } else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) { + /** 设置跳停*/ + this.setJumpStop(); + } else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) { + /** 取消跳停*/ + this.cancelJumpStop(); + } + }, + // 设置扣车 + setDetainTrain() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.setDetainTrain.menu.operation + }; - this.loading = true; - this.$store.dispatch('training/next', 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); - }); - }, - // 取消扣车 - cancelDetainTrain() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', 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); + }); + }, + // 取消扣车 + cancelDetainTrain() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation + }; - this.loading = true; - this.$store.dispatch('training/next', 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); - }); - }, - // 强制取消扣车 - cancelDetainTrainForce() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', 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); + }); + }, + // 强制取消扣车 + cancelDetainTrainForce() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation + }; - this.loading = true; - this.$store.dispatch('training/next', 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); - }); - }, - // 提前发车 - earlyDeparture() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.earlyDeparture.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', 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); + }); + }, + // 提前发车 + earlyDeparture() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.earlyDeparture.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); - }); - }, - // 设置跳停 - setJumpStop() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.setJumpStop.menu.operation, - val: this.selected.direction // 站台的上下行方向, 01:下行 /02:上行 - }; + 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); + }); + }, + // 设置跳停 + setJumpStop() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + val: this.selected.direction // 站台的上下行方向, 01:下行 /02:上行 + }; - 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() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, - val: this.selected.direction // 站台的上下行方向, 01:下行 /02:上行 - }; + 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() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + val: this.selected.direction // 站台的上下行方向, 01:下行 /02:上行 + }; - 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/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 = false; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { - this.doClose(); - }); - } - } + this.loading = false; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } };