司机 ATS客户端 添加列车指令

This commit is contained in:
joylink_cuiweidong 2023-02-13 11:32:00 +08:00
parent 27a99a7013
commit ab2a68865d

View File

@ -2,18 +2,21 @@
<div> <div>
<pop-menu ref="popMenu" :menu="menu" /> <pop-menu ref="popMenu" :menu="menu" />
<set-fault ref="setFault" pop-class="fuzhou-01__systerm" /> <set-fault ref="setFault" pop-class="fuzhou-01__systerm" />
<set-train-operation ref="setTrainOperation" pop-class="fuzhou-01__systerm" />
</div> </div>
</template> </template>
<script> <script>
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import SetTrainOperation from '@/jmapNew/theme/components/menus/dialog/setTrainOperation';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
export default { export default {
name: 'MenuTrain', name: 'MenuTrain',
components: { components: {
PopMenu, PopMenu,
SetFault SetFault,
SetTrainOperation
}, },
props: { props: {
selected: { selected: {
@ -33,6 +36,39 @@ export default {
return { return {
menu:[], menu:[],
menuNormal: [ menuNormal: [
{
label: '切换驾驶模式',
children: [
{
label: '转AM-C模式',
handler: this.handlerApplyAmcMode
},
{
label: '转SM-C模式',
handler: this.handlerApplySmcMode
},
{
label: '转AM-I模式',
handler: this.handlerApplyAmiMode
},
{
label: '转SM-I模式',
handler: this.handlerApplySmiMode
},
{
label: '转RM模式',
handler: this.handlerApplyRmMode
}
]
},
{
label: '转NRM模式',
handler: this.handlerApplyNrmMode
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{ {
label: '换端', label: '换端',
handler: this.handleTurnDirection handler: this.handleTurnDirection
@ -41,6 +77,10 @@ export default {
label: '驾驶', label: '驾驶',
handler: this.handleDriveTo handler: this.handleDriveTo
}, },
{
label: '连挂',
handler: this.setLink
},
{ {
label: '回库', label: '回库',
handler: this.setInbound handler: this.setInbound
@ -86,6 +126,68 @@ export default {
} }
}); });
}, },
// NRM
handlerApplyNrmMode() {
commitOperate(menuOperate.Driver.applyNrm, { groupNumber: this.selected.code }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
// AM-C
handlerApplyAmcMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
// SM-C
handlerApplySmcMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
// AM-I
handlerApplyAmiMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handlerApplySmiMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handlerApplyRmMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
setLink() {
commitOperate(menuOperate.Common.setLink, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setTrainOperation.doShow(menuOperate.Common.setLink, this.selected, true);
}
});
},
doShow(point) { doShow(point) {
this.initMenu(); this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {