2022-03-27 19:06:37 +08:00
|
|
|
<template>
|
|
|
|
<el-row class="main-frame">
|
|
|
|
<div v-if="element.frameLinks.src" class="main-frame">
|
2022-04-05 19:28:58 +08:00
|
|
|
<iframe v-if="frameShow" id="iframe" :src="element.frameLinks.src" scrolling="auto" frameborder="0" class="main-frame" @load="loaded" @error="onError" />
|
2022-04-25 15:08:10 +08:00
|
|
|
<div v-if="editMode==='edit'" class="frame-mask edit-mask">
|
2022-03-27 19:06:37 +08:00
|
|
|
<span style="opacity: 1;">
|
|
|
|
<span style="font-weight: bold;color: lawngreen;">{{ $t('panel.edit_web_tips') }}</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
2022-04-25 15:08:10 +08:00
|
|
|
<!--Here are three 15px wide masks(left top right) for easy clicking on the display jump button-->
|
|
|
|
<div v-if="editMode!=='edit'" class="frame-mask preview-top-mask" />
|
|
|
|
<div v-if="editMode!=='edit'" class="frame-mask preview-right-mask" />
|
|
|
|
<div v-if="editMode!=='edit'" class="frame-mask preview-left-mask" />
|
2022-03-30 11:01:01 +08:00
|
|
|
<div v-if="screenShot" class="frame-mask" />
|
2022-03-27 19:06:37 +08:00
|
|
|
</div>
|
|
|
|
<div v-else class="info-class">
|
|
|
|
{{ $t('panel.web_add_tips') }}
|
|
|
|
</div>
|
|
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapState } from 'vuex'
|
2022-04-05 19:28:58 +08:00
|
|
|
import bus from '@/utils/bus'
|
2022-03-27 19:06:37 +08:00
|
|
|
export default {
|
2022-03-30 11:01:01 +08:00
|
|
|
name: 'DeFrame',
|
2022-03-27 19:06:37 +08:00
|
|
|
props: {
|
|
|
|
propValue: {
|
|
|
|
type: String,
|
|
|
|
require: true
|
|
|
|
},
|
|
|
|
element: {
|
|
|
|
type: Object
|
|
|
|
},
|
|
|
|
editMode: {
|
|
|
|
type: String,
|
|
|
|
require: false,
|
|
|
|
default: 'edit'
|
|
|
|
},
|
|
|
|
active: {
|
|
|
|
type: Boolean,
|
|
|
|
require: false,
|
|
|
|
default: false
|
2022-03-30 11:01:01 +08:00
|
|
|
},
|
|
|
|
screenShot: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
2022-03-27 19:06:37 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2022-04-05 19:28:58 +08:00
|
|
|
pOption: {},
|
|
|
|
frameShow: true
|
2022-03-27 19:06:37 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
...mapState([
|
|
|
|
'componentGap',
|
|
|
|
'canvasStyleData'
|
|
|
|
])
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
h(newVal, oldVla) {
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
},
|
|
|
|
mounted() {
|
2022-06-30 17:03:01 +08:00
|
|
|
bus.$on('frameLinksChange-' + this.element.id, this.frameLinksChange)
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
bus.$off('frameLinksChange-' + this.element.id, this.frameLinksChange)
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
frameLinksChange() {
|
2022-04-05 19:28:58 +08:00
|
|
|
this.frameShow = false
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.frameShow = true
|
|
|
|
})
|
2022-06-30 17:03:01 +08:00
|
|
|
},
|
2022-03-30 11:01:01 +08:00
|
|
|
loaded(e) {
|
|
|
|
},
|
|
|
|
onError(e) {
|
|
|
|
}
|
2022-03-27 19:06:37 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.info-class{
|
|
|
|
text-align: center;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2022-06-30 18:43:16 +08:00
|
|
|
background-color: rgba(255,255,255,0.3);
|
2022-03-27 19:06:37 +08:00
|
|
|
font-size: 12px;
|
|
|
|
color: #9ea6b2;
|
|
|
|
}
|
|
|
|
|
|
|
|
.main-frame{
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.frame-mask {
|
|
|
|
display: flex;
|
|
|
|
opacity: 0.5;
|
|
|
|
position:absolute;
|
|
|
|
top:0px;
|
2022-04-25 15:08:10 +08:00
|
|
|
z-index: 1;
|
2022-03-27 19:06:37 +08:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2022-04-25 15:08:10 +08:00
|
|
|
.edit-mask{
|
|
|
|
left: 0px;
|
|
|
|
background-color: #5c5e61;
|
|
|
|
height: 100%!important;
|
|
|
|
width: 100% !important;
|
|
|
|
}
|
|
|
|
.preview-top-mask{
|
|
|
|
left: 0px;
|
|
|
|
height: 15px!important;
|
|
|
|
width: 100% !important;
|
|
|
|
}
|
|
|
|
.preview-right-mask{
|
|
|
|
right: 0px;
|
|
|
|
height: 100%!important;
|
|
|
|
width: 15px !important;
|
|
|
|
}
|
|
|
|
.preview-left-mask{
|
|
|
|
left: 0px;
|
|
|
|
height: 100%!important;
|
|
|
|
width: 15px !important;
|
|
|
|
}
|
2022-03-27 19:06:37 +08:00
|
|
|
</style>
|
|
|
|
|