修改宁波3号线 操作中的部分bug

This commit is contained in:
lVAL 2021-02-19 10:42:58 +08:00
parent 2aff2be8b4
commit b7ea10b459
3 changed files with 46 additions and 34 deletions

View File

@ -37,10 +37,10 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || speedLimitValue<=0" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || speedLimitValue<0" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdApply" type="primary" :disabled="!selected || speedLimitValue<=0" :loading="loading" @click="apply">应用(A)</el-button>
<el-button :id="domIdApply" type="primary" :disabled="!selected || speedLimitValue<0" :loading="loading" @click="apply">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -176,13 +176,15 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/setSelected', {device: val});
const sectionEle = this.$store.getters['map/getDeviceByCode'](val.code);
this.speedLimitValue = sectionEle.speedUpLimit;
if (this.speedLimitValue > 0) {
this.$refs.table2.setCurrentRow(this.limitList[this.speedLimitValue / 5 - 1]);
} else {
this.$refs.table2.setCurrentRow();
}
// const sectionEle = this.$store.getters['map/getDeviceByCode'](val.code);
// this.speedLimitValue = sectionEle.speedUpLimit;
// if (this.speedLimitValue > 0) {
// this.$refs.table2.setCurrentRow(this.limitList[this.speedLimitValue / 5 - 1]);
// } else {
// this.$refs.table2.setCurrentRow();
// }
this.$refs.table2.setCurrentRow()
this.speedLimitValue = 0;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
@ -192,15 +194,17 @@ export default {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
operation: OperationEvent.Command.common.choose1.operation,
val: val.value,
param: {speedLimitValue: val.value}
};
const step = {
operation: OperationEvent.Command.common.choose1.operation,
val: val.value,
param: {speedLimitValue: val.value}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.speedLimitValue = val.value;
this.speedLimitValue = val.value;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();

View File

@ -187,8 +187,8 @@ export default {
},
commit(isClose = true) {
const operate = {
// cmdType: this.command ? CMD.Section.CMD_SECTION_SET_LIMIT_SPEED : CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
cmdType: this.speedLimitValue ? CMD.Section.CMD_SECTION_SET_LIMIT_SPEED : CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
// cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation,
over: true,
param: {sectionCode: this.selected.code, speedLimitValue:this.speedLimitValue}

View File

@ -33,14 +33,14 @@
</div>
<div class="radio-box-title">设置位置</div>
<div class="radio-box">
<el-radio v-model="position" label="normal" :disabled="!selected" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reverse" :disabled="!selected" style="display: block;">反位</el-radio>
<el-radio v-model="position" label="normal" :disabled="!selected&&mode=='auto'" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reverse" :disabled="!selected&&mode=='auto'" style="display: block;">反位</el-radio>
</div>
<div class="radio-box-title">设置预留</div>
<div class="radio-box">
<el-radio v-model="reserved" label="auto" :disabled="true" style="display: block;margin-bottom: 10px;">自动与预留</el-radio>
<el-radio v-model="reserved" label="reversed" :disabled="true" style="display: block;margin-bottom: 10px;">预留</el-radio>
<el-radio v-model="reserved" label="release" :disabled="true" style="display: block;">释放</el-radio>
<el-radio v-model="reserved" label="auto" :disabled="!selected&&mode=='auto'" style="display: block;margin-bottom: 10px;">自动与预留</el-radio>
<el-radio v-model="reserved" label="reversed" :disabled="!selected&&mode=='auto'" style="display: block;margin-bottom: 10px;">预留</el-radio>
<el-radio v-model="reserved" label="release" :disabled="!selected&&mode=='auto'" style="display: block;">释放</el-radio>
</div>
</el-col>
</el-row>
@ -80,7 +80,7 @@ export default {
allChecked: false,
dialogShow: false,
loading: false,
mode: '',
mode: 'artificial',
position: '',
reserved: 'reversed'
@ -110,11 +110,23 @@ export default {
}
},
watch: {
mode(val) {
if (val == 'auto') {
this.position = '';
this.reserved = '';
}
},
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
'selected': function(val) {
if (val) {
const section = this.$store.getters['map/getDeviceByCode'](val.code);
this.position = section && section.normalPosition? 'reverse': 'normal';
}
}
},
methods: {
doShow(operate) {
@ -132,10 +144,12 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit(isClose = false) {
const cmd = {
normal: menuOperate.Switch.locate,
reverse: menuOperate.Switch.reverse
}[this.position];
const cmd = this.mode == 'auto'
? menuOperate.Switch.turnout
: {
normal: menuOperate.Switch.locate,
reverse: menuOperate.Switch.reverse
}[this.position];
if (cmd) {
commitOperate(cmd, {switchCode: this.selected.code}, 3).then(({valid})=>{
@ -154,13 +168,7 @@ export default {
if (!val) { return; }
commitOperate(menuOperate.Switch.turnout, {code:val.code}).then(({valid, operate})=>{
if (valid) {
const switchEle = this.$store.getters['map/getDeviceByCode'](val.code);
this.position = '';
if (switchEle.normalPosition) {
this.position = 'reverse';
} else if (switchEle.reversePosition) {
this.position = 'normal';
}
this.$store.dispatch('menuOperation/setSelected', {device: val});
}
});