From d30ef2b77bd39b0ae63df3ede8011b4aa60c17c0 Mon Sep 17 00:00:00 2001 From: wisonic-s <51065359+wisonic-s@users.noreply.github.com> Date: Wed, 23 Apr 2025 16:26:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4G2PLOT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/config/distributed.ts | 2 +- .../views/chart/components/js/panel/types/impl/g2plot.ts | 3 --- core/core-frontend/src/views/chart/components/js/util.ts | 2 -- core/core-frontend/src/views/copilot/DialogueChart.vue | 9 ++++----- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/core/core-frontend/config/distributed.ts b/core/core-frontend/config/distributed.ts index c78ec0c274..02ccbb5481 100644 --- a/core/core-frontend/config/distributed.ts +++ b/core/core-frontend/config/distributed.ts @@ -26,7 +26,7 @@ export default { vue: ['vue', 'vue-router', 'pinia', 'vue-i18n', 'mitt'], lodash: ['lodash-es', 'lodash'], library: ['jspdf', '@tinymce/tinymce-vue', 'screenfull'], - antv: ['@antv/g2', '@antv/g2plot', '@antv/l7', '@antv/l7plot', '@antv/s2'], + antv: ['@antv/g2', '@antv/l7', '@antv/l7plot', '@antv/s2'], tinymce: ['tinymce'], axios: ['axios'], 'vuedraggable-es': ['vuedraggable'] diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/g2plot.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/g2plot.ts index 8aa142bea3..7d8f2818ca 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/g2plot.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/g2plot.ts @@ -1,5 +1,3 @@ -import type { PickOptions } from '@antv/g2plot/esm/core/plot' -import type { Plot } from '@antv/g2plot/esm/core/plot' import { getAnalyse, getAnalyseHorizontal, @@ -31,7 +29,6 @@ import { handleEmptyDataStrategy, setupSeriesColor } from '../../../util' -import { Options } from '@antv/g2plot' export interface G2PlotDrawOptions extends AntVDrawOptions { /** diff --git a/core/core-frontend/src/views/chart/components/js/util.ts b/core/core-frontend/src/views/chart/components/js/util.ts index 28ef68faf7..22fc10b474 100644 --- a/core/core-frontend/src/views/chart/components/js/util.ts +++ b/core/core-frontend/src/views/chart/components/js/util.ts @@ -5,8 +5,6 @@ import { FeatureCollection } from '@antv/l7plot/dist/esm/plots/choropleth/types' import { useMapStoreWithOut } from '@/store/modules/map' import { getGeoJson } from '@/api/map' import { computed, toRaw } from 'vue' -import { Options } from '@antv/g2plot/esm' -import { PickOptions } from '@antv/g2plot/esm/core/plot' import { innerExportDataSetDetails, innerExportDetails } from '@/api/chart' import { ElMessage } from 'element-plus-secondary' import { useI18n } from '@/hooks/web/useI18n' diff --git a/core/core-frontend/src/views/copilot/DialogueChart.vue b/core/core-frontend/src/views/copilot/DialogueChart.vue index f56b24d1cc..a0b3e59c0f 100644 --- a/core/core-frontend/src/views/copilot/DialogueChart.vue +++ b/core/core-frontend/src/views/copilot/DialogueChart.vue @@ -7,7 +7,6 @@ import copilot from '@/assets/svg/copilot.svg' import chartTable from '@/assets/svg/chart-table.svg' import chartDownload from '@/assets/svg/chart-download.svg' import { PropType, computed, onMounted, shallowRef, ref, nextTick, watch } from 'vue' -import { Column, Line, Pie } from '@antv/g2plot' import { useElementSize } from '@vueuse/core' import { downloadCanvas } from '@/utils/imgUtils' import ExcelJS from 'exceljs' @@ -53,7 +52,7 @@ const chartRef = ref() const { width } = useElementSize(chartRef) onMounted(() => { const { chart, msgType, msgStatus, chartData, id } = props.copilotInfo - if (msgStatus === 1 && msgType === 'api' && chartData) { + /* if (msgStatus === 1 && msgType === 'api' && chartData) { if (['bar', 'line'].includes(chart.type)) { activeCommand.value = chart.type const chartType = chart.type === 'bar' ? Column : Line @@ -94,7 +93,7 @@ onMounted(() => { }) renderTableLocal.value = true } - } + } */ nextTick(() => { ;(chartTypeList.value || content.value).scrollIntoView({ block: 'end', @@ -134,7 +133,7 @@ const changeChartType = () => { } const switchChartType = type => { renderTableLocal.value = false - nextTick(() => { + /* nextTick(() => { if (columnPlot?.chart && !columnPlot.chart.wrapperElement) { columnPlot.chart.wrapperElement = document.querySelector( `#de-${props.copilotInfo.id}-ed > div` @@ -193,7 +192,7 @@ const switchChartType = type => { renderTableLocal.value = true } - }) + }) */ } const chartTypeRef = ref() const downloadChart = () => {