地图高级数据停站时间

This commit is contained in:
fan 2020-04-20 09:57:00 +08:00
parent c13624b60a
commit ed26ff34d9
10 changed files with 711 additions and 90 deletions

View File

@ -536,4 +536,42 @@ export function getFlankProtectionList(mapId, params) {
params params
}); });
} }
/** 创建车站区段停站时间 */
export function createStationParkTime(data) {
return request({
url: `/api/mapBuild/stationParkTime`,
method: 'post',
data
});
}
/** 删除车站区段停站时间 */
export function deleteStationParkTime(stationParkTimeId) {
return request({
url: `/api/mapBuild/stationParkTime/${stationParkTimeId}`,
method: 'delete'
});
}
/** 获取车站区段停站时间 */
export function getStationParkTime(stationParkTimeId, params) {
return request({
url: `/api/mapBuild/stationParkTime/${stationParkTimeId}`,
method: 'get',
params
});
}
/** 更新车站区段停站时间 */
export function updateStationParkTime(data) {
return request({
url: `/api/mapBuild/stationParkTime/${data.id}`,
method: 'get',
data
});
}
/** 分页获取车站区段停站时间 */
export function getStationParkTimeList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/stationParkTime`,
method: 'get',
params
});
}

View File

@ -234,5 +234,9 @@ export default {
mapSortSuccessfully: 'Map sort successfully', mapSortSuccessfully: 'Map sort successfully',
mapSortFailed: 'Map sort failed', mapSortFailed: 'Map sort failed',
enterTrainingRoomFailed: 'Failed to enter the comprehensive drill, please consult the administrator is still in the room!', enterTrainingRoomFailed: 'Failed to enter the comprehensive drill, please consult the administrator is still in the room!',
failedToAddNewRoom: 'Failed to add new room' failedToAddNewRoom: 'Failed to add new room',
dwellTimeSuccessful: 'Create dwell time successful!',
dwellTimeFailed: 'Failed to create dwell time!',
updateDwellTimeSuccessful: 'Update dwell time successful!',
updateDwellTimeFailed: 'Failed to update dwell time!'
}; };

View File

@ -234,5 +234,9 @@ export default {
mapSortSuccessfully: '地图排序成功!', mapSortSuccessfully: '地图排序成功!',
mapSortFailed: '地图排序失败!', mapSortFailed: '地图排序失败!',
enterTrainingRoomFailed: '进入综合演练失败,请咨询管理员是否还在房间内!', enterTrainingRoomFailed: '进入综合演练失败,请咨询管理员是否还在房间内!',
failedToAddNewRoom: '加入新房间失败' failedToAddNewRoom: '加入新房间失败',
dwellTimeSuccessful: '创建停站时间成功!',
dwellTimeFailed: '创建停站时间失败!',
updateDwellTimeSuccessful: '更新停站时间成功!',
updateDwellTimeFailed: '更新停站时间失败!'
}; };

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康 BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -0,0 +1,201 @@
<template>
<el-dialog v-dialogDrag class="autoSignal" :title="$t('map.automaticSignalList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getStationParkTimeList, deleteStationParkTime, getStationParkTime } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
code: {
type: 'text',
label: this.$t('map.autoSignalCode'),
config: {
data: []
}
},
signalCode: {
type: 'select',
label: this.$t('map.signal'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '停站车站',
prop: 'stationCode',
type: 'tag',
columnValue: (row) => { return this.formatName(row.stationCode); },
tagType: (row) => { return ''; }
},
{
title: '停站时间',
prop: 'parkingTimeVOList',
type: 'tagMore',
columnValue: (row) => { return this.handelParkingTime(row.parkingTimeVOList); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.editObj
},
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
}
]
}
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList',
'signalList',
'stationStandList'
])
},
watch: {
signalList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].uniqueName, value: val[i].code });
}
this.queryForm.queryObject.signalCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
handelParkingTime(parkingTimeVOList) {
const nameList = [];
parkingTimeVOList.forEach(item => {
nameList.push(`${this.formatName(item.sectionCode)}(${item.parkingTime}s)`);
});
return nameList;
},
doClose() {
this.show = false;
},
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
name = device.uniqueName || device.name;
}
console.log(code, name, device);
return name;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getStationParkTimeList(this.mapInfo.id, params);
}
},
acquireMapList() {
//
listMap({ drawWay:true}).then(response => {
this.mapList = response.data;
});
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
elem.code = elem.signalCode;
elem.signalCode = that.formatName(elem.signalCode);
});
}
}
return data;
},
editObj(index, row) {
getStationParkTime(row.id).then(response => {
const data = response.data;
this.$emit('autoMaticoSelected', data);
this.doClose();
});
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
deleteStationParkTime(row.id).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('map.failDelete'));
});
}
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>
<style lang="scss">
.autoSignal .el-dialog__body {
padding: 0px 20px 10px 20px;
color: #606266;
font-size: 14px;
}
.autoSignal .el-dialog{
margin-top: 5vh !important;
}
</style>

View File

@ -0,0 +1,259 @@
<template>
<div style="height: 100%;">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="80px" size="mini">
<div class="definition">
<el-form-item label="停站车站" prop="stationCode">
<el-select v-model="addModel.stationCode" clearable :filterable="true">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'parkStationCode' ? 'danger' : 'primary'"
@click="hover('parkStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="停站时间:" prop="parkingTimeVOList">
<div style="margin-left: 10px; margin-top: 15px;">
<span style="text-align:right;vertical-align:middle;font-size:14px;color:#606266;font-weight: 700;">停站区段:</span>
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'parkSection' ? 'danger' : 'primary'"
@click="hover('parkSection')"
>{{ $t('map.activate') }}</el-button>
</div>
<div style="margin-left: 10px; margin-top: 15px; margin-bottom: 15px;">
<span style="text-align:right;vertical-align:middle;font-size:14px;color:#606266;font-weight: 700;">停站时间:</span>
<el-input-number v-model="parkingTime" controls-position="right" :min="0" /><span>(s)</span>
<el-button
type="primary"
style="position: absolute; right: 10px;"
@click="pushSection(addModel.parkingTimeVOList, {sectionCode: sectionCode, parkingTime:parkingTime})"
>
{{ $t('map.add') }}
</el-button>
</div>
<el-table :data="addModel.parkingTimeVOList" border style="width: 97%">
<el-table-column prop="sectionCode" label="停车区段">
<template slot-scope="scope">
<span>{{ formatName(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="parkingTime" label="停车时间">
<template slot-scope="scope">
<span>{{ scope.row.parkingTime }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSection(addModel.routingSectionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
</el-button>
</el-button-group>
</el-form-item>
</div>
</el-form>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { createStationParkTime, updateStationParkTime } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/utils/runPlan';
export default {
name: 'RouteOperation',
props: {
selected: {
type: Object,
default() {
return null;
}
},
mapInfo: {
type: Object,
default() {
return null;
}
},
routeData: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
ViewMode: ViewMode,
field: '',
isSave: true,
loading: false,
sectionCode: '',
parkingTime: 0,
addModel: {
id: '',
code: '',
mapId: '',
stationCode: '',
parkingTimeVOList: []
},
editShow: false,
rules: {
signalCode: [
{ required: true, message: this.$t('map.pleaseSelectSignal'), trigger: 'change' }
]
// sectionList: [
// { required: true, message: this.$t('map.triggerSegmentData'), trigger: 'change' }
// ]
}
};
},
computed: {
...mapGetters('map', [
'sectionList',
'stationList'
]),
filtersectionList() {
return this.sectionList.filter(section=>{
return section.type == '01' || section.type == '03';
});
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
routeData(val, old) {
if (val) {
this.addModel = val;
if (val.parkingTimeVOList.length) {
this.sectionCode = val.parkingTimeVOList[0].sectionCode;
this.parkingTime = val.parkingTimeVOList[0].parkingTime;
}
this.editShow = true;
}
}
},
mounted() {
},
methods: {
hover(field) {
this.field = field === this.field ? '' : field;
},
formatName(code) {
return formatName(code);
},
pushSection(list, data) {
list.push(data);
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'parkStationCode'.toUpperCase()) {
this.addModel.stationCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'parkSection'.toUpperCase()) {
this.sectionCode = selected.code;
}
}
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
if (code) { model['code'] = code; }
model['mapId'] = this.mapInfo.id;
model['id'] = this.addModel.id;
return model;
},
save() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
createStationParkTime(this.buildModel(setUID('dwellTime'))).then(resp => {
this.$message.success(this.$t('tip.dwellTimeSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.dwellTimeFailed'));
this.loading = false;
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
updateStationParkTime(this.buildModel()).then(resp => {
this.$message.success(this.$t('tip.updateDwellTimeSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.updateDwellTimeFailed'));
this.loading = false;
});
}
});
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id;
this.addModel.stationCode = '';
this.addModel.parkingTimeVOList = [];
this.sectionCode = '';
this.parkingTime = 0;
this.addModel.code = '';
this.isSave = true;
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-radio {
margin-right: 10px;
}
/deep/ {
.el-select .el-tag {
height: auto;
display: flex;
align-items: center;
justify-content: center;
padding-right: 15px;
box-sizing: border-box;
white-space: normal;
}
.el-input__suffix{
right: 2px;
}
}
</style>

View File

@ -0,0 +1,87 @@
<template>
<div style="height: 100%;">
<dwell-time-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
/>
<dwell-time-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" />
</div>
</template>
<script>
import DwellTimeDraft from './dwellTime';
import DwellTimeDetail from './detail';
export default {
name: 'DwellTimeOperate',
components: {
DwellTimeDraft,
DwellTimeDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
enabledTab: 'Route',
routeData: null
};
},
methods: {
clickEvent(e, model) {
this.onSelect(model);
},
onSelect(model) {
if (model) {
this.selected = model;
} else {
this.selected = null;
}
},
setDelayUnlockStatus(data, status) {
if (data && data.delayShowList) {
data.delayShowList.forEach(elem => {
elem.status = status;
});
}
},
autoMaticoSelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false;
}
},
previewRouteEvent: function () {
if (this.$refs && this.$refs.routeDetail) {
this.$refs.routeDetail.doShow();
}
},
deleteSection(list, index) {
list.splice(index, 1);
},
createRouteEvent: function () {
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.clear();
}
},
setSelected(selected) {
this.$refs.routeEdit.setSelected(selected);
},
setCenter(code) {
this.$emit('setCenter', code);
}
}
};
</script>

View File

@ -69,6 +69,14 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="停站时间" class="tab_pane_box" name="dwellTime">
<dwell-time-operate
ref="dwellTimeOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div> </div>
@ -84,6 +92,7 @@ import RunLevelOperate from './runLeveloperate/index';
import SignalOperate from './signaloperate/index'; import SignalOperate from './signaloperate/index';
import TurnedOperate from './turnedoperate/index'; import TurnedOperate from './turnedoperate/index';
import FlankProtectOperate from './flankProtectOperate/index'; import FlankProtectOperate from './flankProtectOperate/index';
import DwellTimeOperate from './dwellTimeOperate/index';
export default { export default {
name: 'DataRelation', name: 'DataRelation',
@ -95,7 +104,8 @@ export default {
FlankProtectOperate, FlankProtectOperate,
// PathOperate, // PathOperate,
SignalOperate, SignalOperate,
TurnedOperate TurnedOperate,
DwellTimeOperate
}, },
props: { props: {
selected: { selected: {
@ -120,7 +130,8 @@ export default {
signal: 'signalOperate', signal: 'signalOperate',
runLevel: 'runLevelOperate', runLevel: 'runLevelOperate',
turned: 'turnedOperate', turned: 'turnedOperate',
flankProtect: 'flankProtectOperate' flankProtect: 'flankProtectOperate',
dwellTime: 'dwellTimeOperate'
} }
}; };
}, },

View File

@ -87,10 +87,10 @@ export default {
}, },
{ {
title: this.$t('map.routingDirection'), title: this.$t('map.routingDirection'),
prop: 'directionCode', prop: 'right',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.directionCode, 'DirectionCodeList'); }, columnValue: (row) => { if (row.right) { return '右行'; } else { return '左行'; } },
tagType: (row) => { if (row.directionCode === '0') { return 'primary'; } else { return 'success'; } } tagType: (row) => { if (row.right) { return 'primary'; } else { return 'success'; } }
}, },
{ {
title: this.$t('map.destination'), title: this.$t('map.destination'),
@ -98,17 +98,14 @@ export default {
}, },
{ {
title: this.$t('map.remarks'), title: this.$t('map.remarks'),
prop: 'remarks' prop: 'description'
}, },
{ {
type: 'button',
title: this.$t('map.sectionData'), title: this.$t('map.sectionData'),
buttons: [ prop: 'parkSectionCodeList',
{ type: 'tagMore',
name: this.$t('map.preview'), columnValue: (row) => { return this.handlerParkSectionCodeList(row.parkSectionCodeList); },
handleClick: this.sectionDetail tagType: 'primary'
}
]
}, },
{ {
type: 'button', type: 'button',
@ -159,6 +156,15 @@ export default {
doClose() { doClose() {
this.show = false; this.show = false;
}, },
handlerParkSectionCodeList(parkSectionCodeList) {
const nameList = [];
this.sectionList.forEach(item => {
if (parkSectionCodeList.includes(item.code)) {
nameList.push(item.name);
}
});
return nameList;
},
formatName(code) { formatName(code) {
let name = ''; let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code); const device = this.$store.getters['map/getDeviceByCode'](code);
@ -223,10 +229,10 @@ export default {
const fieldList = { const fieldList = {
id: row.id, id: row.id,
mapId: this.$route.params.mapId, mapId: this.$route.params.mapId,
title: '区段列表', title: '',
name: row.name, name: row.name,
model: { model: {
field: 'routingSectionList', field: 'parkSectionCodeList',
items: [ items: [
{ prop: 'stationCode', label: this.$t('map.stationCodeClomn'), type: 'text' }, { prop: 'stationCode', label: this.$t('map.stationCodeClomn'), type: 'text' },
{ {

View File

@ -66,7 +66,7 @@
<el-input v-model="addModel.destinationCode" /> <el-input v-model="addModel.destinationCode" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.routingDirection')" prop="directionCode"> <el-form-item :label="$t('map.routingDirection')" prop="directionCode">
<el-select v-model="addModel.directionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')"> <el-select v-model="addModel.right" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option <el-option
v-for="item in DirectionCodeList" v-for="item in DirectionCodeList"
:key="item.value" :key="item.value"
@ -75,68 +75,79 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.remarksColon')" prop="remarks"> <el-form-item :label="$t('map.remarksColon')" prop="description">
<el-input v-model="addModel.remarks" 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="routingSectionList"> <el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList">
<div> <el-select v-model="addModel.parkSectionCodeList" multiple>
<el-select v-model="stationCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')"> <el-option
<el-option v-for="item in sectionList"
v-for="item in filterStationList" :key="item.code"
:key="item.code" :label="`${item.name}(${item.code})`"
:label="`${item.name}(${item.code})`" :value="item.code"
:value="item.code" />
/> </el-select>
</el-select> <el-button :type=" field === 'routingSection' ? 'danger' : 'primary'" @click="hover('routingSection')">{{ $t('map.activate') }}</el-button>
<el-button
:type="field === 'routingStation' ? 'danger' : 'primary'"
@click="hover('routingStation')"
>{{ $t('map.activate') }}</el-button>
</div>
<div>
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<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-button
type="primary"
@click="pushSection(addModel.routingSectionList, {stationCode: stationCode, sectionCode: sectionCode})"
>
{{ $t('map.add') }}
</el-button>
</div>
<el-table :data="addModel.routingSectionList" border style="width: 97%">
<el-table-column prop="sectionCode" :label="$t('map.stationName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.stationCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="$t('map.sectionName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSection(addModel.routingSectionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item> </el-form-item>
<!--<el-form-item :label="$t('map.trafficSegmentData')" prop="routingSectionList">-->
<!--<div>-->
<!--<el-select v-model="stationCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">-->
<!--<el-option-->
<!--v-for="item in filterStationList"-->
<!--:key="item.code"-->
<!--:label="`${item.name}(${item.code})`"-->
<!--:value="item.code"-->
<!--/>-->
<!--</el-select>-->
<!--<el-button-->
<!--:type="field === 'routingStation' ? 'danger' : 'primary'"-->
<!--@click="hover('routingStation')"-->
<!--&gt;{{ $t('map.activate') }}</el-button>-->
<!--</div>-->
<!--<div>-->
<!--<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">-->
<!--<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')"-->
<!--&gt;{{ $t('map.activate') }}</el-button>-->
<!--<el-button-->
<!--type="primary"-->
<!--@click="pushSection(addModel.routingSectionList, {stationCode: stationCode, sectionCode: sectionCode})"-->
<!--&gt;-->
<!--{{ $t('map.add') }}-->
<!--</el-button>-->
<!--</div>-->
<!--<el-table :data="addModel.routingSectionList" border style="width: 97%">-->
<!--<el-table-column prop="sectionCode" :label="$t('map.stationName')">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ formatName(scope.row.stationCode) }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column prop="sectionCode" :label="$t('map.sectionName')">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ formatName(scope.row.sectionCode) }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column fixed="right" :label="$t('map.operation')" width="50">-->
<!--<template slot-scope="scope">-->
<!--<el-button-->
<!--type="text"-->
<!--size="small"-->
<!--@click.native.prevent="deleteSection(addModel.routingSectionList, scope.$index)"-->
<!--&gt;-->
<!--{{ $t('map.remove') }}-->
<!--</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>-->
<!--</el-form-item>-->
<el-form-item> <el-form-item>
<el-button-group> <el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }} <el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
@ -188,19 +199,19 @@ export default {
sectionCode: '', sectionCode: '',
isSave: true, isSave: true,
loading: false, loading: false,
DirectionCodeList: this.$ConstSelect.DirectionCodeList, DirectionCodeList: [{label: '右行', value: true}, {label: '左行', value: false}],
addModel: { addModel: {
name: '', name: '',
mapId: '', mapId: '',
code: '', code: '',
directionCode: '', right: true,
destinationCode: '', destinationCode: '',
startStationCode: '', startStationCode: '',
startSectionCode: '', startSectionCode: '',
endStationCode: '', endStationCode: '',
endSectionCode: '', endSectionCode: '',
remarks: '', description: '',
routingSectionList: [] parkSectionCodeList: []
}, },
editShow: false, editShow: false,
rules: { rules: {
@ -293,7 +304,7 @@ export default {
this.addModel.endSectionCode = selected.code; this.addModel.endSectionCode = selected.code;
this.addModel.destinationCode = selected.destinationCode || ''; this.addModel.destinationCode = selected.destinationCode || '';
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingSection'.toUpperCase()) { } else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingSection'.toUpperCase()) {
this.sectionCode = selected.code; this.addModel.parkSectionCodeList.push(selected.code);
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() == 'routingStation'.toUpperCase()) { } else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() == 'routingStation'.toUpperCase()) {
this.stationCode = selected.code; this.stationCode = selected.code;
} }
@ -313,9 +324,9 @@ export default {
list.splice(index, 1); list.splice(index, 1);
}, },
buildModel(code) { buildModel(code) {
this.addModel.routingSectionList.forEach((elem, index) => { // this.addModel.routingSectionList.forEach((elem, index) => {
elem['orderNum'] = index + 1; // 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;
@ -360,7 +371,7 @@ export default {
delete this.addModel.id; delete this.addModel.id;
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id; this.addModel.mapId = this.mapInfo.id;
this.addModel.routingSectionList = []; this.addModel.parkSectionCodeList = [];
this.addModel.code = ''; this.addModel.code = '';
this.stationCode = ''; this.stationCode = '';
this.sectionCode = ''; this.sectionCode = '';