diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue
index 938f1baa45..9f44ec5270 100644
--- a/core/core-frontend/src/components/dashboard/DbToolbar.vue
+++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue
@@ -549,7 +549,7 @@ const initOpenHandler = newWindow => {
is-label
:base-width="115"
:icon-name="dvMoreCom"
- :title="'visualization.more'"
+ :title="t('visualization.more')"
>
diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue
index 277c5c1bd7..a0e0ecd2a5 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue
@@ -2,7 +2,7 @@
import { getCanvasStyle, getShapeItemStyle } from '@/utils/style'
import ComponentWrapper from './ComponentWrapper.vue'
import { changeStyleWithScale } from '@/utils/translate'
-import { computed, nextTick, ref, toRefs, watch, onBeforeUnmount, onMounted } from 'vue'
+import { computed, nextTick, ref, toRefs, watch, onBeforeUnmount, onMounted, reactive } from 'vue'
import { changeRefComponentsSizeWithScalePoint } from '@/utils/changeComponentsSizeWithScale'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { storeToRefs } from 'pinia'
@@ -105,6 +105,9 @@ const renderReady = ref(false)
const dashboardActive = computed(() => {
return dvInfo.value.type === 'dashboard'
})
+const state = reactive({
+ initState: true
+})
const curSearchCount = computed(() => {
return outerSearchCount.value + searchCount.value
@@ -304,9 +307,9 @@ const winMsgHandle = event => {
isMainCanvas(canvasId.value)
) {
const attachParams = msgInfo.params
- if (attachParams) {
- dvMainStore.addOuterParamsFilter(attachParams, baseComponentData.value, 'outer')
- }
+ state.initState = false
+ dvMainStore.addOuterParamsFilter(attachParams, baseComponentData.value, 'outer')
+ state.initState = true
}
}
@@ -402,6 +405,7 @@ defineExpose({
:class="{ 'de-download-custom': downloadStatus, 'datav-preview': dataVPreview }"
ref="previewCanvas"
@mousedown="handleMouseDown"
+ v-if="state.initState"
>
diff --git a/core/core-frontend/src/pages/panel/DashboardPreview.vue b/core/core-frontend/src/pages/panel/DashboardPreview.vue
index ed92398eef..8411f11390 100644
--- a/core/core-frontend/src/pages/panel/DashboardPreview.vue
+++ b/core/core-frontend/src/pages/panel/DashboardPreview.vue
@@ -11,8 +11,6 @@ import { getOuterParamsInfo } from '@/api/visualization/outerParams'
import { ElMessage } from 'element-plus-secondary'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { useI18n } from '@/hooks/web/useI18n'
-import VanSticky from 'vant/es/sticky'
-import VanNavBar from 'vant/es/nav-bar'
import request from '@/config/axios'
import 'vant/es/nav-bar/style'
import 'vant/es/sticky/style'
@@ -29,7 +27,8 @@ const state = reactive({
canvasStylePreview: null,
canvasViewInfoPreview: null,
dvInfo: null,
- curPreviewGap: 0
+ curPreviewGap: 0,
+ initState: true
})
const dvMainStore = dvMainStoreWithOut()
@@ -106,9 +105,9 @@ onBeforeMount(async () => {
nextTick(() => {
dashboardPreview.value.restore()
})
- if (attachParams) {
- dvMainStore.addOuterParamsFilter(attachParams, canvasDataResult, 'outer')
- }
+ state.initState = false
+ dvMainStore.addOuterParamsFilter(attachParams, canvasDataResult, 'outer')
+ state.initState = true
}
)
})
@@ -117,7 +116,7 @@ onBeforeMount(async () => {
{
// 校验targetSourceId
if (msgInfo && msgInfo.type === 'attachParams' && msgInfo.targetSourceId === state.chartId + '') {
const attachParams = msgInfo.params
- if (attachParams) {
- dvMainStore.addOuterParamsFilter(attachParams, state.canvasDataPreview, 'outer')
- }
+ state.initState = false
+ dvMainStore.addOuterParamsFilter(attachParams, state.canvasDataPreview, 'outer')
+ state.initState = true
}
}
@@ -89,9 +90,10 @@ onBeforeMount(async () => {
state.canvasStylePreview = canvasStyleResult
state.canvasViewInfoPreview = canvasViewInfoPreview
state.dvInfo = dvInfo
- if (attachParams) {
- dvMainStore.addOuterParamsFilter(attachParams, canvasDataResult)
- }
+ state.initState = false
+ dvMainStore.addOuterParamsFilter(attachParams, canvasDataResult)
+ state.initState = true
+
viewInfo.value = canvasViewInfoPreview[chartId]
;(
(canvasDataResult as unknown as Array<{
@@ -151,7 +153,7 @@ const onPointClick = param => {
-
+
{
const targetInfo = this.nowPanelOuterParamsBaseInfo[key]
- const userParams = paramsPre[key]
+ const userParams = paramsPre ? paramsPre[key] : null
const userParamsIsNull = !userParams || userParams.length === 0
if (targetInfo.required && userParamsIsNull) {
// 要求用户必填 但是用户没有输入参数
@@ -1016,7 +1016,7 @@ export const dvMainStore = defineStore('dataVisualization', {
})
if (errorCount > 0) {
ElMessage.error('参数错误 ' + errorMes + '为必填参数')
- return
+ throw new Error('参数错误 ' + errorMes + '为必填参数')
}
} else {
return
diff --git a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue
index 77df16cf35..c461fd1911 100644
--- a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue
+++ b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue
@@ -26,7 +26,8 @@ const state = reactive({
canvasStylePreview: null,
canvasViewInfoPreview: null,
dvInfo: null,
- curPreviewGap: 0
+ curPreviewGap: 0,
+ initState: false
})
const props = defineProps({
@@ -114,6 +115,7 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
canvasViewInfoPreview,
curPreviewGap
}) {
+ state.initState = false
state.canvasDataPreview = canvasDataResult
state.canvasStylePreview = canvasStyleResult
state.canvasViewInfoPreview = canvasViewInfoPreview
@@ -122,9 +124,8 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
if (jumpParam) {
dvMainStore.addViewTrackFilter(jumpParam)
}
- if (attachParam) {
- dvMainStore.addOuterParamsFilter(attachParam)
- }
+ dvMainStore.addOuterParamsFilter(attachParam)
+ state.initState = true
if (props.publicLinkStatus) {
// 设置浏览器title为当前仪表板名称
document.title = dvInfo.name
@@ -176,7 +177,7 @@ defineExpose({
{
if (jumpParam) {
dvMainStore.addViewTrackFilter(jumpParam)
}
- if (attachParam) {
- dvMainStore.addOuterParamsFilter(attachParam)
- }
+ state.initState = false
+
+ dvMainStore.addOuterParamsFilter(attachParam)
+ state.initState = true
+
if (props.publicLinkStatus) {
// 设置浏览器title为当前仪表板名称
document.title = dvInfo.name
@@ -156,7 +159,7 @@ defineExpose({
-