From eb3f667ca6fd0360ee9d6b64671102fbc8cc67d5 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 16 Oct 2024 16:37:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(X-Pack):=20=E7=A4=BE=E5=8C=BA=E7=89=88?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/plugin/src/PluginComponent.vue | 5 ++++- .../src/components/plugin/src/index.vue | 17 +++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core/core-frontend/src/components/plugin/src/PluginComponent.vue b/core/core-frontend/src/components/plugin/src/PluginComponent.vue index 8232500f52..7ae6c0382b 100644 --- a/core/core-frontend/src/components/plugin/src/PluginComponent.vue +++ b/core/core-frontend/src/components/plugin/src/PluginComponent.vue @@ -110,7 +110,10 @@ onMounted(async () => { distributed = wsCache.get(key) } if (isNull(distributed)) { - emits('loadFail') + setTimeout(() => { + emits('loadFail') + loading.value = false + }, 1000) return } if (distributed) { diff --git a/core/core-frontend/src/components/plugin/src/index.vue b/core/core-frontend/src/components/plugin/src/index.vue index 9718f639b4..069bd72da3 100644 --- a/core/core-frontend/src/components/plugin/src/index.vue +++ b/core/core-frontend/src/components/plugin/src/index.vue @@ -98,11 +98,14 @@ const pluginProxy = ref(null) const invokeMethod = param => { if (pluginProxy.value['invokeMethod']) { pluginProxy.value['invokeMethod'](param) - } else { + } else if (param.methodName && pluginProxy.value[param.methodName]) { pluginProxy.value[param.methodName](param.args) } } - +const emits = defineEmits(['loadFail']) +defineExpose({ + invokeMethod +}) onMounted(async () => { const key = 'xpack-model-distributed' let distributed = false @@ -115,7 +118,10 @@ onMounted(async () => { distributed = wsCache.get(key) } if (isNull(distributed)) { - emits('loadFail') + setTimeout(() => { + emits('loadFail') + loading.value = false + }, 1000) return } if (distributed) { @@ -143,11 +149,6 @@ onMounted(async () => { loadComponent() } }) - -const emits = defineEmits(['loadFail']) -defineExpose({ - invokeMethod -})