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

页面修改

parent 13577256
......@@ -17,9 +17,9 @@
@change="getColorStr"></el-color-picker>
<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;"
@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;"
@click="operateCity(x, index, 0)"></i>
@click="operateCountry(x, index, 0)"></i>
</div>
</div>
</div>
......@@ -121,9 +121,21 @@
this.TripMapList.forEach(x => {
x.CityList.forEach(y => {
this.citiesData.forEach(z => {
if (y.MName == z.name && y.Lng) {
z.Lng = y.Lng;
z.Lat = y.Lat;
if (y.MName == z.name) {
if (y.Lat && y.Lng) {
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 @@
ConfigId: this.ConfigId
};
var trip_map_obj = document.getElementById("trip_map");
console.log("trip_map_obj", trip_map_obj);
html2Canvas(trip_map_obj).then(function (canvas) {
var image = document.createElement("a");
image.href = canvas.toDataURL("image/png");
......@@ -428,11 +439,11 @@
err => {}
);
},
//添加、删除城市
operateCity(x, index, type) {
//添加、删除国家(type=1,新增,0-删除)
operateCountry(x, index, type) {
let obj = {
CityList: [],
CityListAll: [],//国家城市下来列表
CityListAll: [], //国家城市下来列表
CityListIds: [],
NationList: x.NationList,
ColorStr: x.ColorStr,
......@@ -456,10 +467,13 @@
if (type) {
this.TripMapList.push(JSON.parse(JSON.stringify(obj)));
} else {
let MId = this.countriesData[index].MId;
this.ClearSource('curve-layer-' + MId, 1)
this.ClearSource('curve-source-' + MId, 2)
this.ClearSource('world-layer-' + MId, 1)
var currentCountry = this.countriesData[index];
if (currentCountry) {
let MId = currentCountry.MId;
this.ClearSource('curve-layer-' + MId, 1)
this.ClearSource('curve-source-' + MId, 2)
this.ClearSource('world-layer-' + MId, 1)
}
this.TripMapList.splice(index, 1);
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