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})` }