Commit 5d2dea70 authored by 黄奎's avatar 黄奎

页面修改

parent 11269c08
<template> <template>
<div class="tripmap-form marginT20" v-if="PostConfig"> <div class="tripmap-form marginT20" v-if="PostConfig" v-loading="pageLoading">
<div class="tripmap-Search" v-loading="pageLoading"> <div class="tripmap-Search">
<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">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<div class="row-aic" style="flex-shrink: 0;"> <div class="row-aic" style="flex-shrink: 0;">
<el-button type="danger" key="BtnClose" @click="CloseMapBox">关闭</el-button> <el-button type="danger" key="BtnClose" @click="CloseMapBox">关闭</el-button>
<el-button type="primary" key="BtnCreateImg" :disabled="setLoading" @click="getResultImg()">{{btnStr}} <el-button type="primary" key="BtnCreateImg" :loading="saveLoading" @click="saveLoading=true">{{btnStr}}
</el-button> </el-button>
</div> </div>
</div> </div>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
props: ["PostConfig"], props: ["PostConfig"],
data() { data() {
return { return {
setLoading: false, saveLoading: false,
pageLoading: false, pageLoading: false,
SourceCountryList: [], //所有国家列表 SourceCountryList: [], //所有国家列表
SourceCityList: [], //国家下面的城市列表 SourceCityList: [], //国家下面的城市列表
...@@ -125,6 +125,15 @@ ...@@ -125,6 +125,15 @@
}, },
deep: true, deep: true,
immediate: true immediate: true
},
saveLoading: {
handler(val, oldVal) {
if (val) {
setTimeout(() => {
this.getResultImg();
}, 1000)
}
},
} }
}, },
created() { created() {
...@@ -245,7 +254,7 @@ ...@@ -245,7 +254,7 @@
this.clearCountriesMaker(); this.clearCountriesMaker();
//遍历有经纬度的城市 //遍历有经纬度的城市
var tempData = []; var tempData = [];
var that = this; var that = this;
this.citiesData.forEach(cItem => { this.citiesData.forEach(cItem => {
if (cItem.longitude && cItem.latitude) { if (cItem.longitude && cItem.latitude) {
tempData.push(cItem); tempData.push(cItem);
...@@ -740,15 +749,16 @@ ...@@ -740,15 +749,16 @@
// 导出地图片 // 导出地图片
getResultImg() { getResultImg() {
this.btnStr = "生成中.."; this.btnStr = "生成中..";
this.setLoading = true; this.saveLoading = true;
this.pageLoading = true; this.pageLoading = true;
let that = this;
var postJson = { var postJson = {
ConfigId: this.PostConfig.ID ConfigId: this.PostConfig.ID
}; };
let that = this;
var trip_map_obj = document.getElementById("trip_map"); var trip_map_obj = document.getElementById("trip_map");
html2Canvas(trip_map_obj).then(function (canvas) { html2Canvas(trip_map_obj, {
backgroundColor: null,
}).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");
let blob = that.base64ToBlob(image.href); let blob = that.base64ToBlob(image.href);
...@@ -759,17 +769,17 @@ ...@@ -759,17 +769,17 @@
that.pageLoading = false; that.pageLoading = false;
that.btnStr = "生成图片"; that.btnStr = "生成图片";
if (x.data.StatusCode == 1) { if (x.data.StatusCode == 1) {
that.setLoading = false; that.saveLoading = 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.PostConfig.TripMapList = JSON.parse(JSON.stringify(that.TripMapList)); that.PostConfig.TripMapList = JSON.parse(JSON.stringify(that.TripMapList));
that.$emit('saveMsg'); that.$emit('saveMsg');
} else { } else {
that.setLoading = false; that.saveLoading = false;
} }
}); });
}); })
}, },
} }
}; };
......
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