修复: 信号机接近区段检索后台无数据是清空之前的数据

This commit is contained in:
fan 2019-12-27 17:32:22 +08:00
parent a285d28cb3
commit e5997a5856

View File

@ -4,7 +4,7 @@
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini"> <el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
<div class="definition"> <div class="definition">
<el-form-item :label="$t('map.signalID')" prop="signalCode"> <el-form-item :label="$t('map.signalID')" prop="signalCode">
<el-select v-model="addModel.signalCode" clearable :filterable="true" @change="changeSignal"> <el-select v-model="addModel.signalCode" clearable :filterable="true">
<el-option <el-option
v-for="item in signalList" v-for="item in signalList"
:key="item.code" :key="item.code"
@ -134,6 +134,7 @@ export default {
} }
if (val) { if (val) {
this.changeSignalSelected(val, true, 'routeSignal'); this.changeSignalSelected(val, true, 'routeSignal');
this.changeSignal(val);
} }
} }
}, },
@ -158,6 +159,12 @@ export default {
if (resp.data && resp.data.list && resp.data.list.length) { if (resp.data && resp.data.list && resp.data.list.length) {
this.routeData = resp.data.list[0]; this.routeData = resp.data.list[0];
this.isSave = false; this.isSave = false;
} else {
this.addModel.id = '';
this.addModel.code = '';
this.addModel.mapId = '';
this.addModel.routeSectionList = [];
this.isSave = true;
} }
}).catch(error=> { }).catch(error=> {
console.log(error); console.log(error);