From 8c21e25aeb70ff29dd0c3e2b0915e0473b9e5f9a Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 1 Apr 2024 15:47:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=BD=91=E9=A1=B5=E7=BB=84=E4=BB=B6=E5=86=85=E5=B5=8C?= =?UTF-8?q?=E5=85=A5=E5=85=AC=E5=85=B1=E9=93=BE=E6=8E=A5=E6=97=B6=E5=86=85?= =?UTF-8?q?=E9=83=A8=E6=97=B6=E9=97=B4=E7=BB=84=E4=BB=B6=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=9C=A8=E7=BD=91=E9=A1=B5=E7=BB=84=E4=BB=B6=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=97=B6=E6=97=A0=E6=B3=95=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=97=AE=E9=A2=98=20#7605?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/customComponent/DeFrame.vue | 10 +++++++++- .../frontend/src/components/widget/deWidget/DeDate.vue | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/frontend/src/components/canvas/customComponent/DeFrame.vue b/core/frontend/src/components/canvas/customComponent/DeFrame.vue index bbbc271cd1..8cdb35040a 100644 --- a/core/frontend/src/components/canvas/customComponent/DeFrame.vue +++ b/core/frontend/src/components/canvas/customComponent/DeFrame.vue @@ -10,7 +10,7 @@ :src="element.frameLinks.src" scrolling="auto" frameborder="0" - class="main-frame" + class="main-frame main-de-iframe " @load="loaded" @error="onError" /> @@ -103,6 +103,14 @@ export default { mounted() { bus.$on('frameLinksChange-' + this.element.id, this.frameLinksChange) eventBus.$on('startMoveIn', this.frameLinksChange) + window.addEventListener('click', function(event) { + const iframes = document.getElementsByClassName('main-de-iframe') + if (iframes) { + iframes.forEach(function(iframe) { + iframe.contentWindow.postMessage('closeFilterComponent', '*') + }) + } + }) }, beforeDestroy() { bus.$off('frameLinksChange-' + this.element.id, this.frameLinksChange) diff --git a/core/frontend/src/components/widget/deWidget/DeDate.vue b/core/frontend/src/components/widget/deWidget/DeDate.vue index aed842e12e..14d0ddcb25 100644 --- a/core/frontend/src/components/widget/deWidget/DeDate.vue +++ b/core/frontend/src/components/widget/deWidget/DeDate.vue @@ -381,6 +381,12 @@ export default { if (this.inDraw) { bus.$on('reset-default-value', this.resetDefaultValue) } + const _this = this + window.addEventListener('message', function(event) { + if (event.data === 'closeFilterComponent') { + _this.$refs.dateRef.hidePicker() + } + }) }, beforeDestroy() { this.clearTime()