From 5571fae31b156065b08f4ed5418172d1890d1c8a Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 15 Jan 2025 16:52:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=94=AF=E6=8C=81=E5=90=8C=E7=8E=AF=E6=AF=94?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E5=AF=8C=E6=96=87=E6=9C=AC=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=95=B0=E6=8D=AE=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rich-text/DeRichTextView.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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 ee6588d9f0..2724613e11 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -535,13 +535,25 @@ const updateEmptyValue = view => { : '-' } +const checkCompareCalc = view => { + let compareCount = 0 + view.yAxis?.forEach(item => { + if (item?.compareCalc?.type !== 'none') { + compareCount++ + } + }) + return compareCount > 0 +} + const calcData = (view: Chart, callback) => { isError.value = false updateEmptyValue(view) if (view.tableId || view['dataFrom'] === 'template') { const v = JSON.parse(JSON.stringify(view)) - v.resultCount = 1 - v.resultMode = 'custom' + if (!checkCompareCalc(view)) { + v.resultCount = 1 + v.resultMode = 'custom' + } getData(v) .then(res => { if (res.code && res.code !== 0) {