forked from github/dataease
feat: 视图
This commit is contained in:
parent
7056db3b53
commit
5427545962
@ -0,0 +1,23 @@
|
||||
package io.dataease.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ChartGroup implements Serializable {
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String pid;
|
||||
|
||||
private Integer level;
|
||||
|
||||
private String type;
|
||||
|
||||
private String createBy;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
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 ChartGroupExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public ChartGroupExample() {
|
||||
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 andPidIsNull() {
|
||||
addCriterion("pid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNotNull() {
|
||||
addCriterion("pid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidEqualTo(String value) {
|
||||
addCriterion("pid =", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotEqualTo(String value) {
|
||||
addCriterion("pid <>", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThan(String value) {
|
||||
addCriterion("pid >", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("pid >=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThan(String value) {
|
||||
addCriterion("pid <", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThanOrEqualTo(String value) {
|
||||
addCriterion("pid <=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLike(String value) {
|
||||
addCriterion("pid like", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotLike(String value) {
|
||||
addCriterion("pid not like", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIn(List<String> values) {
|
||||
addCriterion("pid in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotIn(List<String> values) {
|
||||
addCriterion("pid not in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidBetween(String value1, String value2) {
|
||||
addCriterion("pid between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotBetween(String value1, String value2) {
|
||||
addCriterion("pid not between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelIsNull() {
|
||||
addCriterion("`level` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelIsNotNull() {
|
||||
addCriterion("`level` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelEqualTo(Integer value) {
|
||||
addCriterion("`level` =", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelNotEqualTo(Integer value) {
|
||||
addCriterion("`level` <>", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelGreaterThan(Integer value) {
|
||||
addCriterion("`level` >", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("`level` >=", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelLessThan(Integer value) {
|
||||
addCriterion("`level` <", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("`level` <=", value, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelIn(List<Integer> values) {
|
||||
addCriterion("`level` in", values, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelNotIn(List<Integer> values) {
|
||||
addCriterion("`level` not in", values, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelBetween(Integer value1, Integer value2) {
|
||||
addCriterion("`level` between", value1, value2, "level");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andLevelNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("`level` not between", value1, value2, "level");
|
||||
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 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 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 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,30 @@
|
||||
package io.dataease.base.mapper;
|
||||
|
||||
import io.dataease.base.domain.ChartGroup;
|
||||
import io.dataease.base.domain.ChartGroupExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface ChartGroupMapper {
|
||||
long countByExample(ChartGroupExample example);
|
||||
|
||||
int deleteByExample(ChartGroupExample example);
|
||||
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(ChartGroup record);
|
||||
|
||||
int insertSelective(ChartGroup record);
|
||||
|
||||
List<ChartGroup> selectByExample(ChartGroupExample example);
|
||||
|
||||
ChartGroup selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") ChartGroup record, @Param("example") ChartGroupExample example);
|
||||
|
||||
int updateByExample(@Param("record") ChartGroup record, @Param("example") ChartGroupExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(ChartGroup record);
|
||||
|
||||
int updateByPrimaryKey(ChartGroup record);
|
||||
}
|
@ -0,0 +1,243 @@
|
||||
<?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.ChartGroupMapper">
|
||||
<resultMap id="BaseResultMap" type="io.dataease.base.domain.ChartGroup">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="pid" jdbcType="VARCHAR" property="pid" />
|
||||
<result column="level" jdbcType="INTEGER" property="level" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
</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`, pid, `level`, `type`, create_by, create_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.dataease.base.domain.ChartGroupExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from chart_group
|
||||
<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="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from chart_group
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from chart_group
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.dataease.base.domain.ChartGroupExample">
|
||||
delete from chart_group
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.dataease.base.domain.ChartGroup">
|
||||
insert into chart_group (id, `name`, pid,
|
||||
`level`, `type`, create_by,
|
||||
create_time)
|
||||
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR},
|
||||
#{level,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.dataease.base.domain.ChartGroup">
|
||||
insert into chart_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
`name`,
|
||||
</if>
|
||||
<if test="pid != null">
|
||||
pid,
|
||||
</if>
|
||||
<if test="level != null">
|
||||
`level`,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</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="pid != null">
|
||||
#{pid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="level != null">
|
||||
#{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
#{createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.dataease.base.domain.ChartGroupExample" resultType="java.lang.Long">
|
||||
select count(*) from chart_group
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update chart_group
|
||||
<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.pid != null">
|
||||
pid = #{record.pid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.level != null">
|
||||
`level` = #{record.level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createBy != null">
|
||||
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update chart_group
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
`name` = #{record.name,jdbcType=VARCHAR},
|
||||
pid = #{record.pid,jdbcType=VARCHAR},
|
||||
`level` = #{record.level,jdbcType=INTEGER},
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.ChartGroup">
|
||||
update chart_group
|
||||
<set>
|
||||
<if test="name != null">
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="pid != null">
|
||||
pid = #{pid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="level != null">
|
||||
`level` = #{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.ChartGroup">
|
||||
update chart_group
|
||||
set `name` = #{name,jdbcType=VARCHAR},
|
||||
pid = #{pid,jdbcType=VARCHAR},
|
||||
`level` = #{level,jdbcType=INTEGER},
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
create_by = #{createBy,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
package io.dataease.controller.chart;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.dataease.base.domain.DatasetTable;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.datasource.dto.TableFiled;
|
||||
import io.dataease.service.dataset.DataSetTableService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("chart/table")
|
||||
public class ChartController {
|
||||
|
||||
|
||||
|
||||
@PostMapping("list")
|
||||
public List<JSON> list(@RequestBody DataSetTableRequest dataSetTableRequest) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package io.dataease.controller.chart;
|
||||
|
||||
import io.dataease.base.domain.ChartGroup;
|
||||
import io.dataease.controller.request.chart.ChartGroupRequest;
|
||||
import io.dataease.dto.chart.ChartGroupDTO;
|
||||
import io.dataease.service.chart.ChartGroupService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("chart/group")
|
||||
public class ChartGroupController {
|
||||
@Resource
|
||||
private ChartGroupService chartGroupService;
|
||||
|
||||
@PostMapping("/save")
|
||||
public ChartGroupDTO save(@RequestBody ChartGroup ChartGroup) {
|
||||
return chartGroupService.save(ChartGroup);
|
||||
}
|
||||
|
||||
@PostMapping("/tree")
|
||||
public List<ChartGroupDTO> tree(@RequestBody ChartGroupRequest ChartGroup) {
|
||||
return chartGroupService.tree(ChartGroup);
|
||||
}
|
||||
|
||||
@PostMapping("/delete/{id}")
|
||||
public void tree(@PathVariable String id) {
|
||||
chartGroupService.delete(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package io.dataease.controller.request.chart;
|
||||
|
||||
import io.dataease.base.domain.ChartGroup;
|
||||
import io.dataease.base.domain.DatasetGroup;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class ChartGroupRequest extends ChartGroup {
|
||||
private String sort;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package io.dataease.dto.chart;
|
||||
|
||||
import io.dataease.base.domain.DatasetGroup;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class ChartGroupDTO extends DatasetGroup {
|
||||
private String label;
|
||||
private List<ChartGroupDTO> children;
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package io.dataease.service.chart;
|
||||
|
||||
import com.alibaba.nacos.common.util.UuidUtils;
|
||||
import io.dataease.base.domain.ChartGroup;
|
||||
import io.dataease.base.domain.ChartGroupExample;
|
||||
import io.dataease.base.mapper.ChartGroupMapper;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.controller.request.chart.ChartGroupRequest;
|
||||
import io.dataease.dto.chart.ChartGroupDTO;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
public class ChartGroupService {
|
||||
@Resource
|
||||
private ChartGroupMapper chartGroupMapper;
|
||||
|
||||
public ChartGroupDTO save(ChartGroup chartGroup) {
|
||||
if (StringUtils.isEmpty(chartGroup.getId())) {
|
||||
chartGroup.setId(UuidUtils.generateUuid());
|
||||
chartGroup.setCreateTime(System.currentTimeMillis());
|
||||
chartGroupMapper.insert(chartGroup);
|
||||
} else {
|
||||
chartGroupMapper.updateByPrimaryKey(chartGroup);
|
||||
}
|
||||
ChartGroupDTO ChartGroupDTO = new ChartGroupDTO();
|
||||
BeanUtils.copyBean(ChartGroupDTO, chartGroup);
|
||||
ChartGroupDTO.setLabel(ChartGroupDTO.getName());
|
||||
return ChartGroupDTO;
|
||||
}
|
||||
|
||||
public void delete(String id) {
|
||||
ChartGroupRequest ChartGroup = new ChartGroupRequest();
|
||||
ChartGroup.setId(id);
|
||||
List<ChartGroupDTO> tree = tree(ChartGroup);
|
||||
List<String> ids = new ArrayList<>();
|
||||
getAllId(tree, ids);
|
||||
ChartGroupExample ChartGroupExample = new ChartGroupExample();
|
||||
ChartGroupExample.createCriteria().andIdIn(ids);
|
||||
chartGroupMapper.deleteByExample(ChartGroupExample);
|
||||
}
|
||||
|
||||
public List<ChartGroupDTO> tree(ChartGroupRequest ChartGroup) {
|
||||
ChartGroupExample ChartGroupExample = new ChartGroupExample();
|
||||
ChartGroupExample.Criteria criteria = ChartGroupExample.createCriteria();
|
||||
if (StringUtils.isNotEmpty(ChartGroup.getName())) {
|
||||
criteria.andNameLike("%" + ChartGroup.getName() + "%");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(ChartGroup.getType())) {
|
||||
criteria.andTypeEqualTo(ChartGroup.getType());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(ChartGroup.getId())) {
|
||||
criteria.andIdEqualTo(ChartGroup.getId());
|
||||
} else {
|
||||
criteria.andLevelEqualTo(0);
|
||||
}
|
||||
ChartGroupExample.setOrderByClause(ChartGroup.getSort());
|
||||
List<ChartGroup> ChartGroups = chartGroupMapper.selectByExample(ChartGroupExample);
|
||||
List<ChartGroupDTO> DTOs = ChartGroups.stream().map(ele -> {
|
||||
ChartGroupDTO dto = new ChartGroupDTO();
|
||||
BeanUtils.copyBean(dto, ele);
|
||||
dto.setLabel(ele.getName());
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
getAll(DTOs, ChartGroup);
|
||||
return DTOs;
|
||||
}
|
||||
|
||||
public void getAll(List<ChartGroupDTO> list, ChartGroupRequest ChartGroup) {
|
||||
for (ChartGroupDTO obj : list) {
|
||||
ChartGroupExample ChartGroupExample = new ChartGroupExample();
|
||||
ChartGroupExample.Criteria criteria = ChartGroupExample.createCriteria();
|
||||
if (StringUtils.isNotEmpty(ChartGroup.getName())) {
|
||||
criteria.andNameLike("%" + ChartGroup.getName() + "%");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(ChartGroup.getType())) {
|
||||
criteria.andTypeEqualTo(ChartGroup.getType());
|
||||
}
|
||||
criteria.andPidEqualTo(obj.getId());
|
||||
ChartGroupExample.setOrderByClause(ChartGroup.getSort());
|
||||
List<ChartGroup> ChartGroups = chartGroupMapper.selectByExample(ChartGroupExample);
|
||||
List<ChartGroupDTO> DTOs = ChartGroups.stream().map(ele -> {
|
||||
ChartGroupDTO dto = new ChartGroupDTO();
|
||||
BeanUtils.copyBean(dto, ele);
|
||||
dto.setLabel(ele.getName());
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
obj.setChildren(DTOs);
|
||||
if (CollectionUtils.isNotEmpty(DTOs)) {
|
||||
getAll(DTOs, ChartGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getAllId(List<ChartGroupDTO> list, List<String> ids) {
|
||||
for (ChartGroupDTO dto : list) {
|
||||
ids.add(dto.getId());
|
||||
if (CollectionUtils.isNotEmpty(dto.getChildren())) {
|
||||
getAllId(dto.getChildren(), ids);
|
||||
}
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
}
|
12
backend/src/main/resources/db/migration/V10__chart.sql
Normal file
12
backend/src/main/resources/db/migration/V10__chart.sql
Normal file
@ -0,0 +1,12 @@
|
||||
-- chart start
|
||||
CREATE TABLE IF NOT EXISTS `chart_group` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`name` varchar(64) NOT NULL COMMENT '名称',
|
||||
`pid` varchar(50) COMMENT '父级ID',
|
||||
`level` int(10) COMMENT '当前分组处于第几级',
|
||||
`type` varchar(50) COMMENT 'group or scene',
|
||||
`create_by` varchar(50) COMMENT '创建人ID',
|
||||
`create_time` bigint(13) COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
-- chart end
|
@ -64,7 +64,7 @@
|
||||
|
||||
<!--要生成的数据库表 -->
|
||||
|
||||
<table tableName="datasource"/>
|
||||
<table tableName="chart_group"/>
|
||||
|
||||
|
||||
</context>
|
||||
|
45
frontend/src/business/components/chart/Chart.vue
Normal file
45
frontend/src/business/components/chart/Chart.vue
Normal file
@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<ms-container>
|
||||
|
||||
<ms-aside-container>
|
||||
<group/>
|
||||
</ms-aside-container>
|
||||
|
||||
<ms-main-container>
|
||||
<keep-alive>
|
||||
<router-view/>
|
||||
</keep-alive>
|
||||
</ms-main-container>
|
||||
</ms-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsMainContainer from "../common/components/MsMainContainer";
|
||||
import MsContainer from "../common/components/MsContainer";
|
||||
import MsAsideContainer from "../common/components/MsAsideContainer";
|
||||
import MsSettingMenu from "../settings/SettingMenu";
|
||||
import MsCurrentUser from "../settings/CurrentUser";
|
||||
import Group from "./group/Group";
|
||||
|
||||
export default {
|
||||
name: "Chart",
|
||||
components: {MsMainContainer, MsContainer, MsAsideContainer, MsSettingMenu, MsCurrentUser, Group},
|
||||
data() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ms-aside-container {
|
||||
height: calc(100vh - 40px);
|
||||
padding: 15px;
|
||||
min-width: 300px;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.ms-main-container {
|
||||
height: calc(100vh - 40px);
|
||||
}
|
||||
|
||||
</style>
|
148
frontend/src/business/components/chart/data/AddDB.vue
Normal file
148
frontend/src/business/components/chart/data/AddDB.vue
Normal file
@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-row style="height: 26px;">
|
||||
<span style="line-height: 26px;">
|
||||
{{$t('dataset.add_db_table')}}
|
||||
</span>
|
||||
<el-row style="float: right">
|
||||
<el-button size="mini" @click="cancel">
|
||||
{{$t('dataset.cancel')}}
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="save" :disabled="checkTableList.length < 1">
|
||||
{{$t('dataset.confirm')}}
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-divider/>
|
||||
<el-row>
|
||||
<el-form :inline="true">
|
||||
<el-form-item class="form-item">
|
||||
<el-select v-model="dataSource" filterable :placeholder="$t('dataset.pls_slc_data_source')" size="mini">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item class="form-item" style="float: right;">
|
||||
<el-input
|
||||
size="mini"
|
||||
:placeholder="$t('dataset.search')"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="searchTable"
|
||||
clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row style="overflow: auto;height: 600px;">
|
||||
<el-checkbox-group v-model="checkTableList" size="small">
|
||||
<el-checkbox
|
||||
border
|
||||
v-for="t in tables"
|
||||
:label="t"
|
||||
:key="t">
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "AddDB",
|
||||
data() {
|
||||
return {
|
||||
searchTable: '',
|
||||
options: [],
|
||||
dataSource: '',
|
||||
tables: [],
|
||||
checkTableList: [],
|
||||
scene: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initDataSource();
|
||||
this.scene = this.$route.params.scene;
|
||||
},
|
||||
activated() {
|
||||
this.initDataSource();
|
||||
this.scene = this.$route.params.scene;
|
||||
},
|
||||
methods: {
|
||||
initDataSource() {
|
||||
this.$get("/datasource/list", response => {
|
||||
this.options = response.data;
|
||||
})
|
||||
},
|
||||
|
||||
save() {
|
||||
// console.log(this.checkTableList);
|
||||
// console.log(this.scene);
|
||||
let sceneId = this.scene.id;
|
||||
let dataSourceId = this.dataSource;
|
||||
let tables = [];
|
||||
this.checkTableList.forEach(function (name) {
|
||||
tables.push({
|
||||
name: name,
|
||||
sceneId: sceneId,
|
||||
dataSourceId: dataSourceId,
|
||||
type: 'db'
|
||||
})
|
||||
});
|
||||
this.$post('/dataset/table/batchAdd', tables, response => {
|
||||
this.$store.commit('setSceneData', new Date().getTime());
|
||||
this.cancel();
|
||||
});
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.dataReset();
|
||||
this.$router.push("/dataset/home");
|
||||
},
|
||||
|
||||
dataReset() {
|
||||
this.searchTable = '';
|
||||
this.options = [];
|
||||
this.dataSource = '';
|
||||
this.tables = [];
|
||||
this.checkTableList = [];
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dataSource(val) {
|
||||
if (val) {
|
||||
this.$post("/datasource/getTables", {id: val}, response => {
|
||||
this.tables = response.data;
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
margin-bottom: 14px;
|
||||
margin-left: 0;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
25
frontend/src/business/components/chart/data/ChartHome.vue
Normal file
25
frontend/src/business/components/chart/data/ChartHome.vue
Normal file
@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<el-col style="height: 100%;">
|
||||
<el-row style="height: 100%;" class="custom-position">
|
||||
{{$t('chart.pls_slc_tbl_left')}}
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ChartHome"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.custom-position {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
flex-flow: row nowrap;
|
||||
color: #9ea6b2;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<el-col>
|
||||
<el-table
|
||||
size="mini"
|
||||
:data="data"
|
||||
border
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
width="180px"
|
||||
v-for="field in fields"
|
||||
:key="field.fieldName"
|
||||
:prop="field.fieldName"
|
||||
:label="field.fieldName">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
table: Object,
|
||||
fields: Array,
|
||||
data: Array
|
||||
},
|
||||
name: "TabDataPreview",
|
||||
data() {
|
||||
return {
|
||||
tableData: [{
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄'
|
||||
}, {
|
||||
date: '2016-05-04',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1517 弄'
|
||||
}, {
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄'
|
||||
}, {
|
||||
date: '2016-05-03',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1516 弄'
|
||||
}]
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
activated() {
|
||||
},
|
||||
methods: {},
|
||||
watch: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
122
frontend/src/business/components/chart/data/ViewTable.vue
Normal file
122
frontend/src/business/components/chart/data/ViewTable.vue
Normal file
@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-row style="height: 26px;">
|
||||
<span v-show="false">{{tableId}}</span>
|
||||
<span style="line-height: 26px;">
|
||||
{{table.name}}
|
||||
</span>
|
||||
<el-row style="float: right">
|
||||
<el-button size="mini">
|
||||
{{$t('dataset.edit')}}
|
||||
</el-button>
|
||||
<el-button size="mini">
|
||||
{{$t('dataset.create_view')}}
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-divider/>
|
||||
|
||||
<el-tabs v-model="tabActive">
|
||||
<el-tab-pane :label="$t('dataset.data_preview')" name="dataPreview">
|
||||
<tab-data-preview :table="table" :fields="fields" :data="data"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="tab2" name="tab2">
|
||||
tab2
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="tab3" name="tab3">
|
||||
tab3
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="tab4" name="tab4">
|
||||
tab4
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TabDataPreview from "./TabDataPreview";
|
||||
|
||||
export default {
|
||||
name: "ViewTable",
|
||||
components: {TabDataPreview},
|
||||
data() {
|
||||
return {
|
||||
table: {
|
||||
name: ''
|
||||
},
|
||||
fields: [],
|
||||
data: [],
|
||||
tabActive: 'dataPreview',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tableId() {
|
||||
console.log(this.$store.state.dataset.table);
|
||||
this.initTable(this.$store.state.dataset.table);
|
||||
return this.$store.state.dataset.table;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.resetTable();
|
||||
},
|
||||
mounted() {
|
||||
this.resetTable();
|
||||
},
|
||||
activated() {
|
||||
this.resetTable();
|
||||
},
|
||||
methods: {
|
||||
initTable(id) {
|
||||
if (id !== null) {
|
||||
this.fields = [];
|
||||
this.data = [];
|
||||
this.$post('/dataset/table/get/' + id, null, response => {
|
||||
this.table = response.data;
|
||||
this.initPreviewData();
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
initPreviewData() {
|
||||
if (this.table.id) {
|
||||
this.$post('/dataset/table/getPreviewData', this.table, response => {
|
||||
this.fields = response.data.fields;
|
||||
this.data = response.data.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
initTableFields() {
|
||||
if (this.table.id) {
|
||||
this.$post('/dataset/table/getFields', this.table, response => {
|
||||
});
|
||||
}
|
||||
},
|
||||
initTableData() {
|
||||
if (this.table.id) {
|
||||
this.$post('/dataset/table/getData', this.table, response => {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
resetTable() {
|
||||
this.table = {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
</style>
|
517
frontend/src/business/components/chart/group/Group.vue
Normal file
517
frontend/src/business/components/chart/group/Group.vue
Normal file
@ -0,0 +1,517 @@
|
||||
<template xmlns:el-col="http://www.w3.org/1999/html">
|
||||
<el-col>
|
||||
<!-- group -->
|
||||
<el-col v-if="!sceneMode">
|
||||
<el-row class="title-css">
|
||||
<span class="title-text">
|
||||
{{ $t('chart.datalist') }}
|
||||
</span>
|
||||
</el-row>
|
||||
<el-divider/>
|
||||
|
||||
<el-row>
|
||||
<el-button icon="el-icon-circle-plus" type="primary" size="mini" @click="add('group')">
|
||||
{{$t('chart.add_group')}}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-folder-add" type="primary" size="mini" @click="add('scene')">
|
||||
{{$t('chart.add_scene')}}
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-form>
|
||||
<el-form-item class="form-item">
|
||||
<el-input
|
||||
size="mini"
|
||||
:placeholder="$t('chart.search')"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="search"
|
||||
clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
<el-col class="custom-tree-container">
|
||||
<div class="block">
|
||||
<el-tree
|
||||
:default-expanded-keys="expandedArray"
|
||||
:data="data"
|
||||
node-key="id"
|
||||
:expand-on-click-node="true"
|
||||
@node-click="nodeClick">
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<span>
|
||||
<span v-if="data.type === 'scene'">
|
||||
<el-button
|
||||
icon="el-icon-folder"
|
||||
type="text"
|
||||
size="mini">
|
||||
</el-button>
|
||||
</span>
|
||||
<span style="margin-left: 6px">{{ data.name }}</span>
|
||||
</span>
|
||||
<span>
|
||||
<span @click.stop v-if="data.type ==='group'">
|
||||
<el-dropdown trigger="click" @command="clickAdd" size="small">
|
||||
<span class="el-dropdown-link">
|
||||
<el-button
|
||||
icon="el-icon-plus"
|
||||
type="text"
|
||||
size="small">
|
||||
</el-button>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-circle-plus" :command="beforeClickAdd('group',data,node)">
|
||||
{{$t('chart.group')}}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-folder-add" :command="beforeClickAdd('scene',data,node)">
|
||||
{{$t('chart.scene')}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</span>
|
||||
<span @click.stop style="margin-left: 12px;">
|
||||
<el-dropdown trigger="click" @command="clickMore" size="small">
|
||||
<span class="el-dropdown-link">
|
||||
<el-button
|
||||
icon="el-icon-more"
|
||||
type="text"
|
||||
size="small">
|
||||
</el-button>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('rename',data,node)">
|
||||
{{$t('chart.rename')}}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-delete" :command="beforeClickMore('delete',data,node)">
|
||||
{{$t('chart.delete')}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<!--group add/edit-->
|
||||
<el-dialog :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%">
|
||||
<el-form :model="groupForm" :rules="groupFormRules" ref="groupForm">
|
||||
<el-form-item :label="$t('commons.name')" prop="name">
|
||||
<el-input v-model="groupForm.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="close()" size="mini">{{$t('chart.cancel')}}</el-button>
|
||||
<el-button type="primary" @click="saveGroup(groupForm)" size="mini">{{$t('chart.confirm')}}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
|
||||
<!--scene-->
|
||||
<el-col v-if="sceneMode">
|
||||
<el-row class="title-css">
|
||||
<span class="title-text">
|
||||
{{currGroup.name}}
|
||||
</span>
|
||||
<el-button icon="el-icon-back" size="mini" @click="back" style="float: right">
|
||||
{{$t('chart.back')}}
|
||||
</el-button>
|
||||
</el-row>
|
||||
<el-divider/>
|
||||
<el-row>
|
||||
<el-button type="primary" size="mini" plain>
|
||||
{{$t('chart.add_chart')}}
|
||||
</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form>
|
||||
<el-form-item class="form-item">
|
||||
<el-input
|
||||
size="mini"
|
||||
:placeholder="$t('chart.search')"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="search"
|
||||
clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span>{{sceneData}}</span>
|
||||
<el-tree
|
||||
:data="chartData"
|
||||
node-key="id"
|
||||
:expand-on-click-node="true"
|
||||
@node-click="sceneClick">
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<span>
|
||||
<span>({{data.type}})</span>
|
||||
<span style="margin-left: 6px">{{ data.name }}</span>
|
||||
</span>
|
||||
<span>
|
||||
<span @click.stop style="margin-left: 12px;">
|
||||
<el-dropdown trigger="click" @command="clickMore">
|
||||
<span class="el-dropdown-link">
|
||||
<el-button
|
||||
icon="el-icon-more"
|
||||
type="text"
|
||||
size="small">
|
||||
</el-button>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('renameChart',data,node)">
|
||||
{{$t('chart.rename')}}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-delete" :command="beforeClickMore('deleteChart',data,node)">
|
||||
{{$t('chart.delete')}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
|
||||
<!--rename chart-->
|
||||
<el-dialog :title="$t('chart.table')" :visible="editTable" :show-close="false" width="30%">
|
||||
<el-form :model="tableForm" :rules="tableFormRules" ref="tableForm">
|
||||
<el-form-item :label="$t('commons.name')" prop="name">
|
||||
<el-input v-model="tableForm.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeTable()" size="mini">{{$t('chart.cancel')}}</el-button>
|
||||
<el-button type="primary" @click="saveTable(tableForm)" size="mini">{{$t('chart.confirm')}}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</el-col>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Group",
|
||||
data() {
|
||||
return {
|
||||
sceneMode: false,
|
||||
dialogTitle: '',
|
||||
search: '',
|
||||
editGroup: false,
|
||||
editTable: false,
|
||||
data: [],
|
||||
chartData: [],
|
||||
currGroup: null,
|
||||
expandedArray: [],
|
||||
groupForm: {
|
||||
name: '',
|
||||
pid: null,
|
||||
level: 0,
|
||||
type: '',
|
||||
children: [],
|
||||
sort: 'type desc,name asc'
|
||||
},
|
||||
tableForm: {
|
||||
name: '',
|
||||
sort: 'type asc,create_time desc,name asc'
|
||||
},
|
||||
groupFormRules: {
|
||||
name: [
|
||||
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'},
|
||||
],
|
||||
},
|
||||
tableFormRules: {
|
||||
name: [
|
||||
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'},
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
sceneData: function () {
|
||||
this.chartTree();
|
||||
return this.$store.state.chart.sceneData;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.groupTree(this.groupForm);
|
||||
this.chartTree();
|
||||
this.$router.push('/chart');
|
||||
},
|
||||
activated() {
|
||||
this.groupTree(this.groupForm);
|
||||
this.chartTree();
|
||||
this.$router.push('/chart');
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
methods: {
|
||||
clickAdd(param) {
|
||||
this.add(param.type);
|
||||
this.groupForm.pid = param.data.id;
|
||||
this.groupForm.level = param.data.level + 1;
|
||||
},
|
||||
|
||||
beforeClickAdd(type, data, node) {
|
||||
return {
|
||||
'type': type,
|
||||
'data': data,
|
||||
'node': node
|
||||
}
|
||||
},
|
||||
|
||||
clickMore(param) {
|
||||
switch (param.type) {
|
||||
case 'rename':
|
||||
this.add(param.data.type);
|
||||
this.groupForm = JSON.parse(JSON.stringify(param.data));
|
||||
break;
|
||||
case 'move':
|
||||
|
||||
break;
|
||||
case 'delete':
|
||||
this.delete(param.data);
|
||||
break;
|
||||
case 'renameChart':
|
||||
this.editTable = true;
|
||||
this.tableForm = JSON.parse(JSON.stringify(param.data));
|
||||
break;
|
||||
case 'deleteChart':
|
||||
this.deleteChart(param.data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
beforeClickMore(type, data, node) {
|
||||
return {
|
||||
'type': type,
|
||||
'data': data,
|
||||
'node': node
|
||||
}
|
||||
},
|
||||
|
||||
add(type) {
|
||||
switch (type) {
|
||||
case 'group':
|
||||
this.dialogTitle = this.$t('chart.group');
|
||||
break;
|
||||
case 'scene':
|
||||
this.dialogTitle = this.$t('chart.scene');
|
||||
break;
|
||||
}
|
||||
this.groupForm.type = type;
|
||||
this.editGroup = true;
|
||||
},
|
||||
|
||||
saveGroup(group) {
|
||||
this.$refs['groupForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$post("/chart/group/save", group, response => {
|
||||
this.close();
|
||||
this.$message({
|
||||
message: this.$t('commons.save_success'),
|
||||
type: 'success',
|
||||
showClose: true,
|
||||
});
|
||||
this.tree(this.groupForm);
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: this.$t('commons.input_content'),
|
||||
type: 'error',
|
||||
showClose: true,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
saveTable(table) {
|
||||
this.$refs['tableForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$post("/chart/table/update", table, response => {
|
||||
this.closeTable();
|
||||
this.$message({
|
||||
message: this.$t('commons.save_success'),
|
||||
type: 'success',
|
||||
showClose: true,
|
||||
});
|
||||
this.chartTree();
|
||||
this.$router.push('/chart/home');
|
||||
this.$store.commit('setTable', null);
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: this.$t('commons.input_content'),
|
||||
type: 'error',
|
||||
showClose: true,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
delete(data) {
|
||||
this.$confirm(this.$t('chart.confirm_delete'), this.$t('chart.tips'), {
|
||||
confirmButtonText: this.$t('chart.confirm'),
|
||||
cancelButtonText: this.$t('chart.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$post("/chart/group/delete/" + data.id, null, response => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: this.$t('chart.delete_success'),
|
||||
showClose: true,
|
||||
});
|
||||
this.groupTree(this.groupForm);
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
|
||||
deleteChart(data) {
|
||||
this.$confirm(this.$t('chart.confirm_delete'), this.$t('chart.tips'), {
|
||||
confirmButtonText: this.$t('chart.confirm'),
|
||||
cancelButtonText: this.$t('chart.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$post("/chart/table/delete/" + data.id, null, response => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: this.$t('chart.delete_success'),
|
||||
showClose: true,
|
||||
});
|
||||
this.chartTree();
|
||||
this.$router.push('/chart/home');
|
||||
this.$store.commit('setTable', null);
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
|
||||
close() {
|
||||
this.editGroup = false;
|
||||
this.groupForm = {
|
||||
name: '',
|
||||
pid: null,
|
||||
level: 0,
|
||||
type: '',
|
||||
children: [],
|
||||
sort: 'type desc,name asc'
|
||||
}
|
||||
},
|
||||
|
||||
closeTable() {
|
||||
this.editTable = false;
|
||||
this.tableForm = {
|
||||
name: '',
|
||||
}
|
||||
},
|
||||
|
||||
groupTree(group) {
|
||||
this.$post("/chart/group/tree", group, response => {
|
||||
this.data = response.data;
|
||||
})
|
||||
},
|
||||
|
||||
chartTree() {
|
||||
this.chartData = [];
|
||||
if (this.currGroup) {
|
||||
this.$post('/chart/table/list', {
|
||||
sort: 'type asc,create_time desc,name asc',
|
||||
sceneId: this.currGroup.id
|
||||
}, response => {
|
||||
this.chartData = response.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
nodeClick(data, node) {
|
||||
if (data.type === 'scene') {
|
||||
this.sceneMode = true;
|
||||
this.currGroup = data;
|
||||
}
|
||||
if (node.expanded) {
|
||||
this.expandedArray.push(data.id);
|
||||
} else {
|
||||
let index = this.expandedArray.indexOf(data.id);
|
||||
if (index > -1) {
|
||||
this.expandedArray.splice(index, 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
back() {
|
||||
this.sceneMode = false;
|
||||
this.$router.push('/chart/home');
|
||||
},
|
||||
|
||||
beforeClickAddData(type) {
|
||||
return {
|
||||
'type': type
|
||||
}
|
||||
},
|
||||
|
||||
addDB() {
|
||||
this.$router.push({
|
||||
name: 'add_db',
|
||||
params: {
|
||||
scene: this.currGroup
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
sceneClick(data, node) {
|
||||
// this.$store.commit('setChart', data.id);
|
||||
// this.$router.push({
|
||||
// name: 'ChartGroup',
|
||||
// params: {
|
||||
// table: data
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0
|
||||
}
|
||||
|
||||
.search-input {
|
||||
padding: 12px 0;
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.custom-position {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
flex-flow: row nowrap;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.title-css {
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
line-height: 26px;
|
||||
}
|
||||
</style>
|
18
frontend/src/business/components/chart/router.js
Normal file
18
frontend/src/business/components/chart/router.js
Normal file
@ -0,0 +1,18 @@
|
||||
const Chart = () => import('@/business/components/chart/Chart');
|
||||
const ChartHome = () => import('@/business/components/chart/data/ChartHome');
|
||||
|
||||
export default {
|
||||
path: "/chart",
|
||||
name: "ChartGroup",
|
||||
redirect: "/chart/home",
|
||||
components: {
|
||||
content: Chart,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
name: 'home',
|
||||
component: ChartHome,
|
||||
}
|
||||
]
|
||||
}
|
@ -11,7 +11,7 @@
|
||||
<el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']">
|
||||
{{ $t('test_track.test_track') }}
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/api" @click="active()" v-permission="['test_manager','test_user','test_viewer']">
|
||||
<el-menu-item index="/chart" @click="active()" v-permission="['test_manager','test_user','test_viewer']">
|
||||
{{ $t('commons.api') }}
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/dataset" onselectstart="return false"
|
||||
|
@ -2,7 +2,8 @@ import Vue from "vue";
|
||||
import VueRouter from 'vue-router'
|
||||
import RouterSidebar from "./RouterSidebar";
|
||||
import Setting from "@/business/components/settings/router";
|
||||
import API from "@/business/components/api/router";
|
||||
import Chart from "@/business/components/chart/router";
|
||||
// import API from "@/business/components/api/router";
|
||||
// import Performance from "@/business/components/performance/router";
|
||||
import DataSet from "@/business/components/dataset/router";
|
||||
import Track from "@/business/components/track/router";
|
||||
@ -19,7 +20,7 @@ const router = new VueRouter({
|
||||
}
|
||||
},
|
||||
Setting,
|
||||
API,
|
||||
Chart,
|
||||
// Performance,
|
||||
DataSet,
|
||||
Track,
|
||||
|
@ -18,6 +18,21 @@ const Dataset = {
|
||||
}
|
||||
}
|
||||
|
||||
const Chart = {
|
||||
state: {
|
||||
chartSceneData: "",
|
||||
chart: ""
|
||||
},
|
||||
mutations: {
|
||||
setChartSceneData(state, chartSceneData) {
|
||||
state.chartSceneData = chartSceneData;
|
||||
},
|
||||
setChart(state, chart) {
|
||||
state.chart = chart;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const Common = {
|
||||
state: {
|
||||
projectId: ""
|
||||
@ -71,6 +86,7 @@ export default new Vuex.Store({
|
||||
common: Common,
|
||||
switch: Switch,
|
||||
isReadOnly: IsReadOnly,
|
||||
dataset: Dataset
|
||||
dataset: Dataset,
|
||||
chart: Chart
|
||||
}
|
||||
})
|
||||
|
@ -1529,6 +1529,37 @@ export default {
|
||||
title: '认证设置',
|
||||
auth_name_valid: '名称不支持特殊字符',
|
||||
},
|
||||
chart: {
|
||||
datalist: '视图列表',
|
||||
add_group: '添加分组',
|
||||
add_scene: '添加场景',
|
||||
group: '分组',
|
||||
scene: '场景',
|
||||
delete: '删除',
|
||||
move_to: '移动到',
|
||||
rename: '重命名',
|
||||
tips: '提示',
|
||||
confirm_delete: '确认删除',
|
||||
delete_success: '删除成功',
|
||||
confirm: '确认',
|
||||
cancel: '取消',
|
||||
search: '搜索',
|
||||
back: '返回',
|
||||
add_table: '添加表',
|
||||
process: '进度',
|
||||
add_chart: '添加视图',
|
||||
db_data: '数据库表',
|
||||
sql_data: 'SQL数据集',
|
||||
excel_data: 'Excel数据集',
|
||||
custom_data: '自助数据集',
|
||||
pls_slc_tbl_left: '请从左侧选视图',
|
||||
add_db_table: '添加数据库表',
|
||||
pls_slc_data_source: '请选择数据库连接',
|
||||
table: '表',
|
||||
edit: '编辑',
|
||||
create_view: '创建试图',
|
||||
data_preview:'数据预览'
|
||||
},
|
||||
dataset: {
|
||||
datalist: '数据列表',
|
||||
add_group: '添加分组',
|
||||
|
Loading…
Reference in New Issue
Block a user