From cf5577822921b36908dcbd98b0bf835592cdd5da Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 10 Mar 2022 10:38:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=86=E5=9B=BE=E6=89=80=E6=9C=89?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=A7=BB=E5=88=B0=E4=BB=AA=E8=A1=A8=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/base/domain/ChartViewCache.java | 39 + .../base/domain/ChartViewCacheExample.java | 1210 +++++++++++++++++ .../base/domain/ChartViewCacheWithBLOBs.java | 35 + .../base/mapper/ChartViewCacheMapper.java | 37 + .../base/mapper/ChartViewCacheMapper.xml | 604 ++++++++ .../base/mapper/ext/ExtChartViewMapper.java | 17 +- .../base/mapper/ext/ExtChartViewMapper.xml | 104 +- .../mapper/ext/ExtDataSetTableMapper.java | 3 + .../base/mapper/ext/ExtDataSetTableMapper.xml | 23 + .../commons/constants/CommonConstants.java | 15 + .../controller/chart/ChartViewController.java | 30 +- .../panel/PanelGroupController.java | 8 + .../request/chart/ChartExtRequest.java | 1 + .../request/chart/ChartViewRequest.java | 4 + .../io/dataease/dto/panel/PanelGroupDTO.java | 5 +- .../service/chart/ChartViewService.java | 77 +- .../service/panel/PanelGroupService.java | 60 +- .../service/panel/PanelViewService.java | 8 + .../src/main/resources/generatorConfig.xml | 2 +- frontend/src/api/chart/chart.js | 41 +- frontend/src/api/panel/panel.js | 25 + frontend/src/components/DeDrag/index.vue | 2 +- .../canvas/components/Editor/EditBar.vue | 33 +- .../canvas/components/Editor/SettingMenu.vue | 35 +- .../canvas/components/Editor/index.vue | 6 + .../canvas/custom-component/UserView.vue | 18 +- frontend/src/lang/en.js | 6 +- frontend/src/lang/tw.js | 6 +- frontend/src/lang/zh.js | 6 +- frontend/src/store/index.js | 15 +- frontend/src/views/chart/view/ChartEdit.vue | 252 +++- .../dataset/common/DatasetChartDetail.vue | 4 +- frontend/src/views/panel/ViewSelect/index.vue | 8 +- frontend/src/views/panel/edit/index.vue | 589 +++++--- 34 files changed, 2949 insertions(+), 379 deletions(-) create mode 100644 backend/src/main/java/io/dataease/base/domain/ChartViewCache.java create mode 100644 backend/src/main/java/io/dataease/base/domain/ChartViewCacheExample.java create mode 100644 backend/src/main/java/io/dataease/base/domain/ChartViewCacheWithBLOBs.java create mode 100644 backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.java create mode 100644 backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.xml diff --git a/backend/src/main/java/io/dataease/base/domain/ChartViewCache.java b/backend/src/main/java/io/dataease/base/domain/ChartViewCache.java new file mode 100644 index 0000000000..1cb34116b3 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/ChartViewCache.java @@ -0,0 +1,39 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class ChartViewCache implements Serializable { + private String id; + + private String name; + + private String title; + + private String sceneId; + + private String tableId; + + private String type; + + private String render; + + private Integer resultCount; + + private String resultMode; + + private String createBy; + + private Long createTime; + + private Long updateTime; + + private String stylePriority; + + private String chartType; + + private Boolean isPlugin; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/ChartViewCacheExample.java b/backend/src/main/java/io/dataease/base/domain/ChartViewCacheExample.java new file mode 100644 index 0000000000..aa5bb02aef --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/ChartViewCacheExample.java @@ -0,0 +1,1210 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ChartViewCacheExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ChartViewCacheExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andTitleIsNull() { + addCriterion("title is null"); + return (Criteria) this; + } + + public Criteria andTitleIsNotNull() { + addCriterion("title is not null"); + return (Criteria) this; + } + + public Criteria andTitleEqualTo(String value) { + addCriterion("title =", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotEqualTo(String value) { + addCriterion("title <>", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThan(String value) { + addCriterion("title >", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThanOrEqualTo(String value) { + addCriterion("title >=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThan(String value) { + addCriterion("title <", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThanOrEqualTo(String value) { + addCriterion("title <=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLike(String value) { + addCriterion("title like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotLike(String value) { + addCriterion("title not like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleIn(List values) { + addCriterion("title in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotIn(List values) { + addCriterion("title not in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleBetween(String value1, String value2) { + addCriterion("title between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotBetween(String value1, String value2) { + addCriterion("title not between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNull() { + addCriterion("scene_id is null"); + return (Criteria) this; + } + + public Criteria andSceneIdIsNotNull() { + addCriterion("scene_id is not null"); + return (Criteria) this; + } + + public Criteria andSceneIdEqualTo(String value) { + addCriterion("scene_id =", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotEqualTo(String value) { + addCriterion("scene_id <>", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThan(String value) { + addCriterion("scene_id >", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdGreaterThanOrEqualTo(String value) { + addCriterion("scene_id >=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThan(String value) { + addCriterion("scene_id <", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLessThanOrEqualTo(String value) { + addCriterion("scene_id <=", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdLike(String value) { + addCriterion("scene_id like", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotLike(String value) { + addCriterion("scene_id not like", value, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdIn(List values) { + addCriterion("scene_id in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotIn(List values) { + addCriterion("scene_id not in", values, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdBetween(String value1, String value2) { + addCriterion("scene_id between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andSceneIdNotBetween(String value1, String value2) { + addCriterion("scene_id not between", value1, value2, "sceneId"); + return (Criteria) this; + } + + public Criteria andTableIdIsNull() { + addCriterion("table_id is null"); + return (Criteria) this; + } + + public Criteria andTableIdIsNotNull() { + addCriterion("table_id is not null"); + return (Criteria) this; + } + + public Criteria andTableIdEqualTo(String value) { + addCriterion("table_id =", value, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdNotEqualTo(String value) { + addCriterion("table_id <>", value, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdGreaterThan(String value) { + addCriterion("table_id >", value, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdGreaterThanOrEqualTo(String value) { + addCriterion("table_id >=", value, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdLessThan(String value) { + addCriterion("table_id <", value, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdLessThanOrEqualTo(String value) { + addCriterion("table_id <=", value, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdLike(String value) { + addCriterion("table_id like", value, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdNotLike(String value) { + addCriterion("table_id not like", value, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdIn(List values) { + addCriterion("table_id in", values, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdNotIn(List values) { + addCriterion("table_id not in", values, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdBetween(String value1, String value2) { + addCriterion("table_id between", value1, value2, "tableId"); + return (Criteria) this; + } + + public Criteria andTableIdNotBetween(String value1, String value2) { + addCriterion("table_id not between", value1, value2, "tableId"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("`type` like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("`type` not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andRenderIsNull() { + addCriterion("render is null"); + return (Criteria) this; + } + + public Criteria andRenderIsNotNull() { + addCriterion("render is not null"); + return (Criteria) this; + } + + public Criteria andRenderEqualTo(String value) { + addCriterion("render =", value, "render"); + return (Criteria) this; + } + + public Criteria andRenderNotEqualTo(String value) { + addCriterion("render <>", value, "render"); + return (Criteria) this; + } + + public Criteria andRenderGreaterThan(String value) { + addCriterion("render >", value, "render"); + return (Criteria) this; + } + + public Criteria andRenderGreaterThanOrEqualTo(String value) { + addCriterion("render >=", value, "render"); + return (Criteria) this; + } + + public Criteria andRenderLessThan(String value) { + addCriterion("render <", value, "render"); + return (Criteria) this; + } + + public Criteria andRenderLessThanOrEqualTo(String value) { + addCriterion("render <=", value, "render"); + return (Criteria) this; + } + + public Criteria andRenderLike(String value) { + addCriterion("render like", value, "render"); + return (Criteria) this; + } + + public Criteria andRenderNotLike(String value) { + addCriterion("render not like", value, "render"); + return (Criteria) this; + } + + public Criteria andRenderIn(List values) { + addCriterion("render in", values, "render"); + return (Criteria) this; + } + + public Criteria andRenderNotIn(List values) { + addCriterion("render not in", values, "render"); + return (Criteria) this; + } + + public Criteria andRenderBetween(String value1, String value2) { + addCriterion("render between", value1, value2, "render"); + return (Criteria) this; + } + + public Criteria andRenderNotBetween(String value1, String value2) { + addCriterion("render not between", value1, value2, "render"); + return (Criteria) this; + } + + public Criteria andResultCountIsNull() { + addCriterion("result_count is null"); + return (Criteria) this; + } + + public Criteria andResultCountIsNotNull() { + addCriterion("result_count is not null"); + return (Criteria) this; + } + + public Criteria andResultCountEqualTo(Integer value) { + addCriterion("result_count =", value, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountNotEqualTo(Integer value) { + addCriterion("result_count <>", value, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountGreaterThan(Integer value) { + addCriterion("result_count >", value, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountGreaterThanOrEqualTo(Integer value) { + addCriterion("result_count >=", value, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountLessThan(Integer value) { + addCriterion("result_count <", value, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountLessThanOrEqualTo(Integer value) { + addCriterion("result_count <=", value, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountIn(List values) { + addCriterion("result_count in", values, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountNotIn(List values) { + addCriterion("result_count not in", values, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountBetween(Integer value1, Integer value2) { + addCriterion("result_count between", value1, value2, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultCountNotBetween(Integer value1, Integer value2) { + addCriterion("result_count not between", value1, value2, "resultCount"); + return (Criteria) this; + } + + public Criteria andResultModeIsNull() { + addCriterion("result_mode is null"); + return (Criteria) this; + } + + public Criteria andResultModeIsNotNull() { + addCriterion("result_mode is not null"); + return (Criteria) this; + } + + public Criteria andResultModeEqualTo(String value) { + addCriterion("result_mode =", value, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeNotEqualTo(String value) { + addCriterion("result_mode <>", value, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeGreaterThan(String value) { + addCriterion("result_mode >", value, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeGreaterThanOrEqualTo(String value) { + addCriterion("result_mode >=", value, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeLessThan(String value) { + addCriterion("result_mode <", value, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeLessThanOrEqualTo(String value) { + addCriterion("result_mode <=", value, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeLike(String value) { + addCriterion("result_mode like", value, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeNotLike(String value) { + addCriterion("result_mode not like", value, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeIn(List values) { + addCriterion("result_mode in", values, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeNotIn(List values) { + addCriterion("result_mode not in", values, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeBetween(String value1, String value2) { + addCriterion("result_mode between", value1, value2, "resultMode"); + return (Criteria) this; + } + + public Criteria andResultModeNotBetween(String value1, String value2) { + addCriterion("result_mode not between", value1, value2, "resultMode"); + return (Criteria) this; + } + + public Criteria andCreateByIsNull() { + addCriterion("create_by is null"); + return (Criteria) this; + } + + public Criteria andCreateByIsNotNull() { + addCriterion("create_by is not null"); + return (Criteria) this; + } + + public Criteria andCreateByEqualTo(String value) { + addCriterion("create_by =", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotEqualTo(String value) { + addCriterion("create_by <>", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThan(String value) { + addCriterion("create_by >", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThanOrEqualTo(String value) { + addCriterion("create_by >=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThan(String value) { + addCriterion("create_by <", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThanOrEqualTo(String value) { + addCriterion("create_by <=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLike(String value) { + addCriterion("create_by like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotLike(String value) { + addCriterion("create_by not like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByIn(List values) { + addCriterion("create_by in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotIn(List values) { + addCriterion("create_by not in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByBetween(String value1, String value2) { + addCriterion("create_by between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotBetween(String value1, String value2) { + addCriterion("create_by not between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStylePriorityIsNull() { + addCriterion("style_priority is null"); + return (Criteria) this; + } + + public Criteria andStylePriorityIsNotNull() { + addCriterion("style_priority is not null"); + return (Criteria) this; + } + + public Criteria andStylePriorityEqualTo(String value) { + addCriterion("style_priority =", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityNotEqualTo(String value) { + addCriterion("style_priority <>", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityGreaterThan(String value) { + addCriterion("style_priority >", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityGreaterThanOrEqualTo(String value) { + addCriterion("style_priority >=", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityLessThan(String value) { + addCriterion("style_priority <", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityLessThanOrEqualTo(String value) { + addCriterion("style_priority <=", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityLike(String value) { + addCriterion("style_priority like", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityNotLike(String value) { + addCriterion("style_priority not like", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityIn(List values) { + addCriterion("style_priority in", values, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityNotIn(List values) { + addCriterion("style_priority not in", values, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityBetween(String value1, String value2) { + addCriterion("style_priority between", value1, value2, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityNotBetween(String value1, String value2) { + addCriterion("style_priority not between", value1, value2, "stylePriority"); + return (Criteria) this; + } + + public Criteria andChartTypeIsNull() { + addCriterion("chart_type is null"); + return (Criteria) this; + } + + public Criteria andChartTypeIsNotNull() { + addCriterion("chart_type is not null"); + return (Criteria) this; + } + + public Criteria andChartTypeEqualTo(String value) { + addCriterion("chart_type =", value, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeNotEqualTo(String value) { + addCriterion("chart_type <>", value, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeGreaterThan(String value) { + addCriterion("chart_type >", value, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeGreaterThanOrEqualTo(String value) { + addCriterion("chart_type >=", value, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeLessThan(String value) { + addCriterion("chart_type <", value, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeLessThanOrEqualTo(String value) { + addCriterion("chart_type <=", value, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeLike(String value) { + addCriterion("chart_type like", value, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeNotLike(String value) { + addCriterion("chart_type not like", value, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeIn(List values) { + addCriterion("chart_type in", values, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeNotIn(List values) { + addCriterion("chart_type not in", values, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeBetween(String value1, String value2) { + addCriterion("chart_type between", value1, value2, "chartType"); + return (Criteria) this; + } + + public Criteria andChartTypeNotBetween(String value1, String value2) { + addCriterion("chart_type not between", value1, value2, "chartType"); + return (Criteria) this; + } + + public Criteria andIsPluginIsNull() { + addCriterion("is_plugin is null"); + return (Criteria) this; + } + + public Criteria andIsPluginIsNotNull() { + addCriterion("is_plugin is not null"); + return (Criteria) this; + } + + public Criteria andIsPluginEqualTo(Boolean value) { + addCriterion("is_plugin =", value, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginNotEqualTo(Boolean value) { + addCriterion("is_plugin <>", value, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginGreaterThan(Boolean value) { + addCriterion("is_plugin >", value, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_plugin >=", value, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginLessThan(Boolean value) { + addCriterion("is_plugin <", value, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginLessThanOrEqualTo(Boolean value) { + addCriterion("is_plugin <=", value, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginIn(List values) { + addCriterion("is_plugin in", values, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginNotIn(List values) { + addCriterion("is_plugin not in", values, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginBetween(Boolean value1, Boolean value2) { + addCriterion("is_plugin between", value1, value2, "isPlugin"); + return (Criteria) this; + } + + public Criteria andIsPluginNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_plugin not between", value1, value2, "isPlugin"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/ChartViewCacheWithBLOBs.java b/backend/src/main/java/io/dataease/base/domain/ChartViewCacheWithBLOBs.java new file mode 100644 index 0000000000..424a2d89ea --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/ChartViewCacheWithBLOBs.java @@ -0,0 +1,35 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ChartViewCacheWithBLOBs extends ChartViewCache implements Serializable { + private String xAxis; + + private String xAxisExt; + + private String yAxis; + + private String yAxisExt; + + private String extStack; + + private String extBubble; + + private String customAttr; + + private String customStyle; + + private String customFilter; + + private String drillFields; + + private String snapshot; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.java b/backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.java new file mode 100644 index 0000000000..aec7c7da16 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.java @@ -0,0 +1,37 @@ +package io.dataease.base.mapper; + +import io.dataease.base.domain.ChartViewCache; +import io.dataease.base.domain.ChartViewCacheExample; +import io.dataease.base.domain.ChartViewCacheWithBLOBs; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ChartViewCacheMapper { + long countByExample(ChartViewCacheExample example); + + int deleteByExample(ChartViewCacheExample example); + + int deleteByPrimaryKey(String id); + + int insert(ChartViewCacheWithBLOBs record); + + int insertSelective(ChartViewCacheWithBLOBs record); + + List selectByExampleWithBLOBs(ChartViewCacheExample example); + + List selectByExample(ChartViewCacheExample example); + + ChartViewCacheWithBLOBs selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") ChartViewCacheWithBLOBs record, @Param("example") ChartViewCacheExample example); + + int updateByExampleWithBLOBs(@Param("record") ChartViewCacheWithBLOBs record, @Param("example") ChartViewCacheExample example); + + int updateByExample(@Param("record") ChartViewCache record, @Param("example") ChartViewCacheExample example); + + int updateByPrimaryKeySelective(ChartViewCacheWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(ChartViewCacheWithBLOBs record); + + int updateByPrimaryKey(ChartViewCache record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.xml new file mode 100644 index 0000000000..cbe53167c6 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.xml @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode, + create_by, create_time, update_time, style_priority, chart_type, is_plugin + + + x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style, + custom_filter, drill_fields, snapshot + + + + + + delete from chart_view_cache + where id = #{id,jdbcType=VARCHAR} + + + delete from chart_view_cache + + + + + + insert into chart_view_cache (id, `name`, title, + scene_id, table_id, `type`, + render, result_count, result_mode, + create_by, create_time, update_time, + style_priority, chart_type, is_plugin, + x_axis, x_axis_ext, y_axis, + y_axis_ext, ext_stack, ext_bubble, + custom_attr, custom_style, custom_filter, + drill_fields, snapshot) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, + #{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR}, + #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, + #{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT}, + #{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR}, + #{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{extBubble,jdbcType=LONGVARCHAR}, + #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, #{customFilter,jdbcType=LONGVARCHAR}, + #{drillFields,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR}) + + + insert into chart_view_cache + + + id, + + + `name`, + + + title, + + + scene_id, + + + table_id, + + + `type`, + + + render, + + + result_count, + + + result_mode, + + + create_by, + + + create_time, + + + update_time, + + + style_priority, + + + chart_type, + + + is_plugin, + + + x_axis, + + + x_axis_ext, + + + y_axis, + + + y_axis_ext, + + + ext_stack, + + + ext_bubble, + + + custom_attr, + + + custom_style, + + + custom_filter, + + + drill_fields, + + + snapshot, + + + + + #{id,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{title,jdbcType=VARCHAR}, + + + #{sceneId,jdbcType=VARCHAR}, + + + #{tableId,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{render,jdbcType=VARCHAR}, + + + #{resultCount,jdbcType=INTEGER}, + + + #{resultMode,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{stylePriority,jdbcType=VARCHAR}, + + + #{chartType,jdbcType=VARCHAR}, + + + #{isPlugin,jdbcType=BIT}, + + + #{xAxis,jdbcType=LONGVARCHAR}, + + + #{xAxisExt,jdbcType=LONGVARCHAR}, + + + #{yAxis,jdbcType=LONGVARCHAR}, + + + #{yAxisExt,jdbcType=LONGVARCHAR}, + + + #{extStack,jdbcType=LONGVARCHAR}, + + + #{extBubble,jdbcType=LONGVARCHAR}, + + + #{customAttr,jdbcType=LONGVARCHAR}, + + + #{customStyle,jdbcType=LONGVARCHAR}, + + + #{customFilter,jdbcType=LONGVARCHAR}, + + + #{drillFields,jdbcType=LONGVARCHAR}, + + + #{snapshot,jdbcType=LONGVARCHAR}, + + + + + + update chart_view_cache + + + id = #{record.id,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + scene_id = #{record.sceneId,jdbcType=VARCHAR}, + + + table_id = #{record.tableId,jdbcType=VARCHAR}, + + + `type` = #{record.type,jdbcType=VARCHAR}, + + + render = #{record.render,jdbcType=VARCHAR}, + + + result_count = #{record.resultCount,jdbcType=INTEGER}, + + + result_mode = #{record.resultMode,jdbcType=VARCHAR}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + style_priority = #{record.stylePriority,jdbcType=VARCHAR}, + + + chart_type = #{record.chartType,jdbcType=VARCHAR}, + + + is_plugin = #{record.isPlugin,jdbcType=BIT}, + + + x_axis = #{record.xAxis,jdbcType=LONGVARCHAR}, + + + x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR}, + + + y_axis = #{record.yAxis,jdbcType=LONGVARCHAR}, + + + y_axis_ext = #{record.yAxisExt,jdbcType=LONGVARCHAR}, + + + ext_stack = #{record.extStack,jdbcType=LONGVARCHAR}, + + + ext_bubble = #{record.extBubble,jdbcType=LONGVARCHAR}, + + + 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}, + + + + + + + + update chart_view_cache + set id = #{record.id,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + title = #{record.title,jdbcType=VARCHAR}, + scene_id = #{record.sceneId,jdbcType=VARCHAR}, + table_id = #{record.tableId,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + render = #{record.render,jdbcType=VARCHAR}, + result_count = #{record.resultCount,jdbcType=INTEGER}, + result_mode = #{record.resultMode,jdbcType=VARCHAR}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + style_priority = #{record.stylePriority,jdbcType=VARCHAR}, + chart_type = #{record.chartType,jdbcType=VARCHAR}, + is_plugin = #{record.isPlugin,jdbcType=BIT}, + x_axis = #{record.xAxis,jdbcType=LONGVARCHAR}, + x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR}, + y_axis = #{record.yAxis,jdbcType=LONGVARCHAR}, + y_axis_ext = #{record.yAxisExt,jdbcType=LONGVARCHAR}, + ext_stack = #{record.extStack,jdbcType=LONGVARCHAR}, + ext_bubble = #{record.extBubble,jdbcType=LONGVARCHAR}, + 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} + + + + + + update chart_view_cache + set id = #{record.id,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + title = #{record.title,jdbcType=VARCHAR}, + scene_id = #{record.sceneId,jdbcType=VARCHAR}, + table_id = #{record.tableId,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + render = #{record.render,jdbcType=VARCHAR}, + result_count = #{record.resultCount,jdbcType=INTEGER}, + result_mode = #{record.resultMode,jdbcType=VARCHAR}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + style_priority = #{record.stylePriority,jdbcType=VARCHAR}, + chart_type = #{record.chartType,jdbcType=VARCHAR}, + is_plugin = #{record.isPlugin,jdbcType=BIT} + + + + + + update chart_view_cache + + + `name` = #{name,jdbcType=VARCHAR}, + + + title = #{title,jdbcType=VARCHAR}, + + + scene_id = #{sceneId,jdbcType=VARCHAR}, + + + table_id = #{tableId,jdbcType=VARCHAR}, + + + `type` = #{type,jdbcType=VARCHAR}, + + + render = #{render,jdbcType=VARCHAR}, + + + result_count = #{resultCount,jdbcType=INTEGER}, + + + result_mode = #{resultMode,jdbcType=VARCHAR}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + style_priority = #{stylePriority,jdbcType=VARCHAR}, + + + chart_type = #{chartType,jdbcType=VARCHAR}, + + + is_plugin = #{isPlugin,jdbcType=BIT}, + + + x_axis = #{xAxis,jdbcType=LONGVARCHAR}, + + + x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR}, + + + y_axis = #{yAxis,jdbcType=LONGVARCHAR}, + + + y_axis_ext = #{yAxisExt,jdbcType=LONGVARCHAR}, + + + ext_stack = #{extStack,jdbcType=LONGVARCHAR}, + + + ext_bubble = #{extBubble,jdbcType=LONGVARCHAR}, + + + 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} + + + update chart_view_cache + set `name` = #{name,jdbcType=VARCHAR}, + title = #{title,jdbcType=VARCHAR}, + scene_id = #{sceneId,jdbcType=VARCHAR}, + table_id = #{tableId,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, + render = #{render,jdbcType=VARCHAR}, + result_count = #{resultCount,jdbcType=INTEGER}, + result_mode = #{resultMode,jdbcType=VARCHAR}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT}, + style_priority = #{stylePriority,jdbcType=VARCHAR}, + chart_type = #{chartType,jdbcType=VARCHAR}, + is_plugin = #{isPlugin,jdbcType=BIT}, + x_axis = #{xAxis,jdbcType=LONGVARCHAR}, + x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR}, + y_axis = #{yAxis,jdbcType=LONGVARCHAR}, + y_axis_ext = #{yAxisExt,jdbcType=LONGVARCHAR}, + ext_stack = #{extStack,jdbcType=LONGVARCHAR}, + ext_bubble = #{extBubble,jdbcType=LONGVARCHAR}, + 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} + + + update chart_view_cache + set `name` = #{name,jdbcType=VARCHAR}, + title = #{title,jdbcType=VARCHAR}, + scene_id = #{sceneId,jdbcType=VARCHAR}, + table_id = #{tableId,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, + render = #{render,jdbcType=VARCHAR}, + result_count = #{resultCount,jdbcType=INTEGER}, + result_mode = #{resultMode,jdbcType=VARCHAR}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT}, + style_priority = #{stylePriority,jdbcType=VARCHAR}, + chart_type = #{chartType,jdbcType=VARCHAR}, + is_plugin = #{isPlugin,jdbcType=BIT} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.java index fd3e2cb602..82667c44a0 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.java @@ -12,7 +12,7 @@ import java.util.List; public interface ExtChartViewMapper { List search(ChartViewRequest request); - ChartViewDTO searchOne(ChartViewRequest request); +// ChartViewDTO searchOne(ChartViewRequest request); void chartCopy(@Param("newChartId")String newChartId,@Param("oldChartId")String oldChartId,@Param("panelId")String panelId); @@ -25,9 +25,24 @@ public interface ExtChartViewMapper { ChartViewDTO searchOneWithPrivileges(@Param("userId") String userId,@Param("id") String id ); + ChartViewDTO searchOne(@Param("id") String id ); + void chartCopyWithPanel(@Param("copyId") String copyId); void deleteCircleView(@Param("pid") String pid); void deleteCircleGroup(@Param("pid") String pid); + + List searchViewsWithPanelId(@Param("panelId") String panelId); + + ChartViewDTO searchOneFromCache(@Param("id") String id ); + + void copyToCache(@Param("id") String id ); + + void deleteCacheWithPanel(@Param("panelId") String panelId ); + + void deleteViewCache(@Param("viewId") String viewId ); + + void copyCacheToView(@Param("viewIds") List viewIds ); + } diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml index 01c0c1d3eb..89a85b05c5 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml @@ -16,22 +16,38 @@ + + + + Insert into chart_view_cache select * from chart_view where chart_view.id = #{id} + + + + + + + + + + + + + + + + + + + + + SELECT * FROM chart_view + WHERE + id IN ( + SELECT + chart_view_id + FROM + panel_view + WHERE + panel_id = #{panelId} + ) + + + + DELETE cvc, + pv + FROM + chart_view_cache cvc + INNER JOIN panel_view pv ON cvc.id = pv.chart_view_id + WHERE + pv.panel_id = #{panelId} + + + delete from chart_view_cache where id = #{viewId} + + + + UPDATE chart_view cv, + chart_view_cache cve + SET cv.`name` = cve.`name`, + cv.title = cve.title, + cv.scene_id = cve.scene_id, + cv.table_id = cve.table_id, + cv.`type` = cve.`type`, + cv.render = cve.render, + cv.result_count = cve.result_count, + cv.result_mode = cve.result_mode, + cv.create_by = cve.create_by, + cv.create_time = cve.create_time, + cv.update_time = cve.update_time, + cv.style_priority = cve.style_priority, + cv.chart_type = cve.chart_type, + cv.is_plugin = cve.is_plugin, + cv.x_axis = cve.x_axis, + cv.x_axis_ext = cve.x_axis_ext, + cv.y_axis = cve.y_axis, + cv.y_axis_ext = cve.y_axis_ext, + cv.ext_stack = cve.ext_stack, + cv.ext_bubble = cve.ext_bubble, + cv.custom_attr = cve.custom_attr, + cv.custom_style = cve.custom_style, + cv.custom_filter = cve.custom_filter, + cv.drill_fields = cve.drill_fields, + cv.SNAPSHOT = cve.SNAPSHOT where cve.id = cv.id and cv.id in + + #{viewId} + + diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.java index bca5c5202b..5110460776 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.java @@ -2,6 +2,7 @@ package io.dataease.base.mapper.ext; import io.dataease.controller.request.dataset.DataSetTableRequest; import io.dataease.dto.dataset.DataSetTableDTO; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -10,4 +11,6 @@ public interface ExtDataSetTableMapper { DataSetTableDTO searchOne(DataSetTableRequest request); + List searchDataSetTableWithPanelId(@Param("panelId") String panelId, @Param("userId") String userId); + } diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml index 91abf6daea..fe1bd89034 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml @@ -100,4 +100,27 @@ ORDER BY CONVERT(`name` using gbk) + + + diff --git a/backend/src/main/java/io/dataease/commons/constants/CommonConstants.java b/backend/src/main/java/io/dataease/commons/constants/CommonConstants.java index 2c16a2b72e..88c87e6db5 100644 --- a/backend/src/main/java/io/dataease/commons/constants/CommonConstants.java +++ b/backend/src/main/java/io/dataease/commons/constants/CommonConstants.java @@ -43,6 +43,10 @@ public class CommonConstants { // 仪表板 public static final String PANEL = "panel"; + + // 仪表板编辑 + public static final String PANEL_EDIT = "panel_edit"; + } //视图数据查询模式 @@ -54,4 +58,15 @@ public class CommonConstants { // 自定义 public static final String CUSTOM = "custom"; } + + //视图数据查询来源 + public static final class VIEW_EDIT_FROM { + + // 仪表板 + public static final String PANEL = "panel"; + + // 仪表板编辑 + public static final String CACHE = "cache"; + + } } diff --git a/backend/src/main/java/io/dataease/controller/chart/ChartViewController.java b/backend/src/main/java/io/dataease/controller/chart/ChartViewController.java index 8e0501338b..551ee2becf 100644 --- a/backend/src/main/java/io/dataease/controller/chart/ChartViewController.java +++ b/backend/src/main/java/io/dataease/controller/chart/ChartViewController.java @@ -3,6 +3,7 @@ package io.dataease.controller.chart; import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.dataease.auth.annotation.DePermission; import io.dataease.auth.annotation.DePermissionProxy; +import io.dataease.base.domain.ChartViewCacheWithBLOBs; import io.dataease.base.domain.ChartViewWithBLOBs; import io.dataease.commons.constants.DePermissionType; import io.dataease.commons.constants.ResourceAuthLevel; @@ -35,10 +36,17 @@ public class ChartViewController { @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @ApiOperation("保存") @PostMapping("/save/{panelId}") - public ChartViewWithBLOBs save(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) { + public ChartViewDTO save(@PathVariable String panelId, @RequestBody ChartViewCacheWithBLOBs chartViewWithBLOBs) { return chartViewService.save(chartViewWithBLOBs); } + @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) + @ApiOperation("保存到缓存表") + @PostMapping("/save2Cache/{panelId}") + public void save2Cache(@PathVariable String panelId, @RequestBody ChartViewCacheWithBLOBs chartViewWithBLOBs) { + chartViewService.save2Cache(chartViewWithBLOBs); + } + @ApiIgnore @ApiOperation("查询") @PostMapping("/list") @@ -56,8 +64,8 @@ public class ChartViewController { @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1) @ApiOperation("详细信息") @PostMapping("/get/{id}/{panelId}") - public ChartViewWithBLOBs get(@PathVariable String id, @PathVariable String panelId) { - return chartViewService.get(id); + public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId,@RequestBody ChartViewRequest viewRequest) { + return chartViewService.getOne(id,viewRequest.getQueryFrom()); } @ApiIgnore @@ -117,4 +125,20 @@ public class ChartViewController { throws Exception { return chartViewService.checkSameDataSet(viewIdSource, viewIdTarget); } + + @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW) + @ApiOperation("初始化仪表板视图缓存") + @PostMapping("/initViewCache/{panelId}") + public void initViewCache(@PathVariable String panelId) { + chartViewService.initViewCache(panelId); + } + + + @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1) + @ApiOperation("重置视图缓存") + @PostMapping("/resetViewCache/{id}/{panelId}") + public void resetViewCache(@PathVariable String id, @PathVariable String panelId) { + chartViewService.resetViewCache(id); + } + } diff --git a/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java b/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java index 1c39bf4a55..39360d17aa 100644 --- a/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java +++ b/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; +import java.util.Map; /** * Author: wangjiahao @@ -92,4 +93,11 @@ public class PanelGroupController { return panelGroupService.queryPanelViewTree(); } + @ApiOperation("仪表板组件信息") + @GetMapping("/queryPanelComponents/{id}") + @I18n + public Map queryPanelComponents(@PathVariable String id){ + return panelGroupService.queryPanelComponents(id); + } + } diff --git a/backend/src/main/java/io/dataease/controller/request/chart/ChartExtRequest.java b/backend/src/main/java/io/dataease/controller/request/chart/ChartExtRequest.java index 31e99d2b83..03ec1abeaa 100644 --- a/backend/src/main/java/io/dataease/controller/request/chart/ChartExtRequest.java +++ b/backend/src/main/java/io/dataease/controller/request/chart/ChartExtRequest.java @@ -42,4 +42,5 @@ public class ChartExtRequest { @ApiModelProperty(hidden = true) private PermissionProxy proxy; + } diff --git a/backend/src/main/java/io/dataease/controller/request/chart/ChartViewRequest.java b/backend/src/main/java/io/dataease/controller/request/chart/ChartViewRequest.java index ad297454ff..c503157132 100644 --- a/backend/src/main/java/io/dataease/controller/request/chart/ChartViewRequest.java +++ b/backend/src/main/java/io/dataease/controller/request/chart/ChartViewRequest.java @@ -16,4 +16,8 @@ public class ChartViewRequest extends ChartViewWithBLOBs { private String sort; @ApiModelProperty("当前登陆用户ID") private String userId; + @ApiModelProperty("编辑来源") + private String editFrom; + @ApiModelProperty("查询来源") + private String queryFrom; } diff --git a/backend/src/main/java/io/dataease/dto/panel/PanelGroupDTO.java b/backend/src/main/java/io/dataease/dto/panel/PanelGroupDTO.java index efbe8a0525..e328b3fad6 100644 --- a/backend/src/main/java/io/dataease/dto/panel/PanelGroupDTO.java +++ b/backend/src/main/java/io/dataease/dto/panel/PanelGroupDTO.java @@ -2,11 +2,13 @@ package io.dataease.dto.panel; import io.dataease.base.domain.PanelGroupWithBLOBs; import io.dataease.commons.model.ITreeBase; +import io.dataease.dto.chart.ChartViewDTO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * Author: wangjiahao @@ -31,6 +33,7 @@ public class PanelGroupDTO extends PanelGroupWithBLOBs implements ITreeBase children; - + @ApiModelProperty("视图信息") + private List> viewsInfo; } 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 628b1fe9e9..1d3266e31f 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -6,6 +6,7 @@ import io.dataease.auth.api.dto.CurrentUserDto; import io.dataease.auth.entity.SysUserEntity; import io.dataease.auth.service.AuthUserService; import io.dataease.base.domain.*; +import io.dataease.base.mapper.ChartViewCacheMapper; import io.dataease.base.mapper.ChartViewMapper; import io.dataease.base.mapper.ext.ExtChartGroupMapper; import io.dataease.base.mapper.ext.ExtChartViewMapper; @@ -71,29 +72,55 @@ public class ChartViewService { private PermissionService permissionService; @Resource private AuthUserService authUserService; + @Resource + private ChartViewCacheMapper chartViewCacheMapper; //默认使用非公平 private ReentrantLock lock = new ReentrantLock(); - public ChartViewWithBLOBs save(ChartViewWithBLOBs chartView) { - checkName(chartView); + // 直接保存统一到缓存表 + public ChartViewDTO save(ChartViewCacheWithBLOBs chartView) { long timestamp = System.currentTimeMillis(); chartView.setUpdateTime(timestamp); - if (ObjectUtils.isEmpty(chartView.getId())) { - chartView.setId(UUID.randomUUID().toString()); - chartView.setCreateBy(AuthUtils.getUser().getUsername()); - chartView.setCreateTime(timestamp); - chartView.setUpdateTime(timestamp); - chartViewMapper.insertSelective(chartView); - } else { - chartViewMapper.updateByPrimaryKeySelective(chartView); - } + chartViewCacheMapper.updateByPrimaryKeySelective(chartView); Optional.ofNullable(chartView.getId()).ifPresent(id -> { CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id); }); - return getOneWithPermission(chartView.getId()); + return getOne(chartView.getId(),"panel_edit"); } + + // 直接保存统一到缓存表 + public void save2Cache(ChartViewCacheWithBLOBs chartView) { + long timestamp = System.currentTimeMillis(); + chartView.setUpdateTime(timestamp); + chartViewCacheMapper.updateByPrimaryKeySelective(chartView); + Optional.ofNullable(chartView.getId()).ifPresent(id -> { + CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id); + }); + } + + +// // 直接保存统一到缓存表 +// public ChartViewWithBLOBs save(ChartViewRequest chartView) { +// checkName(chartView); +// long timestamp = System.currentTimeMillis(); +// chartView.setUpdateTime(timestamp); +// if (ObjectUtils.isEmpty(chartView.getId())) { +// chartView.setId(UUID.randomUUID().toString()); +// chartView.setCreateBy(AuthUtils.getUser().getUsername()); +// chartView.setCreateTime(timestamp); +// chartView.setUpdateTime(timestamp); +// chartViewMapper.insertSelective(chartView); +// } else { +// chartViewMapper.updateByPrimaryKeySelective(chartView); +// } +// Optional.ofNullable(chartView.getId()).ifPresent(id -> { +// CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id); +// }); +// return getOneWithPermission(chartView.getId()); +// } + public List list(ChartViewRequest chartViewRequest) { chartViewRequest.setUserId(String.valueOf(AuthUtils.getUser().getUserId())); return extChartViewMapper.search(chartViewRequest); @@ -178,6 +205,21 @@ public class ChartViewService { return extChartViewMapper.searchOneWithPrivileges(userId, id); } + public ChartViewDTO getOne(String id,String queryFrom){ + ChartViewDTO result; + //仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入 + if(CommonConstants.VIEW_QUERY_FROM.PANEL_EDIT.equals(queryFrom)){ + result= extChartViewMapper.searchOneFromCache(id); + if(result == null){ + extChartViewMapper.copyToCache(id); + result = extChartViewMapper.searchOneFromCache(id); + } + }else{ + result = extChartViewMapper.searchOne(id); + } + return result; + } + public void delete(String id) { chartViewMapper.deleteByPrimaryKey(id); } @@ -189,7 +231,7 @@ public class ChartViewService { } public ChartViewDTO getData(String id, ChartExtRequest request) throws Exception { - ChartViewDTO view = this.getOneWithPermission(id); + ChartViewDTO view = this.getOne(id,request.getQueryFrom()); // 如果是从仪表板获取视图数据,则仪表板的查询模式,查询结果的数量,覆盖视图对应的属性 if (CommonConstants.VIEW_QUERY_FROM.PANEL.equals(request.getQueryFrom()) && CommonConstants.VIEW_RESULT_MODE.CUSTOM.equals(request.getResultMode())) { view.setResultMode(request.getResultMode()); @@ -1712,4 +1754,13 @@ public class ChartViewService { } } } + + public void initViewCache(String panelId){ + extChartViewMapper.deleteCacheWithPanel(panelId); + } + + public void resetViewCache (String viewId){ + extChartViewMapper.deleteViewCache(viewId); + extChartViewMapper.copyToCache(viewId); + } } diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java index 81cfe76173..18739312fd 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -14,14 +14,17 @@ import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.LogUtil; import io.dataease.commons.utils.TreeUtils; import io.dataease.controller.request.authModel.VAuthModelRequest; +import io.dataease.controller.request.dataset.DataSetTableRequest; import io.dataease.controller.request.panel.PanelGroupRequest; import io.dataease.dto.authModel.VAuthModelDTO; import io.dataease.dto.chart.ChartViewDTO; +import io.dataease.dto.dataset.DataSetTableDTO; import io.dataease.dto.panel.PanelGroupDTO; import io.dataease.dto.panel.linkJump.PanelLinkJumpBaseRequest; import io.dataease.exception.DataEaseException; import io.dataease.i18n.Translator; import io.dataease.service.chart.ChartViewService; +import io.dataease.service.dataset.DataSetTableService; import io.dataease.service.sys.SysAuthService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -33,10 +36,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; /** @@ -81,6 +81,11 @@ public class PanelGroupService { private ExtPanelViewLinkageMapper extPanelViewLinkageMapper; @Resource private ExtChartViewMapper extChartViewMapper; + @Resource + private ExtDataSetTableMapper extDataSetTableMapper; + @Resource + private DataSetTableService dataSetTableService; + public List tree(PanelGroupRequest panelGroupRequest) { String userId = String.valueOf(AuthUtils.getUser().getUserId()); @@ -99,13 +104,8 @@ public class PanelGroupService { @DeCleaner(DePermissionType.PANEL) // @Transactional public PanelGroup saveOrUpdate(PanelGroupRequest request) { - try { - Boolean mobileLayout = panelViewService.syncPanelViews(request); - request.setMobileLayout(mobileLayout); - } catch (Exception e) { - e.printStackTrace(); - LOGGER.error("更新panelView出错panelId:{}", request.getId()); - } + Boolean mobileLayout = panelViewService.syncPanelViews(request); + request.setMobileLayout(mobileLayout); String panelId = request.getId(); if (StringUtils.isEmpty(panelId)) { // 新建 @@ -341,4 +341,42 @@ public class PanelGroupService { LogUtil.info("=====v1.8版本 仪表板私有化【结束】====="); } + // 获取仪表板的视图信息 + public Map queryPanelComponents(String panelId) { + try { + Map result, tableWithFields, viewWithViewInfo, tableWithTableInfo; + //查找所有view + List views = extChartViewMapper.searchViewsWithPanelId(panelId); + viewWithViewInfo = views.stream().collect(Collectors.toMap(ChartViewDTO::getId, ChartViewDTO -> ChartViewDTO)); + //查找所有dataset + List tables = extDataSetTableMapper.searchDataSetTableWithPanelId(panelId, String.valueOf(AuthUtils.getUser().getUserId())); + tableWithTableInfo = tables.stream().collect(Collectors.toMap(DataSetTableDTO::getId, DataSetTableDTO -> DataSetTableDTO)); + //查找所有datasetFields + tableWithFields = new HashMap(); + if (CollectionUtils.isNotEmpty(tables)) { + for (DataSetTableDTO table : tables) { + DataSetTableRequest dataSetTableRequest = new DataSetTableRequest(); + dataSetTableRequest.setId(table.getId()); + Map> tableDataSetFields = dataSetTableService.getFieldsFromDE(dataSetTableRequest); + tableWithFields.put(table.getId(), tableDataSetFields); + } + } + + result = new HashMap(); + result.put("tableWithFields", tableWithFields); + result.put("viewWithViewInfo", viewWithViewInfo); + result.put("tableWithTableInfo", tableWithTableInfo); + return result; + } catch (Exception e) { + e.printStackTrace(); + LogUtil.error(e); + } + return null; + } + + public void findPanelAttachInfo(String panelId) { + + } + + } diff --git a/backend/src/main/java/io/dataease/service/panel/PanelViewService.java b/backend/src/main/java/io/dataease/service/panel/PanelViewService.java index 9351ddd953..5c9e67c07f 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelViewService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelViewService.java @@ -7,6 +7,7 @@ import io.dataease.base.domain.PanelGroupWithBLOBs; import io.dataease.base.domain.PanelView; import io.dataease.base.domain.PanelViewExample; import io.dataease.base.mapper.PanelViewMapper; +import io.dataease.base.mapper.ext.ExtChartViewMapper; import io.dataease.base.mapper.ext.ExtPanelViewMapper; import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.BeanUtils; @@ -39,6 +40,9 @@ public class PanelViewService { @Resource private PanelViewMapper panelViewMapper; + @Resource + private ExtChartViewMapper extChartViewMapper; + private final static String SCENE_TYPE = "scene"; public List groups() { @@ -115,6 +119,10 @@ public class PanelViewService { extPanelViewMapper.deleteWithPanelId(panelId); if (CollectionUtils.isNotEmpty(panelViewInsertDTOList)) { extPanelViewMapper.savePanelView(panelViewInsertDTOList); + //将视图从cache表中更新到正式表中 + List viewIds = panelViewInsertDTOList.stream().map(panelView ->panelView.getChartViewId()).collect(Collectors.toList()); + extChartViewMapper.copyCacheToView(viewIds); + extChartViewMapper.deleteCacheWithPanel(panelId); } } return mobileLayout; diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index f50178f11f..71ca683b77 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -60,7 +60,7 @@ - +
diff --git a/frontend/src/api/chart/chart.js b/frontend/src/api/chart/chart.js index 5d9a956c7e..ef96c7f3e5 100644 --- a/frontend/src/api/chart/chart.js +++ b/frontend/src/api/chart/chart.js @@ -1,10 +1,12 @@ import request from '@/utils/request' +import store from '@/store' +import { queryPanelComponents } from '@/api/panel/panel' export function post(url, data) { return request({ url: url, method: 'post', - loading: true, + loading: false, data }) } @@ -13,7 +15,7 @@ export function getChartTree(data) { return request({ url: 'api', method: 'post', - loading: true, + loading: false, data }) } @@ -38,7 +40,7 @@ export function searchAdviceSceneId(panelId) { return request({ url: '/chart/view/searchAdviceSceneId/' + panelId, method: 'get', - loading: true + loading: false }) } @@ -54,7 +56,7 @@ export function ajaxGetDataOnly(id, panelId, data) { return request({ url: '/chart/view/getData/' + id + '/' + panelId, method: 'post', - loading: true, + loading: false, hideMsg: true, data }) @@ -75,3 +77,34 @@ export function deleteCircle(id) { }) } +export function getChartDetails(id, panelId, data) { + return request({ + url: '/chart/view/get/' + id + '/' + panelId, + method: 'post', + loading: false, + data + }) +} + +export function save2Cache(panelId, data) { + return request({ + url: '/chart/view/save2Cache/' + panelId, + method: 'post', + loading: false, + data + }) +} + +export function resetViewCacheCallBack(viewId, panelId, callback) { + // 加载仪表板组件视图数据 + resetViewCache(viewId, panelId).then(rep => { + callback(rep) + }) +} +export function resetViewCache(viewId, panelId) { + return request({ + url: '/chart/view/resetViewCache/' + viewId + '/' + panelId, + method: 'post', + loading: false + }) +} diff --git a/frontend/src/api/panel/panel.js b/frontend/src/api/panel/panel.js index 0cb50e64af..17f555d3c5 100644 --- a/frontend/src/api/panel/panel.js +++ b/frontend/src/api/panel/panel.js @@ -164,3 +164,28 @@ export function queryPanelViewTree() { }) } +export function initPanelComponentsData(panelId, callback) { + // 加载仪表板组件视图数据 + queryPanelComponents(panelId).then(rep => { + store.commit('initPanelComponents', rep.data) + callback(rep) + }) +} + +export function queryPanelComponents(id) { + return request({ + url: 'panel/group/queryPanelComponents/' + id, + method: 'get', + loading: false + }) +} + +export function initViewCache(panelId) { + // 初始化仪表板视图缓存 + return request({ + url: 'chart/view/initViewCache/' + panelId, + method: 'post', + loading: false + }) +} + diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index 115965c69e..20cb6b3100 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -531,7 +531,7 @@ export default { width: this.computedMainSlotWidth, height: this.computedMainSlotHeight } - if (this.element.commonBackground && this.element.commonBackground.enable) { + if (this.element.commonBackground&&this.element.commonBackground.enable) { if (this.element.commonBackground.backgroundType === 'innerImage') { style['background'] = `url(${this.element.commonBackground.innerImage}) no-repeat` } else if (this.element.commonBackground.backgroundType === 'outerImage') { diff --git a/frontend/src/components/canvas/components/Editor/EditBar.vue b/frontend/src/components/canvas/components/Editor/EditBar.vue index d3fd3226f3..d13c4f6910 100644 --- a/frontend/src/components/canvas/components/Editor/EditBar.vue +++ b/frontend/src/components/canvas/components/Editor/EditBar.vue @@ -184,22 +184,25 @@ export default { // resize this.$emit('resizeView') }, + // edit() { + // // 编辑时临时保存 当前修改的画布 + // this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData)) + // this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData)) + // if (this.curComponent.type === 'view') { + // this.$store.dispatch('chart/setViewId', null) + // this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId) + // bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }}) + // } + // if (this.curComponent.type === 'custom') { + // bus.$emit('component-dialog-edit') + // } + // // 编辑样式组件 + // if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') { + // bus.$emit('component-dialog-style') + // } + // }, edit() { - // 编辑时临时保存 当前修改的画布 - this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData)) - this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData)) - if (this.curComponent.type === 'view') { - this.$store.dispatch('chart/setViewId', null) - this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId) - bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }}) - } - if (this.curComponent.type === 'custom') { - bus.$emit('component-dialog-edit') - } - // 编辑样式组件 - if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') { - bus.$emit('component-dialog-style') - } + bus.$emit('change_panel_right_draw', true) }, linkageEdit() { diff --git a/frontend/src/components/canvas/components/Editor/SettingMenu.vue b/frontend/src/components/canvas/components/Editor/SettingMenu.vue index 2c55a62779..c08b8b260c 100644 --- a/frontend/src/components/canvas/components/Editor/SettingMenu.vue +++ b/frontend/src/components/canvas/components/Editor/SettingMenu.vue @@ -46,23 +46,24 @@ export default { ]), methods: { edit() { - // 编辑时临时保存 当前修改的画布 - this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData)) - this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData)) - if (this.curComponent.type === 'view') { - this.$store.dispatch('chart/setViewId', null) - this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId) - bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }}) - } - if (this.curComponent.type === 'custom') { - bus.$emit('component-dialog-edit') - } - - // 编辑样式组件 - - if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') { - bus.$emit('component-dialog-style') - } + bus.$emit('change_panel_right_draw', true) + // // 编辑时临时保存 当前修改的画布 + // this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData)) + // this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData)) + // if (this.curComponent.type === 'view') { + // this.$store.dispatch('chart/setViewId', null) + // this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId) + // bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }}) + // } + // if (this.curComponent.type === 'custom') { + // bus.$emit('component-dialog-edit') + // } + // + // // 编辑样式组件 + // + // if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') { + // bus.$emit('component-dialog-style') + // } }, lock() { this.$store.commit('lock') diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index cd97d64708..62ca0c7aa8 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -57,6 +57,7 @@ @linkJumpSet="linkJumpSet(item)" @boardSet="boardSet(item)" @canvasDragging="canvasDragging" + @editComponent="editComponent(index,item)" > { param.viewId && param.viewId === this.element.propValue.viewId && this.addViewTrackFilter(param) }) + bus.$on('view-in-cache', param => { + param.viewId && param.viewId === this.element.propValue.viewId && this.getDataEdit(param) + }) }, addViewTrackFilter(linkageParam) { @@ -431,7 +434,8 @@ export default { } const requestInfo = { ...this.filter, - cache: cache + cache: cache, + queryFrom: this.isEdit ? 'panel_edit' : 'panel' } if (this.panelInfo.proxy) { // method = viewInfo @@ -711,6 +715,18 @@ export default { renderComponent() { return this.chart.render + }, + getDataEdit(param) { + this.$store.state.styleChangeTimes++ + if (param.type === 'propChange') { + this.getData(param.viewId, false) + } else if (param.type === 'styleChange') { + this.chart.customAttr = param.viewInfo.customAttr + this.chart.customStyle = param.viewInfo.customStyle + this.sourceCustomAttrStr = this.chart.customAttr + this.sourceCustomStyleStr = this.chart.customStyle + this.mergeScale() + } } } } diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 0b8b52bd60..75986c8dcb 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1029,7 +1029,8 @@ export default { table_item_align: 'Body Align', table_align_left: 'Left', table_align_center: 'Center', - table_align_right: 'Right' + table_align_right: 'Right', + draw_back: 'Draw Back' }, dataset: { sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default', @@ -1578,7 +1579,8 @@ export default { uninstall_confirm: 'Comfirm to uninstall the plugin?', uninstall_cancel: 'Cancel uninstall plugin', setting_background: 'BackGround', - setting_jump: 'Jump Setting' + setting_jump: 'Jump Setting', + select_view: 'Select View' }, display: { logo: 'Head system logo', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 16b9565570..36fb4a8459 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1029,7 +1029,8 @@ export default { table_item_align: '表格對齊方式', table_align_left: '左對齊', table_align_center: '居中', - table_align_right: '右對齊' + table_align_right: '右對齊', + draw_back: '收回' }, dataset: { sheet_warn: '有多個 Sheet 頁,默認抽取第一個', @@ -1564,7 +1565,8 @@ export default { choose_background: '选择组件背景', choose_background_tips: '组件自有的背景设置会覆盖当前设置', setting_background: '设置背景', - setting_jump: '跳转设置' + setting_jump: '跳转设置', + select_view: '请选择视图...' }, plugin: { local_install: '本地安裝', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index e8f9ffebca..e79e8b4dca 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1032,7 +1032,8 @@ export default { table_item_align: '表格对齐方式', table_align_left: '左对齐', table_align_center: '居中', - table_align_right: '右对齐' + table_align_right: '右对齐', + draw_back: '收回' }, dataset: { sheet_warn: '有多个 Sheet 页,默认抽取第一个', @@ -1573,7 +1574,8 @@ export default { choose_background: '选择组件背景', choose_background_tips: '组件自有的背景设置会覆盖当前设置', setting_background: '设置背景', - setting_jump: '跳转设置' + setting_jump: '跳转设置', + select_view: '请选择视图...' }, plugin: { local_install: '本地安装', diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 55d58a53b2..1e416ae701 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -99,7 +99,9 @@ const data = { x: 300, y: 600 }, - scrollAutoMove: 0 + scrollAutoMove: 0, + // 视图是否编辑记录 + panelViewEditInfo: {} }, mutations: { ...animation.mutations, @@ -392,6 +394,17 @@ const data = { }, setScrollAutoMove(state, offset) { state.scrollAutoMove = offset + }, + initPanelComponents(state, panelComponents) { + if (panelComponents) { + state.canvasStyleData['panelComponents'] = panelComponents + } + }, + recordViewEdit(state, viewInfo) { + state.panelViewEditInfo[viewInfo.viewId] = viewInfo.hasEdit + }, + resetViewEditInfo(state) { + state.panelViewEditInfo = {} } }, modules: { diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 84f8c778c6..ac57e049cb 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -1,7 +1,10 @@