From 992120f8aa605469e476a9f974a63e7e6506baa1 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 26 Sep 2024 14:13:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?perf(X-Pack):=20=E7=A4=BE=E5=8C=BA=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=96=E6=B6=88xpack=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/home/RestIndexController.java | 13 +++++++------ .../java/io/dataease/home/manage/DeIndexManage.java | 13 +++++++++++++ .../src/components/plugin/src/PluginComponent.vue | 7 ++++++- .../src/components/plugin/src/index.vue | 8 +++++++- core/core-frontend/src/utils/logout.ts | 3 ++- core/core-frontend/src/utils/utils.ts | 4 ++++ core/core-frontend/src/views/about/index.vue | 2 +- de-xpack | 2 +- 8 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 core/core-backend/src/main/java/io/dataease/home/manage/DeIndexManage.java diff --git a/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java b/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java index e848d88e9d..231afa9d90 100644 --- a/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java +++ b/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java @@ -1,9 +1,9 @@ package io.dataease.home; -import io.dataease.license.utils.LicenseUtil; +import io.dataease.home.manage.DeIndexManage; import io.dataease.utils.ModelUtils; import io.dataease.utils.RsaUtils; -import org.springframework.beans.factory.annotation.Value; +import jakarta.annotation.Resource; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -13,8 +13,9 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping public class RestIndexController { - @Value("${dataease.xpack-front-distributed:false}") - private boolean xpackFrontDistributed; + + @Resource + private DeIndexManage deIndexManage; @GetMapping("/dekey") @ResponseBody @@ -31,8 +32,8 @@ public class RestIndexController { @GetMapping("/xpackModel") @ResponseBody - public boolean xpackModel() { - return xpackFrontDistributed && LicenseUtil.licenseValid(); + public Boolean xpackModel() { + return deIndexManage.xpackModel(); } } diff --git a/core/core-backend/src/main/java/io/dataease/home/manage/DeIndexManage.java b/core/core-backend/src/main/java/io/dataease/home/manage/DeIndexManage.java new file mode 100644 index 0000000000..9ef0cfe13a --- /dev/null +++ b/core/core-backend/src/main/java/io/dataease/home/manage/DeIndexManage.java @@ -0,0 +1,13 @@ +package io.dataease.home.manage; + +import io.dataease.license.config.XpackInteract; +import org.springframework.stereotype.Component; + +@Component +public class DeIndexManage { + + @XpackInteract(value = "deIndexManage", replace = true) + public Boolean xpackModel() { + return null; + } +} diff --git a/core/core-frontend/src/components/plugin/src/PluginComponent.vue b/core/core-frontend/src/components/plugin/src/PluginComponent.vue index b0e2fc2894..8232500f52 100644 --- a/core/core-frontend/src/components/plugin/src/PluginComponent.vue +++ b/core/core-frontend/src/components/plugin/src/PluginComponent.vue @@ -12,6 +12,7 @@ import * as vueRouter from 'vue-router' import { useEmitt } from '@/hooks/web/useEmitt' import request from '@/config/axios' const { wsCache } = useCache() +import { isNull } from '@/utils/utils' const plugin = ref() @@ -103,11 +104,15 @@ onMounted(async () => { let distributed = false if (wsCache.get(key) === null) { const res = await xpackModelApi() - wsCache.set('xpack-model-distributed', res.data) + wsCache.set('xpack-model-distributed', isNull(res.data) ? 'null' : res.data) distributed = res.data } else { distributed = wsCache.get(key) } + if (isNull(distributed)) { + emits('loadFail') + return + } if (distributed) { const moduleName = getModuleName() if (window[moduleName]) { diff --git a/core/core-frontend/src/components/plugin/src/index.vue b/core/core-frontend/src/components/plugin/src/index.vue index 3072a48018..9718f639b4 100644 --- a/core/core-frontend/src/components/plugin/src/index.vue +++ b/core/core-frontend/src/components/plugin/src/index.vue @@ -12,6 +12,7 @@ import * as echarts from 'echarts' import router from '@/router' import tinymce from 'tinymce/tinymce' import { useEmitt } from '@/hooks/web/useEmitt' +import { isNull } from '@/utils/utils' const { wsCache } = useCache() @@ -107,11 +108,16 @@ onMounted(async () => { let distributed = false if (wsCache.get(key) === null) { const res = await xpackModelApi() - wsCache.set('xpack-model-distributed', res.data) + 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)) { + emits('loadFail') + return + } if (distributed) { if (window['DEXPack']) { const xpack = await window['DEXPack'].mapping[attrs.jsname] diff --git a/core/core-frontend/src/utils/logout.ts b/core/core-frontend/src/utils/logout.ts index 4dce91b431..c0dc30ac12 100644 --- a/core/core-frontend/src/utils/logout.ts +++ b/core/core-frontend/src/utils/logout.ts @@ -51,7 +51,8 @@ const removeCache = () => { if ( key.startsWith('de-plugin-') || key === 'de-platform-client' || - key === 'pwd-validity-period' + key === 'pwd-validity-period' || + key === 'xpack-model-distributed' ) { wsCache.delete(key) } diff --git a/core/core-frontend/src/utils/utils.ts b/core/core-frontend/src/utils/utils.ts index 9699452db5..cc1d599659 100644 --- a/core/core-frontend/src/utils/utils.ts +++ b/core/core-frontend/src/utils/utils.ts @@ -184,3 +184,7 @@ export function cutTargetTree(tree: BusiTreeNode[], targetId: string | number) { export const isLink = () => { return window.location.hash.startsWith('#/de-link/') } + +export const isNull = arg => { + return typeof arg === 'undefined' || arg === null || arg === 'null' +} diff --git a/core/core-frontend/src/views/about/index.vue b/core/core-frontend/src/views/about/index.vue index eda28a0370..033cc2e512 100644 --- a/core/core-frontend/src/views/about/index.vue +++ b/core/core-frontend/src/views/about/index.vue @@ -87,6 +87,7 @@ const removeDistributeModule = () => { localStorage.removeItem(key) } const importLic = file => { + removeDistributeModule() const reader = new FileReader() reader.onload = function (e) { const licKey = e.target.result @@ -97,7 +98,6 @@ const importLic = file => { reader.readAsText(file) } const validateHandler = (param, success) => { - removeDistributeModule() validateApi(param).then(success) } const getLicense = result => { diff --git a/de-xpack b/de-xpack index d415457510..686ee95e62 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit d415457510f49faf552ad2bfe51030f8c228e736 +Subproject commit 686ee95e622fbd16e04cf0847d0a84dbe9a59488 From bb411aaaf56e34b2bdb28d871d8be01c4067e4c1 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 26 Sep 2024 14:25:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=8C=87=E6=A0=87=E5=8D=A1=E9=85=8D=E7=BD=AE=E6=95=B0?= =?UTF-8?q?=E5=80=BC=E6=A0=BC=E5=BC=8F=E5=90=8E=E8=A2=AB=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20#12199?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/editor/drag-item/QuotaItem.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue index 51ae3d9ebf..c3dc1148d3 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue @@ -249,7 +249,10 @@ const quickCalc = param => { break case 'setting': // 选择占比外,设置自动 - resetValueFormatter(item.value) + // 指标卡不需要重置数值格式 + if (chart.value.type !== 'indicator') { + resetValueFormatter(item.value) + } editCompare() break case 'percent': @@ -278,6 +281,7 @@ const editCompare = () => { } const valueFormatter = () => { + debugger item.value.index = props.index item.value.formatterType = props.type emit('valueFormatter', item.value) From 963f4ff85b724480c06de99caafb675245a023e7 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 26 Sep 2024 14:27:40 +0800 Subject: [PATCH 3/5] =?UTF-8?q?style(=E5=9B=BE=E8=A1=A8):=20=E6=B8=85?= =?UTF-8?q?=E9=99=A4debugger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/editor/drag-item/QuotaItem.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue index c3dc1148d3..5a1e9bb751 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue @@ -281,7 +281,6 @@ const editCompare = () => { } const valueFormatter = () => { - debugger item.value.index = props.index item.value.formatterType = props.type emit('valueFormatter', item.value) From c7bbabf26fbb798ec2cc6e4ef6c023eb22f94238 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 26 Sep 2024 14:48:22 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E8=B6=85=E9=93=BE=E6=8E=A5=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=BD=93=E5=89=8D=E7=AA=97=E5=8F=A3=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rich-text/DeRichTextView.vue | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue index 407bfc96d3..4263a24ffb 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -204,6 +204,7 @@ watch( canEdit.value = false reShow() myValue.value = assignment(element.value.propValue.textValue) + console.log('===myValue.value=' + myValue.value) ed.setContent(myValue.value) } } @@ -263,6 +264,23 @@ const initCurFieldsChange = () => { } } +const jumpTargetAdaptor = () => { + setTimeout(() => { + const paragraphs = document.querySelectorAll('p') + paragraphs.forEach(p => { + // 如果 p 标签已经有 onclick 且包含 event.stopPropagation,则跳过 + if ( + p.getAttribute('onclick') && + p.getAttribute('onclick').includes('event.stopPropagation()') + ) { + return // 已经有 stopPropagation,跳过 + } + // 否则添加 onclick 事件 + p.setAttribute('onclick', 'event.stopPropagation()') + }) + }, 1000) +} + const assignment = content => { const on = content.match(/\[(.+?)\]/g) if (on) { @@ -288,8 +306,10 @@ const assignment = content => { //De 本地跳转失效问题 content = content.replace(/href="#\//g, 'href="/#/') content = content.replace(/href=\\"#\//g, 'href=\\"/#/') + content = content.replace(/href=\\"#\//g, 'href=\\"/#/') resetSelect() initFontFamily(content) + jumpTargetAdaptor() return content } const initFontFamily = htmlText => { From 449bad198318fe6e67bec92b2978de3542bfb3b5 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 26 Sep 2024 15:04:23 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=80=9A=E8=BF=87=E6=97=B6=E9=97=B4=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E4=BE=9D?= =?UTF-8?q?=E7=84=B6=E6=98=BE=E7=A4=BA=E6=9C=80=E5=80=BC=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#12074?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/js/panel/charts/bar/bar.ts | 1 + .../src/views/chart/components/js/panel/charts/line/area.ts | 1 + .../src/views/chart/components/js/panel/charts/line/line.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts index 17ab2ca800..8bb686b50e 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts @@ -97,6 +97,7 @@ export class Bar extends G2PlotChartView { async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, container, action } = drawOptions if (!chart?.data?.data?.length) { + chart.container = container clearExtremum(chart) return } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts index ec8e71b19e..ad002acae1 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts @@ -98,6 +98,7 @@ export class Area extends G2PlotChartView { async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, container, action } = drawOptions if (!chart.data?.data?.length) { + chart.container = container clearExtremum(chart) return } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts index cc601921a3..5432140a63 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts @@ -50,6 +50,7 @@ export class Line extends G2PlotChartView { async drawChart(drawOptions: G2PlotDrawOptions): Promise { const { chart, action, container } = drawOptions if (!chart.data?.data?.length) { + chart.container = container clearExtremum(chart) return }