预览页面
This commit is contained in:
parent
24570117bb
commit
106691b39b
@ -1,12 +1,22 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref, onMounted,watch } from 'vue'
|
||||
import {ref, onMounted,watch,computed } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import { useEmbedded } from '@/store/modules/embedded'
|
||||
|
||||
const props = defineProps({
|
||||
projectInfo: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
const appStore = useAppStoreWithOut()
|
||||
const embeddedStore = useEmbedded()
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { dvInfo } = storeToRefs(dvMainStore)
|
||||
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
const projectInfo:any=ref({
|
||||
|
||||
})
|
||||
@ -16,7 +26,25 @@ watch(() => props.projectInfo, val => {
|
||||
onMounted(()=>{
|
||||
projectInfo.value = props.projectInfo
|
||||
})
|
||||
|
||||
//预览
|
||||
const previewpage=()=>{
|
||||
if(dvInfo.value.id !== null){
|
||||
const baseUrl = isDataEaseBi.value ? embeddedStore.baseUrl : ''
|
||||
const url = baseUrl + '#/preview?dvId=' + dvInfo.value.id + '&ignoreParams=true'
|
||||
const newWindow = window.open(url, '_blank')
|
||||
initOpenHandler(newWindow)
|
||||
}
|
||||
}
|
||||
const openHandler = ref(null)
|
||||
const initOpenHandler = newWindow => {
|
||||
if (openHandler?.value) {
|
||||
const pm = {
|
||||
methodName: 'initOpenHandler',
|
||||
args: newWindow
|
||||
}
|
||||
openHandler.value.invokeMethod(pm)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="project-header-box">
|
||||
@ -28,7 +56,7 @@ onMounted(()=>{
|
||||
<div class="header-title">{{projectInfo.name }}</div>
|
||||
</div>
|
||||
<div class="project-header-right">
|
||||
<div class="preview-button">预览</div>
|
||||
<div class="preview-button" @click="previewpage">预览</div>
|
||||
<div class="design-button">设计</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user