From c85ee86f085b0b5dbc8f969ceb0bda0847eb5770 Mon Sep 17 00:00:00 2001 From: Cindy Chang Date: Fri, 26 Jul 2024 11:39:02 +0800 Subject: [PATCH] sonar medium --- .../Conformance/ConformanceResults.vue | 37 +++++++++++++------ .../ConformanceSidebar/ActSeqDrag.vue | 4 +- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/components/Discover/Conformance/ConformanceResults.vue b/src/components/Discover/Conformance/ConformanceResults.vue index bb6b5e2..f8e6ccf 100644 --- a/src/components/Discover/Conformance/ConformanceResults.vue +++ b/src/components/Discover/Conformance/ConformanceResults.vue @@ -38,13 +38,6 @@

- -
@@ -105,6 +98,15 @@

Short Loop(s)

+ + + + + + + + +
@@ -154,6 +156,15 @@

Issue Listinfo

+ + + + + + + + +
@@ -502,8 +513,9 @@ export default { color: '#334155', align: 'inner', callback: function(value, index, values) { - if (value === 0) return `${value * 100}%`; - else if (value === 1) return `${value * 100}%`; + if (value === 0 || value === 1) { + return `${value * 100}%`; + } }, }, grid: { @@ -587,8 +599,9 @@ export default { color: '#334155', align: 'inner', callback: function(value, index, values) { - if (index === 0) return shortScaleNumber(value); - else if (index === values.length - 1) return shortScaleNumber(value); + if (index === 0 || index === values.length - 1) { + return shortScaleNumber(value); + } }, }, grid: { @@ -617,7 +630,7 @@ export default { let max = yMax * 1.1; let xVal = timeRange(xMin, xMax, 100); let yVal = yTimeRange(data, 100, yMin, yMax); - data = xVal.map((x, index) => ({ x, y: yVal[index] })); + xVal.map((x, index) => ({ x, y: yVal[index] })); let formattedXVal = xVal.map(value => formatTime(value)); formattedXVal = formatMaxTwo(formattedXVal); let selectTimeMinIndex = getXIndex(xVal, this.selectDurationTime.min); diff --git a/src/components/Discover/Conformance/ConformanceSidebar/ActSeqDrag.vue b/src/components/Discover/Conformance/ConformanceSidebar/ActSeqDrag.vue index e02c3cf..007ff95 100644 --- a/src/components/Discover/Conformance/ConformanceSidebar/ActSeqDrag.vue +++ b/src/components/Discover/Conformance/ConformanceSidebar/ActSeqDrag.vue @@ -113,7 +113,9 @@ export default { // 拖曳結束要顯示箭頭,但最後一個不用 const lastChild = evt.item.lastChild; const listIndex = this.listSequence.length - 1 - evt.oldIndex !== listIndex ? lastChild.style.display = '' : null; + if (evt.oldIndex !== listIndex) { + lastChild.style.display = ''; + } // reset: 拖曳最後一個元素時,倒數第二的元素的箭頭要隱藏 this.lastItemIndex = null; },