|
@@ -22,15 +22,15 @@
|
|
|
<div
|
|
|
class="ssc_main_mapList_showList"
|
|
|
:id="'map' + index"
|
|
|
- v-for="(mapIndex, index) in checkedCities"
|
|
|
- :key="index"
|
|
|
+ v-for="(item, index) in sortBaseMap"
|
|
|
+ :key="item.id"
|
|
|
:style="mapListBoxStyle()"
|
|
|
@mouseover="changeMouseOverIndex(index)"
|
|
|
>
|
|
|
- <span>{{ mapList[mapIndex].mapName }}</span>
|
|
|
+ <span>{{ item.mapName }}</span>
|
|
|
<Map
|
|
|
ref="mapBox"
|
|
|
- :mapUrl="mapList[mapIndex].mapUrl"
|
|
|
+ :mapUrl="item.mapUrl"
|
|
|
:index="index"
|
|
|
:mouseIndex="mouseIndex"
|
|
|
:centerZoom="centerZoom"
|
|
@@ -116,6 +116,7 @@ export default {
|
|
|
components: { Map },
|
|
|
data() {
|
|
|
return {
|
|
|
+ sortBaseMap: [],
|
|
|
doPrintLoading: false,
|
|
|
// 同屏对比弹窗显示状态
|
|
|
dialogVisible: false,
|
|
@@ -168,28 +169,36 @@ export default {
|
|
|
methods: {
|
|
|
// 获取地图底图服务
|
|
|
getBaseMap() {
|
|
|
- this.mapList = [];
|
|
|
+ map2DViewer.baseMapCollection = [];
|
|
|
let params = new FormData();
|
|
|
- params = {
|
|
|
- columnId: 35,
|
|
|
- states: "3",
|
|
|
- pageSize: 30,
|
|
|
- page: 0,
|
|
|
- };
|
|
|
+ params.append("columnId", 35);
|
|
|
+ params.append("states", 3);
|
|
|
+ params.append("pageSize", 30);
|
|
|
+ params.append("page", 0);
|
|
|
let sortparam = [{ field: "c_year", orderByType: 1 }];
|
|
|
- params.orderBy = JSON.stringify(sortparam);
|
|
|
+ params.append("orderBy", JSON.stringify(sortparam));
|
|
|
this.$Post(this.urlsCollection.selectContentList, params).then((res) => {
|
|
|
if (res.code === 200 && res.content.data.length > 0) {
|
|
|
let data = res.content.data;
|
|
|
data.forEach((v) => {
|
|
|
- this.mapList.unshift({
|
|
|
+ map2DViewer.baseMapCollection.unshift({
|
|
|
mapName: v.title,
|
|
|
mapUrl:
|
|
|
v.c_url +
|
|
|
"?AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM",
|
|
|
active: v.c_defined_show ? v.c_defined_show : false,
|
|
|
+ basemapType: v.basemap,
|
|
|
+ year: v.c_year,
|
|
|
});
|
|
|
});
|
|
|
+ this.mapList = map2DViewer.baseMapCollection.map((v) => {
|
|
|
+ return {
|
|
|
+ mapName: v.mapName,
|
|
|
+ mapUrl: v.mapUrl,
|
|
|
+ active: v.active,
|
|
|
+ year: v.year,
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -209,7 +218,9 @@ export default {
|
|
|
zoom: mapZoom,
|
|
|
};
|
|
|
}
|
|
|
- this.handleCheckedCitiesChange();
|
|
|
+ setTimeout(() => {
|
|
|
+ this.handleCheckedCitiesChange();
|
|
|
+ }, 1000);
|
|
|
},
|
|
|
// 弹窗关闭询问
|
|
|
handleClose() {
|
|
@@ -359,15 +370,27 @@ export default {
|
|
|
document.body.removeChild(new_iframe);
|
|
|
},
|
|
|
// 修改选中地图
|
|
|
- handleCheckedCitiesChange(e) {
|
|
|
+ handleCheckedCitiesChange() {
|
|
|
+ this.sortBaseMap = this.checkedCities.map((v) => {
|
|
|
+ return {
|
|
|
+ id: v,
|
|
|
+ mapUrl: this.mapList[v].mapUrl,
|
|
|
+ mapName: this.mapList[v].mapName,
|
|
|
+ year: this.mapList[v].year,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ let newSortBaseMap = this.sortBaseMap.sort((a, b) => {
|
|
|
+ return a.year - b.year;
|
|
|
+ });
|
|
|
setTimeout(() => {
|
|
|
- this.checkedCities.forEach((item, index) => {
|
|
|
+ // 修改地图尺寸
|
|
|
+ newSortBaseMap.forEach((item, index) => {
|
|
|
this.$refs["mapBox"][index].$nextTick(() => {
|
|
|
this.$refs["mapBox"][index].changeMapSize();
|
|
|
this.$refs["mapBox"][index].addSinglePolygon(false);
|
|
|
});
|
|
|
});
|
|
|
- }, 300);
|
|
|
+ }, 1000);
|
|
|
},
|
|
|
// 根据地图列表,返回合适的样式
|
|
|
mapListBoxStyle() {
|