Commit 0c13f386 authored by youjie's avatar youjie

no message

parent 7b7deec3
<template>
<div class="travelDays-form">
<div class="travelDays-box absolute z-index1">
<div class="travelDays-Title">===============</div>
</div>
<el-dialog custom-class="resourceImgAdd" :title="$t('sm.chooseImg')" center :visible.sync="isShowScenicImg">
<!--imgType:1-酒店,2-餐厅,3-景点,4-票务,5-车辆,6-领队,7-购物店,isCheckmore:是否多选图片-->
<DMCchooseImg @closeImg="closeDMCchooseImg" ref="DMCchooseImg1" @headCallBack="getDMCimg" v-bind:isCheckmore="1"
v-bind:imgType="choseType" v-bind:queryItem="queryItem" v-bind:IsShowAdd="true" v-bind:IsShowVideo="true">
</DMCchooseImg>
</el-dialog>
</div>
</template>
<script>
import MasterMapList from "./components/MasterMapList";
import subheading from "./components/subheading";
import vEditDiv from "../TravelTemp/VEditDiv";
import FeatureControls from "./components/featureControls";
import DMCchooseImg from "../../../commonPage/DMCchooseImg.vue";
export default {
components: {
MasterMapList,
subheading,
vEditDiv,
FeatureControls,
DMCchooseImg
},
props: [
'TripColor',
'index',
'FeatureItem'
],
data() {
return {
canEdit: true,
canEdit1: true,
isShowScenicImg: false,
choseType: 0,
queryItem: {
queryName: '',
queryId: 0,
},
MasterMapIndex: null,//主图下标
StencilDrawing: false,//是否是模版图
};
},
methods: {
UploadImg(index,type) {
this.MasterMapIndex = index?index:0
if(type) this.StencilDrawing = true
else this.StencilDrawing = false
if(this.FeatureItem.pageType==2){
document.querySelector(`#introducefile_${(this.index * 2 + 1)}_0`).click();
}else{
document.querySelector(`#travelDays_${(this.index * 2 + 1)}`).click();
}
},
uploadpic(e) {
let that = this;
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 fileName = `${that.uuid(10, 10)}.png`;
var path = `/newFeature`;
that.uploadSelfBlob(path, newArr, x => {
let allPath = that.domainManager().ViittoFileUrl + x.data.FilePath;
let i = e.target.id.split("_")[2];
if(that.StencilDrawing){
that.FeatureItem.dataObj.SubList[that.MasterMapIndex].url = allPath
}else{
that.FeatureItem.dataObj.ImgList[that.MasterMapIndex].url = allPath
}
});
};
reader.readAsDataURL(e.target.files[0]);
}
},
SelectImg(index,type) {
this.MasterMapIndex = index?index:0
if(type) this.StencilDrawing = true
else this.StencilDrawing = false
if(this.FeatureData.pageType==3) this.choseType = 2
else if(this.FeatureData.pageType==4) this.choseType = 1
else if(this.FeatureData.pageType==5) this.choseType = 2
else if(this.FeatureData.pageType==6) this.choseType = 3
else this.choseType = 0
this.isShowScenicImg = true
},
AddImg() {
let obj = {
url:''
}
this.FeatureItem.dataObj.ImgList.push(obj)
},
DeleteImg(index,type) {
if(type) this.StencilDrawing = true
else this.StencilDrawing = false
if(this.StencilDrawing){
this.FeatureItem.dataObj.SubList.splice(index,1)
}else{
this.FeatureItem.dataObj.ImgList.splice(index,1)
}
},
toAddPages() {
this.$emit('toAddPages', this.index, this.FeatureItem)
},
toDeletePages() {
this.$emit('toDeletePages', this.index, this.FeatureItem)
},
setTemplate(TemplateType) {
this.FeatureItem.pageTemplate = TemplateType
},
closeDMCchooseImg() {
this.isShowScenicImg = false
},
getDMCimg(selectImgArr) {
let Path = selectImgArr[0].Path
if(this.StencilDrawing){
this.FeatureItem.dataObj.SubList[this.MasterMapIndex].url = Path
}else{
this.FeatureItem.dataObj.ImgList[this.MasterMapIndex].url = Path
}
this.isShowScenicImg = false
}
},
computed: {},
watch: {
FeatureData: {
handler(val, oldVal) {
},
deep: true,
immediate: true
},
},
mounted() {
}
};
</script>
<style>
.travelDays-box{
position: absolute;
left: 0;
top: 112px;
right: 0;
bottom: 115px;
border: 1px solid #ddd;
}
</style>
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