Merge branch 'test_deplotSimulation' of git.code.tencent.com:lian-cbtc/jl-client into test_deplotSimulation

This commit is contained in:
yuan 2021-09-07 14:01:03 +08:00
commit bafc4d65e7
2 changed files with 242 additions and 99 deletions

View File

@ -67,10 +67,10 @@
<span class="buttonColor">钮解</span>
</button>
<button
:id="Command.cancel.clearMbm.domId"
:id="Signal.cancelTrainRoute.button.domId"
class="button_box"
:style="{ width: width + 'px', backgroundColor: buttonUpColor }"
@click="buttonDown(Command.cancel.clearMbm.operation)"
@click="buttonDown(Signal.cancelTrainRoute.button.operation)"
>
<span class="buttonColor">取消</span>
</button>
@ -185,6 +185,66 @@ export default {
beforeDestroy() {
this.resetMbmButton()
},
methods: {
updateButtonShow(val, old) {
if (old) {
//
// this.promptInfo = '';
const domId = OperationHandler.getDomIdByOperation(old)
const dom = document.getElementById(domId)
if (dom) {
dom.disabled = false
dom.style.backgroundColor = this.buttonUpColor
}
}
if (val) {
//
const domId = OperationHandler.getDomIdByOperation(val)
const dom = document.getElementById(domId)
if (dom) {
// this.promptInfo = dom.innerText;
dom.disabled = true
dom.style.backgroundColor = this.buttonDownColor
}
}
},
passWordCommit(data) {
let operate = {}
if (data.overNext) {
operate = {
over: true,
code: data.code,
operation: data.operation,
cmdType: this.cmdType,
param: data.param,
}
} else if (data.nextCmdType) {
operate = {
over: true,
operation: data.operation,
cmdType: data.nextCmdType,
}
} else {
operate = {
operation: data.operateNext,
}
}
this.trainingOperation(operate)
},
//
trainingOperation(operate) {
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
}
})
.catch((error) => {
console.error(error)
this.$refs.noticeInfo.doShow()
})
},
methods: {
updateButtonShow(val, old) {
if (old) {
@ -252,7 +312,7 @@ export default {
buttonDown(operation) {
//
this.deviceList = []
if (operation != this.Command.cancel.clearMbm.operation) {
// if (operation != this.Command.cancel.clearMbm.operation) {
const operate = {
operation: operation,
}
@ -278,19 +338,7 @@ export default {
this.$store.dispatch('training/emitTipFresh')
}
})
} else {
const operate = {
start: true,
operation: operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', null)
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
Handler.clear() //
}
})
}
},
},
},
}

View File

@ -13,21 +13,21 @@
</template>
<script>
import PopMenu from '@/components/PopMenu';
import RouteControl from '@/jmapNew/theme/components/menus/dialog/routeControl';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import RouteSelection from './dialog/routeSelection';
import RouteLock from './dialog/routeLock';
import RouteCmdControl from './dialog/routeCmdControl';
import RouteHandControl from './dialog/routeHandControl';
import RouteDetail from './dialog/routeDetail';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import PopMenu from '@/components/PopMenu'
import RouteControl from '@/jmapNew/theme/components/menus/dialog/routeControl'
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'
import RouteSelection from './dialog/routeSelection'
import RouteLock from './dialog/routeLock'
import RouteCmdControl from './dialog/routeCmdControl'
import RouteHandControl from './dialog/routeHandControl'
import RouteDetail from './dialog/routeDetail'
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum'
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'
import { mapGetters } from 'vuex'
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'
export default {
name: 'SignalMenu',
@ -46,7 +46,7 @@ export default {
selected: {
type: Object,
default() {
return null;
return null
},
},
},
@ -206,228 +206,323 @@ export default {
cmdType: CMD.Fault.CMD_TRIGGER_FAULT,
},
],
};
}
},
computed: {
...mapGetters('training', ['mode', 'operatemode']),
...mapGetters('menuOperation', ['buttonOperation']),
...mapGetters('map', ['routeList']),
group() {
return this.$route.query.group;
return this.$route.query.group
},
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
this.doShow(this.$store.state.menuOperation.menuPosition)
} else {
this.doClose();
this.doClose()
}
},
'$store.state.menuOperation.selectedCount': function (val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Signal') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected)
}
},
},
methods: {
initMenu() {
this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = MenuContextHandler.covert(this.menuNormal)
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
this.menu = this.menuForce
}
},
operationHandler(buttonOperation, selectType) {
switch (buttonOperation) {
//
case OperationEvent.Signal.lock.button.operation: {
commitOperate(menuOperate.Signal.lock, { signalCode: selectType.code }, 3)
.then(({ valid, operate }) => {
if (valid) {
// this.$refs.routeLock.doShow(operate, this.selected);
} else {
this.$refs.noticeInfo.doShow();
this.$refs.noticeInfo.doShow()
}
})
.catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
break;
console.error(error)
this.$refs.noticeInfo.doShow()
})
break
}
case OperationEvent.Signal.lock.unlock.operation: {
//
case OperationEvent.Signal.unlock.button.operation: {
// this.unlock(selectType);
commitOperate(menuOperate.Signal.unlock, { signalCode: selectType.code }, 3)
.then(({ valid, operate }) => {
if (valid) {
// this.$refs.routeLock.doShow(operate, this.selected);
} else {
this.$refs.noticeInfo.doShow();
this.$refs.noticeInfo.doShow()
}
})
.catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
break;
console.error(error)
this.$refs.noticeInfo.doShow()
})
break
}
//
case OperationEvent.Signal.cancelTrainRoute.button.operation: {
commitOperate(menuOperate.Signal.cancelTrainRoute, { signalCode: selectType.code }, 3)
.then(({ valid, operate }) => {
if (valid) {
// this.$refs.routeLock.doShow(operate, this.selected);
} else {
this.$refs.noticeInfo.doShow()
}
})
.catch((error) => {
console.error(error)
this.$refs.noticeInfo.doShow()
})
break
}
//
//
default: {
break;
break
}
}
},
doShow(point) {
this.initMenu();
this.initMenu()
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
this.$refs.popMenu.resetShowPosition(point)
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
this.$refs.popMenu.close()
}
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected)
}
});
})
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected)
}
});
})
},
//
getRouteList(selectType) {
const routes = [];
const routes = []
this.routeList.forEach((elem) => {
if (elem.startSignalCode === selectType.code) {
routes.push(elem);
routes.push(elem)
}
});
return routes;
})
return routes
},
//
arrangementRoute() {
commitOperate(menuOperate.Signal.arrangementRoute, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeSelection.doShow(operate, this.selected, this.getRouteList(this.selected));
this.$refs.routeSelection.doShow(operate, this.selected, this.getRouteList(this.selected))
}
});
})
},
//
cancelTrainRoute() {
commitOperate(menuOperate.Signal.cancelTrainRoute, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(operate, this.selected)
}
});
})
},
//
lock() {
commitOperate(menuOperate.Signal.lock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeLock.doShow(operate, this.selected);
this.$refs.routeLock.doShow(operate, this.selected)
}
});
})
},
//
unlock() {
commitOperate(menuOperate.Signal.unlock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeCmdControl.doShow(operate, this.selected);
this.$refs.routeCmdControl.doShow(operate, this.selected)
}
});
})
},
//
reopenSignal() {
commitOperate(menuOperate.Signal.reopenSignal, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(operate, this.selected)
}
});
})
},
//
guide() {
commitOperate(menuOperate.Signal.guide, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeCmdControl.doShow(operate, this.selected);
this.$refs.routeCmdControl.doShow(operate, this.selected)
}
});
})
},
//
setAutoInterlock() {
commitOperate(menuOperate.Signal.setAutoInterlock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(operate, this.selected)
}
});
})
},
//
cancelAutoInterlock() {
commitOperate(menuOperate.Signal.cancelAutoInterlock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(operate, this.selected)
}
});
})
},
//
setAutoTrigger() {
commitOperate(menuOperate.Signal.setAutoTrigger, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(operate, this.selected)
}
});
})
},
//
cancelAutoTrigger() {
commitOperate(menuOperate.Signal.cancelAutoTrigger, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(operate, this.selected)
}
});
})
},
//
signalClose() {
commitOperate(menuOperate.Signal.signalClose, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected);
this.$refs.routeControl.doShow(operate, this.selected)
}
});
})
},
// ()
humanControl() {
commitOperate(menuOperate.Signal.humanControl, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected));
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected))
}
});
})
},
// ATS
atsAutoControl() {
commitOperate(menuOperate.Signal.atsAutoControl, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected));
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected))
}
});
})
},
//
detail() {
commitOperate(menuOperate.Signal.detail, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeDetail.doShow(operate, this.selected, this.getRouteList(this.selected));
this.$refs.routeDetail.doShow(operate, this.selected, this.getRouteList(this.selected))
}
});
})
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
this.$store.dispatch('training/setTriggerFaultCount', this.selected)
},
//
guide() {
commitOperate(menuOperate.Signal.guide, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeCmdControl.doShow(operate, this.selected)
}
})
},
//
setAutoInterlock() {
commitOperate(menuOperate.Signal.setAutoInterlock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected)
}
})
},
//
cancelAutoInterlock() {
commitOperate(menuOperate.Signal.cancelAutoInterlock, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected)
}
})
},
//
setAutoTrigger() {
commitOperate(menuOperate.Signal.setAutoTrigger, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected)
}
})
},
//
cancelAutoTrigger() {
commitOperate(menuOperate.Signal.cancelAutoTrigger, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected)
}
})
},
//
signalClose() {
commitOperate(menuOperate.Signal.signalClose, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeControl.doShow(operate, this.selected)
}
})
},
// ()
humanControl() {
commitOperate(menuOperate.Signal.humanControl, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected))
}
})
},
// ATS
atsAutoControl() {
commitOperate(menuOperate.Signal.atsAutoControl, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected))
}
})
},
//
detail() {
commitOperate(menuOperate.Signal.detail, { signalCode: this.selected.code }, 0).then(({ valid, operate }) => {
if (valid) {
this.$refs.routeDetail.doShow(operate, this.selected, this.getRouteList(this.selected))
}
})
},
triggerFaultManagement() {
this.$store.dispatch('training/setTriggerFaultCount', this.selected)
},
},
};
}
</script>