From 0a6cf7ed13dd808fdd2cb69ffd06573d8462f4f4 Mon Sep 17 00:00:00 2001 From: wisonic Date: Wed, 6 Nov 2024 15:17:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8=E5=90=88=E5=B9=B6=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=92=8C=E8=A1=8C=E5=88=97=E5=86=BB=E7=BB=93=E4=BA=92=E6=96=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/table/TableCellSelector.vue | 26 ++++++++++++++++--- .../js/panel/common/common_table.ts | 6 +++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue index 27167f01de..d65bc6a145 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue @@ -4,6 +4,7 @@ import icon_italic_outlined from '@/assets/svg/icon_italic_outlined.svg' import icon_leftAlignment_outlined from '@/assets/svg/icon_left-alignment_outlined.svg' import icon_centerAlignment_outlined from '@/assets/svg/icon_center-alignment_outlined.svg' import icon_rightAlignment_outlined from '@/assets/svg/icon_right-alignment_outlined.svg' +import icon_info_outlined from '@/assets/svg/icon_info_outlined.svg' import { computed, onMounted, PropType, reactive, watch } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { COLOR_PANEL, DEFAULT_TABLE_CELL } from '@/views/chart/components/editor/util/chart' @@ -321,6 +322,7 @@ onMounted(() => { @@ -339,7 +341,7 @@ onMounted(() => { :effect="themes" controls-position="right" v-model="state.tableCellForm.tableColumnFreezeHead" - :disabled="!state.tableCellForm.tableFreeze" + :disabled="!state.tableCellForm.tableFreeze || state.tableCellForm.mergeCells" :min="0" :max="100" @change="changeTableCell('tableColumnFreezeHead')" @@ -357,7 +359,7 @@ onMounted(() => { :effect="themes" controls-position="right" v-model="state.tableCellForm.tableRowFreezeHead" - :disabled="!state.tableCellForm.tableFreeze" + :disabled="!state.tableCellForm.tableFreeze || state.tableCellForm.mergeCells" :min="0" :max="100" @change="changeTableCell('tableRowFreezeHead')" @@ -376,7 +378,17 @@ onMounted(() => { v-model="state.tableCellForm.mergeCells" @change="changeTableCell('mergeCells')" > - {{ t('chart.merge_cells') }} + + {{ t('chart.merge_cells') }} + + + + + + + { .mobile-style { margin-top: 25px; } +.data-area-label { + text-align: left; + position: relative; + width: 100%; + display: flex; + flex-direction: row; + align-items: center; +} diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts index 22120abd4a..6c8acb6709 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts @@ -1430,12 +1430,14 @@ export function configMergeCells(chart: Chart, options: S2Options, dataConfig: S const { mergeCells } = parseJson(chart.customAttr).tableCell const { showIndex } = parseJson(chart.customAttr).tableHeader if (mergeCells) { + options.frozenColCount = 0 + options.frozenRowCount = 0 const fields = chart.data.fields || [] - const fielsMap = fields.reduce((p, n) => { + const fieldsMap = fields.reduce((p, n) => { p[n.dataeaseName] = n return p }, {}) || {} - const quotaIndex = dataConfig.meta.findIndex(m => fielsMap[m.field].groupType === 'q') + const quotaIndex = dataConfig.meta.findIndex(m => fieldsMap[m.field].groupType === 'q') const data = chart.data?.tableRow if (quotaIndex === 0 || !data?.length) { return