Files

59 lines
1.3 KiB
Vue
Raw Permalink Normal View History

2022-06-28 09:15:10 +08:00
<template>
<section class="preview">
2024-03-01 11:29:37 +08:00
<ai-dv-wrapper :views="[{label: '返回'}]" :theme="config.theme" @change="handleBack" v-if="screenId" :title="info.name" :background="bgImg" :titleSize="config.titleSize">
2022-09-06 15:19:28 +08:00
<ai-dv-viewer :urlPrefix="urlPrefix" :instance="instance" :dict="dict" :id="screenId"/>
2022-06-28 09:15:10 +08:00
</ai-dv-wrapper>
</section>
</template>
<script>
2023-03-10 09:38:31 +08:00
import {mapActions} from "vuex"
2022-06-28 09:15:10 +08:00
export default {
name: "preview",
props: {
instance: Function,
dict: Object,
permissions: Function,
urlPrefix: {
type: String,
default: '/app'
}
},
computed: {
2023-03-10 15:52:05 +08:00
screenId: v => v.$route.query.id,
2023-03-10 16:22:01 +08:00
bgImg: v => v.config.theme == 1 ? 'https://cdn.cunwuyun.cn/dvcp/dv/img/dj_bg.png' : (v.config.backgroundImage?.[0]?.url || "")
2022-06-28 09:15:10 +08:00
},
data() {
return {
info: {},
config: {}
}
},
methods: {
2023-03-10 09:38:31 +08:00
...mapActions(['closePage']),
2022-06-28 09:15:10 +08:00
getDvData() {
let {id} = this.$route.query
2023-03-10 15:52:05 +08:00
this.instance.post(`/app/appdiylargescreen/queryLargeScreenDetailById?id=${id}`).then(res => {
2022-06-28 09:15:10 +08:00
if (res?.data) {
this.info = res.data
this.config = JSON.parse(res.data.config).dashboard
}
})
2023-03-10 09:38:31 +08:00
},
handleBack() {
this.$router.back()
this.closePage()
2022-06-28 09:15:10 +08:00
}
},
created() {
this.getDvData()
}
}
</script>
<style lang="scss" scoped>
.preview {
}
</style>