调整佛山线路 站台操作

This commit is contained in:
zyy 2020-06-10 11:18:50 +08:00
parent c8bf7c80ef
commit e4ec3dfbde
3 changed files with 32 additions and 29 deletions

View File

@ -188,12 +188,12 @@ export default {
getLevelByTime(time) {
const times = Object.keys(this.timeList).findIndex(key => {
return this.timeList[key].findIndex(obj => {
return obj.value === time;
return obj.value == time;
}) >= 0;
}).toString();
return times == -1 ? '0' : times;
},
loadInitData(selected, opts) {
loadInitData(selected) {
this.tempData = [];
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
if (selected.direction == '01') { //
@ -201,18 +201,18 @@ export default {
if (index != 0) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(opts.intervalRunTime), time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(selected.runLevelTime), time: selected.runLevelTime ? selected.runLevelTime : 0, check: !!selected.runLevelTimeForever });
}
} else {
//
if (index != this.stationList.length) {
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(opts.intervalRunTime), time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
this.tempData.push({ name: `${stationStand.name}(${station.name})`, level: this.getLevelByTime(selected.runLevelTime), time: selected.runLevelTime ? selected.runLevelTime : 0, check: !!selected.runLevelTimeForever });
}
}
},
doShow(operate, selected, opts) {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
@ -225,7 +225,7 @@ export default {
this.stationName = station.name;
}
}
this.loadInitData(selected, opts);
this.loadInitData(selected);
}
this.dialogShow = true;
@ -249,10 +249,11 @@ export default {
},
timeSelectChange(time) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.choose.operation
operation: OperationEvent.StationStand.setRunLevel.choose.operation,
val: this.time
};
this.time = time.toString();
this.time = time;
this.isSelect = false;
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
@ -263,7 +264,8 @@ export default {
},
levelSelectChange(row) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.chooseLevel.operation
operation: OperationEvent.StationStand.setRunLevel.chooseLevel.operation,
val: row.level
};
this.time = row.time = this.timeList[row.level][0].value;
@ -277,8 +279,10 @@ export default {
},
checkChange(check) {
const operate = {
operation: OperationEvent.StationStand.setRunLevel.check.operation
operation: OperationEvent.StationStand.setRunLevel.check.operation,
val: check
};
this.isConfirm = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -299,7 +303,7 @@ export default {
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME,
param: {
runLevelTime: this.time,
runLevelTime: Number(this.time),
runLevelTimeForever: !!this.tempData[0].check
}
};

View File

@ -38,8 +38,8 @@
<span class="base-label" style="left: -9px;">有效次数</span>
<div style=" position: relative; top:-10px;">
<el-radio-group v-model="effective" :disabled="disabledTime" @change="chooseEffective">
<el-radio :id="effective === 0? '': domIdChoose2" label="0" name="effective">一次有效</el-radio>
<el-radio :id="effective === 1? '': domIdChoose2" label="1" name="effective">一直有效</el-radio>
<el-radio :id="effective == '0'? '': domIdChoose2" label="0" name="effective">一次有效</el-radio>
<el-radio :id="effective == '1'? '': domIdChoose2" label="1" name="effective">一直有效</el-radio>
</el-radio-group>
</div>
</div>
@ -128,7 +128,7 @@ export default {
});
},
methods: {
doShow(operate, selected, tempDate) {
doShow(operate, selected) {
this.selected = selected || {};
//
if (!this.dialogShow) {
@ -142,11 +142,11 @@ export default {
}
}
this.control = Number(tempDate.parkingTime) === -1 ? '01' : '02';
this.time = Number(tempDate.parkingTime) === -1 ? 15 : Number(tempDate.parkingTime);
// this.effective = tempDate.parkingValidStatus ? true : false;
this.effective = tempDate.parkingValidStatus ? '1' : '0';
this.control = Number(selected.parkingTime) == -1 ? '01' : '02';
this.effective = selected.parkingAlwaysValid ? '1' : '0';
this.direction = selected.direction;
this.time = Number(selected.parkingTime) == -1 ? 15 : Number(selected.parkingTime);
}
this.dialogShow = true;
this.$nextTick(function () {
@ -162,12 +162,13 @@ export default {
chooseControl(control) {
/** 自动时的默认时间*/
if (control == '01') {
this.inputTime = 15;
this.effective = 1;
this.time = 15;
this.effective = '1';
}
const operate = {
operation: OperationEvent.StationStand.setStopTime.choose1.operation
operation: OperationEvent.StationStand.setStopTime.choose1.operation,
val: this.control
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
@ -178,7 +179,8 @@ export default {
},
chooseEffective() {
const operate = {
operation: OperationEvent.StationStand.setStopTime.choose2.operation
operation: OperationEvent.StationStand.setStopTime.choose2.operation,
val: this.effective
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
@ -190,7 +192,8 @@ export default {
inputTime() {
const operate = {
repeat: true,
operation: OperationEvent.StationStand.setStopTime.input.operation
operation: OperationEvent.StationStand.setStopTime.input.operation,
val: this.time
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
@ -205,11 +208,9 @@ export default {
operation: OperationEvent.StationStand.setStopTime.menu.operation,
cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME,
param: {
parkingTime: this.control == '01' ? -1 : 1,
runLevelTime: this.time,
parkingTime: this.control == '01' ? -1 : this.time,
parkingAlwaysValid: this.effective == '1'
}
// messages: [`: ${this.stationName} - ${this.standName}, ${this.control == '01' ? '' : this.time + ''}, ${this.effective == false ? '' : ''}`]
};
this.loading = true;
@ -217,8 +218,6 @@ export default {
this.loading = false;
if (valid) {
this.doClose();
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.confirmControl.doShow(operate);
}
}).catch((error) => {
this.loading = false;