diff --git a/src/components/PopMenu/popTip.vue b/src/components/PopMenu/popTip.vue index 03f6c8cb6..ff845626a 100644 --- a/src/components/PopMenu/popTip.vue +++ b/src/components/PopMenu/popTip.vue @@ -1,6 +1,6 @@ @@ -99,8 +99,8 @@ export default { closeMenuStationStand() { this.$refs.menuStationStand.doClose(); }, - standOperationCallback(val) { - this.$refs.menuStationStand.callback(val); + totalMenuEvent(param) { + this.$refs.menuCancel.doShow(param); } } }; @@ -175,11 +175,8 @@ export default { opacity: 1; } .xian-02__system .el-dialog .el-dialog__title { - font-size: 16px; + font-size: 18px; color: #fff; - position: absolute; - top: 4px; - left:25px; } .xian-02__menus .stand-stop-time .el-dialog .el-dialog__title { font-size: 16px; @@ -189,11 +186,14 @@ export default { top: 4px; left:550px; } + .xian-02__system .el-dialog .el-dialog__header { + padding: 2px 1px; + } .xian-02__system .el-dialog .el-dialog__headerbtn { background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770); border: 1px solid #fff; border-radius: 4px; - top: 6px; + top: 2px; right: 3px; line-height: 16px; } diff --git a/src/jmapNew/theme/xian_02/menus/menuCancel.vue b/src/jmapNew/theme/xian_02/menus/menuCancel.vue index 211705db0..ae97ea8b8 100644 --- a/src/jmapNew/theme/xian_02/menus/menuCancel.vue +++ b/src/jmapNew/theme/xian_02/menus/menuCancel.vue @@ -20,7 +20,7 @@ export default { menuNormal: [ { label: '发送', - handler: this.undeveloped + handler: this.sendRequestList }, { label: '取消', @@ -148,6 +148,32 @@ export default { callback: action => { } }); + }, + sendRequestList() { + const requestList = this.$store.state.menuOperation.requestList; + if (requestList && requestList.length > 0) { + this.commitEachCommand(requestList); + } + }, + commitEachCommand(requestList) { + const eachCmd = requestList[0]; + const operate = { + send: true, + operation: eachCmd.operation.code, + cmdType: eachCmd.cmdType, + param: eachCmd.param // 请求栈中参数配置 + }; + this.$store.dispatch('menuOperation/spliceRequestList', {deviceCode:eachCmd.device.code, operateCode:eachCmd.operation.code}); + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + this.loading = false; + if (valid) { + if (requestList.length) { + this.commitEachCommand(requestList); + } + } + }).catch(() => { + this.loading = false; + }); } } }; diff --git a/src/jmapNew/theme/xian_02/menus/menuRequest.vue b/src/jmapNew/theme/xian_02/menus/menuRequest.vue index e0fce3d14..e4b94d977 100644 --- a/src/jmapNew/theme/xian_02/menus/menuRequest.vue +++ b/src/jmapNew/theme/xian_02/menus/menuRequest.vue @@ -7,7 +7,7 @@
- + @@ -98,24 +98,23 @@ export default { commit() { const requestList = this.$store.state.menuOperation.requestList; if (requestList && requestList.length > 0) { - this.commitEachCommand(requestList, 0); + this.commitEachCommand(requestList); } }, - commitEachCommand(requestList, index) { - const eachCmd = requestList[index]; + commitEachCommand(requestList) { + const eachCmd = requestList[0]; const operate = { - over: true, + send: true, operation: eachCmd.operation.code, - cmdType: eachCmd.operation.cmdType, - param: eachCmd.operation.param // 请求栈中参数配置 + cmdType: eachCmd.cmdType, + param: eachCmd.param // 请求栈中参数配置 }; + this.$store.dispatch('menuOperation/spliceRequestList', {deviceCode:eachCmd.device.code, operateCode:eachCmd.operation.code}); this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { - this.$store.dispatch('menuOperation/spliceRequestList', {deviceCode:eachCmd.device.code, operateCode:eachCmd.operation.code}); - const nextIndex = index++; - if (nextIndex < requestList.length) { - this.commitEachCommand(requestList, nextIndex); + if (requestList.length) { + this.commitEachCommand(requestList); } // this.doClose(); } diff --git a/src/jmapNew/theme/xian_02/menus/menuStationStand.vue b/src/jmapNew/theme/xian_02/menus/menuStationStand.vue index 370ef2977..24e82a770 100644 --- a/src/jmapNew/theme/xian_02/menus/menuStationStand.vue +++ b/src/jmapNew/theme/xian_02/menus/menuStationStand.vue @@ -13,7 +13,7 @@ :close-on-click-modal="false" > -
{{ title }}
+
{{ title }}
设备
@@ -49,10 +49,10 @@
跳停
-
设置/取消 所有列车跳停本站
+
设置/取消 所有列车跳停本站
-
所有列车跳停本站
+
所有列车跳停本站
@@ -60,10 +60,10 @@
ATS站台扣车
-
设置/取消 所有列车本站扣车
+
设置/取消 所有列车本站扣车
-
所有列车本站扣车
+
所有列车本站扣车
@@ -146,9 +146,10 @@ export default { position: '', title: '', standDetainColor: '#FFF', - allDetainColor: '#FFF', - stopJumpColor: '#FFF', - allStopJumpColor: '#FFF' + detainStatusColor: '#FFF', + bgColor: '#000', + fontColor: '#FFF', + detainInterval: '' }; }, computed: { @@ -185,6 +186,14 @@ export default { } else { this.doClose(); } + }, + '$store.state.menuOperation.requestList': function (list) { + this.initStatus(list); + }, + '$store.state.socket.equipmentStatus': function (val) { + if (this.selected) { + this.detainStatusColor = this.selected.centerHoldTrain || this.selected.stationHoldTrain ? '#FF0' : '#FFF'; + } } }, mounted() { @@ -195,27 +204,48 @@ export default { methods: { doShow(position) { // this.operate = operate || {}; + const requestList = this.$store.state.menuOperation.requestList; + this.initStatus(requestList || []); this.position = position; this.dialogShow = true; this.$nextTick(function () { this.$store.dispatch('training/emitTipFresh'); }); }, + initStatus(requestList) { + this.standDetainColor = '#FFF'; + this.bgColor = '#000'; + this.fontColor = '#FFF'; + if (this.detainInterval) { + clearInterval(this.detainInterval); + this.detainInterval = ''; + } + requestList.forEach(item => { + if (item.device && item.device.code === this.selected.code) { + if (item.operation.code === OperationEvent.StationStand.setDetainTrain.menu.operation || item.operation.code === OperationEvent.StationStand.cancelDetainTrain.menu.operation) { + this.standDetain(); + } + } + }); + }, doClose() { this.loading = false; this.dialogShow = false; this.$store.dispatch('training/emitTipFresh'); if (this.detainInterval) { - clearTimeout(this.detainInterval); - } - if (this.stopJumpInterval) { - clearTimeout(this.stopJumpInterval); + clearInterval(this.detainInterval); + this.detainInterval = ''; } }, menuEvent(val) { - this.$emit('popMenuStationStand', {position:{x: event.clientX, y: event.clientY}, type:val}); - event.stopPropagation(); - event.preventDefault(); + if (val) { + this.$emit('popMenuStationStand', {position:{x: event.clientX, y: event.clientY}, type:val}); + event.stopPropagation(); + event.preventDefault(); + } + }, + totalMenuEvent() { + this.$emit('totalMenuEvent', {x: event.clientX, y: event.clientY}); }, clickEvent(val) { this.dialogShow = true; @@ -272,28 +302,11 @@ export default { // } // }); }, - callback(val) { - if (val === 'standDetain') { - this.setStandDetain(true); - } else if (val === 'stopJumping') { - this.setStopJumping(true); - } - }, - setStopJumping(flag) { - this.stopJumpColor = '#FF0'; - if (flag && !this.stopJumpInterval) { - this.stopJumpInterval = setInterval(() => { - if (this.stopJumpColor !== '#FF0') { - this.stopJumpColor = '#FF0'; - } else { - this.stopJumpColor = '#000'; - } - }, 1000); - } - }, - setStandDetain(flag) { + standDetain() { this.standDetainColor = '#FF0'; - if (flag && !this.detainInterval) { + this.bgColor = '#FFF'; + this.fontColor = '#000'; + if (!this.detainInterval) { this.detainInterval = setInterval(() => { if (this.standDetainColor !== '#FF0') { this.standDetainColor = '#FF0'; diff --git a/src/jmapNew/theme/xian_02/menus/popStationStand.vue b/src/jmapNew/theme/xian_02/menus/popStationStand.vue index ed6ab53e0..29c1b753a 100644 --- a/src/jmapNew/theme/xian_02/menus/popStationStand.vue +++ b/src/jmapNew/theme/xian_02/menus/popStationStand.vue @@ -1,6 +1,6 @@