From a2065dced187c02ed3fbafa27aaf8d38fd2cbcea Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 11 Dec 2024 17:26:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=9E=E9=80=80=20(#13984)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: taojinlong --- core/core-backend/pom.xml | 15 ------- .../main/resources/application-standalone.yml | 4 +- .../src/components/plugin/src/index.vue | 42 ++++++++++++++++++- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/core/core-backend/pom.xml b/core/core-backend/pom.xml index 615ba53b31..a1917fcbfd 100644 --- a/core/core-backend/pom.xml +++ b/core/core-backend/pom.xml @@ -18,21 +18,6 @@ guava ${guava.version} - - io.dataease - xpack-base - ${project.version} - - - io.dataease - xpack-permissions - ${project.version} - - - io.dataease - xpack-sync - ${project.version} - io.dataease api-base diff --git a/core/core-backend/src/main/resources/application-standalone.yml b/core/core-backend/src/main/resources/application-standalone.yml index 4503605f38..dc736ca3a7 100644 --- a/core/core-backend/src/main/resources/application-standalone.yml +++ b/core/core-backend/src/main/resources/application-standalone.yml @@ -1,8 +1,8 @@ spring: datasource: - url: jdbc:mysql://123.57.152.118:3306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://localhost:3306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root - password: Password123@mysql + password: 123456 messages: basename: i18n/lic,i18n/core,i18n/permissions,i18n/xpack,i18n/sync flyway: diff --git a/core/core-frontend/src/components/plugin/src/index.vue b/core/core-frontend/src/components/plugin/src/index.vue index 915304f1c8..5b56d5a364 100644 --- a/core/core-frontend/src/components/plugin/src/index.vue +++ b/core/core-frontend/src/components/plugin/src/index.vue @@ -108,7 +108,47 @@ defineExpose({ invokeMethod }) onMounted(async () => { - loadComponent() + const key = 'xpack-model-distributed' + let distributed = false + if (wsCache.get(key) === null) { + const res = await xpackModelApi() + const resData = isNull(res.data) ? 'null' : res.data + wsCache.set('xpack-model-distributed', resData) + distributed = res.data + } else { + distributed = wsCache.get(key) + } + if (isNull(distributed)) { + setTimeout(() => { + emits('loadFail') + loading.value = false + }, 1000) + return + } + if (distributed) { + if (window['DEXPack']) { + const xpack = await window['DEXPack'].mapping[attrs.jsname] + plugin.value = xpack.default + } else if (!window._de_xpack_not_loaded) { + window._de_xpack_not_loaded = true + window['VueDe'] = Vue + window['AxiosDe'] = axios + window['PiniaDe'] = Pinia + window['vueRouterDe'] = router + window['MittAllDe'] = useEmitt().emitter.all + window['I18nDe'] = i18n + window['EchartsDE'] = echarts + if (!window.tinymce) { + window.tinymce = tinymce + } + loadDistributed().then(async res => { + new Function(res.data)() + useEmitt().emitter.emit('load-xpack') + }) + } + } else { + loadComponent() + } })