refactor: 弹窗跳转内禁用下载 (#14775)

This commit is contained in:
王嘉豪 2025-01-20 17:46:20 +08:00 committed by GitHub
parent c843333fed
commit f8ba2fb4d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 7 deletions

View File

@ -344,7 +344,8 @@ const {
componentData, componentData,
canvasViewInfo, canvasViewInfo,
mobileInPc, mobileInPc,
dvInfo dvInfo,
isIframe
} = storeToRefs(dvMainStore) } = storeToRefs(dvMainStore)
const state = reactive({ const state = reactive({
@ -598,7 +599,9 @@ const initCurFields = () => {
} }
} }
const showDownload = computed(() => canvasViewInfo.value[element.value.id]?.dataFrom !== 'template') const showDownload = computed(
() => canvasViewInfo.value[element.value.id]?.dataFrom !== 'template' && !isIframe.value
)
// -End // -End
const datasetParamsSetShow = computed(() => { const datasetParamsSetShow = computed(() => {

View File

@ -8,7 +8,7 @@
trigger="click" trigger="click"
class="userViewEnlarge-class" class="userViewEnlarge-class"
> >
<template #header> <template #header v-if="!isIframe">
<div class="header-title"> <div class="header-title">
<div>{{ viewInfo?.title }}</div> <div>{{ viewInfo?.title }}</div>
<div class="export-button"> <div class="export-button">
@ -27,7 +27,6 @@
/> />
</el-option-group> </el-option-group>
</el-select> </el-select>
<el-button <el-button
class="m-button" class="m-button"
v-if="optType === 'enlarge' && exportPermissions[0]" v-if="optType === 'enlarge' && exportPermissions[0]"
@ -178,7 +177,7 @@ const { t } = useI18n()
const optType = ref(null) const optType = ref(null)
const chartComponentDetails = ref(null) const chartComponentDetails = ref(null)
const chartComponentDetails2 = ref(null) const chartComponentDetails2 = ref(null)
const { dvInfo, editMode } = storeToRefs(dvMainStore) const { dvInfo, editMode, isIframe } = storeToRefs(dvMainStore)
const exportLoading = ref(false) const exportLoading = ref(false)
const sourceViewType = ref() const sourceViewType = ref()
const activeName = ref('left') const activeName = ref('left')

View File

@ -192,10 +192,14 @@ export const dvMainStore = defineStore('dataVisualization', {
baseCellInfo: {}, baseCellInfo: {},
dataPrepareState: false, //数据准备状态 dataPrepareState: false, //数据准备状态
multiplexingStyleAdapt: true, //复用样式跟随主题 multiplexingStyleAdapt: true, //复用样式跟随主题
mainScrollTop: 0 //主画布运动量 mainScrollTop: 0, //主画布运动量
isIframe: false // 当前是否在iframe中
} }
}, },
actions: { actions: {
setIframeFlag(value) {
this.isIframe = value
},
setCanvasAttachInfo(value) { setCanvasAttachInfo(value) {
this.canvasAttachInfo = value this.canvasAttachInfo = value
}, },

View File

@ -30,7 +30,8 @@ const state = reactive({
canvasViewInfoPreview: null, canvasViewInfoPreview: null,
dvInfo: null, dvInfo: null,
curPreviewGap: 0, curPreviewGap: 0,
initState: true initState: true,
showPosition: null
}) })
const props = defineProps({ const props = defineProps({
@ -176,6 +177,8 @@ onMounted(async () => {
const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId
// //
const ignoreParams = router.currentRoute.value.query.ignoreParams === 'true' const ignoreParams = router.currentRoute.value.query.ignoreParams === 'true'
const isFrameFlag = window.self !== window.top
dvMainStore.setIframeFlag(isFrameFlag)
const { dvType, callBackFlag, taskId, showWatermark } = router.currentRoute.value.query const { dvType, callBackFlag, taskId, showWatermark } = router.currentRoute.value.query
if (!!taskId) { if (!!taskId) {
dvMainStore.setCanvasAttachInfo({ taskId, showWatermark }) dvMainStore.setCanvasAttachInfo({ taskId, showWatermark })