佛山有轨电车操作代码调整

This commit is contained in:
joylink_cuiweidong 2020-03-26 09:56:46 +08:00
parent 8c01b4129f
commit 9a9716e5a9
2 changed files with 25 additions and 79 deletions

View File

@ -18,7 +18,11 @@
</el-row>
<el-table ref="table" :data="tempData" border style="width: 100%; margin-top:10px" size="mini" height="120" highlight-current-row @row-click="clickEvent">
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px;" width="150px" />
<el-table-column prop="settable" label="状态" style="margin-left:30px;" width="100px" />
<el-table-column prop="settable" label="状态" style="margin-left:30px;" width="100px">
<template slot-scope="scope">
<span>{{ scope.row.settable == 1? '允许选排':'不能选排' }}</span>
</template>
</el-table-column>
<el-table-column style="margin-left:30px;" />
</el-table>
<el-row justify="center" class="button-group">
@ -56,6 +60,7 @@ export default {
display: true,
stationName: '',
signalName: '',
commitDisabled:true
};
},
computed: {
@ -73,13 +78,6 @@ export default {
},
title() {
return '进路选排';
},
commitDisabled() {
let disabled = true;
if (this.row) {
disabled = !this.row.canSetting;
}
return disabled;
}
},
mounted() {
@ -97,6 +95,7 @@ export default {
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
this.commitDisabled = true;
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
@ -166,6 +165,12 @@ export default {
operation: OperationEvent.Signal.arrangementRoute.choose.operation
};
if (this.row.settable) {
this.commitDisabled = false;
} else {
this.commitDisabled = true;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });

View File

@ -19,6 +19,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
export default {
name: 'SectionMenu',
@ -132,93 +133,33 @@ export default {
},
//
alxeFailure() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.alxeFailure.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.mouseCancelState(this.selected);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.$refs.noticeInfo.doShow(operate);
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then((data)=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
fault() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.fault.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionUnLock.doShow(operate, this.selected);
}
commitOperate(menuOperate.Section.fault, {sectionCode:this.selected.code}, 0).then((data)=>{
this.$refs.sectionUnLock.doShow(data.operate, this.selected);
});
},
//
split() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.split.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then((data)=>{
this.$refs.sectionControl.doShow(data.operate, this.selected);
});
},
//
active() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Section.active.menu.operation,
param: {
sectionCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate, this.selected);
}
commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then((data)=>{
this.$refs.sectionControl.doShow(data.operate, this.selected);
});
}
// //
// setSpeed() {
// const operate = {
// start: true,
// code: this.selected.code,
// operation: OperationEvent.Section.setSpeed.menu.operation,
// param: {
// sectionCode: this.selected.code
// }
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.speedLimitControl.doShow(operate, this.selected);
// }
// commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then((data)=>{
// this.$refs.speedLimitControl.doShow(data.operate, this.selected);
// });
// }
}