feat:主题
This commit is contained in:
parent
7ce09f5b5d
commit
33a93b8916
@ -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;
|
||||
}
|
||||
@ -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<Criteria> oredCriteria;
|
||||
|
||||
public PanelSubjectExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
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<Criteria> 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<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> 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<String> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<String> 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<String> values) {
|
||||
addCriterion("`name` in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> 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<String> values) {
|
||||
addCriterion("`type` in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotIn(List<String> 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<Long> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Long> 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<String> values) {
|
||||
addCriterion("create_by in", values, "createBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateByNotIn(List<String> 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<Long> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Long> 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<String> values) {
|
||||
addCriterion("update_by in", values, "updateBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateByNotIn(List<String> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<PanelSubject> selectByExampleWithBLOBs(PanelSubjectExample example);
|
||||
|
||||
List<PanelSubject> 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);
|
||||
}
|
||||
@ -0,0 +1,304 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.dataease.base.mapper.PanelSubjectMapper">
|
||||
<resultMap id="BaseResultMap" type="io.dataease.base.domain.PanelSubject">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.PanelSubject">
|
||||
<result column="details" jdbcType="LONGVARCHAR" property="details" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, `name`, `type`, create_time, create_by, update_time, update_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
details
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="io.dataease.base.domain.PanelSubjectExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from panel_subject
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="io.dataease.base.domain.PanelSubjectExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from panel_subject
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from panel_subject
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from panel_subject
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.dataease.base.domain.PanelSubjectExample">
|
||||
delete from panel_subject
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.dataease.base.domain.PanelSubject">
|
||||
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>
|
||||
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelSubject">
|
||||
insert into panel_subject
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
`name`,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="details != null">
|
||||
details,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
#{createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
#{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="details != null">
|
||||
#{details,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.dataease.base.domain.PanelSubjectExample" resultType="java.lang.Long">
|
||||
select count(*) from panel_subject
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update panel_subject
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
`name` = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.createBy != null">
|
||||
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.updateBy != null">
|
||||
update_by = #{record.updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.details != null">
|
||||
details = #{record.details,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
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}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
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}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.PanelSubject">
|
||||
update panel_subject
|
||||
<set>
|
||||
<if test="name != null">
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="details != null">
|
||||
details = #{details,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.dataease.base.domain.PanelSubject">
|
||||
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>
|
||||
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.PanelSubject">
|
||||
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}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -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<PanelSubject> query(@RequestBody PanelSubjectRequest request) {
|
||||
return panelSubjectService.query(request);
|
||||
}
|
||||
|
||||
@PostMapping("/querySubjectWithGroup")
|
||||
public List<PanelSubject> 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -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 {
|
||||
|
||||
}
|
||||
@ -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 {
|
||||
}
|
||||
@ -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<PanelSubject> query(PanelSubjectRequest request){
|
||||
PanelSubjectExample example = new PanelSubjectExample();
|
||||
return panelSubjectMapper.selectByExampleWithBLOBs(null);
|
||||
}
|
||||
|
||||
public List querySubjectWithGroup(PanelSubjectRequest request){
|
||||
List result = new ArrayList();
|
||||
int pageSize = 4;
|
||||
List<PanelSubject> allInfo = panelSubjectMapper.selectByExampleWithBLOBs(null);
|
||||
for(int i =0;i<allInfo.size();i=i+pageSize){
|
||||
List<PanelSubject> tmp = allInfo.subList(i,i+pageSize<allInfo.size()?i+pageSize:allInfo.size());
|
||||
result.add(tmp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void update(PanelSubject request){
|
||||
if(StringUtils.isEmpty(request.getId())){
|
||||
request.setId(UUID.randomUUID().toString());
|
||||
request.setCreateTime(System.currentTimeMillis());
|
||||
request.setType("self");
|
||||
request.setName("个人主题");
|
||||
panelSubjectMapper.insertSelective(request);
|
||||
}else{
|
||||
request.setUpdateTime(System.currentTimeMillis());
|
||||
panelSubjectMapper.updateByPrimaryKeySelective(request);
|
||||
}
|
||||
}
|
||||
|
||||
public void delete(String id){
|
||||
Assert.notNull(id,"subjectId should not be null");
|
||||
panelSubjectMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -12,30 +12,26 @@ CREATE TABLE IF NOT EXISTS `chart_group`
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
DROP TABLE IF EXISTS `chart_view`;
|
||||
CREATE TABLE IF NOT EXISTS `chart_view`
|
||||
(
|
||||
`id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`name` varchar(64) COMMENT '名称',
|
||||
`scene_id` varchar(50) NOT NULL COMMENT '场景ID',
|
||||
`table_id` varchar(50) NOT NULL COMMENT '数据集表ID',
|
||||
`type` varchar(50) COMMENT '图表类型',
|
||||
`title` varchar(50) COMMENT 'EChart标题',
|
||||
`x_axis` longtext COMMENT '横轴field',
|
||||
`y_axis` longtext COMMENT '纵轴field',
|
||||
`custom_attr` longtext COMMENT '图形属性',
|
||||
`custom_style` longtext COMMENT '组件样式',
|
||||
`custom_filter` longtext COMMENT '结果过滤',
|
||||
`create_by` varchar(50) COMMENT '创建人ID',
|
||||
`create_time` bigint(13) COMMENT '创建时间',
|
||||
`update_time` bigint(13) COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `IDX_TABLE_ID` (`table_id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4;
|
||||
CREATE TABLE `chart_view` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`name` varchar(64) DEFAULT NULL COMMENT '名称',
|
||||
`scene_id` varchar(50) NOT NULL COMMENT '场景ID',
|
||||
`table_id` varchar(50) NOT NULL COMMENT '数据集表ID',
|
||||
`type` varchar(50) DEFAULT NULL COMMENT '图表类型',
|
||||
`title` varchar(50) DEFAULT NULL COMMENT 'EChart标题',
|
||||
`x_axis` longtext COMMENT '横轴field',
|
||||
`y_axis` longtext COMMENT '纵轴field',
|
||||
`custom_attr` longtext COMMENT '图形属性',
|
||||
`custom_style` longtext COMMENT '组件样式',
|
||||
`custom_filter` longtext COMMENT '结果过滤',
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` bigint(13) DEFAULT NULL COMMENT '更新时间',
|
||||
`snapshot` longtext COMMENT '缩略图 ',
|
||||
`style_priority` varchar(255) DEFAULT 'panel' COMMENT '样式优先级 panel 仪表盘 view 视图',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `IDX_TABLE_ID` (`table_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
ALTER TABLE `chart_view`
|
||||
ADD COLUMN `snapshot` longtext NULL COMMENT '缩略图 ' AFTER `update_time`,
|
||||
ADD COLUMN `style_priority` varchar(255) NULL COMMENT '样式优先级 panel 仪表盘 view 视图' AFTER `snapshot`;
|
||||
-- chart end
|
||||
|
||||
@ -166,3 +166,20 @@ CREATE TABLE `panel_link` (
|
||||
`pwd` varchar(255) DEFAULT NULL COMMENT '密码',
|
||||
PRIMARY KEY (`resource_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='仪表板链接';
|
||||
|
||||
DROP TABLE IF EXISTS `panel_template`;
|
||||
CREATE TABLE `panel_template` (
|
||||
`id` varchar(50) NOT NULL,
|
||||
`name` varchar(255) DEFAULT NULL COMMENT '名称',
|
||||
`pid` varchar(255) DEFAULT NULL COMMENT '父级id',
|
||||
`level` int(10) DEFAULT NULL COMMENT '层级',
|
||||
`node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
|
||||
`snapshot` longtext COMMENT '缩略图',
|
||||
`template_type` varchar(255) DEFAULT NULL COMMENT '仪表盘类型 system 系统内置 self 用户自建 ',
|
||||
`template_style` longtext COMMENT 'template 样式',
|
||||
`template_data` longtext COMMENT 'template 数据',
|
||||
`dynamic_data` longtext COMMENT '预存数据',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
@ -1,5 +1,40 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function deleteSubject(id) {
|
||||
return request({
|
||||
url: '/panel/subject/delete/' + id,
|
||||
method: 'delete',
|
||||
loading: true
|
||||
})
|
||||
}
|
||||
|
||||
export function saveSubject(data) {
|
||||
return request({
|
||||
url: '/panel/subject/update',
|
||||
method: 'post',
|
||||
loading: true,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function querySubject(data) {
|
||||
return request({
|
||||
url: '/panel/subject/query',
|
||||
method: 'post',
|
||||
loading: true,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function querySubjectWithGroup(data) {
|
||||
return request({
|
||||
url: '/panel/subject/querySubjectWithGroup',
|
||||
method: 'post',
|
||||
loading: true,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function defaultTree(data) {
|
||||
return request({
|
||||
url: '/panel/group/defaultTree',
|
||||
@ -35,50 +70,6 @@ export function panelSave(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getScene(sceneId) {
|
||||
return request({
|
||||
url: '/panel/group/getScene/' + sceneId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function addGroup(data) {
|
||||
return request({
|
||||
url: '/panel/group/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delGroup(groupId) {
|
||||
return request({
|
||||
url: '/panel/group/deleteCircle/' + groupId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function addTable(data) {
|
||||
return request({
|
||||
url: '/panel/table/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delTable(tableId) {
|
||||
return request({
|
||||
url: '/panel/table/delete/' + tableId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function listDatasource() {
|
||||
return request({
|
||||
url: '/datasource/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getTable(id) {
|
||||
return request({
|
||||
url: '/panel/table/get/' + id,
|
||||
@ -125,4 +116,4 @@ export function get(url) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { post, get, groupTree, defaultTree, viewData ,panelSave}
|
||||
export default { post, get, groupTree, defaultTree, viewData, panelSave, querySubject, querySubjectWithGroup, saveSubject,deleteSubject }
|
||||
|
||||
@ -106,9 +106,11 @@ export default {
|
||||
this.panelId = this.$route.path.split('/')[2]
|
||||
// 加载视图数据
|
||||
get('panel/group/findOne/' + this.panelId).then(response => {
|
||||
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()
|
||||
})
|
||||
},
|
||||
|
||||
@ -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('保存成功')
|
||||
},
|
||||
|
||||
@ -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 => {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -81,7 +81,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
debugger
|
||||
console.log(JSON.stringify(this.chart))
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item v-if="sourceType==='view'" :label="$t('chart.not_alpha')" class="form-item form-item-slider">
|
||||
<el-form-item :label="$t('chart.not_alpha')" class="form-item form-item-slider">
|
||||
<el-slider v-model="colorForm.alpha" show-input :show-input-controls="false" input-size="mini" @change="changeColorCase" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@ -125,6 +125,13 @@
|
||||
</el-row>
|
||||
</div>
|
||||
<div style="height: 40%;overflow:hidden;border-top: 1px solid #e6e6e6">
|
||||
<el-row class="padding-lr">
|
||||
<span>样式优先级</span>
|
||||
<el-radio-group v-model="view.stylePriority" size="mini" @change="save">
|
||||
<el-radio style="margin-left: 20px" label="view"><span>视图</span></el-radio>
|
||||
<el-radio label="panel"><span>仪表盘</span></el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
<el-tabs type="card" :stretch="true" class="tab-header">
|
||||
<el-tab-pane :label="$t('chart.shape_attr')" class="padding-lr">
|
||||
<color-selector class="attr-selector" :chart="chart" @onColorChange="onColorChange" />
|
||||
@ -194,9 +201,10 @@
|
||||
</draggable>
|
||||
</el-row>
|
||||
</el-row>
|
||||
|
||||
<chart-component v-if="chart.type && !chart.type.includes('table')" :chart-id="chart.id" :chart="chart" class="chart-class" />
|
||||
<table-normal v-if="chart.type && chart.type.includes('table')" :chart="chart" class="table-class" />
|
||||
<div ref="imageWrapper" style="height: 100%">
|
||||
<chart-component v-if="chart.type && !chart.type.includes('table')" :chart-id="chart.id" :chart="chart" class="chart-class" />
|
||||
<table-normal v-if="chart.type && chart.type.includes('table')" :chart="chart" class="table-class" />
|
||||
</div>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,6 @@ export default {
|
||||
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event)
|
||||
},
|
||||
showSearchWidget() {
|
||||
this.showSearchInput = true
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-radio v-model="panel.backgroundType" label="color">颜色</el-radio>
|
||||
<el-radio v-model="panel.backgroundType" label="color" @change="onChangeType">颜色</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<colorPicker v-model="panel.color" style="margin-top: 6px;cursor: pointer;z-index: 1004;border: solid 1px black" />
|
||||
@ -17,7 +17,7 @@
|
||||
</el-row>
|
||||
<el-row style="height: 60px;margin-top:10px;overflow: hidden">
|
||||
<el-col :span="6">
|
||||
<el-radio v-model="panel.backgroundType" label="image">图片</el-radio>
|
||||
<el-radio v-model="panel.backgroundType" label="image" @change="onChangeType">图片</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-upload
|
||||
@ -29,7 +29,7 @@
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove"
|
||||
:http-request="upload"
|
||||
:file-list="filesTmp"
|
||||
:file-list="fileList"
|
||||
:on-change="onChange"
|
||||
>
|
||||
<i class="el-icon-plus" />
|
||||
@ -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)
|
||||
},
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,89 +1,194 @@
|
||||
<template>
|
||||
<div class="subject-template">
|
||||
<div class="vertical-layout">
|
||||
<i class="el-icon-error" />
|
||||
<i class="el-icon-edit" />
|
||||
<div class="vertical-layout" @click.stop="subjectChange">
|
||||
<i v-if="subjectItem.type==='self'" class="el-icon-error" @click.stop="subjectDelete" />
|
||||
<!-- <i class="el-icon-edit" />-->
|
||||
<!-- 背景-->
|
||||
<div style="inset: 0px; position: absolute; background: 0% 0% / cover rgb(239, 241, 244);" />
|
||||
|
||||
<div class="allBack" :style="customBackground" style="inset: 1px; position: absolute;" />
|
||||
<!-- 视图组件 背景-->
|
||||
<div style="inset: 17px 10px 10px; position: absolute; background: 0% 0% / cover rgb(255, 255, 255);" />
|
||||
<div style="inset: 17px 10px 10px; position: absolute;" :style="chartBackground" />
|
||||
<!-- 视图组件 主题-->
|
||||
<div style="inset: 20px 13px 15px; position: absolute;">
|
||||
<div style="position: absolute; inset: 0px 4px; width: auto; height: auto;">
|
||||
<!--柱形-->
|
||||
<div style="left: 0px; top: 11px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(255, 191, 83);" />
|
||||
<div style="left: 5px; top: 6px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(4, 177, 194);" />
|
||||
<div style="left: 10px; top: 2px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(240, 116, 116);" />
|
||||
<div style="left: 0px; top: 11px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundLeft" />
|
||||
<div style="left: 5px; top: 6px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundMiddle" />
|
||||
<div style="left: 10px; top: 2px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundRight" />
|
||||
|
||||
<!--柱形-->
|
||||
<div style="left: 20px; top: 11px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(255, 191, 83);" />
|
||||
<div style="left: 25px; top: 2px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(4, 177, 194);" />
|
||||
<div style="left: 30px; top: 6px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(240, 116, 116);" />
|
||||
<div style="left: 20px; top: 11px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundLeft" />
|
||||
<div style="left: 25px; top: 2px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundMiddle" />
|
||||
<div style="left: 30px; top: 6px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundRight" />
|
||||
|
||||
<!--柱形-->
|
||||
<div style="left: 40px; top: 2px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(255, 191, 83);" />
|
||||
<div style="left: 45px; top: 6px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(4, 177, 194);" />
|
||||
<div style="left: 50px; top: 11px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(240, 116, 116);" />
|
||||
<div style="left: 40px; top: 2px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundLeft" />
|
||||
<div style="left: 45px; top: 6px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundMiddle" />
|
||||
<div style="left: 50px; top: 11px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundRight" />
|
||||
|
||||
<!--柱形-->
|
||||
<div style="left: 60px; top: 6px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(255, 191, 83);" />
|
||||
<div style="left: 65px; top: 11px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(4, 177, 194);" />
|
||||
<div style="left: 70px; top: 2px; bottom: 0px; width: 3px; position: absolute; background-color: rgb(240, 116, 116);" />
|
||||
<div style="left: 60px; top: 6px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundLeft" />
|
||||
<div style="left: 65px; top: 11px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundMiddle" />
|
||||
<div style="left: 70px; top: 2px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundRight" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 表格表头颜色 -->
|
||||
<div style="left: 10px; right: 10px; top: 10px; height: 6px; position: absolute; background: 0% 0% / cover rgb(255, 255, 255);" />
|
||||
<div style="left: 10px; right: 10px; top: 10px; height: 6px; position: absolute;" :style="tableHeadBackground" />
|
||||
|
||||
<!-- 字体颜色 -->
|
||||
<div style="left: 14px; top: 10px; height: 6px; position: absolute; vertical-align: middle">
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; background-color: rgb(26, 26, 26);float: left;" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; background-color: rgb(26, 26, 26);float: left;" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; background-color: rgb(26, 26, 26);float: left;" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; background-color: rgb(26, 26, 26);float: left;" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; background-color: rgb(26, 26, 26);float: left;" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; background-color: rgb(26, 26, 26);float: left;" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="position: absolute; left: 0px; right: 0px; bottom: 0px; height: 30px;">
|
||||
<div style=" background-color:#f7f8fa;color:#3d4d66;font-size:12px;height: 30px; line-height: 30px; text-align: center; white-space: pre; text-overflow: ellipsis; margin-left: 1px; margin-right: 1px;">
|
||||
<span style="margin-top: 8px">Preset style 1</span>
|
||||
<span style="margin-top: 8px">{{ subjectItem.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { chartTransStr2Object } from '@/views/panel/panel'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'StyleTemplateItem',
|
||||
props: {
|
||||
template: {
|
||||
subjectItem: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultSubject: {
|
||||
|
||||
},
|
||||
subjectItemDetails: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
classBackground() {
|
||||
return {
|
||||
background: `url(${this.template.snapshot}) no-repeat`,
|
||||
'background-size': `100% 100%`
|
||||
customBackground() {
|
||||
let style = {
|
||||
background: 'background: 0% 0% / cover rgb(255, 255, 255)'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
templateDelete() {
|
||||
this.$alert('是否删除模板:' + this.template.name + '?', '', {
|
||||
confirmButtonText: '确认',
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
this.$emit('templateDelete', this.template.id)
|
||||
if (this.subjectItemDetails) {
|
||||
if (this.subjectItemDetails.panel.backgroundType === 'image') {
|
||||
style = {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
background: `url(${this.subjectItemDetails.panel.imageUrl}) no-repeat`,
|
||||
'background-size': '100% 100% !important'
|
||||
}
|
||||
} else {
|
||||
style = {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
background: this.subjectItemDetails.panel.color
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
return style
|
||||
},
|
||||
columnBackgroundLeft() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
opacity: this.subjectItemDetails.chart.customAttr.color.alpha / 100,
|
||||
background: this.subjectItemDetails.chart.customAttr.color.colors[0]
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
columnBackgroundMiddle() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
opacity: this.subjectItemDetails.chart.customAttr.color.alpha / 100,
|
||||
background: this.subjectItemDetails.chart.customAttr.color.colors[1]
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
columnBackgroundRight() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
opacity: this.subjectItemDetails.chart.customAttr.color.alpha / 100,
|
||||
background: this.subjectItemDetails.chart.customAttr.color.colors[2]
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
tableHeadBackground() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
opacity: this.subjectItemDetails.chart.customAttr.color.alpha / 100,
|
||||
background: this.subjectItemDetails.chart.customAttr.color.tableHeaderBgColor
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
tableFontColor() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
background: this.subjectItemDetails.chart.customAttr.color.tableFontColor
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
chartBackground() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
background: this.subjectItemDetails.chart.customStyle.background.color,
|
||||
opacity: this.subjectItemDetails.chart.customStyle.background.alpha / 100
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
...mapState([
|
||||
'canvasStyleData'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
subjectItem: {
|
||||
handler(newVal, oldVla) {
|
||||
debugger
|
||||
this.subjectItemDetails = chartTransStr2Object(JSON.parse(newVal.details), 'Y')
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
resize() {
|
||||
this.drawEcharts()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.subjectItemDetails = chartTransStr2Object(JSON.parse(this.subjectItem.details), 'Y')
|
||||
},
|
||||
methods: {
|
||||
subjectDelete() {
|
||||
this.$emit('subjectDelete', this.subjectItem.id)
|
||||
// this.$alert('是否删除主题:' + this.subjectItem.name + '?', '', {
|
||||
// confirmButtonText: '确认',
|
||||
// callback: (action) => {
|
||||
// if (action === 'confirm') {
|
||||
// this.$emit('subjectDelete', this.subjectItem.id)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
},
|
||||
subjectChange() {
|
||||
this.$store.commit('setCanvasStyle', JSON.parse(this.subjectItem.details))
|
||||
},
|
||||
templateEdit() {
|
||||
this.$emit('templateEdit', this.template)
|
||||
@ -97,6 +202,9 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
|
||||
.allBack {
|
||||
background-size: 100% 100%!important;
|
||||
}
|
||||
.subject-template {
|
||||
width: 110px;
|
||||
height: 90px;
|
||||
@ -148,10 +256,18 @@ export default {
|
||||
|
||||
.vertical-layout:hover > .el-icon-error {
|
||||
z-index: 10;
|
||||
display:block;
|
||||
}
|
||||
|
||||
.vertical-layout:hover > .el-icon-edit {
|
||||
z-index: 10;
|
||||
display:block;
|
||||
}
|
||||
.vertical-layout>>>.el-icon-error {
|
||||
display:none
|
||||
}
|
||||
.vertical-layout>>>.el-icon-edit {
|
||||
display:none
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="subject-template">
|
||||
<div class="vertical-layout">
|
||||
<i class="el-icon-error" />
|
||||
<i class="el-icon-edit" />
|
||||
<!-- 背景-->
|
||||
<div style="inset: 0px; position: absolute;" :style="customBackground" />
|
||||
<!-- 视图组件 背景-->
|
||||
<div style="inset: 17px 10px 10px; position: absolute; background: 0% 0% / cover rgb(255, 255, 255);" />
|
||||
<!-- 视图组件 主题-->
|
||||
<div style="inset: 20px 13px 15px; position: absolute;">
|
||||
<div style="position: absolute; inset: 0px 4px; width: auto; height: auto;">
|
||||
<!--柱形-->
|
||||
<div style="left: 0px; top: 11px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundLeft" />
|
||||
<div style="left: 5px; top: 6px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundMiddle" />
|
||||
<div style="left: 10px; top: 2px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundRight" />
|
||||
|
||||
<!--柱形-->
|
||||
<div style="left: 20px; top: 11px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundLeft" />
|
||||
<div style="left: 25px; top: 2px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundMiddle" />
|
||||
<div style="left: 30px; top: 6px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundRight" />
|
||||
|
||||
<!--柱形-->
|
||||
<div style="left: 40px; top: 2px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundLeft" />
|
||||
<div style="left: 45px; top: 6px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundMiddle" />
|
||||
<div style="left: 50px; top: 11px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundRight" />
|
||||
|
||||
<!--柱形-->
|
||||
<div style="left: 60px; top: 6px; bottom: 0px; width: 3px; position: absolute;" :style="columnBackgroundLeft" />
|
||||
<div style="left: 65px; top: 11px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundMiddle" />
|
||||
<div style="left: 70px; top: 2px; bottom: 0px; width: 3px; position: absolute; " :style="columnBackgroundRight" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 表格表头颜色 -->
|
||||
<div style="left: 10px; right: 10px; top: 10px; height: 6px; position: absolute;" :style="tableHeadBackground" />
|
||||
|
||||
<!-- 字体颜色 -->
|
||||
<div style="left: 14px; top: 10px; height: 6px; position: absolute; vertical-align: middle">
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
<div style="width: 1px; height: 2px; position: relative; flex-shrink: 0; margin-top: 2px;margin-right: 1px; float: left;" :style="tableFontColor" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="position: absolute; left: 0px; right: 0px; bottom: 0px; height: 30px;">
|
||||
<div style=" background-color:#f7f8fa;color:#3d4d66;font-size:12px;height: 30px; line-height: 30px; text-align: center; white-space: pre; text-overflow: ellipsis; margin-left: 1px; margin-right: 1px;">
|
||||
<span style="margin-top: 8px">{{ subjectItem.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { chartTransStr2Object } from '@/views/panel/panel'
|
||||
export default {
|
||||
name: 'StyleTemplateItem',
|
||||
props: {
|
||||
subjectItem: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultSubject: {
|
||||
|
||||
},
|
||||
subjectItemDetails: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
customBackground() {
|
||||
let style = {
|
||||
background: '0% 0% / cover rgb(239, 241, 244)'
|
||||
}
|
||||
if (this.subjectItemDetails) {
|
||||
if (this.subjectItemDetails.panel.backgroundType === 'image') {
|
||||
style = {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
background: `url(${this.subjectItemDetails.panel.imageUrl}) no-repeat`
|
||||
}
|
||||
} else {
|
||||
style = {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
background: this.subjectItemDetails.panel.color
|
||||
}
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
columnBackgroundLeft() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
background: this.subjectItemDetails.chart.customAttr.color.colors[0]
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
columnBackgroundMiddle() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
background: this.subjectItemDetails.chart.customAttr.color.colors[1]
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
columnBackgroundRight() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
background: this.subjectItemDetails.chart.customAttr.color.colors[2]
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
tableHeadBackground() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
background: this.subjectItemDetails.chart.customAttr.color.tableHeaderBgColor
|
||||
}
|
||||
}
|
||||
return style
|
||||
},
|
||||
tableFontColor() {
|
||||
let style = {}
|
||||
if (this.subjectItemDetails) {
|
||||
style = {
|
||||
background: this.subjectItemDetails.chart.customAttr.color.tableFontColor
|
||||
}
|
||||
}
|
||||
return style
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
subjectItem: {
|
||||
handler(newVal, oldVla) {
|
||||
this.subjectItemDetails = chartTransStr2Object(newVal.details, 'Y')
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
resize() {
|
||||
this.drawEcharts()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
templateDelete() {
|
||||
this.$alert('是否删除模板:' + this.template.name + '?', '', {
|
||||
confirmButtonText: '确认',
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
this.$emit('templateDelete', this.template.id)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
templateEdit() {
|
||||
this.$emit('templateEdit', this.template)
|
||||
},
|
||||
handleDelete() {
|
||||
console.log('handleDelete')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.subject-template {
|
||||
width: 110px;
|
||||
height: 90px;
|
||||
position: relative;
|
||||
float: left;
|
||||
margin: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.demonstration {
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin: 10px auto;
|
||||
width: 150px;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
|
||||
.vertical-layout {
|
||||
overflow: hidden auto;
|
||||
position: absolute;
|
||||
inset: 0px 0px 30px;
|
||||
width: 108px; height: 58px;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 2px 0 rgba(31,31,31,0.15), 0 1px 2px 0 rgba(31,31,31,0.15);
|
||||
border: solid 1px #fff;
|
||||
box-sizing: border-box;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.vertical-layout:hover {
|
||||
border: solid 1px #4b8fdf;
|
||||
border-radius: 3px;
|
||||
color: deepskyblue;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vertical-layout > i{
|
||||
float: right;
|
||||
color: gray;
|
||||
margin: 2px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.vertical-layout > i:hover {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.vertical-layout:hover > .el-icon-error {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.vertical-layout:hover > .el-icon-edit {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,18 +18,13 @@
|
||||
@node-drag-start="handleDragStart"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="showdetail" class="detail-class">
|
||||
<el-card class="filter-card-class">
|
||||
<div slot="header" class="button-div-class">
|
||||
<span>{{ detailItem.name }}</span>
|
||||
<div style="float: right; padding: 1px 5px; cursor:pointer; " @click="closeDetail">
|
||||
<i class="el-icon-close" />
|
||||
</div>
|
||||
</div>
|
||||
<img class="view-list-thumbnails" :src="'/common-files/images/'+detailItem.id+'/VIEW_DEFAULT_IMAGE'" alt="">
|
||||
<img class="view-list-thumbnails" :src="detailItem.snapshot" alt="">
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -149,6 +144,7 @@ export default {
|
||||
}
|
||||
.detail-class {
|
||||
width: 100%;
|
||||
min-height: 200px;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
名称:{{ panelInfo.name || '测试仪表板' }}
|
||||
</span>
|
||||
<!--横向工具栏-->
|
||||
<Toolbar @showPanel="showPanel" />
|
||||
<Toolbar @showPanel="showPanel" @close-left-panel="closeLeftPanel" />
|
||||
</el-row>
|
||||
<el-row>
|
||||
<de-container>
|
||||
@ -43,12 +43,11 @@
|
||||
</div>
|
||||
<div ref="leftPanel" :class="{show:show}" class="leftPanel-container">
|
||||
<div />
|
||||
<div v-show="show" class="leftPanel">
|
||||
|
||||
<div v-if="show" class="leftPanel">
|
||||
<div style="height:100%;overflow-y: auto">
|
||||
<view-select v-show=" showIndex===0" />
|
||||
<filter-group v-show="showIndex===1" />
|
||||
<subject-setting v-show="showIndex===2" />
|
||||
<view-select v-show=" show && showIndex===0" />
|
||||
<filter-group v-show=" show &&showIndex===1" />
|
||||
<subject-setting v-show=" show &&showIndex===2" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -102,7 +101,6 @@
|
||||
</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +102,6 @@ export default {
|
||||
return false
|
||||
}
|
||||
panelSave(this.editPanel.panelInfo).then(response => {
|
||||
debugger
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user