Commit 767eeca0 authored by 黄奎's avatar 黄奎

页面修改

parent 746b7028
......@@ -123,7 +123,7 @@
<!-- -->
<div v-if="FeatureData.FeatureType==9&&FeatureDataFlag" v-loading="iframeLoading">
<iframe name="myIframe" :src="myIframeUrl" style="width: 100%;border: 0;"
:style="{'height':myIframeHeigth+'px'}">
:style="{'height':myIframeHeigth+'px'}" >
</iframe>
<!-- <div v-if="FeatureData.TripImageListNew&&FeatureData.TripImageListNew.length>0">
<template v-for="url in FeatureData.TripImageListNew">
......@@ -133,15 +133,15 @@
:preview-src-list="FeatureData.TripImageListNew"></el-image>
</template>
</div> -->
<div v-show="PostMessageText=='暂无行程数据'"
style="text-align: center;margin-bottom: 20px;font-size: 14px;color: #808080;">暂无数据,右上角编辑行程试试吧!</div>
<div v-show="PostMessageText=='暂无行程数据'" style="text-align: center;margin-bottom: 20px;font-size: 14px;color: #808080;">暂无数据,右上角编辑行程试试吧!</div>
</div>
</div>
</div>
</div>
<!-- ppt 模版新增编辑窗口 -->
<pptIframe v-show="dialogPptistVisible" :Url="TemplateUrl" @close="closeIframe()"></pptIframe>
<pptIframe v-show="dialogPptistVisible" :Url="TemplateUrl"
@close="closeIframe()"></pptIframe>
</div>
</template>
<script>
......@@ -282,8 +282,8 @@
CurrentUserInfo: {},
dialogPptistVisible: false,
userInfo: {},
TemplateUrl: '', // 模版 修改url
myIframeUrl: '', //行程特色url
TemplateUrl:'',// 模版 修改url
myIframeUrl:'',//行程特色url
myIframeHeigth: 0,
isPostMessage: false,
PostMessageText: '',
......@@ -295,36 +295,54 @@
},
methods: {
closeIframe() {
closeIframe(){
this.dialogPptistVisible = false
},
handleMessage(event, targetOrigin) {
console.log(event.data, '-----------event.data')
if (event.data && event.data.data && !event.data.data) return
if (this.isPostMessage) return
if (event && event.data && event.data == '行程数据保存成功') {
handleMessage(event,targetOrigin) {
console.log(event.data,'-----------event.data')
if(event.data&&event.data.data&&!event.data.data) return
if(this.isPostMessage) return
// if(event.data&&event.data=='行程数据保存成功'){
// // this.dialogPptistVisible = false
// this.$emit('ConfigInfo')
// if(document.all.myIframe){
// document.all.myIframe.src = this.myIframeUrl
// }
// }else if(event.data&&event.data.indexOf('行程特色高')!=-1){
// this.PostMessageText = ''
// let datas = event.data.split('-')
// this.myIframeHeigth = datas[1]
// }else if(event.data&&event.data=='暂无行程数据'){
// this.PostMessageText = event.data
// }
if (event && event.data) {
if (event.data == '行程数据保存成功') {
this.$emit('ConfigInfo')
if (document.all.myIframe) {
document.all.myIframe.src = this.myIframeUrl
}
} else if (event && event.data && event.data.indexOf('行程特色高') != -1) {
this.PostMessageText = ''
let datas = event.data.split('-')
this.myIframeHeigth = datas[1]
} else if (event && event.data && event.data == '暂无行程数据') {
} else if (event.data == '暂无行程数据') {
this.PostMessageText = event.data
} else {
//行程特色高
this.PostMessageText = '';
if (event.data && typeof(event.data)=='string') {
let datas = event.data.split('-')
this.myIframeHeigth = datas[1];
}
}
}
this.isPostMessage = true
this.iframeLoading = false
},
// 添加编辑模版
journeyTemplate(type) {
journeyTemplate(type){
this.isPostMessage = false
let href = this.domainManager().PptUrl
if (type && type == 1) {
this.TemplateUrl = `${href}/?uid=${this.userInfo.EmployeeId}&ConfigId=0&model=1`
} else {
this.TemplateUrl = `${href}/?uid=${this.userInfo.EmployeeId}&ConfigId=${this.FeatureData.ConfigId}&model=0`
if(type&&type==1){
this.TemplateUrl=`${href}/?uid=${this.userInfo.EmployeeId}&ConfigId=0&model=1`
}else{
this.TemplateUrl=`${href}/?uid=${this.userInfo.EmployeeId}&ConfigId=${this.FeatureData.ConfigId}&model=0`
}
this.dialogPptistVisible = true
},
......@@ -559,9 +577,9 @@
});
}
this.initFileList();
if (this.FeatureData.FeatureType == 9) {
if(this.FeatureData.FeatureType==9) {
// this.iframeLoading = true
if (document.all.myIframe) {
if(document.all.myIframe){
document.all.myIframe.src = this.myIframeUrl
this.isPostMessage = false
}
......@@ -637,22 +655,21 @@
}
},
mounted() {
window.addEventListener('message', this.handleMessage, false);
window.addEventListener('message', this.handleMessage,false);
this.userInfo = this.getLocalStorage()
let userInfo = this.getLocalStorage()
this.CurrentUserInfo = userInfo
this.MsgBus.$on('FeatureDataFlag', () => {
this.FeatureDataFlag = true
});
let obj = this.TypeArray.find(x => {
let obj = this.TypeArray.find(x=>{
return x.TypeState == this.FeatureData.FeatureType
})
if (obj) {
if(obj){
this.clickFeature(obj)
}
this.myIframeUrl =
`${this.domainManager().PptUrl}/?uid=${this.userInfo.EmployeeId}&ConfigId=${this.$route.query.configId}&index=0&model=3&w=1108`
if (document.all.myIframe) {
this.myIframeUrl = `${this.domainManager().PptUrl}/?uid=${this.userInfo.EmployeeId}&ConfigId=${this.$route.query.configId}&index=0&model=3&w=1108`
if(document.all.myIframe){
document.all.myIframe.src = this.myIframeUrl
this.isPostMessage = false
}
......@@ -666,7 +683,7 @@
},
deep: true,
immediate: true
immediate:true
},
"FeatureData.fileList": {
handler: function (val, oldval) {
......
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