From b0271e10d4dddbdb5f643b7000d3960d665ad1a1 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 2 Sep 2025 14:57:25 +0800 Subject: [PATCH] perf: Assistant full-screen embedding code optimization --- frontend/src/views/system/embedded/iframe.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/system/embedded/iframe.vue b/frontend/src/views/system/embedded/iframe.vue index 1534c1ec..e558a2d7 100644 --- a/frontend/src/views/system/embedded/iframe.vue +++ b/frontend/src/views/system/embedded/iframe.vue @@ -407,11 +407,13 @@ const handleEmbedded = (row: any) => { script.src = "${origin + pathname}xpack_static/sqlbot-embedded-dynamic.umd.js"; document.head.appendChild(script); })() - - sqlbot_embedded_handler.mounted('.copilot', { - "embeddedId": "${row.id}", - "online": true -})` + let sqlbot_embedded_timer = setInterval(() => { + if (sqlbot_embedded_handler?.mounted) { + sqlbot_embedded_handler.mounted('.copilot', { "embeddedId": "${row.id}" }) + clearInterval(sqlbot_embedded_timer) + } + }, 1000) + ` } const copyJsCode = () => { copy(jsCodeElement.value)