Commit 9da31480 authored by 黄奎's avatar 黄奎

页面修改

parent 65b4047e
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</div> </div>
</div> </div>
<Tripmap v-if="ShowMap" :PostConfig="PostConfig" :ConfigId="ConfigId" @Cancel="ShowMap=false" <Tripmap v-if="ShowMap" :PostConfig="PostConfig" :ConfigId="ConfigId" @Cancel="ShowMap=false"
@Success="getMapImgSuccess()" @saveMsg="SaveData(1)"></Tripmap> @saveMsg="ShowMap=false,SaveData(1)"></Tripmap>
</div> </div>
<TravelNotice :class="{'showOther':TeamType==3}" ref="TravelNotice" id="fourAnchor" @headCallBack="getNotice" <TravelNotice :class="{'showOther':TeamType==3}" ref="TravelNotice" id="fourAnchor" @headCallBack="getNotice"
:subArray="NoticeParameters" :NoticeData="NoticeData" v-bind:PostConfig="PostConfig" :subArray="NoticeParameters" :NoticeData="NoticeData" v-bind:PostConfig="PostConfig"
...@@ -299,10 +299,6 @@ ...@@ -299,10 +299,6 @@
}; };
}, },
methods: { methods: {
getMapImgSuccess(path) {
this.PostConfig.MapUrl = path
this.ShowMap = false
},
/*获取行程特色内容对象*/ /*获取行程特色内容对象*/
getFeature(featureObj) { getFeature(featureObj) {
this.PostFeature = featureObj; this.PostFeature = featureObj;
......
<template> <template>
<div class="tripmap-form marginT20" v-if="PostConfig"> <div class="tripmap-form marginT20" v-if="PostConfig">
<div class="tripmap-Search" v-loading="setLoading"> <div class="tripmap-Search" v-loading="pageLoading">
<div style="display: flex;align-items: start; justify-content: space-between;"> <div style="display: flex;align-items: start; justify-content: space-between;">
<div style="display: flex;flex-wrap: wrap; flex-grow: 1;"> <div style="display: flex;flex-wrap: wrap; flex-grow: 1;">
<div v-for="(x, index) in TripMapList" :key="index" class="row-aic"> <div v-for="(x, index) in TripMapList" :key="index" class="row-aic">
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
</div> </div>
</div> </div>
<div class="row-aic" style="flex-shrink: 0;"> <div class="row-aic" style="flex-shrink: 0;">
<el-button type="danger" @click="Cancel" size="small">关闭</el-button> <el-button type="danger" key="BtnClose" @click="Cancel">关闭</el-button>
<el-button type="primary" :loading="setLoading" @click="getResultImg()" size="small">生成图片</el-button> <el-button type="primary" key="BtnCreateImg" :disabled="setLoading" @click="getResultImg()">{{btnStr}}
</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -48,6 +49,7 @@ ...@@ -48,6 +49,7 @@
data() { data() {
return { return {
setLoading: false, setLoading: false,
pageLoading: false,
TripColor: "", TripColor: "",
NationList: [], NationList: [],
searchNation: { searchNation: {
...@@ -111,7 +113,8 @@ ...@@ -111,7 +113,8 @@
"fill-opacity": 0.5 "fill-opacity": 0.5
}, },
paintRbBgList: [], paintRbBgList: [],
paintHgBgList: [] paintHgBgList: [],
btnStr: '生成图片'
}; };
}, },
watch: { watch: {
...@@ -126,16 +129,19 @@ ...@@ -126,16 +129,19 @@
z.Lng = y.Lng; z.Lng = y.Lng;
z.Lat = y.Lat; z.Lat = y.Lat;
} else { } else {
//使用系统中的经纬度
var tempCity = x.CityListAll.find((cItem) => { var tempCity = x.CityListAll.find((cItem) => {
return cItem.ID === y.MId; return cItem.ID === y.MId;
}) })
if (tempCity&&tempCity.Lng&&tempCity.Lat) { if (tempCity && tempCity.Lng && tempCity.Lat) {
z.Lng = tempCity.Lng; z.Lng = tempCity.Lng;
z.Lat = tempCity.Lat; z.Lat = tempCity.Lat;
z.latitude = Number(tempCity.Lat); z.latitude = Number(tempCity.Lat);
z.longitude = Number(tempCity.Lng); z.longitude = Number(tempCity.Lng);
} }
} }
y.Lat = z.Lat;
y.Lng = z.Lng;
} }
}); });
}); });
...@@ -322,9 +328,24 @@ ...@@ -322,9 +328,24 @@
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) {
if (y.Lat && y.Lng) {
z.Lng = y.Lng; z.Lng = y.Lng;
z.Lat = y.Lat; 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);
}
}
y.Lat = z.Lat;
y.Lng = z.Lng;
} }
}); });
}); });
...@@ -380,15 +401,11 @@ ...@@ -380,15 +401,11 @@
}); });
}); });
}, },
//保存标记坐标
SavePositionStr() {
this.PostConfig.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
this.$emit('saveMsg')
},
// 导出地图片 // 导出地图片
getResultImg() { getResultImg() {
this.btnStr = "生成中..";
this.setLoading = true; this.setLoading = true;
this.SavePositionStr(); this.pageLoading = true;
let that = this; let that = this;
var postJson = { var postJson = {
ConfigId: this.ConfigId ConfigId: this.ConfigId
...@@ -402,17 +419,19 @@ ...@@ -402,17 +419,19 @@
newArr.push(blob); newArr.push(blob);
var path = `/Upload/Temporary`; var path = `/Upload/Temporary`;
that.uploadSelfBlob(path, newArr, postJson, x => { that.uploadSelfBlob(path, newArr, postJson, x => {
that.pageLoading = false;
that.btnStr = "生成图片";
if (x.data.StatusCode == 1) { if (x.data.StatusCode == 1) {
that.SavePositionStr()
that.setLoading = false; that.setLoading = false;
let allPath = that.domainManager().ViittoFileUrl + x.data.FilePath; let allPath = that.domainManager().ViittoFileUrl + x.data.FilePath;
that.PostConfig.Mapurl = allPath; that.PostConfig.Mapurl = allPath;
that.$emit("Success", allPath); //调用父页面保存方法
that.PostConfig.TripMapList = JSON.parse(JSON.stringify(that.TripMapList));
that.$emit('saveMsg');
} else { } else {
that.setLoading = false; that.setLoading = false;
} }
}); });
return;
}); });
}, },
//关闭地图弹窗 //关闭地图弹窗
...@@ -659,6 +678,7 @@ ...@@ -659,6 +678,7 @@
marker.setLngLat([item.longitude, item.latitude]); marker.setLngLat([item.longitude, item.latitude]);
} }
marker.addTo(this.map); marker.addTo(this.map);
marker.on("dragend", function () { marker.on("dragend", function () {
let currentMarkerLngLat = marker.getLngLat(); let currentMarkerLngLat = marker.getLngLat();
console.log(currentMarkerLngLat, '------currentMarkerLngLat') console.log(currentMarkerLngLat, '------currentMarkerLngLat')
......
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