From 33a93b891695ed86b58a07c28f9338a7dfb30efd Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 7 May 2021 19:20:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/base/domain/PanelSubject.java | 25 + .../base/domain/PanelSubjectExample.java | 670 ++++++++++++++++++ .../base/mapper/PanelSubjectMapper.java | 36 + .../base/mapper/PanelSubjectMapper.xml | 304 ++++++++ .../panel/PanelSubjectController.java | 49 ++ .../request/panel/PanelSubjectRequest.java | 12 + .../dataease/dto/panel/PanelSubjectDTO.java | 11 + .../service/panel/PanelSubjectService.java | 78 ++ .../resources/db/migration/V10__chart.sql | 44 +- .../db/migration/V12__panel_table.sql | 17 + frontend/src/api/panel/panel.js | 81 +-- .../canvas/components/Editor/PreviewEject.vue | 4 +- .../components/canvas/components/Toolbar.vue | 6 +- .../canvas/custom-component/UserView.vue | 10 +- .../views/chart/components/ChartComponent.vue | 4 - .../component-style/TitleSelector.vue | 1 - .../components/shape-attr/ColorSelector.vue | 2 +- frontend/src/views/chart/view/ChartEdit.vue | 23 +- frontend/src/views/panel/GrantAuth/index.vue | 1 - .../PanelStyle/BackgroundSelector.vue | 34 +- .../SubjectSetting/PreSubject/Slider.vue | 89 ++- .../PreSubject/SubjectTemplateItem.vue | 204 ++++-- .../PreSubject/SubjectTemplateItemback.vue | 236 ++++++ .../src/views/panel/SubjectSetting/index.vue | 30 +- frontend/src/views/panel/ViewSelect/index.vue | 8 +- frontend/src/views/panel/edit/index.vue | 20 +- .../src/views/panel/list/EditPanel/index.vue | 1 - frontend/src/views/panel/list/PanelList.vue | 2 - frontend/src/views/panel/panel.js | 45 ++ 29 files changed, 1823 insertions(+), 224 deletions(-) create mode 100644 backend/src/main/java/io/dataease/base/domain/PanelSubject.java create mode 100644 backend/src/main/java/io/dataease/base/domain/PanelSubjectExample.java create mode 100644 backend/src/main/java/io/dataease/base/mapper/PanelSubjectMapper.java create mode 100644 backend/src/main/java/io/dataease/base/mapper/PanelSubjectMapper.xml create mode 100644 backend/src/main/java/io/dataease/controller/panel/PanelSubjectController.java create mode 100644 backend/src/main/java/io/dataease/controller/request/panel/PanelSubjectRequest.java create mode 100644 backend/src/main/java/io/dataease/dto/panel/PanelSubjectDTO.java create mode 100644 backend/src/main/java/io/dataease/service/panel/PanelSubjectService.java create mode 100644 frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItemback.vue diff --git a/backend/src/main/java/io/dataease/base/domain/PanelSubject.java b/backend/src/main/java/io/dataease/base/domain/PanelSubject.java new file mode 100644 index 0000000000..f8fdf47b36 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/PanelSubject.java @@ -0,0 +1,25 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class PanelSubject implements Serializable { + private String id; + + private String name; + + private String type; + + private Long createTime; + + private String createBy; + + private Long updateTime; + + private String updateBy; + + private String details; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/PanelSubjectExample.java b/backend/src/main/java/io/dataease/base/domain/PanelSubjectExample.java new file mode 100644 index 0000000000..fef898737e --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/PanelSubjectExample.java @@ -0,0 +1,670 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class PanelSubjectExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public PanelSubjectExample() { + 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 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 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 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 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 andUpdateByIsNull() { + addCriterion("update_by is null"); + return (Criteria) this; + } + + public Criteria andUpdateByIsNotNull() { + addCriterion("update_by is not null"); + return (Criteria) this; + } + + public Criteria andUpdateByEqualTo(String value) { + addCriterion("update_by =", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotEqualTo(String value) { + addCriterion("update_by <>", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByGreaterThan(String value) { + addCriterion("update_by >", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByGreaterThanOrEqualTo(String value) { + addCriterion("update_by >=", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLessThan(String value) { + addCriterion("update_by <", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLessThanOrEqualTo(String value) { + addCriterion("update_by <=", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLike(String value) { + addCriterion("update_by like", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotLike(String value) { + addCriterion("update_by not like", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByIn(List values) { + addCriterion("update_by in", values, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotIn(List values) { + addCriterion("update_by not in", values, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByBetween(String value1, String value2) { + addCriterion("update_by between", value1, value2, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotBetween(String value1, String value2) { + addCriterion("update_by not between", value1, value2, "updateBy"); + 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/mapper/PanelSubjectMapper.java b/backend/src/main/java/io/dataease/base/mapper/PanelSubjectMapper.java new file mode 100644 index 0000000000..a499fc7889 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/PanelSubjectMapper.java @@ -0,0 +1,36 @@ +package io.dataease.base.mapper; + +import io.dataease.base.domain.PanelSubject; +import io.dataease.base.domain.PanelSubjectExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface PanelSubjectMapper { + long countByExample(PanelSubjectExample example); + + int deleteByExample(PanelSubjectExample example); + + int deleteByPrimaryKey(String id); + + int insert(PanelSubject record); + + int insertSelective(PanelSubject record); + + List selectByExampleWithBLOBs(PanelSubjectExample example); + + List selectByExample(PanelSubjectExample example); + + PanelSubject selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") PanelSubject record, @Param("example") PanelSubjectExample example); + + int updateByExampleWithBLOBs(@Param("record") PanelSubject record, @Param("example") PanelSubjectExample example); + + int updateByExample(@Param("record") PanelSubject record, @Param("example") PanelSubjectExample example); + + int updateByPrimaryKeySelective(PanelSubject record); + + int updateByPrimaryKeyWithBLOBs(PanelSubject record); + + int updateByPrimaryKey(PanelSubject record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/PanelSubjectMapper.xml b/backend/src/main/java/io/dataease/base/mapper/PanelSubjectMapper.xml new file mode 100644 index 0000000000..01d76737ed --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/PanelSubjectMapper.xml @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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`, `type`, create_time, create_by, update_time, update_by + + + details + + + + + + delete from panel_subject + where id = #{id,jdbcType=VARCHAR} + + + delete from panel_subject + + + + + + insert into panel_subject (id, `name`, `type`, + create_time, create_by, update_time, + update_by, details) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{createTime,jdbcType=BIGINT}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, + #{updateBy,jdbcType=VARCHAR}, #{details,jdbcType=LONGVARCHAR}) + + + insert into panel_subject + + + id, + + + `name`, + + + `type`, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + details, + + + + + #{id,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{details,jdbcType=LONGVARCHAR}, + + + + + + update panel_subject + + + id = #{record.id,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + `type` = #{record.type,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + update_by = #{record.updateBy,jdbcType=VARCHAR}, + + + details = #{record.details,jdbcType=LONGVARCHAR}, + + + + + + + + update panel_subject + set id = #{record.id,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + update_by = #{record.updateBy,jdbcType=VARCHAR}, + details = #{record.details,jdbcType=LONGVARCHAR} + + + + + + update panel_subject + set id = #{record.id,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + update_by = #{record.updateBy,jdbcType=VARCHAR} + + + + + + update panel_subject + + + `name` = #{name,jdbcType=VARCHAR}, + + + `type` = #{type,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + details = #{details,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update panel_subject + set `name` = #{name,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=BIGINT}, + update_by = #{updateBy,jdbcType=VARCHAR}, + details = #{details,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + update panel_subject + set `name` = #{name,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=BIGINT}, + update_by = #{updateBy,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/controller/panel/PanelSubjectController.java b/backend/src/main/java/io/dataease/controller/panel/PanelSubjectController.java new file mode 100644 index 0000000000..75b3fa3ab7 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/panel/PanelSubjectController.java @@ -0,0 +1,49 @@ +package io.dataease.controller.panel; + +import io.dataease.base.domain.PanelSubject; +import io.dataease.base.domain.PanelTemplateWithBLOBs; +import io.dataease.controller.request.panel.PanelSubjectRequest; +import io.dataease.controller.request.panel.PanelTemplateRequest; +import io.dataease.dto.panel.PanelTemplateDTO; +import io.dataease.service.panel.PanelSubjectService; +import io.dataease.service.panel.PanelTemplateService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * Author: wangjiahao + * Date: 2021-05-06 + * Description: + */ +@RestController +@RequestMapping("panel/subject") +public class PanelSubjectController { + + @Resource + private PanelSubjectService panelSubjectService; + + @PostMapping("/query") + public List query(@RequestBody PanelSubjectRequest request) { + return panelSubjectService.query(request); + } + + @PostMapping("/querySubjectWithGroup") + public List querySubjectWithGroup(@RequestBody PanelSubjectRequest request) { + return panelSubjectService.querySubjectWithGroup(request); + } + + @PostMapping("/update") + public void update(@RequestBody PanelSubjectRequest request) { + panelSubjectService.update(request); + } + + + @DeleteMapping("/delete/{id}") + public void update(@PathVariable String id) { + panelSubjectService.delete(id); + } + + +} diff --git a/backend/src/main/java/io/dataease/controller/request/panel/PanelSubjectRequest.java b/backend/src/main/java/io/dataease/controller/request/panel/PanelSubjectRequest.java new file mode 100644 index 0000000000..84aaa4a44c --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/request/panel/PanelSubjectRequest.java @@ -0,0 +1,12 @@ +package io.dataease.controller.request.panel; + +import io.dataease.base.domain.PanelSubject; + +/** + * Author: wangjiahao + * Date: 2021-05-07 + * Description: + */ +public class PanelSubjectRequest extends PanelSubject { + +} diff --git a/backend/src/main/java/io/dataease/dto/panel/PanelSubjectDTO.java b/backend/src/main/java/io/dataease/dto/panel/PanelSubjectDTO.java new file mode 100644 index 0000000000..593b2aa6df --- /dev/null +++ b/backend/src/main/java/io/dataease/dto/panel/PanelSubjectDTO.java @@ -0,0 +1,11 @@ +package io.dataease.dto.panel; + +import io.dataease.base.domain.PanelSubject; + +/** + * Author: wangjiahao + * Date: 2021-05-07 + * Description: + */ +public class PanelSubjectDTO extends PanelSubject { +} diff --git a/backend/src/main/java/io/dataease/service/panel/PanelSubjectService.java b/backend/src/main/java/io/dataease/service/panel/PanelSubjectService.java new file mode 100644 index 0000000000..d1385cf178 --- /dev/null +++ b/backend/src/main/java/io/dataease/service/panel/PanelSubjectService.java @@ -0,0 +1,78 @@ +package io.dataease.service.panel; + +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import io.dataease.base.domain.PanelSubject; +import io.dataease.base.domain.PanelSubjectExample; +import io.dataease.base.domain.PanelTemplateWithBLOBs; +import io.dataease.base.mapper.PanelSubjectMapper; +import io.dataease.base.mapper.PanelTemplateMapper; +import io.dataease.base.mapper.ext.ExtPanelTemplateMapper; +import io.dataease.commons.utils.BeanUtils; +import io.dataease.commons.utils.PageUtils; +import io.dataease.commons.utils.Pager; +import io.dataease.controller.request.panel.PanelSubjectRequest; +import io.dataease.controller.request.panel.PanelTemplateRequest; +import io.dataease.dto.panel.PanelTemplateDTO; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +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; + +/** + * Author: wangjiahao + * Date: 2021-05-06 + * Description: + */ +@Service +public class PanelSubjectService { + + private Logger LOGGER = LoggerFactory.getLogger(this.getClass()); + + @Resource + private PanelSubjectMapper panelSubjectMapper; + + public List query(PanelSubjectRequest request){ + PanelSubjectExample example = new PanelSubjectExample(); + return panelSubjectMapper.selectByExampleWithBLOBs(null); + } + + public List querySubjectWithGroup(PanelSubjectRequest request){ + List result = new ArrayList(); + int pageSize = 4; + List allInfo = panelSubjectMapper.selectByExampleWithBLOBs(null); + for(int i =0;i tmp = allInfo.subList(i,i+pageSize { - debugger this.componentDataSource = this.resetID(JSON.parse(response.data.panelData)) this.canvasStyleData = JSON.parse(response.data.panelStyle) + this.$store.commit('setCanvasStyle', { + ...this.canvasStyleData + }) this.resize() }) }, diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 3aaf038dbf..07797dd975 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -86,7 +86,10 @@ export default { }, methods: { closePanelEdit() { - bus.$emit('PanelSwitchComponent', { name: 'PanelMain' }) + this.$emit('close-left-panel') + this.$nextTick(() => { + bus.$emit('PanelSwitchComponent', { name: 'PanelMain' }) + }) }, goFile() { this.$refs.files.click() @@ -205,7 +208,6 @@ export default { panelStyle: JSON.stringify(this.canvasStyleData), panelData: JSON.stringify(this.componentData) } - debugger post('panel/group/save', requestInfo, () => {}) this.$message.success('保存成功') }, diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 0d028a21ac..5f1aa5d89b 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -55,7 +55,6 @@ export default { // deep监听panel 如果改变 提交到 store canvasStyleData: { handler(newVal, oldVla) { - debugger // this.chart.stylePriority == panel 优先使用仪表盘样式 this.mergeStyle() }, @@ -110,21 +109,22 @@ export default { const customStylePanel = JSON.parse(this.canvasStyleData.chart.customStyle) // 组件样式-标题设置 - customStyleChart.text = customAttrPanel.text + customStyleChart.text = customStylePanel.text // 组件样式-背景设置 - customStyleChart.background = customAttrPanel.background + customStyleChart.background = customStylePanel.background // 图形属性-颜色设置 - customAttrChart.color = customStylePanel.color + customAttrChart.color = customAttrPanel.color this.chart = { ...this.chart, customAttr: JSON.stringify(customAttrChart), - customStyle: JSON.stringify(customAttrChart) + customStyle: JSON.stringify(customStyleChart) } } }, getData(id) { if (id) { + debugger this.requestStatus = 'waiting' this.message = null viewData(id, this.filter).then(response => { diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 50bd5a1d42..f4d98672ed 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -38,8 +38,6 @@ export default { watch: { chart: { handler(newVal, oldVla) { - debugger - console.log('chart,watch') this.preDraw() }, deep: true @@ -59,7 +57,6 @@ export default { methods: { preDraw() { // 基于准备好的dom,初始化echarts实例 - console.log('chartId:' + this.chartId) // 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表盘有重复id情况 new Promise((resolve) => { resolve() }).then(() => { // 此dom为echarts图标展示dom @@ -95,7 +92,6 @@ export default { } else if (chart.type === 'radar') { chart_option = baseRadarOption(JSON.parse(JSON.stringify(BASE_RADAR)), chart) } - console.log(chart_option) this.myEcharts(chart_option) }, myEcharts(option) { diff --git a/frontend/src/views/chart/components/component-style/TitleSelector.vue b/frontend/src/views/chart/components/component-style/TitleSelector.vue index 33dc035fda..1d539dec55 100644 --- a/frontend/src/views/chart/components/component-style/TitleSelector.vue +++ b/frontend/src/views/chart/components/component-style/TitleSelector.vue @@ -81,7 +81,6 @@ export default { } }, created() { - debugger console.log(JSON.stringify(this.chart)) }, mounted() { diff --git a/frontend/src/views/chart/components/shape-attr/ColorSelector.vue b/frontend/src/views/chart/components/shape-attr/ColorSelector.vue index 1f5d11df88..ba29343078 100644 --- a/frontend/src/views/chart/components/shape-attr/ColorSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/ColorSelector.vue @@ -35,7 +35,7 @@ - + diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 5556054091..6612180865 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -125,6 +125,13 @@
+ + 样式优先级 + + 视图 + 仪表盘 + + @@ -194,9 +201,10 @@ - - - +
+ + +
@@ -280,6 +288,7 @@ import BackgroundColorSelector from '../components/component-style/BackgroundCol import QuotaFilterEditor from '../components/filter/QuotaFilterEditor' import DimensionFilterEditor from '../components/filter/DimensionFilterEditor' import TableNormal from '../components/table/TableNormal' +import html2canvas from 'html2canvas' export default { name: 'ChartEdit', @@ -425,6 +434,14 @@ export default { if (getData) { this.getData(response.data.id) } else { + debugger + html2canvas(this.$refs.imageWrapper).then(canvas => { + const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1是图片质量 + if (snapshot !== '') { + view.snapshot = snapshot + post('/chart/view/save', view) + } + }) this.getChart(response.data.id) } diff --git a/frontend/src/views/panel/GrantAuth/index.vue b/frontend/src/views/panel/GrantAuth/index.vue index da7f8fe016..0b4131f3ab 100644 --- a/frontend/src/views/panel/GrantAuth/index.vue +++ b/frontend/src/views/panel/GrantAuth/index.vue @@ -49,7 +49,6 @@ export default { methods: { handleClick(tab, event) { - console.log(tab, event) }, showSearchWidget() { this.showSearchInput = true diff --git a/frontend/src/views/panel/SubjectSetting/PanelStyle/BackgroundSelector.vue b/frontend/src/views/panel/SubjectSetting/PanelStyle/BackgroundSelector.vue index 9c4a685cdc..d70817e088 100644 --- a/frontend/src/views/panel/SubjectSetting/PanelStyle/BackgroundSelector.vue +++ b/frontend/src/views/panel/SubjectSetting/PanelStyle/BackgroundSelector.vue @@ -9,7 +9,7 @@ - 颜色 + 颜色 @@ -17,7 +17,7 @@ - 图片 + 图片 @@ -55,8 +55,7 @@ export default { name: 'BackgroundSelector', data() { return { - filesTmp: [], - imageUrl: '', + fileList: [], dialogImageUrl: '', dialogVisible: false, uploadDisabled: false, @@ -68,37 +67,40 @@ export default { ]), watch: { // deep监听panel 如果改变 提交到 store - panel: { - handler(newVal, oldVla) { - debugger - const canvasStyleData = deepCopy(this.canvasStyleData) - canvasStyleData.panel = this.panel - this.$store.commit('setCanvasStyle', canvasStyleData) - }, - deep: true - } }, created() { // 初始化赋值 this.panel = this.canvasStyleData.panel + if (this.panel.imageUrl) { + this.fileList.push({ url: this.panel.imageUrl }) + } }, methods: { + commitStyle() { + const canvasStyleData = deepCopy(this.canvasStyleData) + canvasStyleData.panel = this.panel + this.$store.commit('setCanvasStyle', canvasStyleData) + }, + onChangeType() { + this.commitStyle() + }, handleRemove(file, fileList) { this.uploadDisabled = false this.panel.imageUrl = null - console.log(file, fileList) + this.fileList = [] + this.commitStyle() }, handlePictureCardPreview(file) { this.dialogImageUrl = file.url this.dialogVisible = true }, onChange(file, fileList) { - debugger var _this = this _this.uploadDisabled = true const reader = new FileReader() reader.onload = function() { _this.panel.imageUrl = reader.result + this.commitStyle() } reader.readAsDataURL(file.raw) }, diff --git a/frontend/src/views/panel/SubjectSetting/PreSubject/Slider.vue b/frontend/src/views/panel/SubjectSetting/PreSubject/Slider.vue index ad1b694fbe..9117f8155a 100644 --- a/frontend/src/views/panel/SubjectSetting/PreSubject/Slider.vue +++ b/frontend/src/views/panel/SubjectSetting/PreSubject/Slider.vue @@ -2,7 +2,7 @@ - L +  
  • @@ -18,7 +18,8 @@
@@ -27,7 +28,8 @@ @@ -36,7 +38,8 @@ @@ -45,7 +48,7 @@ - R +  
  • @@ -67,7 +70,7 @@
- 保存个人主题 + 保存个人主题 @@ -76,6 +79,9 @@ + + diff --git a/frontend/src/views/panel/SubjectSetting/index.vue b/frontend/src/views/panel/SubjectSetting/index.vue index ffdd95150f..a9e69ccf30 100644 --- a/frontend/src/views/panel/SubjectSetting/index.vue +++ b/frontend/src/views/panel/SubjectSetting/index.vue @@ -73,25 +73,8 @@ export default { ]), watch: { - // deep监听panel 如果改变 提交到 store - chart: { - handler(newVal, oldVla) { - debugger - const canvasStyleData = deepCopy(this.canvasStyleData) - const chart = deepCopy(this.chart) - chart.xaxis = JSON.stringify(this.chart.xaxis) - chart.yaxis = JSON.stringify(this.chart.yaxis) - chart.customAttr = JSON.stringify(this.chart.customAttr) - chart.customStyle = JSON.stringify(this.chart.customStyle) - chart.customFilter = JSON.stringify(this.chart.customFilter) - canvasStyleData.chart = chart - this.$store.commit('setCanvasStyle', canvasStyleData) - }, - deep: true - } }, created() { - debugger // 初始化赋值 const chart = deepCopy(this.canvasStyleData.chart) if (chart.xaxis) { @@ -118,16 +101,23 @@ export default { this.save() }, onTextChange(val) { - debugger this.chart.customStyle.text = val - // this.save() + this.save() }, onChangeBackgroundForm(val) { this.chart.customStyle.background = val this.save() }, save() { - console.log('save') + const canvasStyleData = deepCopy(this.canvasStyleData) + const chart = deepCopy(this.chart) + chart.xaxis = JSON.stringify(this.chart.xaxis) + chart.yaxis = JSON.stringify(this.chart.yaxis) + chart.customAttr = JSON.stringify(this.chart.customAttr) + chart.customStyle = JSON.stringify(this.chart.customStyle) + chart.customFilter = JSON.stringify(this.chart.customFilter) + canvasStyleData.chart = chart + this.$store.commit('setCanvasStyle', canvasStyleData) } } } diff --git a/frontend/src/views/panel/ViewSelect/index.vue b/frontend/src/views/panel/ViewSelect/index.vue index f7d11f0b46..ccca047152 100644 --- a/frontend/src/views/panel/ViewSelect/index.vue +++ b/frontend/src/views/panel/ViewSelect/index.vue @@ -18,18 +18,13 @@ @node-drag-start="handleDragStart" /> -
{{ detailItem.name }} -
- -
- +
-
@@ -149,6 +144,7 @@ export default { } .detail-class { width: 100%; + min-height: 200px; position: fixed; bottom: 0px; } diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 0494c16f64..6dab2d2328 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -5,7 +5,7 @@ 名称:{{ panelInfo.name || '测试仪表板' }} - + @@ -43,12 +43,11 @@
-
- +
- - - + + +
@@ -102,7 +101,6 @@
- @@ -154,7 +152,8 @@ export default { reSelectAnimateIndex: undefined, filterVisible: false, currentWidget: null, - currentFilterCom: null + currentFilterCom: null, + subjectVisible: false } }, @@ -216,7 +215,6 @@ export default { this.$store.commit('setCanvasStyle', JSON.parse(canvasStyleDataTemp)) } else if (panelId) { get('panel/group/findOne/' + panelId).then(response => { - debugger this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) const panelStyle = JSON.parse(response.data.panelStyle) this.$store.commit('setCanvasStyle', panelStyle) @@ -357,6 +355,10 @@ export default { this.currentWidget = ApplicationContext.getService(serviceName) this.currentFilterCom = this.curComponent this.openFilterDiolog() + }, + closeLeftPanel() { + this.show = false + this.beforeDestroy() } } } diff --git a/frontend/src/views/panel/list/EditPanel/index.vue b/frontend/src/views/panel/list/EditPanel/index.vue index 944aef9f89..a0baa1f45b 100644 --- a/frontend/src/views/panel/list/EditPanel/index.vue +++ b/frontend/src/views/panel/list/EditPanel/index.vue @@ -102,7 +102,6 @@ export default { return false } panelSave(this.editPanel.panelInfo).then(response => { - debugger this.$message({ message: '保存成功', type: 'success', diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index cae0078980..bfd18bc3eb 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -312,7 +312,6 @@ export default { this.tree(this.groupForm) }, showEditPanel(param) { - debugger this.editPanel = JSON.parse(JSON.stringify(this.editPanelModel)) this.editPanel.optType = param.optType this.editPanel.panelInfo.nodeType = param.type @@ -465,7 +464,6 @@ export default { if (data.nodeType === 'panel') { // 加载视图数据 get('panel/group/findOne/' + data.id).then(response => { - debugger this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) const temp = JSON.parse(response.data.panelStyle) this.$store.commit('setCanvasStyle', temp) diff --git a/frontend/src/views/panel/panel.js b/frontend/src/views/panel/panel.js index de815806cf..7f6532d8f5 100644 --- a/frontend/src/views/panel/panel.js +++ b/frontend/src/views/panel/panel.js @@ -9,6 +9,7 @@ import { DEFAULT_YAXIS_STYLE, DEFAULT_BACKGROUND_COLOR } from '@/views/chart/chart/chart' +import { deepCopy } from '@/components/canvas/utils/utils' export const DEFAULT_PANEL_STYLE = { color: '#ffffff', @@ -45,3 +46,47 @@ export const DEFAULT_COMMON_CANVAS_STYLE = { customFilter: [] } } + +export function chartTransStr2Object(targetIn, copy) { + const target = copy === 'Y' ? deepCopy(targetIn) : targetIn + if (target.chart) { + if (target.chart.xaxis && typeof target.chart.xaxis === 'string') { + target.chart.xaxis = JSON.parse(target.chart.xaxis) + } + if (target.chart.yaxis && typeof target.chart.yaxis === 'string') { + target.chart.yaxis = JSON.parse(target.chart.yaxis) + } + if (target.chart.customAttr && typeof target.chart.customAttr === 'string') { + target.chart.customAttr = JSON.parse(target.chart.customAttr) + } + if (target.chart.customStyle && typeof target.chart.customStyle === 'string') { + target.chart.customStyle = JSON.parse(target.chart.customStyle) + } + if (target.chart.customFilter && typeof target.chart.customFilter === 'string') { + target.chart.customFilter = JSON.parse(target.chart.customFilter) + } + } + return target +} + +export function chartTransObject2Str(targetIn, deepCopy) { + const target = copy === 'Y' ? deepCopy(targetIn) : targetIn + if (target.chart) { + if (target.chart.xaxis && typeof target.chart.xaxis !== 'string') { + target.chart.xaxis = JSON.stringify(target.chart.xaxis) + } + if (target.chart.yaxis && typeof target.chart.yaxis !== 'string') { + target.chart.yaxis = JSON.stringify(target.chart.yaxis) + } + if (target.chart.customAttr && typeof target.chart.customAttr !== 'string') { + target.chart.customAttr = JSON.stringify(target.chart.customAttr) + } + if (target.chart.customStyle && typeof target.chart.customStyle !== 'string') { + target.chart.customStyle = JSON.stringify(target.chart.customStyle) + } + if (target.chart.customFilter && typeof target.chart.customFilter !== 'string') { + target.chart.customFilter = JSON.stringify(target.chart.customFilter) + } + } + return target +}