From e2692e714ec5e19510340ae8acff016c180d659b Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Tue, 3 Dec 2024 09:27:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=8A=98=E7=BA=BF=E5=9B=BE=E6=9D=A1=E4=BB=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=AF=B9=E8=AE=A1=E6=95=B0=E5=AD=97=E6=AE=B5=E7=9A=84=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/js/panel/common/common_antv.ts | 70 +++++++++---------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index d3b30f151c..c9cbcef083 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -1377,43 +1377,41 @@ export function getConditions(chart: Chart) { continue } for (const t of field.conditions) { - if ([2, 3, 4].includes(field.field.deType)) { - const annotation = { - type: 'regionFilter', - start: ['start', 'median'], - end: ['end', 'min'], - color: t.color - } - // 加中线 - const annotationLine = { - type: 'line', - start: ['start', t.value], - end: ['end', t.value], - style: { - stroke: t.color, - lineDash: [2, 2] - } - } - if (t.term === 'between') { - annotation.start = ['start', parseFloat(t.min)] - annotation.end = ['end', parseFloat(t.max)] - annotationLine.start = ['start', parseFloat(t.min)] - annotationLine.end = ['end', parseFloat(t.min)] - annotations.push(JSON.parse(JSON.stringify(annotationLine))) - annotationLine.start = ['start', parseFloat(t.max)] - annotationLine.end = ['end', parseFloat(t.max)] - annotations.push(annotationLine) - } else if (['lt', 'le'].includes(t.term)) { - annotation.start = ['start', t.value] - annotation.end = ['end', 'min'] - annotations.push(annotationLine) - } else if (['gt', 'ge'].includes(t.term)) { - annotation.start = ['start', t.value] - annotation.end = ['end', 'max'] - annotations.push(annotationLine) - } - annotations.push(annotation) + const annotation = { + type: 'regionFilter', + start: ['start', 'median'], + end: ['end', 'min'], + color: t.color } + // 加中线 + const annotationLine = { + type: 'line', + start: ['start', t.value], + end: ['end', t.value], + style: { + stroke: t.color, + lineDash: [2, 2] + } + } + if (t.term === 'between') { + annotation.start = ['start', parseFloat(t.min)] + annotation.end = ['end', parseFloat(t.max)] + annotationLine.start = ['start', parseFloat(t.min)] + annotationLine.end = ['end', parseFloat(t.min)] + annotations.push(JSON.parse(JSON.stringify(annotationLine))) + annotationLine.start = ['start', parseFloat(t.max)] + annotationLine.end = ['end', parseFloat(t.max)] + annotations.push(annotationLine) + } else if (['lt', 'le'].includes(t.term)) { + annotation.start = ['start', t.value] + annotation.end = ['end', 'min'] + annotations.push(annotationLine) + } else if (['gt', 'ge'].includes(t.term)) { + annotation.start = ['start', t.value] + annotation.end = ['end', 'max'] + annotations.push(annotationLine) + } + annotations.push(annotation) } } return annotations