diff --git a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java index 24f8b99a41..d06d88f47f 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -279,6 +279,12 @@ public class ChartViewService { if (result == null) { DataEaseException.throwException(Translator.get("i18n_chart_delete")); } + DatasetTable datasetTable = dataSetTableService.get(result.getTableId()); + if (ObjectUtils.isNotEmpty(datasetTable)) { + result.setDatasetMode(datasetTable.getMode()); + Datasource datasource = datasourceService.get(datasetTable.getDataSourceId()); + result.setDatasourceType(datasource != null ? datasource.getType() : null); + } return result; } catch (Exception e) { e.printStackTrace(); @@ -645,13 +651,23 @@ public class ChartViewService { // 直连明细表分页 Map mapAttr = gson.fromJson(view.getCustomAttr(), Map.class); Map mapSize = (Map) mapAttr.get("size"); - if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0 && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) { - if (chartExtRequest.getGoPage() == null) { - chartExtRequest.setGoPage(1L); - } - if (chartExtRequest.getPageSize() == null) { - String pageSize = (String) mapSize.get("tablePageSize"); - chartExtRequest.setPageSize(Long.parseLong(pageSize)); + if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) { + if (StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) { + if (chartExtRequest.getGoPage() == null) { + chartExtRequest.setGoPage(1L); + } + if (chartExtRequest.getPageSize() == null) { + String pageSize = (String) mapSize.get("tablePageSize"); + chartExtRequest.setPageSize(Math.min(Long.parseLong(pageSize), view.getResultCount().longValue())); + } + } else { + if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { + chartExtRequest.setGoPage(1L); + chartExtRequest.setPageSize(view.getResultCount().longValue()); + } else { + chartExtRequest.setGoPage(null); + chartExtRequest.setPageSize(null); + } } } else { chartExtRequest.setGoPage(null); @@ -910,7 +926,13 @@ public class ChartViewService { String totalPageSql = null; PageInfo pageInfo = new PageInfo(); pageInfo.setGoPage(chartExtRequest.getGoPage()); - pageInfo.setPageSize(chartExtRequest.getPageSize()); + if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { + if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) { + pageInfo.setPageSize(Math.min(view.getResultCount() - (chartExtRequest.getGoPage() - 1) * chartExtRequest.getPageSize(), chartExtRequest.getPageSize())); + } + } else { + pageInfo.setPageSize(chartExtRequest.getPageSize()); + } List detailFieldList = new ArrayList<>(); String detailFieldSql = null; diff --git a/frontend/src/components/deDrag/index.vue b/frontend/src/components/deDrag/index.vue index 18d983d94d..2591f61ad6 100644 --- a/frontend/src/components/deDrag/index.vue +++ b/frontend/src/components/deDrag/index.vue @@ -66,7 +66,7 @@ @mousedown.stop.prevent="handleDown(handlei, $event)" @touchstart.stop.prevent="handleTouchDown(handlei, $event)" > - +
- +
@@ -2170,31 +2170,31 @@ export default { } .de-drag-top { - left: 0; - top: 0; + left: 1px; + top: 1px; height: 12px; - width: 100%; + width: calc(100% - 2px); } .de-drag-right { - right: 0; - top: 0; + right: 1px; + top: 1px; width: 16px; - height: 100%; + height: calc(100% - 30px); } .de-drag-bottom { - left: 0; - bottom: 0; + left: 1px; + bottom: 1px; height: 12px; - width: 100%; + width: calc(100% - 2px); } .de-drag-left { - left: 0; - top: 0; + left: 1px; + top: 1px; width: 16px; - height: 100%; + height: calc(100% - 2px); } diff --git a/frontend/src/views/chart/chart/common/common_antv.js b/frontend/src/views/chart/chart/common/common_antv.js index c869d8132c..21f4ea5abd 100644 --- a/frontend/src/views/chart/chart/common/common_antv.js +++ b/frontend/src/views/chart/chart/common/common_antv.js @@ -376,7 +376,7 @@ export function getTooltip(chart) { } else { res = param.value } - obj.value = res + obj.value = res === null ? '' : res return obj } } diff --git a/frontend/src/views/chart/chart/formatter.js b/frontend/src/views/chart/chart/formatter.js index 9c3be428e3..5a51c89dda 100644 --- a/frontend/src/views/chart/chart/formatter.js +++ b/frontend/src/views/chart/chart/formatter.js @@ -23,6 +23,9 @@ export const formatterType = [ ] export function valueFormatter(value, formatter) { + if (value === null || value === undefined) { + return null + } // 1.unit 2.decimal 3.thousand separator and suffix let result if (formatter.type === 'auto') { diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 5b5c9f6fd4..6b5057a14f 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -332,6 +332,13 @@ export default { }) return } + if (this.canvasStyleData.panel.themeColor === 'dark') { + chart_option.legend['pageIconColor'] = '#ffffff' + chart_option.legend['pageIconInactiveColor'] = '#8c8c8c' + } else { + chart_option.legend['pageIconColor'] = '#000000' + chart_option.legend['pageIconInactiveColor'] = '#8c8c8c' + } this.myEcharts(chart_option) this.$nextTick(() => (this.linkageActive())) }, diff --git a/frontend/src/views/chart/components/ChartComponentG2.vue b/frontend/src/views/chart/components/ChartComponentG2.vue index 5c1a727b62..650a73cf27 100644 --- a/frontend/src/views/chart/components/ChartComponentG2.vue +++ b/frontend/src/views/chart/components/ChartComponentG2.vue @@ -58,6 +58,7 @@ import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' import { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv' import ChartTitleUpdate from './ChartTitleUpdate.vue' import { equalsAny } from '@/utils/StringUtils' +import { mapState } from 'vuex' export default { name: 'ChartComponentG2', @@ -140,7 +141,10 @@ export default { chartInfo() { const { id, title } = this.chart return { id, title } - } + }, + ...mapState([ + 'canvasStyleData' + ]) }, watch: { chart: { @@ -280,6 +284,24 @@ export default { if (this.myChart && chart.type !== 'liquid' && this.searchCount > 0) { this.myChart.options.animation = false } + if (this.myChart.options.legend) { + let pageNavigatorInactiveFill, pageNavigatorFill + if (this.canvasStyleData.panel.themeColor === 'dark') { + pageNavigatorFill = '#ffffff' + pageNavigatorInactiveFill = '#8c8c8c' + } else { + pageNavigatorFill = '#000000' + pageNavigatorInactiveFill = '#8c8c8c' + } + this.myChart.options.legend['pageNavigator'] = { + marker: { + style: { + inactiveFill: pageNavigatorInactiveFill, // 不能点击的颜色 + fill: pageNavigatorFill // 正常的颜色 + } + } + } + } if (this.antVRenderStatus) { this.myChart.render() diff --git a/frontend/src/views/chart/components/senior/FunctionCfg.vue b/frontend/src/views/chart/components/senior/FunctionCfg.vue index 835e6b48fc..31f96f2968 100644 --- a/frontend/src/views/chart/components/senior/FunctionCfg.vue +++ b/frontend/src/views/chart/components/senior/FunctionCfg.vue @@ -76,11 +76,8 @@ v-model="functionForm.emptyDataStrategy" @change="changeFunctionCfg" > - {{ chart.type.includes('bar')?$t('chart.set_zero'):$t('chart.break_line') }} - {{ $t('chart.set_zero') }} + {{ $t('chart.break_line') }} + {{ $t('chart.set_zero') }} {{ $t('chart.ignore_data') }}