This commit is contained in:
fan 2020-12-17 13:20:47 +08:00
commit ca8da79986
3 changed files with 21 additions and 7 deletions

View File

@ -35,7 +35,7 @@ export default {
components: {
MenuBar,
MenuRequest,
MenuCancel,
// MenuCancel,
MenuSignal,
MenuSwitch,
MenuSection,

View File

@ -71,7 +71,7 @@
<div>
<el-form ref="ruleForm" label-width="100px">
<el-form-item label="客流数据:" prop="role">
<el-select v-model="currentFlowDataId" placeholder="请选择客流数据">
<el-select v-model="currentFlowDataId" placeholder="请选择客流数据" @change="changeData">
<el-option
v-for="item in flowDataList"
:key="item.id"
@ -84,7 +84,7 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="flowDataClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="confirmFlowData">{{ $t('global.confirm') }}</el-button>
<el-button type="primary" :disabled="isDisabled" :loading="loading" @click="confirmFlowData">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</div>
@ -127,7 +127,9 @@ export default {
flowDataList:[],
currentFlowDataName:'',
currentFlowDataId:'',
messageBoard: false
isDisabled:false,
loading:false,
messageBoard: false
};
},
computed:{
@ -313,13 +315,16 @@ export default {
},
confirmFlowData() {
if (this.currentFlowDataId) {
this.loading = true;
changePassengerFlowData(this.group, this.currentFlowDataId).then(res=>{
this.$store.dispatch('socket/resetTrainPassagerNum');
// this.$store.dispatch('map/mapClear');
this.flowDataShow = false;
const currentFlowData = this.flowDataList.find(each=>{ return each.id == this.currentFlowDataId; });
if (currentFlowData) { this.currentFlowDataName = currentFlowData.name; }
this.loading = false;
}).catch(error=>{
this.loading = false;
this.$messageBox('切换客流数据失败');
console.log(error.message);
});
@ -382,9 +387,18 @@ export default {
},
changeFlowData() {
this.flowDataShow = true;
this.isDisabled = true;
const currentFlowData = this.flowDataList.find(each=>{ return each.name == this.currentFlowDataName; });
if (currentFlowData) { this.currentFlowDataId = currentFlowData.id; }
},
changeData(id) {
const currentFlowData = this.flowDataList.find(each=>{ return each.id == id; });
if (currentFlowData && currentFlowData.name == this.currentFlowDataName) {
this.isDisabled = true;
} else {
this.isDisabled = false;
}
},
end() {
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {

View File

@ -110,8 +110,7 @@ export default {
deleteSection(list, index) {
const data = list.splice(index, 1);
if (data.length > 0) {
const section = this.$store.getters['map/getDeviceByCode'](data[0].sectionCode);
section.instance.drawBatchSelected(section, '');
this.setSectionColor({'sectionCode':data[0].sectionCode}, '');
}
},
hover(field) {
@ -142,6 +141,7 @@ export default {
if (!sectionState) {
this.sectionCodeList.push({'sectionCode':sectionCode, 'stationCode':stationCode});
this.setSectionColor({'sectionCode':sectionCode}, 'routingSection');
this.sectionCode = '';
} else {
this.$messageBox('一个车站只能添加一个折返区段');
}
@ -193,7 +193,7 @@ export default {
this.loading = false;
});
} else {
this.$messageBox('添加折返区段');
this.$messageBox('添加折返区段');
}
},
clear() {