From 5439cead12b2d991dc22b293cc2e615414fa3eed Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 2 Jan 2025 16:43:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9F=B1=E6=9D=A1=E5=9B=BE=E6=9D=A1=E4=BB=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=8D=E9=80=8F=E6=98=8E=E5=BA=A6=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=E5=8F=8A=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dialog/LineThresholdEdit.vue | 15 ++++++++++++++- .../src/views/chart/components/js/util.ts | 7 ++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/LineThresholdEdit.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/LineThresholdEdit.vue index 919274389e..6a82765001 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/LineThresholdEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/LineThresholdEdit.vue @@ -148,6 +148,17 @@ const isRangeBar = computed(() => { return props.chart.type === 'bar-range' }) +const isBarOrHorizontal = computed(() => { + return [ + 'bar', + 'bar-group', + 'waterfall', + 'bar-horizontal', + 'bidirectional-bar', + 'progress-bar' + ].includes(props.chart.type) +}) + const initFields = () => { let fields = [] if (isSymbolicMap.value) { @@ -407,7 +418,9 @@ init() { * @param alpha */ export const hexToRgba = (hex, alpha = 1) => { + if (!hex.startsWith('#')) { + return hex + } // 去掉 # 号 hex = hex.replace('#', '') // 转换为 RGB 分量 const r = parseInt(hex.slice(0, 2), 16) const g = parseInt(hex.slice(2, 4), 16) const b = parseInt(hex.slice(4, 6), 16) + const hexAlpha = hex.slice(6, 8) + const a = hexAlpha ? parseInt(hex.slice(6, 8), 16) / 255 : alpha // 返回 RGBA 格式 - return `rgba(${r}, ${g}, ${b}, ${alpha})` + return `rgba(${r}, ${g}, ${b}, ${a})` }