Commit 6dd0349d authored by 黄奎's avatar 黄奎

页面修改

parent 13577256
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
@change="getColorStr"></el-color-picker> @change="getColorStr"></el-color-picker>
<div style="margin-left: 5px; font-size: 23px;cursor: pointer;"> <div style="margin-left: 5px; font-size: 23px;cursor: pointer;">
<i v-if="TripMapList.length - 1 == index" class="el-icon-circle-plus" style="color: #E95252;" <i v-if="TripMapList.length - 1 == index" class="el-icon-circle-plus" style="color: #E95252;"
@click="operateCity(x, index, 1)"></i> @click="operateCountry(x, index, 1)"></i>
<i v-if="index != 0" class="el-icon-delete-solid" style="color: gray;" <i v-if="index != 0" class="el-icon-delete-solid" style="color: gray;"
@click="operateCity(x, index, 0)"></i> @click="operateCountry(x, index, 0)"></i>
</div> </div>
</div> </div>
</div> </div>
...@@ -121,9 +121,21 @@ ...@@ -121,9 +121,21 @@
this.TripMapList.forEach(x => { this.TripMapList.forEach(x => {
x.CityList.forEach(y => { x.CityList.forEach(y => {
this.citiesData.forEach(z => { this.citiesData.forEach(z => {
if (y.MName == z.name && y.Lng) { if (y.MName == z.name) {
z.Lng = y.Lng; if (y.Lat && y.Lng) {
z.Lat = y.Lat; z.Lng = y.Lng;
z.Lat = y.Lat;
} else {
var tempCity = x.CityListAll.find((cItem) => {
return cItem.ID === y.MId;
})
if (tempCity&&tempCity.Lng&&tempCity.Lat) {
z.Lng = tempCity.Lng;
z.Lat = tempCity.Lat;
z.latitude = Number(tempCity.Lat);
z.longitude = Number(tempCity.Lng);
}
}
} }
}); });
}); });
...@@ -382,7 +394,6 @@ ...@@ -382,7 +394,6 @@
ConfigId: this.ConfigId ConfigId: this.ConfigId
}; };
var trip_map_obj = document.getElementById("trip_map"); var trip_map_obj = document.getElementById("trip_map");
console.log("trip_map_obj", trip_map_obj);
html2Canvas(trip_map_obj).then(function (canvas) { html2Canvas(trip_map_obj).then(function (canvas) {
var image = document.createElement("a"); var image = document.createElement("a");
image.href = canvas.toDataURL("image/png"); image.href = canvas.toDataURL("image/png");
...@@ -428,11 +439,11 @@ ...@@ -428,11 +439,11 @@
err => {} err => {}
); );
}, },
//添加、删除城市 //添加、删除国家(type=1,新增,0-删除)
operateCity(x, index, type) { operateCountry(x, index, type) {
let obj = { let obj = {
CityList: [], CityList: [],
CityListAll: [],//国家城市下来列表 CityListAll: [], //国家城市下来列表
CityListIds: [], CityListIds: [],
NationList: x.NationList, NationList: x.NationList,
ColorStr: x.ColorStr, ColorStr: x.ColorStr,
...@@ -456,10 +467,13 @@ ...@@ -456,10 +467,13 @@
if (type) { if (type) {
this.TripMapList.push(JSON.parse(JSON.stringify(obj))); this.TripMapList.push(JSON.parse(JSON.stringify(obj)));
} else { } else {
let MId = this.countriesData[index].MId; var currentCountry = this.countriesData[index];
this.ClearSource('curve-layer-' + MId, 1) if (currentCountry) {
this.ClearSource('curve-source-' + MId, 2) let MId = currentCountry.MId;
this.ClearSource('world-layer-' + MId, 1) this.ClearSource('curve-layer-' + MId, 1)
this.ClearSource('curve-source-' + MId, 2)
this.ClearSource('world-layer-' + MId, 1)
}
this.TripMapList.splice(index, 1); this.TripMapList.splice(index, 1);
this.PostConfig.TripMapList = JSON.parse(JSON.stringify(this.TripMapList)); this.PostConfig.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment