From 4d09ae6bd0bc9df3163cb03576ad8dd48728e57c Mon Sep 17 00:00:00 2001 From: Fine Date: Thu, 17 Oct 2024 18:58:21 +0800 Subject: [PATCH] fix --- .../widget/graph-styles/components/ContentDecorations.vue | 3 --- src/views/dashboard/graphs/Card.vue | 8 ++++---- src/views/dashboard/graphs/Table.vue | 8 ++++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/views/dashboard/configuration/widget/graph-styles/components/ContentDecorations.vue b/src/views/dashboard/configuration/widget/graph-styles/components/ContentDecorations.vue index 4931e65a..a8493563 100644 --- a/src/views/dashboard/configuration/widget/graph-styles/components/ContentDecorations.vue +++ b/src/views/dashboard/configuration/widget/graph-styles/components/ContentDecorations.vue @@ -66,9 +66,6 @@ limitations under the License. --> if (!keys.value.length) { return; } - if (!keys.value[index]) { - return; - } delete decorations.value[keys.value[index]]; keys.value.splice(index, 1); updateConfig({ decorations: decorations.value }); diff --git a/src/views/dashboard/graphs/Card.vue b/src/views/dashboard/graphs/Card.vue index f921a1c5..2b79e31d 100644 --- a/src/views/dashboard/graphs/Card.vue +++ b/src/views/dashboard/graphs/Card.vue @@ -72,14 +72,14 @@ limitations under the License. --> let withinRange = false; const ranges = k.match(regex)?.map(Number) || []; if (k.startsWith("[")) { - withinRange = k.startsWith("[-∞") ? true : Number(singleVal.value) >= ranges[0]; + withinRange = k.startsWith("[-∞") || Number(singleVal.value) >= ranges[0]; } else { - withinRange = k.startsWith("(-∞") ? true : Number(singleVal.value) > ranges[0]; + withinRange = k.startsWith("(-∞") || Number(singleVal.value) > ranges[0]; } if (k.endsWith("]")) { - withinRange = withinRange && (k.endsWith("+∞]") ? true : Number(singleVal.value) <= (ranges[1] || ranges[0])); + withinRange = withinRange && (k.endsWith("+∞]") || Number(singleVal.value) <= (ranges[1] || ranges[0])); } else { - withinRange = withinRange && (k.endsWith("+∞)") ? true : Number(singleVal.value) < (ranges[1] || ranges[0])); + withinRange = withinRange && (k.endsWith("+∞)") || Number(singleVal.value) < (ranges[1] || ranges[0])); } console.log(withinRange); if (withinRange) { diff --git a/src/views/dashboard/graphs/Table.vue b/src/views/dashboard/graphs/Table.vue index 57f76886..93e048ed 100644 --- a/src/views/dashboard/graphs/Table.vue +++ b/src/views/dashboard/graphs/Table.vue @@ -88,14 +88,14 @@ limitations under the License. --> let withinRange = false; const ranges = k.match(regex)?.map(Number) || []; if (k.startsWith("[")) { - withinRange = k.startsWith("[-∞") ? true : Number(source) >= ranges[0]; + withinRange = k.startsWith("[-∞") || Number(source) >= ranges[0]; } else { - withinRange = k.startsWith("(-∞") ? true : Number(source) > ranges[0]; + withinRange = k.startsWith("(-∞") || Number(source) > ranges[0]; } if (k.endsWith("]")) { - withinRange = withinRange && (k.endsWith("+∞]") ? true : Number(source) <= (ranges[1] || ranges[0])); + withinRange = withinRange && (k.endsWith("+∞]") || Number(source) <= (ranges[1] || ranges[0])); } else { - withinRange = withinRange && (k.endsWith("+∞)") ? true : Number(source) < (ranges[1] || ranges[0])); + withinRange = withinRange && (k.endsWith("+∞)") || Number(source) < (ranges[1] || ranges[0])); } if (withinRange) { return decorations.value[i];