From eaafad32a3dab9bcd34471342f185b5d2b9ff8e2 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Tue, 26 Aug 2025 18:08:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E8=A1=A8=E6=A0=BC=E5=8F=B3=E9=94=AE=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/table/table-info.ts | 6 ++++++ .../chart/components/js/panel/charts/table/table-normal.ts | 6 ++++++ 2 files changed, 12 insertions(+) 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 3d4a15dd40..0b6a47defe 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 @@ -377,6 +377,12 @@ export class TableInfo extends S2ChartView { newChart.on(S2Event.GLOBAL_CONTEXT_MENU, event => copyContent(newChart, event, meta)) // touch this.configTouchEvent(newChart, drawOption, meta) + // right click + newChart.once(S2Event.LAYOUT_AFTER_RENDER, () => { + newChart.getCanvasElement().addEventListener('contextmenu', e => { + e.preventDefault() + }) + }) // theme const customTheme = this.configTheme(chart) newChart.setThemeCfg({ theme: customTheme }) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts index 8f1e7486fc..3ce5571741 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts @@ -281,6 +281,12 @@ export class TableNormal extends S2ChartView { newChart.on(S2Event.GLOBAL_CONTEXT_MENU, event => copyContent(newChart, event, meta)) // touch this.configTouchEvent(newChart, drawOption, meta) + // right click + newChart.once(S2Event.LAYOUT_AFTER_RENDER, () => { + newChart.getCanvasElement().addEventListener('contextmenu', e => { + e.preventDefault() + }) + }) // theme const customTheme = this.configTheme(chart) newChart.setThemeCfg({ theme: customTheme })