diff --git a/backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java b/backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java index a3510da1c9..5cb65dbda2 100644 --- a/backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java +++ b/backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java @@ -21,6 +21,8 @@ public class ChartViewWithBLOBs extends ChartView implements Serializable { private String customFilter; + private String drillFields; + private String snapshot; private static final long serialVersionUID = 1L; diff --git a/backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml index d89b3a0613..c5c452beef 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml @@ -20,6 +20,7 @@ + @@ -85,7 +86,8 @@ style_priority - x_axis, y_axis, ext_stack, custom_attr, custom_style, custom_filter, snapshot + x_axis, y_axis, ext_stack, custom_attr, custom_style, custom_filter, drill_fields, + snapshot select @@ -141,13 +143,15 @@ create_by, create_time, update_time, style_priority, x_axis, y_axis, ext_stack, custom_attr, custom_style, - custom_filter, snapshot) + custom_filter, drill_fields, snapshot + ) values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{stylePriority,jdbcType=VARCHAR}, #{xAxis,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, - #{customFilter,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR}) + #{customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR} + ) insert into chart_view @@ -200,6 +204,9 @@ custom_filter, + + drill_fields, + snapshot, @@ -253,6 +260,9 @@ #{customFilter,jdbcType=LONGVARCHAR}, + + #{drillFields,jdbcType=LONGVARCHAR}, + #{snapshot,jdbcType=LONGVARCHAR}, @@ -315,6 +325,9 @@ custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR}, + + drill_fields = #{record.drillFields,jdbcType=LONGVARCHAR}, + snapshot = #{record.snapshot,jdbcType=LONGVARCHAR}, @@ -341,6 +354,7 @@ custom_attr = #{record.customAttr,jdbcType=LONGVARCHAR}, custom_style = #{record.customStyle,jdbcType=LONGVARCHAR}, custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR}, + drill_fields = #{record.drillFields,jdbcType=LONGVARCHAR}, snapshot = #{record.snapshot,jdbcType=LONGVARCHAR} @@ -410,6 +424,9 @@ custom_filter = #{customFilter,jdbcType=LONGVARCHAR}, + + drill_fields = #{drillFields,jdbcType=LONGVARCHAR}, + snapshot = #{snapshot,jdbcType=LONGVARCHAR}, @@ -433,6 +450,7 @@ custom_attr = #{customAttr,jdbcType=LONGVARCHAR}, custom_style = #{customStyle,jdbcType=LONGVARCHAR}, custom_filter = #{customFilter,jdbcType=LONGVARCHAR}, + drill_fields = #{drillFields,jdbcType=LONGVARCHAR}, snapshot = #{snapshot,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} diff --git a/backend/src/main/resources/db/migration/V18__area_mapping.sql b/backend/src/main/resources/db/migration/V18__area_mapping.sql index 021b665706..b454ba6d09 100644 --- a/backend/src/main/resources/db/migration/V18__area_mapping.sql +++ b/backend/src/main/resources/db/migration/V18__area_mapping.sql @@ -3078,3 +3078,7 @@ COMMIT; SET FOREIGN_KEY_CHECKS = 1; + +ALTER TABLE `chart_view` ADD COLUMN `drill_fields` LONGTEXT COMMENT '钻取字段' AFTER `custom_filter`; +UPDATE `chart_view` SET `drill_fields` = '[]'; + diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index f01340eb22..8eb8a0cc3f 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -64,7 +64,7 @@ - + diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index ddaf643d25..d296e47dff 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -746,6 +746,7 @@ export default { view.yaxis = JSON.stringify([]) view.extStack = JSON.stringify([]) view.customFilter = JSON.stringify([]) + view.drillFields = JSON.stringify([]) post('/chart/view/save', view).then(response => { this.closeCreateChart() this.$store.dispatch('chart/setTableId', null) diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index c82559cf15..1c956bafff 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -233,6 +233,29 @@ /> + + + 钻取 + / + {{ $t('chart.dimension') }} + + + + + + + + {{ $t('chart.placeholder_field') }} + + {{ $t('chart.drag_block_table_data_column') }} @@ -613,6 +636,7 @@ export default { xaxis: [], yaxis: [], extStack: [], + drillFields: [], show: true, type: 'bar', title: '', @@ -800,6 +824,7 @@ export default { view.customStyle = JSON.stringify(view.customStyle) view.customFilter = JSON.stringify(view.customFilter) view.extStack = JSON.stringify(view.extStack) + view.drillFields = JSON.stringify(view.drillFields) post('/chart/view/save', view).then(response => { // this.get(response.data.id); // this.getData(response.data.id) @@ -900,6 +925,7 @@ export default { this.view.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : [] this.view.yaxis = this.view.yaxis ? JSON.parse(this.view.yaxis) : [] this.view.extStack = this.view.extStack ? JSON.parse(this.view.extStack) : [] + this.view.drillFields = this.view.drillFields ? JSON.parse(this.view.drillFields) : [] this.view.customAttr = this.view.customAttr ? JSON.parse(this.view.customAttr) : {} this.view.customStyle = this.view.customStyle ? JSON.parse(this.view.customStyle) : {} this.view.customFilter = this.view.customFilter ? JSON.parse(this.view.customFilter) : {} @@ -932,6 +958,7 @@ export default { this.view.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : [] this.view.yaxis = this.view.yaxis ? JSON.parse(this.view.yaxis) : [] this.view.extStack = this.view.extStack ? JSON.parse(this.view.extStack) : [] + this.view.drillFields = this.view.drillFields ? JSON.parse(this.view.drillFields) : [] this.view.customAttr = this.view.customAttr ? JSON.parse(this.view.customAttr) : {} this.view.customStyle = this.view.customStyle ? JSON.parse(this.view.customStyle) : {} this.view.customFilter = this.view.customFilter ? JSON.parse(this.view.customFilter) : {}