diff --git a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue index 1fdada09b5..28addd5895 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue @@ -83,7 +83,7 @@ const { config, showPosition, index, canvasStyleData, canvasViewInfo, dvInfo, se toRefs(props) let currentInstance const component = ref(null) -const emits = defineEmits(['userViewEnlargeOpen']) +const emits = defineEmits(['userViewEnlargeOpen', 'onPointClick']) const htmlToImage = () => { setTimeout(() => { @@ -180,6 +180,10 @@ const commonBackgroundSvgInner = computed(() => { } }) +const onPointClick = param => { + emits('onPointClick', param) +} + const deepScale = computed(() => scale.value / 100) @@ -234,6 +238,7 @@ const deepScale = computed(() => scale.value / 100) :scale="deepScale" :disabled="true" :is-edit="false" + @onPointClick="onPointClick" /> 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 f54036ce90..77cfc2bc78 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -13,9 +13,10 @@ import { isMainCanvas } from '@/utils/canvasUtils' import { activeWatermark } from '@/components/watermark/watermark' import { personInfoApi } from '@/api/user' import router from '@/router' +import { XpackComponent } from '@/components/plugin' const dvMainStore = dvMainStoreWithOut() const { pcMatrixCount, curComponent, mobileInPc } = storeToRefs(dvMainStore) - +const openHandler = ref(null) const props = defineProps({ canvasStyleData: { type: Object, @@ -281,6 +282,32 @@ const userViewEnlargeOpen = (opt, item) => { const handleMouseDown = () => { dvMainStore.setCurComponent({ component: null, index: null }) } + +const onPointClick = param => { + try { + console.info('de_inner_params send') + if (window['dataease-embedded-host'] && openHandler?.value) { + const pm = { + methodName: 'embeddedInteractive', + args: { + eventName: 'de_inner_params', + args: param + } + } + openHandler.value.invokeMethod(pm) + } else { + console.info('de_inner_params send to host') + const targetPm = { + type: 'dataease-embedded-interactive', + eventName: 'de_inner_params', + args: param + } + window.parent.postMessage(targetPm, '*') + } + } catch (e) { + console.warn('de_inner_params send error') + } +} defineExpose({ restore }) @@ -316,9 +343,11 @@ defineExpose({ :scale="mobileInPc ? 100 : scaleWidth" :is-selector="props.isSelector" @userViewEnlargeOpen="userViewEnlargeOpen($event, item)" + @onPointClick="onPointClick" /> +