Merge branch 'dev' into pr@dev@fix_line_empty_data_cfg

This commit is contained in:
wisonic-s 2022-11-25 18:00:17 +08:00
commit 9b997c96b9
7 changed files with 15 additions and 6 deletions

View File

@ -45,4 +45,5 @@ public class ChartViewDTO extends ChartViewWithBLOBs {
private long totalPage;
private long totalItems;
private int datasetMode;
private String datasourceType;
}

View File

@ -302,6 +302,8 @@ public class ChartViewService {
DatasetTable datasetTable = dataSetTableService.get(view.getTableId());
if (ObjectUtils.isNotEmpty(datasetTable)) {
view.setDatasetMode(datasetTable.getMode());
Datasource datasource = datasourceService.get(datasetTable.getDataSourceId());
view.setDatasourceType(datasource != null ? datasource.getType() : null);
}
// 如果是从仪表板获取视图数据则仪表板的查询模式查询结果的数量覆盖视图对应的属性
if (CommonConstants.VIEW_RESULT_MODE.CUSTOM.equals(request.getResultMode())) {

View File

@ -2865,7 +2865,10 @@ public class DataSetTableService {
tree = gson.fromJson(request.getExpressionTree(), DatasetRowPermissionsTreeObj.class);
permissionsTreeService.getField(tree);
}
Map<String, Object> previewData = getPreviewData(request, 1, 100000, null, tree);
Datasource datasource = datasourceService.get(request.getDataSourceId());
int pageSize = (datasource != null && StringUtils.equalsIgnoreCase(datasource.getType(), "es")) ? 10000 : 100000;
request.setRow(String.valueOf(pageSize));
Map<String, Object> previewData = getPreviewData(request, 1, pageSize, null, tree);
List<DatasetTableField> fields = (List<DatasetTableField>) previewData.get("fields");
List<Map<String, Object>> data = (List<Map<String, Object>>) previewData.get("data");
// 构建Excel数据格式

View File

@ -1107,3 +1107,5 @@ export const CHART_FONT_LETTER_SPACE = [
{ name: '9px', value: '9' },
{ name: '10px', value: '10' }
]
export const NOT_SUPPORT_PAGE_DATASET = ['kylin', 'sqlServer', 'es', 'presto']

View File

@ -92,7 +92,7 @@ import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar'
import { getRemark, hexColorToRGBA } from '@/views/chart/chart/util'
import { baseTableInfo, baseTableNormal, baseTablePivot } from '@/views/chart/chart/table/table-info'
import TitleRemark from '@/views/chart/view/TitleRemark'
import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
import { DEFAULT_TITLE_STYLE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
import ChartTitleUpdate from './ChartTitleUpdate.vue'
import { mapState } from 'vuex'
@ -234,7 +234,7 @@ export default {
const attr = JSON.parse(this.chart.customAttr)
this.currentPage.pageSize = parseInt(attr.size.tablePageSize ? attr.size.tablePageSize : 20)
data = JSON.parse(JSON.stringify(this.chart.data.tableRow))
if (this.chart.datasetMode === 0) {
if (this.chart.datasetMode === 0 && !NOT_SUPPORT_PAGE_DATASET.includes(this.chart.datasourceType)) {
if (this.chart.type === 'table-info' && (attr.size.tablePageMode === 'page' || !attr.size.tablePageMode) && this.chart.totalItems > this.currentPage.pageSize) {
this.currentPage.show = this.chart.totalItems
this.showPage = true

View File

@ -79,7 +79,7 @@
<script>
import { hexColorToRGBA } from '../../chart/util'
import eventBus from '@/components/canvas/utils/eventBus'
import { DEFAULT_COLOR_CASE, DEFAULT_SIZE } from '@/views/chart/chart/chart'
import { DEFAULT_COLOR_CASE, DEFAULT_SIZE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
import { mapState } from 'vuex'
export default {
@ -238,7 +238,7 @@ export default {
}
data = JSON.parse(JSON.stringify(this.chart.data.tableRow))
if (this.chart.datasetMode === 0) {
if (this.chart.datasetMode === 0 && !NOT_SUPPORT_PAGE_DATASET.includes(this.chart.datasourceType)) {
if (this.chart.type === 'table-info' && (attr.size.tablePageMode === 'page' || !attr.size.tablePageMode) && this.chart.totalItems > this.currentPage.pageSize) {
this.currentPage.show = this.chart.totalItems
this.showPage = true

View File

@ -1,6 +1,7 @@
<template>
<el-row class="component-wait">
<el-tabs
style="padding-left: 10px"
v-model="activeName"
>
<el-tab-pane
@ -35,7 +36,7 @@
class="component-wait-main"
style="padding:10px"
>
<mobile-background-selector />
<mobile-background-selector/>
</el-row>
</el-row>
</template>