This commit is contained in:
fan 2020-04-30 17:40:44 +08:00
commit 4b50306981
7 changed files with 98 additions and 9 deletions

View File

@ -299,10 +299,10 @@ export function updateRoutingData(data) {
}); });
} }
/** 根据地图起始-终点车站站台区段生成站间运行等级(新版)*/ /** 根据地图交路区段生成站间运行等级(新版)*/
export function generateStationRunData(routingId) { export function generateStationRunData(routingId) {
return request({ return request({
url: `/api/draftMap/runLevel/generate/${routingId}`, url: `/api/draftMap/runLevel/generate/routing/${routingId}`,
method: 'post' method: 'post'
}); });
} }

View File

@ -388,6 +388,14 @@ export function postGenerateLevel(data) {
}); });
} }
/** 根据地图交路一键生成生成所有站间运行等级 (新版)*/
export function generateAllStationRunData(mapId) {
return request({
url: `/api/draftMap/runLevel/generate/routing?mapId=${mapId}`,
method: 'post'
});
}
// 新建站间运行等级 // 新建站间运行等级
export function postSaveLevel(data) { export function postSaveLevel(data) {
return request({ return request({

View File

@ -259,7 +259,7 @@ export default {
}, },
generateData(index, row) { generateData(index, row) {
if (this.mapInfo && this.mapInfo.id && row) { if (this.mapInfo && this.mapInfo.id && row) {
// - //
generateStationRunData(row.id).then(response => { generateStationRunData(row.id).then(response => {
this.$message.success(this.$t('map.generateStationRunDataSuccess')); this.$message.success(this.$t('map.generateStationRunDataSuccess'));
// //

View File

@ -99,7 +99,8 @@
<span>{{ formatName(scope.row.sectionCode) }}</span> <span>{{ formatName(scope.row.sectionCode) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" :label="$t('map.operation')" width="50"> <!-- fixed="right" -->
<el-table-column :label="$t('map.operation')" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1" v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1"
@ -498,7 +499,11 @@ export default {
} }
}, },
deleteSection(list, index) { deleteSection(list, index) {
list.splice(index, 1); const data = list.splice(index, 1);
if (data.length > 0) {
const section = this.$store.getters['map/getDeviceByCode'](data[0].sectionCode);
section.instance.drawBatchSelected(section, '');
}
}, },
buildModel(code) { buildModel(code) {
const model = Object.assign({}, this.addModel); const model = Object.assign({}, this.addModel);
@ -566,4 +571,17 @@ export default {
/deep/ .el-radio { /deep/ .el-radio {
margin-right: 10px; margin-right: 10px;
} }
/deep/ .el-parkSectionCode-table table tbody tr{
td{
cursor: pointer;
}
}
/deep/ .el-table--enable-row-hover .el-table__body tr:hover>td {
background-color: rgba(0, 0, 0, 0) !important;
}
/deep/ table tbody tr.sortable-chosen{
background: #f5faf7 !important;
}
</style> </style>

View File

@ -14,7 +14,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft'; import { listMap } from '@/api/jmap/mapdraft';
import { getRunLevelList, deleteRunLevel, getRunLevelDetail } from '@/api/runplan'; import { getRunLevelList, deleteRunLevel, getRunLevelDetail, generateAllStationRunData} from '@/api/runplan';
export default { export default {
name: 'RouteDetail', name: 'RouteDetail',
@ -145,6 +145,9 @@ export default {
// } // }
] ]
} }
],
actions: [
{ text: '一键生成', handler: this.createAll }
] ]
} }
}; };
@ -220,6 +223,17 @@ export default {
} }
return data; return data;
}, },
createAll() {
//
if (this.mapInfo && this.mapInfo.id) {
generateAllStationRunData(this.mapInfo.id).then(response => {
this.$message.success('一键生成站间运行等级成功');
this.reloadTable();
}).catch((error) => {
this.$messageBox('一键生成站间运行等级失败: ' + error.message);
});
}
},
editObj(index, row) { editObj(index, row) {
getRunLevelDetail(row.id).then(response => { // id getRunLevelDetail(row.id).then(response => { // id
const data = response.data; const data = response.data;

View File

@ -11,6 +11,7 @@
</div> </div>
<div class="operation_box back_box"> <div class="operation_box back_box">
<el-button size="small" @click="backRoute">返回</el-button> <el-button size="small" @click="backRoute">返回</el-button>
<el-button size="small" @click="updateObjAxis">更新坐标</el-button>
</div> </div>
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" @onMenu="onContextmenu" /> <jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" @onMenu="onContextmenu" />
</div> </div>
@ -84,6 +85,14 @@ export default {
size: { size: {
width: document.documentElement.clientWidth - 521, width: document.documentElement.clientWidth - 521,
height: document.documentElement.clientHeight - 90 height: document.documentElement.clientHeight - 90
},
updtModel: {
code: '',
scaling: '',
origin: {
x: '',
y: ''
}
} }
}; };
}, },
@ -129,6 +138,44 @@ export default {
} }
}, },
methods: { methods: {
getMapOrigin() {
const dataZoom = this.$store.state.map.dataZoom;
if (dataZoom && dataZoom.offsetX) {
this.updtModel.origin.x = Number.parseInt(dataZoom.offsetX);
this.updtModel.origin.y = Number.parseInt(dataZoom.offsetY);
this.updtModel.scaling = dataZoom.scaleRate;
}
},
updateObjAxis() {
this.getMapOrigin();
this.$confirm('您确认按当前绘图位置更新坐标及缩放比例?', this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
const map = this.$store.state.map.map;
console.log(map, '======');
this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => {
const param = {
mapId: this.$route.params.mapId,
skinVO: {
code: this.$store.state.map.map.skinVO.code,
name: this.$store.state.map.map.skinVO.name,
origin: {
x: this.updtModel.origin.x,
y: this.updtModel.origin.y
},
scaling: this.updtModel.scaling
}
};
saveMap(Object.assign(map, param)).then(response => {
this.$message.success(this.$t('map.updateSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('map.updateFailed'));
});
});
}).catch(() => { });
},
setWindowSize() { setWindowSize() {
this.$nextTick(() => { this.$nextTick(() => {
const width = this.$store.state.app.width - 521; const width = this.$store.state.app.width - 521;
@ -549,7 +596,7 @@ export default {
.back_box{ .back_box{
left: 150px; left: 150px;
display: inline-block; display: inline-block;
width: 57px; width: 180px;
} }
.map-draft{ .map-draft{

View File

@ -3,7 +3,7 @@
<div style="height: 100%;"> <div style="height: 100%;">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="oprt1" :model="fromData" label-width="130px" size="mini" :rules="mergeRules"> <el-form ref="oprt1" :model="fromData" label-width="130px" size="mini" :rules="mergeRules">
<el-form-item label="关联区段" prop="relevanceSwitchList"> <el-form-item label="关联道岔:" prop="relevanceSwitchList">
<el-select v-model="fromData.relevanceSwitchList" filterable multiple :placeholder="$t('rules.pleaseSelect')"> <el-select v-model="fromData.relevanceSwitchList" filterable multiple :placeholder="$t('rules.pleaseSelect')">
<el-option <el-option
v-for="item in switchList" v-for="item in switchList"
@ -145,8 +145,10 @@ export default {
}); });
}, },
pushData(data) { pushData(data) {
if (!this.fromData.relevanceSwitchList.includes(data)) {
this.fromData.relevanceSwitchList.push(data); this.fromData.relevanceSwitchList.push(data);
} }
} }
}
}; };
</script> </script>