From a3e908447953dafa35d424299a886b905f68640f Mon Sep 17 00:00:00 2001 From: wisonic-s <51065359+wisonic-s@users.noreply.github.com> Date: Wed, 9 Apr 2025 18:22:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E9=83=A8=E5=88=86=E5=9B=BE=E8=A1=A8=E7=9A=84=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/drag-item/DimensionItem.vue | 26 ++++++++++++------- .../components/editor/drag-item/QuotaItem.vue | 14 +++++++--- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue index f9be2dd653..df68aec8ac 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue @@ -192,17 +192,25 @@ const showCustomSort = item => { } return !item.chartId && (item.deType === 0 || item.deType === 5) } -const showSort = () => { + +const NOT_SUPPORT_SORT = ['word-cloud', 'stock-line', 'treemap', 'circle-packing'] +const showSort = computed(() => { const { type: chartType } = props.chart const { type: propType } = props - const notShowSort = ['word-cloud', 'stock-line', 'treemap'].includes(chartType) + const notShowSort = NOT_SUPPORT_SORT.includes(chartType) if (notShowSort || propType === 'extColor') { return false } const isChartMix = chartType.includes('chart-mix') const isDimensionType = ['dimension', 'dimensionStack', 'dimensionExt'].includes(propType) return !isChartMix || isDimensionType -} +}) +const showSortPriority = computed(() => { + if (props.chart.type.includes('chart-mix')) { + return false + } + return showSort.value +}) const toggleHide = () => { item.value.index = props.index item.value.hide = !item.value.hide @@ -227,17 +235,17 @@ onMounted(() => { :style="{ backgroundColor: tagType + '0a', border: '1px solid ' + tagType }" > - + - + - + @@ -284,7 +292,7 @@ onMounted(() => { class="item-span-style" :class="{ 'hidden-status': showHideIcon, - 'sort-status': showSort() && item.sort !== 'none' + 'sort-status': showSort && item.sort !== 'none' }" > {{ item.chartShowName ? item.chartShowName : item.name }} @@ -313,7 +321,7 @@ onMounted(() => { class="drop-style" :class="themes === 'dark' ? 'dark-dimension-quota' : ''" > - + { diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue index 5575601869..9d4888a50e 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue @@ -315,14 +315,22 @@ const showHideIcon = computed(() => { return ['tale-info', 'table-normal'].includes(props.chart.type) && item.value.hide }) +const NOT_SUPPORT_SORT = [ + 'circle-packing', + 'indicator', + 'liquid', + 'gauge', + 'word-cloud', + 'stock-line', + 'treemap' +] + const showSort = computed(() => { return ( props.type !== 'extLabel' && props.type !== 'extTooltip' && props.type !== 'extBubble' && - !['indicator', 'liquid', 'gauge', 'word-cloud', 'stock-line', 'treemap'].includes( - chart.value.type - ) && + !NOT_SUPPORT_SORT.includes(chart.value.type) && !chart.value.type.includes('chart-mix') ) })