Commit 1183e78a authored by youjie's avatar youjie

上传地图

parent c429cb15
...@@ -66,7 +66,11 @@ ...@@ -66,7 +66,11 @@
<div class="TravelPrice clearfix" style="padding: 25px;"> <div class="TravelPrice clearfix" style="padding: 25px;">
<div class="mapImg-buttom"> <div class="mapImg-buttom">
<span class="TMTitle"><i></i>地图</span> <span class="TMTitle"><i></i>地图</span>
<span class="foldList" @click="ShowMap=!ShowMap">编辑地图</span> <div style="padding-bottom: 15px;">
<input type="file" style="display:none" id="uploadMap" @change="uploadpic">
<span class="foldList" style="margin-left: 10px;" @click="ShowMap=!ShowMap">编辑地图</span>
<span class="foldList" @click="UploadImg">上传地图 图片</span>
</div>
</div> </div>
<div class="mapImg-Img marginT20"> <div class="mapImg-Img marginT20">
<div v-if="PostConfig&&PostConfig.MapUrl"> <div v-if="PostConfig&&PostConfig.MapUrl">
...@@ -74,7 +78,7 @@ ...@@ -74,7 +78,7 @@
:preview-src-list="[PostConfig.MapUrl]"> :preview-src-list="[PostConfig.MapUrl]">
</el-image> </el-image>
</div> </div>
<p v-else @click="ShowMap=!ShowMap" style="cursor: pointer;">地图暂未生成图</p> <p v-else @click="ShowMap=!ShowMap" style="cursor: pointer;">地图暂未生成/上传</p>
</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"
...@@ -308,6 +312,34 @@ ...@@ -308,6 +312,34 @@
}; };
}, },
methods: { methods: {
UploadImg() {
document.querySelector(`#uploadMap`).click();
},
uploadpic(e) {
let that = this;
var postJson = {
// ConfigId: 8757,
// MapLevel: 11,
};
that.$message.info('上传中...')
if (e.target.files.length > 0 && e.target.files[0].size > 0) {
// 压缩图片需要的一些元素和对象
var reader = new FileReader();
reader.onload = function (event) {
let blob = that.base64ToBlob(event.target.result);
let newArr = [];
newArr.push(blob);
var path = `/newFeature`;
that.uploadSelfBlob(path, newArr, postJson, x => {
let allPath = that.domainManager().ViittoFileUrl + x.data.FilePath;
that.PostConfig.MapUrl = allPath
that.$forceUpdate()
that.$message.success('上传成功');
});
};
reader.readAsDataURL(e.target.files[0]);
}
},
getPptJourney(status){ getPptJourney(status){
this.isPptJourney = status this.isPptJourney = status
}, },
...@@ -521,6 +553,7 @@ ...@@ -521,6 +553,7 @@
} }
basicData.IsUpdateHotel = this.PostConfig.IsUpdateHotel; basicData.IsUpdateHotel = this.PostConfig.IsUpdateHotel;
basicData.MapUrl = this.PostConfig.MapUrl
console.log("travel_post_SetTravelConfigInfo", basicData); console.log("travel_post_SetTravelConfigInfo", basicData);
this.isSubmit = false; this.isSubmit = false;
this.apipost( this.apipost(
......
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