hi-ucs/front/src/views/detailsAll/components/LayerService/LayerServicePreview.vue

90 lines
2.3 KiB
Vue

<!--
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 15:25:33
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-14 11:30:52
* @Description: 图层预览 视频播放
-->
<template>
<div class="application-presentation" v-if="flag">
<detals-title title="图层预览" type="PREVIEW"></detals-title>
<div class="main">
<!-- <iframe
:src="img"
width="100%"
height="100%"
border-radius="0.1rem"
></iframe> -->
<div class="iframe-box">
<iframe :src="img" width="100%" height="440"></iframe>
</div>
</div>
</div>
</template>
<script setup>
import { ref, defineProps, watch } from 'vue'
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle.vue'
const props = defineProps({
dataList: { type: Object, default: null },
})
const flag = ref(true)
const img = ref('')
console.log('111111111111111111111,', props.dataList)
if (props.dataList.infoList) {
let imgindex = props.dataList.infoList.filter(
(item) => item.attrType === '是否可预览' && item.attrValue === '是'
)[0]
if (!imgindex) {
flag.value = false
} else {
props.dataList.infoList.map((item) => {
if (item.attrType === '预览服务地址') {
img.value = item.attrValue.replace(/amp;/g, '') || '--'
}
})
}
}
watch(
() => props.dataList,
(val) => {
if (val) {
let imgindex = props.dataList.infoList.filter(
(item) => item.attrType === '是否可预览' && item.attrValue === '是'
)[0]
if (!imgindex) {
flag.value = false
} else {
val.infoList.map((item) => {
if (item.attrType === '预览服务地址') {
img.value = item.attrValue.replace(/amp;/g, '') || '--'
}
})
}
}
}
)
</script>
<style lang="less" scoped>
.application-presentation {
padding: 0.8rem 3rem 0.6rem;
.main {
// border-radius: 0.1rem;
margin-top: 0.4rem;
// display: flex;
// justify-content: center;
// align-items: center;
iframe {
border: none;
}
.iframe-box {
width: 100%;
height: 440px;
margin-top: 10px;
display: flex;
justify-content: center;
}
}
}
</style>