From 9b945f931d519e8c32b33b2f6684ea10cc427fc7 Mon Sep 17 00:00:00 2001 From: wisonic Date: Fri, 16 Aug 2024 16:17:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8=E5=9B=BE=E7=89=87=E5=AD=97=E6=AE=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/visualization/UserViewEnlarge.vue | 6 ++++-- core/core-frontend/src/models/chart/chart.d.ts | 1 + .../chart/components/js/panel/charts/table/table-info.ts | 7 ++++--- .../chart/components/views/components/ChartComponentS2.vue | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue index 163e43d87c..71fb0f6663 100644 --- a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue +++ b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue @@ -189,7 +189,8 @@ const DETAIL_CHART_ATTR: DeepPartial = { scrollCfg: { open: false } - } + }, + showPosition: 'dialog' } const state = reactive({ @@ -200,7 +201,8 @@ const DETAIL_TABLE_ATTR: DeepPartial = { scrollCfg: { open: false } - } + }, + showPosition: 'dialog' } const authShow = computed(() => editMode.value === 'edit' || dvInfo.value.weight > 3) diff --git a/core/core-frontend/src/models/chart/chart.d.ts b/core/core-frontend/src/models/chart/chart.d.ts index 8d65b4bec5..2dff80aff4 100644 --- a/core/core-frontend/src/models/chart/chart.d.ts +++ b/core/core-frontend/src/models/chart/chart.d.ts @@ -67,6 +67,7 @@ declare interface Chart { seriesFieldObjs?: any[] flowMapStartName?: Axis[] flowMapEndName?: Axis[] + showPosition: string } declare type CustomAttr = DeepPartial | JSONString> declare type CustomStyle = DeepPartial | JSONString> diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts index 4c5f567976..4de4f3690c 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts @@ -18,8 +18,9 @@ class ImageCell extends TableDataCell { !this.cfg.children && (this.cfg.children = []) const { width: imgWidth, height: imgHeight } = img const ratio = Math.max(imgWidth / width, imgHeight / height) - const imgShowWidth = imgWidth / ratio - const imgShowHeight = imgHeight / ratio + // 不铺满,部分留白 + const imgShowWidth = (imgWidth / ratio) * 0.8 + const imgShowHeight = (imgHeight / ratio) * 0.8 this.textShape = this.addShape('image', { attrs: { x: x + (imgShowWidth < width ? (width - imgShowWidth) / 2 : 0), @@ -162,7 +163,7 @@ export class TableInfo extends S2ChartView { } s2Options.dataCell = viewMeta => { const deType = axisMap[viewMeta.valueField]?.deType - if (deType === 7) { + if (deType === 7 && chart.showPosition !== 'dialog') { return new ImageCell(viewMeta, viewMeta?.spreadsheet) } if (viewMeta.colIndex === 0 && s2Options.showSeriesNumber) { diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index 061cd2e5ac..5e6f343db3 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -506,7 +506,7 @@ const trackMenuCalc = itemId => { // 明细表 URL 字段图片放大 if (view.value.type === 'table-info') { view.value.xAxis?.forEach(axis => { - if (axis.id === itemId) { + if (axis.id === itemId && axis.deType === 7) { trackMenuInfo.push('enlarge') } }) From 45c1e327ee47cd26318df5e4a070d8ee6f895f1d Mon Sep 17 00:00:00 2001 From: wisonic Date: Fri, 16 Aug 2024 16:20:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8=E5=9B=BE=E7=89=87=E5=AD=97=E6=AE=B5=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E8=AE=BE=E7=BD=AE=E9=98=88=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor-senior/components/dialog/TableThresholdEdit.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue index 46a64a9148..402474f774 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue @@ -267,6 +267,7 @@ init() :key="fieldOption.id" :label="fieldOption.name" :value="fieldOption.id" + :disabled="chart.type === 'table-info' && fieldOption.deType === 7" >