From 2b297d5e80e14f084da458fc8c85fde22cc6bfa3 Mon Sep 17 00:00:00 2001 From: Huangzhe Date: Tue, 27 May 2025 10:48:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(components):=20=E4=BF=AE=E6=94=B9=20to?= =?UTF-8?q?oltip=20=E5=B1=95=E7=A4=BA=E5=86=85=E5=AE=B9=E5=B9=B6=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=20iframe=20=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 Tootips 组件中,将 tooltip 展示内容从 row.logic_text 改为 row.text - 在 IntelligentGeneration 组件中,注释掉 iframe 相关代码,暂时保留未删除 --- .../YlTable/components/Tootips/Index.vue | 2 +- .../IntelligentGeneration/Index.vue | 76 +++++++++---------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/components/YlTable/components/Tootips/Index.vue b/src/components/YlTable/components/Tootips/Index.vue index 9b7f1dd..1e46a20 100644 --- a/src/components/YlTable/components/Tootips/Index.vue +++ b/src/components/YlTable/components/Tootips/Index.vue @@ -4,7 +4,7 @@ const content = defineModel<{ row: any; column: any; cellValue: any }>('content' diff --git a/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue b/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue index cd17d5f..2b953f1 100644 --- a/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue +++ b/src/views/Home/components/CreateSurvey/components/IntelligentGeneration/Index.vue @@ -7,47 +7,47 @@ const param = `token=${encodeURIComponent(localStorage.getItem('plantToken') as // const url = host + path + param; const url = host + path + param; -const iframe = ref(null); +// const iframe = ref(null); -onMounted(() => { - // 保存原始的window.open方法 - const originalOpen = window.open; +// onMounted(() => { +// // 保存原始的window.open方法 +// const originalOpen = window.open; - // 监听iframe的load事件,确保iframe已完全加载 - iframe.value?.addEventListener('load', () => { - try { - const iframeWindow = iframe.value?.contentWindow; +// // 监听iframe的load事件,确保iframe已完全加载 +// iframe.value?.addEventListener('load', () => { +// try { +// const iframeWindow = iframe.value?.contentWindow; - // 尝试覆盖iframe的open方法 - if (iframeWindow) { - // 方法一:直接覆盖 - try { - iframeWindow.open = function (...args: any[]) { - // console.log('iframe中的open方法被调用,参数:', args); - // 使用父窗口的open方法打开 - return originalOpen.apply(window, args as any); - }; - } catch (e) { - // 方法二:如果直接覆盖失败,尝试使用defineProperty - try { - Object.defineProperty(iframeWindow, 'open', { - value: function (...args: any[]) { - // console.log('iframe中的open方法被调用,参数:', args); - return originalOpen.apply(window, args as any); - }, - writable: true, - configurable: true - }); - } catch (e2) { - // console.error('无法覆盖iframe的open方法(defineProperty):', e2); - } - } - } - } catch (error) { - console.error('无法覆盖iframe的open方法:', error); - } - }); -}); +// // 尝试覆盖iframe的open方法 +// if (iframeWindow) { +// // 方法一:直接覆盖 +// try { +// iframeWindow.open = function (...args: any[]) { +// // console.log('iframe中的open方法被调用,参数:', args); +// // 使用父窗口的open方法打开 +// return originalOpen.apply(window, args as any); +// }; +// } catch (e) { +// // 方法二:如果直接覆盖失败,尝试使用defineProperty +// try { +// Object.defineProperty(iframeWindow, 'open', { +// value: function (...args: any[]) { +// // console.log('iframe中的open方法被调用,参数:', args); +// return originalOpen.apply(window, args as any); +// }, +// writable: true, +// configurable: true +// }); +// } catch (e2) { +// // console.error('无法覆盖iframe的open方法(defineProperty):', e2); +// } +// } +// } +// } catch (error) { +// console.error('无法覆盖iframe的open方法:', error); +// } +// }); +// });