From 090ecb433f4c641ad6cb7eac885c624e927101b5 Mon Sep 17 00:00:00 2001 From: ulleo Date: Thu, 26 Dec 2024 17:35:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E9=80=8F=E8=A7=86?= =?UTF-8?q?=E8=A1=A8=E8=A1=8C=E6=B1=87=E6=80=BB=E5=B0=8F=E8=AE=A1=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=A0=B9=E6=8D=AE=E7=BB=B4=E5=BA=A6=E7=81=B5=E6=B4=BB?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20#11336?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/table/TableTotalSelector.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue index 93da19b17b..5745c466a6 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue @@ -2,7 +2,7 @@ import { onMounted, PropType, reactive, watch, ref, inject, nextTick } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { DEFAULT_TABLE_TOTAL } from '@/views/chart/components/editor/util/chart' -import { cloneDeep, defaultsDeep, find } from 'lodash-es' +import { cloneDeep, defaultsDeep, find, includes } from 'lodash-es' import CustomAggrEdit from './CustomAggrEdit.vue' const { t } = useI18n() @@ -21,7 +21,7 @@ const props = defineProps({ } }) watch( - [() => props.chart.customAttr.tableTotal, () => props.chart.yAxis], + [() => props.chart.customAttr.tableTotal, () => props.chart.xAxis, () => props.chart.yAxis], () => { init() }, @@ -66,17 +66,17 @@ function changeRowSubTableTotal() { const initSubTotalDimensionList = () => { const list = [] - if (props.chart.xAxis.length > 2) { + if (props.chart.xAxis.length >= 2) { for (let i = 0; i < props.chart.xAxis.length - 1; i++) { //排除最后一个 - const old = find( + const old = includes( state.tableTotalForm.row.subTotalsDimensions, - s => s === props.chart.xAxis[i].dataeaseName + props.chart.xAxis[i].dataeaseName ) list.push({ displayName: props.chart.xAxis[i].name, name: props.chart.xAxis[i].dataeaseName, - checked: state.tableTotalForm.row.subTotalsDimensionsNew ? old != undefined : true + checked: !!state.tableTotalForm.row.subTotalsDimensionsNew ? old : true }) } }