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

页面修改

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