新版绘图 交路代码调整

This commit is contained in:
joylink_cuiweidong 2020-04-30 15:16:20 +08:00
parent 3f942518f1
commit 2f8832be83

View File

@ -7,7 +7,7 @@
<el-input v-model="addModel.name" /> <el-input v-model="addModel.name" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.startStationCodeColon')" prop="startStationCode"> <el-form-item :label="$t('map.startStationCodeColon')" prop="startStationCode">
<el-select v-model="addModel.startStationCode" clearable :filterable="true" @change="changeStartStation()"> <el-select v-model="addModel.startStationCode" clearable :filterable="true" @change="changeStartStation">
<el-option <el-option
v-for="item in filterStationList" v-for="item in filterStationList"
:key="item.code" :key="item.code"
@ -21,7 +21,7 @@
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.startSectionColon')" prop="startSectionCode"> <el-form-item :label="$t('map.startSectionColon')" prop="startSectionCode">
<el-select v-model="addModel.startSectionCode" clearable :filterable="true" :disabled="editShow" @change="changeStartSection()"> <el-select v-model="addModel.startSectionCode" clearable :filterable="true" :disabled="editShow" @change="changeStartSection">
<el-option <el-option
v-for="item in filterSectionList" v-for="item in filterSectionList"
:key="item.code" :key="item.code"
@ -36,7 +36,7 @@
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.endStationColon')" prop="endStationCode"> <el-form-item :label="$t('map.endStationColon')" prop="endStationCode">
<el-select v-model="addModel.endStationCode" clearable :filterable="true" :disabled="!isStartSelected" @change="changeEndStation()"> <el-select v-model="addModel.endStationCode" clearable :filterable="true" :disabled="!isStartSelected" @change="changeEndStation">
<el-option <el-option
v-for="item in filterStationList" v-for="item in filterStationList"
:key="item.code" :key="item.code"
@ -51,7 +51,7 @@
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.endSectionColon')" prop="endSectionCode"> <el-form-item :label="$t('map.endSectionColon')" prop="endSectionCode">
<el-select v-model="addModel.endSectionCode" clearable :filterable="true" :disabled="editShow || !isStartSelected" @change="changeEndSection()"> <el-select v-model="addModel.endSectionCode" clearable :filterable="true" :disabled="editShow || !isStartSelected" @change="changeEndSection">
<el-option <el-option
v-for="item in filterSectionList" v-for="item in filterSectionList"
:key="item.code" :key="item.code"
@ -81,17 +81,6 @@
<el-form-item :label="$t('map.remarksColon')" prop="description"> <el-form-item :label="$t('map.remarksColon')" prop="description">
<el-input v-model="addModel.description" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" /> <el-input v-model="addModel.description" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" />
</el-form-item> </el-form-item>
<!--<el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList">-->
<!--<el-select v-model="addModel.parkSectionCodeList" multiple>-->
<!--<el-option-->
<!--v-for="item in sectionList"-->
<!--:key="item.code"-->
<!--:label="`${item.name}(${item.code})`"-->
<!--:value="item.code"-->
<!--/>-->
<!--</el-select>-->
<!--<el-button :type=" field === 'routingSection' ? 'danger' : 'primary'" @click="hover('routingSection')">{{ $t('map.activate') }}</el-button>-->
<!--</el-form-item>-->
<el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList"> <el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList">
<el-button type="primary" size="small" :loading="generating" style="margin-bottom:10px" @click.native.prevent="generateParkSection">生成交路区段</el-button> <el-button type="primary" size="small" :loading="generating" style="margin-bottom:10px" @click.native.prevent="generateParkSection">生成交路区段</el-button>
<el-table <el-table
@ -236,9 +225,9 @@ export default {
name: [ name: [
{ required: true, message: '请输入交路名称', trigger: 'change' } { required: true, message: '请输入交路名称', trigger: 'change' }
], ],
destinationCode: [ // destinationCode: [
{ required: true, message: '请输入目的地码', trigger: 'change' } // { required: true, message: '', trigger: 'change' }
], // ],
startStationCode: [ startStationCode: [
{ required: true, message: '请选择起始站', trigger: 'change' } { required: true, message: '请选择起始站', trigger: 'change' }
], ],
@ -342,7 +331,11 @@ export default {
this.judgeAllowSelected(); this.judgeAllowSelected();
this.addStartSectionData(true); this.addStartSectionData(true);
}, },
changeStartSection() { changeStartSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.startStationCode = section.belongStation;
}
this.judgeAllowSelected(); this.judgeAllowSelected();
this.addStartSectionData(false); this.addStartSectionData(false);
}, },
@ -350,7 +343,11 @@ export default {
this.judgeAllowSelected(); this.judgeAllowSelected();
this.addEndSectionData(true); this.addEndSectionData(true);
}, },
changeEndSection() { changeEndSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.startStationCode = section.belongStation;
}
this.judgeAllowSelected(); this.judgeAllowSelected();
this.addEndSectionData(false); this.addEndSectionData(false);
}, },
@ -390,6 +387,9 @@ export default {
this.addEndSectionData(true); this.addEndSectionData(true);
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) { } else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) {
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) { if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
if (selected.belongStation) {
this.addModel.startStationCode = selected.belongStation;
}
this.addModel.startSectionCode = selected.code; this.addModel.startSectionCode = selected.code;
this.judgeAllowSelected(); this.judgeAllowSelected();
this.addStartSectionData(false); this.addStartSectionData(false);
@ -399,6 +399,9 @@ export default {
} }
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) { } else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) {
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) { if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
if (selected.belongStation) {
this.addModel.startStationCode = selected.belongStation;
}
this.addModel.endSectionCode = selected.code; this.addModel.endSectionCode = selected.code;
this.judgeAllowSelected(); this.judgeAllowSelected();
this.addEndSectionData(false); this.addEndSectionData(false);
@ -495,13 +498,8 @@ export default {
list.splice(index, 1); list.splice(index, 1);
}, },
buildModel(code) { buildModel(code) {
// this.addModel.routingSectionList.forEach((elem, index) => {
// elem['orderNum'] = index + 1;
// });
const model = Object.assign({}, this.addModel); const model = Object.assign({}, this.addModel);
model['mapId'] = this.mapInfo.id; model['mapId'] = this.mapInfo.id;
if (code) { model['code'] = code; } if (code) { model['code'] = code; }
return model; return model;
}, },