Merge branch 'main' of github.com:dataease/dataease into main

This commit is contained in:
taojinlong 2021-02-25 15:34:04 +08:00
commit 9212b73fd7
51 changed files with 4616 additions and 186 deletions

View File

@ -13,10 +13,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<shiro.version>1.6.0</shiro.version>
<shiro.version>1.7.1</shiro.version>
<java.version>1.8</java.version>
<nacos.version>1.1.3</nacos.version>
<dubbo.version>2.7.8</dubbo.version>
<graalvm.version>20.1.0</graalvm.version>
</properties>
@ -80,6 +78,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<!-- flyway -->
<dependency>
@ -115,7 +117,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
<version>4.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@ -127,11 +129,11 @@
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<!--<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.72</version>
</dependency>
</dependency>-->
<!-- openapi -->
<dependency>
@ -140,11 +142,7 @@
<version>1.2.32</version>
</dependency>
<dependency>
<groupId>org.python</groupId>
<artifactId>jython-standalone</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
@ -164,17 +162,7 @@
<version>19.7.0.0</version>
</dependency>
<!-- Zookeeper -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.14</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
@ -186,22 +174,7 @@
<version>4.0.1</version>
</dependency>
<!-- nacos -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-nacos</artifactId>
<version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-api</artifactId>
<version>${nacos.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>${nacos.version}</version>
</dependency>
<!-- easyexcel -->
<dependency>
<groupId>com.alibaba</groupId>
@ -301,12 +274,7 @@
<artifactId>json</artifactId>
<version>20171018</version>
</dependency>
<!--钉钉sdk-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
@ -319,7 +287,7 @@
<version>0.11.7</version>
</dependency>
<!-- k8s client -->
<dependency>
<!--<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
<version>4.13.0</version>
@ -328,7 +296,7 @@
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
<version>2.2.6</version>
</dependency>
</dependency>-->
</dependencies>

View File

@ -0,0 +1,25 @@
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class DatasetTableField implements Serializable {
private String id;
private String tableId;
private String originName;
private String name;
private String type;
private Boolean checked;
private Integer columnIndex;
private Long lastSyncTime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,730 @@
package io.dataease.base.domain;
import java.util.ArrayList;
import java.util.List;
public class DatasetTableFieldExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public DatasetTableFieldExample() {
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 andTableIdIsNull() {
addCriterion("table_id is null");
return (Criteria) this;
}
public Criteria andTableIdIsNotNull() {
addCriterion("table_id is not null");
return (Criteria) this;
}
public Criteria andTableIdEqualTo(String value) {
addCriterion("table_id =", value, "tableId");
return (Criteria) this;
}
public Criteria andTableIdNotEqualTo(String value) {
addCriterion("table_id <>", value, "tableId");
return (Criteria) this;
}
public Criteria andTableIdGreaterThan(String value) {
addCriterion("table_id >", value, "tableId");
return (Criteria) this;
}
public Criteria andTableIdGreaterThanOrEqualTo(String value) {
addCriterion("table_id >=", value, "tableId");
return (Criteria) this;
}
public Criteria andTableIdLessThan(String value) {
addCriterion("table_id <", value, "tableId");
return (Criteria) this;
}
public Criteria andTableIdLessThanOrEqualTo(String value) {
addCriterion("table_id <=", value, "tableId");
return (Criteria) this;
}
public Criteria andTableIdLike(String value) {
addCriterion("table_id like", value, "tableId");
return (Criteria) this;
}
public Criteria andTableIdNotLike(String value) {
addCriterion("table_id not like", value, "tableId");
return (Criteria) this;
}
public Criteria andTableIdIn(List<String> values) {
addCriterion("table_id in", values, "tableId");
return (Criteria) this;
}
public Criteria andTableIdNotIn(List<String> values) {
addCriterion("table_id not in", values, "tableId");
return (Criteria) this;
}
public Criteria andTableIdBetween(String value1, String value2) {
addCriterion("table_id between", value1, value2, "tableId");
return (Criteria) this;
}
public Criteria andTableIdNotBetween(String value1, String value2) {
addCriterion("table_id not between", value1, value2, "tableId");
return (Criteria) this;
}
public Criteria andOriginNameIsNull() {
addCriterion("origin_name is null");
return (Criteria) this;
}
public Criteria andOriginNameIsNotNull() {
addCriterion("origin_name is not null");
return (Criteria) this;
}
public Criteria andOriginNameEqualTo(String value) {
addCriterion("origin_name =", value, "originName");
return (Criteria) this;
}
public Criteria andOriginNameNotEqualTo(String value) {
addCriterion("origin_name <>", value, "originName");
return (Criteria) this;
}
public Criteria andOriginNameGreaterThan(String value) {
addCriterion("origin_name >", value, "originName");
return (Criteria) this;
}
public Criteria andOriginNameGreaterThanOrEqualTo(String value) {
addCriterion("origin_name >=", value, "originName");
return (Criteria) this;
}
public Criteria andOriginNameLessThan(String value) {
addCriterion("origin_name <", value, "originName");
return (Criteria) this;
}
public Criteria andOriginNameLessThanOrEqualTo(String value) {
addCriterion("origin_name <=", value, "originName");
return (Criteria) this;
}
public Criteria andOriginNameLike(String value) {
addCriterion("origin_name like", value, "originName");
return (Criteria) this;
}
public Criteria andOriginNameNotLike(String value) {
addCriterion("origin_name not like", value, "originName");
return (Criteria) this;
}
public Criteria andOriginNameIn(List<String> values) {
addCriterion("origin_name in", values, "originName");
return (Criteria) this;
}
public Criteria andOriginNameNotIn(List<String> values) {
addCriterion("origin_name not in", values, "originName");
return (Criteria) this;
}
public Criteria andOriginNameBetween(String value1, String value2) {
addCriterion("origin_name between", value1, value2, "originName");
return (Criteria) this;
}
public Criteria andOriginNameNotBetween(String value1, String value2) {
addCriterion("origin_name not between", value1, value2, "originName");
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 andCheckedIsNull() {
addCriterion("`checked` is null");
return (Criteria) this;
}
public Criteria andCheckedIsNotNull() {
addCriterion("`checked` is not null");
return (Criteria) this;
}
public Criteria andCheckedEqualTo(Boolean value) {
addCriterion("`checked` =", value, "checked");
return (Criteria) this;
}
public Criteria andCheckedNotEqualTo(Boolean value) {
addCriterion("`checked` <>", value, "checked");
return (Criteria) this;
}
public Criteria andCheckedGreaterThan(Boolean value) {
addCriterion("`checked` >", value, "checked");
return (Criteria) this;
}
public Criteria andCheckedGreaterThanOrEqualTo(Boolean value) {
addCriterion("`checked` >=", value, "checked");
return (Criteria) this;
}
public Criteria andCheckedLessThan(Boolean value) {
addCriterion("`checked` <", value, "checked");
return (Criteria) this;
}
public Criteria andCheckedLessThanOrEqualTo(Boolean value) {
addCriterion("`checked` <=", value, "checked");
return (Criteria) this;
}
public Criteria andCheckedIn(List<Boolean> values) {
addCriterion("`checked` in", values, "checked");
return (Criteria) this;
}
public Criteria andCheckedNotIn(List<Boolean> values) {
addCriterion("`checked` not in", values, "checked");
return (Criteria) this;
}
public Criteria andCheckedBetween(Boolean value1, Boolean value2) {
addCriterion("`checked` between", value1, value2, "checked");
return (Criteria) this;
}
public Criteria andCheckedNotBetween(Boolean value1, Boolean value2) {
addCriterion("`checked` not between", value1, value2, "checked");
return (Criteria) this;
}
public Criteria andColumnIndexIsNull() {
addCriterion("column_index is null");
return (Criteria) this;
}
public Criteria andColumnIndexIsNotNull() {
addCriterion("column_index is not null");
return (Criteria) this;
}
public Criteria andColumnIndexEqualTo(Integer value) {
addCriterion("column_index =", value, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexNotEqualTo(Integer value) {
addCriterion("column_index <>", value, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexGreaterThan(Integer value) {
addCriterion("column_index >", value, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexGreaterThanOrEqualTo(Integer value) {
addCriterion("column_index >=", value, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexLessThan(Integer value) {
addCriterion("column_index <", value, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexLessThanOrEqualTo(Integer value) {
addCriterion("column_index <=", value, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexIn(List<Integer> values) {
addCriterion("column_index in", values, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexNotIn(List<Integer> values) {
addCriterion("column_index not in", values, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexBetween(Integer value1, Integer value2) {
addCriterion("column_index between", value1, value2, "columnIndex");
return (Criteria) this;
}
public Criteria andColumnIndexNotBetween(Integer value1, Integer value2) {
addCriterion("column_index not between", value1, value2, "columnIndex");
return (Criteria) this;
}
public Criteria andLastSyncTimeIsNull() {
addCriterion("last_sync_time is null");
return (Criteria) this;
}
public Criteria andLastSyncTimeIsNotNull() {
addCriterion("last_sync_time is not null");
return (Criteria) this;
}
public Criteria andLastSyncTimeEqualTo(Long value) {
addCriterion("last_sync_time =", value, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeNotEqualTo(Long value) {
addCriterion("last_sync_time <>", value, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeGreaterThan(Long value) {
addCriterion("last_sync_time >", value, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeGreaterThanOrEqualTo(Long value) {
addCriterion("last_sync_time >=", value, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeLessThan(Long value) {
addCriterion("last_sync_time <", value, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeLessThanOrEqualTo(Long value) {
addCriterion("last_sync_time <=", value, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeIn(List<Long> values) {
addCriterion("last_sync_time in", values, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeNotIn(List<Long> values) {
addCriterion("last_sync_time not in", values, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeBetween(Long value1, Long value2) {
addCriterion("last_sync_time between", value1, value2, "lastSyncTime");
return (Criteria) this;
}
public Criteria andLastSyncTimeNotBetween(Long value1, Long value2) {
addCriterion("last_sync_time not between", value1, value2, "lastSyncTime");
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);
}
}
}

View File

@ -1,6 +1,8 @@
package io.dataease.base.domain;
import java.io.Serializable;
import java.util.Objects;
import lombok.Data;
@Data
@ -42,4 +44,30 @@ public class SysMenu implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
/**
* 由于该类型作为HashSet key所以必须重写以下方法
* @param o
* @return
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SysMenu menu = (SysMenu) o;
return Objects.equals(menuId, menu.menuId);
}
@Override
public int hashCode() {
return Objects.hash(menuId);
}
}

View File

@ -0,0 +1,39 @@
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class SysUser implements Serializable {
private Long userId;
private Long deptId;
private String username;
private String nickName;
private String gender;
private String phone;
private String email;
private String password;
private Boolean isAdmin;
private Long enabled;
private String createBy;
private String updateBy;
private Long pwdResetTime;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,320 @@
package io.dataease.base.domain;
import java.util.ArrayList;
import java.util.List;
public class SysUsersRolesExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysUsersRolesExample() {
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 andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andRoleIdIsNull() {
addCriterion("role_id is null");
return (Criteria) this;
}
public Criteria andRoleIdIsNotNull() {
addCriterion("role_id is not null");
return (Criteria) this;
}
public Criteria andRoleIdEqualTo(Long value) {
addCriterion("role_id =", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdNotEqualTo(Long value) {
addCriterion("role_id <>", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdGreaterThan(Long value) {
addCriterion("role_id >", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdGreaterThanOrEqualTo(Long value) {
addCriterion("role_id >=", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdLessThan(Long value) {
addCriterion("role_id <", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdLessThanOrEqualTo(Long value) {
addCriterion("role_id <=", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdIn(List<Long> values) {
addCriterion("role_id in", values, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdNotIn(List<Long> values) {
addCriterion("role_id not in", values, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdBetween(Long value1, Long value2) {
addCriterion("role_id between", value1, value2, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdNotBetween(Long value1, Long value2) {
addCriterion("role_id not between", value1, value2, "roleId");
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);
}
}
}

View File

@ -0,0 +1,13 @@
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class SysUsersRolesKey implements Serializable {
private Long userId;
private Long roleId;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,30 @@
package io.dataease.base.mapper;
import io.dataease.base.domain.DatasetTableField;
import io.dataease.base.domain.DatasetTableFieldExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DatasetTableFieldMapper {
long countByExample(DatasetTableFieldExample example);
int deleteByExample(DatasetTableFieldExample example);
int deleteByPrimaryKey(String id);
int insert(DatasetTableField record);
int insertSelective(DatasetTableField record);
List<DatasetTableField> selectByExample(DatasetTableFieldExample example);
DatasetTableField selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") DatasetTableField record, @Param("example") DatasetTableFieldExample example);
int updateByExample(@Param("record") DatasetTableField record, @Param("example") DatasetTableFieldExample example);
int updateByPrimaryKeySelective(DatasetTableField record);
int updateByPrimaryKey(DatasetTableField record);
}

View File

@ -0,0 +1,258 @@
<?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.DatasetTableFieldMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.DatasetTableField">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="table_id" jdbcType="VARCHAR" property="tableId" />
<result column="origin_name" jdbcType="VARCHAR" property="originName" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="checked" jdbcType="BIT" property="checked" />
<result column="column_index" jdbcType="INTEGER" property="columnIndex" />
<result column="last_sync_time" jdbcType="BIGINT" property="lastSyncTime" />
</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, table_id, origin_name, `name`, `type`, `checked`, column_index, last_sync_time
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.DatasetTableFieldExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from dataset_table_field
<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 dataset_table_field
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from dataset_table_field
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.DatasetTableFieldExample">
delete from dataset_table_field
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.DatasetTableField">
insert into dataset_table_field (id, table_id, origin_name,
`name`, `type`, `checked`, column_index,
last_sync_time)
values (#{id,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{originName,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{checked,jdbcType=BIT}, #{columnIndex,jdbcType=INTEGER},
#{lastSyncTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.DatasetTableField">
insert into dataset_table_field
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="tableId != null">
table_id,
</if>
<if test="originName != null">
origin_name,
</if>
<if test="name != null">
`name`,
</if>
<if test="type != null">
`type`,
</if>
<if test="checked != null">
`checked`,
</if>
<if test="columnIndex != null">
column_index,
</if>
<if test="lastSyncTime != null">
last_sync_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="tableId != null">
#{tableId,jdbcType=VARCHAR},
</if>
<if test="originName != null">
#{originName,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="checked != null">
#{checked,jdbcType=BIT},
</if>
<if test="columnIndex != null">
#{columnIndex,jdbcType=INTEGER},
</if>
<if test="lastSyncTime != null">
#{lastSyncTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.DatasetTableFieldExample" resultType="java.lang.Long">
select count(*) from dataset_table_field
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update dataset_table_field
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.tableId != null">
table_id = #{record.tableId,jdbcType=VARCHAR},
</if>
<if test="record.originName != null">
origin_name = #{record.originName,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.checked != null">
`checked` = #{record.checked,jdbcType=BIT},
</if>
<if test="record.columnIndex != null">
column_index = #{record.columnIndex,jdbcType=INTEGER},
</if>
<if test="record.lastSyncTime != null">
last_sync_time = #{record.lastSyncTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update dataset_table_field
set id = #{record.id,jdbcType=VARCHAR},
table_id = #{record.tableId,jdbcType=VARCHAR},
origin_name = #{record.originName,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
`checked` = #{record.checked,jdbcType=BIT},
column_index = #{record.columnIndex,jdbcType=INTEGER},
last_sync_time = #{record.lastSyncTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.DatasetTableField">
update dataset_table_field
<set>
<if test="tableId != null">
table_id = #{tableId,jdbcType=VARCHAR},
</if>
<if test="originName != null">
origin_name = #{originName,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
`type` = #{type,jdbcType=VARCHAR},
</if>
<if test="checked != null">
`checked` = #{checked,jdbcType=BIT},
</if>
<if test="columnIndex != null">
column_index = #{columnIndex,jdbcType=INTEGER},
</if>
<if test="lastSyncTime != null">
last_sync_time = #{lastSyncTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.DatasetTableField">
update dataset_table_field
set table_id = #{tableId,jdbcType=VARCHAR},
origin_name = #{originName,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
`checked` = #{checked,jdbcType=BIT},
column_index = #{columnIndex,jdbcType=INTEGER},
last_sync_time = #{lastSyncTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,30 @@
package io.dataease.base.mapper;
import io.dataease.base.domain.SysUser;
import io.dataease.base.domain.SysUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysUserMapper {
long countByExample(SysUserExample example);
int deleteByExample(SysUserExample example);
int deleteByPrimaryKey(Long userId);
int insert(SysUser record);
int insertSelective(SysUser record);
List<SysUser> selectByExample(SysUserExample example);
SysUser selectByPrimaryKey(Long userId);
int updateByExampleSelective(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByPrimaryKeySelective(SysUser record);
int updateByPrimaryKey(SysUser record);
}

View File

@ -0,0 +1,370 @@
<?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.SysUserMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysUser">
<id column="user_id" jdbcType="BIGINT" property="userId" />
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="nick_name" jdbcType="VARCHAR" property="nickName" />
<result column="gender" jdbcType="VARCHAR" property="gender" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="is_admin" jdbcType="BIT" property="isAdmin" />
<result column="enabled" jdbcType="BIGINT" property="enabled" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="pwd_reset_time" jdbcType="BIGINT" property="pwdResetTime" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</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">
user_id, dept_id, username, nick_name, gender, phone, email, `password`, is_admin,
enabled, create_by, update_by, pwd_reset_time, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.SysUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_user
<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.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_user
where user_id = #{userId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sys_user
where user_id = #{userId,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysUserExample">
delete from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.SysUser">
insert into sys_user (user_id, dept_id, username,
nick_name, gender, phone,
email, `password`, is_admin,
enabled, create_by, update_by,
pwd_reset_time, create_time, update_time
)
values (#{userId,jdbcType=BIGINT}, #{deptId,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR},
#{nickName,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{isAdmin,jdbcType=BIT},
#{enabled,jdbcType=BIGINT}, #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR},
#{pwdResetTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysUser">
insert into sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="deptId != null">
dept_id,
</if>
<if test="username != null">
username,
</if>
<if test="nickName != null">
nick_name,
</if>
<if test="gender != null">
gender,
</if>
<if test="phone != null">
phone,
</if>
<if test="email != null">
email,
</if>
<if test="password != null">
`password`,
</if>
<if test="isAdmin != null">
is_admin,
</if>
<if test="enabled != null">
enabled,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="pwdResetTime != null">
pwd_reset_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="deptId != null">
#{deptId,jdbcType=BIGINT},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="nickName != null">
#{nickName,jdbcType=VARCHAR},
</if>
<if test="gender != null">
#{gender,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="isAdmin != null">
#{isAdmin,jdbcType=BIT},
</if>
<if test="enabled != null">
#{enabled,jdbcType=BIGINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="pwdResetTime != null">
#{pwdResetTime,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.SysUserExample" resultType="java.lang.Long">
select count(*) from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_user
<set>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.deptId != null">
dept_id = #{record.deptId,jdbcType=BIGINT},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.nickName != null">
nick_name = #{record.nickName,jdbcType=VARCHAR},
</if>
<if test="record.gender != null">
gender = #{record.gender,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.email != null">
email = #{record.email,jdbcType=VARCHAR},
</if>
<if test="record.password != null">
`password` = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.isAdmin != null">
is_admin = #{record.isAdmin,jdbcType=BIT},
</if>
<if test="record.enabled != null">
enabled = #{record.enabled,jdbcType=BIGINT},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.pwdResetTime != null">
pwd_reset_time = #{record.pwdResetTime,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_user
set user_id = #{record.userId,jdbcType=BIGINT},
dept_id = #{record.deptId,jdbcType=BIGINT},
username = #{record.username,jdbcType=VARCHAR},
nick_name = #{record.nickName,jdbcType=VARCHAR},
gender = #{record.gender,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
email = #{record.email,jdbcType=VARCHAR},
`password` = #{record.password,jdbcType=VARCHAR},
is_admin = #{record.isAdmin,jdbcType=BIT},
enabled = #{record.enabled,jdbcType=BIGINT},
create_by = #{record.createBy,jdbcType=VARCHAR},
update_by = #{record.updateBy,jdbcType=VARCHAR},
pwd_reset_time = #{record.pwdResetTime,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysUser">
update sys_user
<set>
<if test="deptId != null">
dept_id = #{deptId,jdbcType=BIGINT},
</if>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="nickName != null">
nick_name = #{nickName,jdbcType=VARCHAR},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="password != null">
`password` = #{password,jdbcType=VARCHAR},
</if>
<if test="isAdmin != null">
is_admin = #{isAdmin,jdbcType=BIT},
</if>
<if test="enabled != null">
enabled = #{enabled,jdbcType=BIGINT},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="pwdResetTime != null">
pwd_reset_time = #{pwdResetTime,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where user_id = #{userId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysUser">
update sys_user
set dept_id = #{deptId,jdbcType=BIGINT},
username = #{username,jdbcType=VARCHAR},
nick_name = #{nickName,jdbcType=VARCHAR},
gender = #{gender,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
is_admin = #{isAdmin,jdbcType=BIT},
enabled = #{enabled,jdbcType=BIGINT},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
pwd_reset_time = #{pwdResetTime,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where user_id = #{userId,jdbcType=BIGINT}
</update>
</mapper>

View File

@ -0,0 +1,24 @@
package io.dataease.base.mapper;
import io.dataease.base.domain.SysUsersRolesExample;
import io.dataease.base.domain.SysUsersRolesKey;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysUsersRolesMapper {
long countByExample(SysUsersRolesExample example);
int deleteByExample(SysUsersRolesExample example);
int deleteByPrimaryKey(SysUsersRolesKey key);
int insert(SysUsersRolesKey record);
int insertSelective(SysUsersRolesKey record);
List<SysUsersRolesKey> selectByExample(SysUsersRolesExample example);
int updateByExampleSelective(@Param("record") SysUsersRolesKey record, @Param("example") SysUsersRolesExample example);
int updateByExample(@Param("record") SysUsersRolesKey record, @Param("example") SysUsersRolesExample example);
}

View File

@ -0,0 +1,145 @@
<?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.SysUsersRolesMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysUsersRolesKey">
<id column="user_id" jdbcType="BIGINT" property="userId" />
<id column="role_id" jdbcType="BIGINT" property="roleId" />
</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">
user_id, role_id
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.SysUsersRolesExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_users_roles
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="io.dataease.base.domain.SysUsersRolesKey">
delete from sys_users_roles
where user_id = #{userId,jdbcType=BIGINT}
and role_id = #{roleId,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysUsersRolesExample">
delete from sys_users_roles
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.SysUsersRolesKey">
insert into sys_users_roles (user_id, role_id)
values (#{userId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysUsersRolesKey">
insert into sys_users_roles
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="roleId != null">
role_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="roleId != null">
#{roleId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.SysUsersRolesExample" resultType="java.lang.Long">
select count(*) from sys_users_roles
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_users_roles
<set>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.roleId != null">
role_id = #{record.roleId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_users_roles
set user_id = #{record.userId,jdbcType=BIGINT},
role_id = #{record.roleId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

View File

@ -2,13 +2,21 @@ package io.dataease.base.mapper.ext;
import io.dataease.controller.sys.request.RoleGridRequest;
import io.dataease.controller.sys.response.RoleNodeResponse;
import io.dataease.controller.sys.response.RoleUserItem;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface ExtSysRoleMapper {
List<RoleNodeResponse> query(@Param("request")RoleGridRequest request);
int deleteRoleMenu(@Param("roleId") Long roleId);
int batchInsertRoleMenu(@Param("maps") List<Map<String, Long>> maps);
List<RoleUserItem> queryAll();
}

View File

@ -11,6 +11,11 @@
</collection>
</resultMap>
<resultMap id="roleItemMap" type="io.dataease.controller.sys.response.RoleUserItem">
<id property="id" column="id"/>
<result property="name" column="name"/>
</resultMap>
<select id="query" resultMap="BaseResultMap">
select r.*, m.menu_id
from sys_role r left join sys_roles_menus m on r.role_id = m.role_id
@ -23,4 +28,21 @@
</select>
<delete id="deleteRoleMenu">
delete from sys_roles_menus where role_id = #{roleId}
</delete>
<insert id="batchInsertRoleMenu">
insert into sys_roles_menus (role_id, menu_id) values
<foreach collection="maps" item="map" separator=",">
(#{map.roleId},#{map.menuId})
</foreach>
</insert>
<select id="queryAll" resultMap="roleItemMap">
select role_id as id, name from sys_role
</select>
</mapper>

View File

@ -0,0 +1,12 @@
package io.dataease.base.mapper.ext;
import io.dataease.controller.sys.request.UserGridRequest;
import io.dataease.controller.sys.response.SysUserGridResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtSysUserMapper {
List<SysUserGridResponse> query(@Param("request")UserGridRequest request);
}

View File

@ -0,0 +1,47 @@
<?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.ext.ExtSysUserMapper">
<resultMap id="sysUserDept" type="io.dataease.controller.sys.response.SysUserDept" >
<id column="dept_id" property="deptId"></id>
<result column="pid" property="pid"></result>
<result column="dept_name" property="deptName"></result>
</resultMap>
<resultMap id="sysUserRole" type="io.dataease.controller.sys.response.SysUserRole" >
<result column="role_id" property="roleId"></result>
<result column="role_name" property="roleName"></result>
</resultMap>
<resultMap id="BaseResultMap" type="io.dataease.controller.sys.response.SysUserGridResponse" extends="io.dataease.base.mapper.SysUserMapper.BaseResultMap">
<result property="id" column="id"></result>
<association property="dept" javaType="io.dataease.controller.sys.response.SysUserDept">
<id column="dept_id" property="deptId"/>
<result column="pid" property="pid" />
<result column="dept_name" property="deptName" />
</association>
<association property="dept" column="dept_id" javaType="io.dataease.controller.sys.response.SysUserDept" resultMap="sysUserDept"/>
<collection property="roles" ofType="io.dataease.controller.sys.response.SysUserRole" >
<id column="role_id" property="roleId" />
<result column="role_name" property="roleName"/>
</collection>
</resultMap>
<select id="query" resultMap="BaseResultMap">
select u.*,u.user_id as id, r.role_id,r.name as role_name , d.pid, d.name as dept_name
from sys_user u left join sys_users_roles ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
left join sys_dept d on d.dept_id = u.dept_id
<where>
<if test="request.name != null">
AND u.name like CONCAT('%', #{request.name},'%')
</if>
</where>
order by u.update_time desc
</select>
</mapper>

View File

@ -21,12 +21,12 @@ public class DataSetTableController {
private DataSetTableService dataSetTableService;
@PostMapping("batchAdd")
public void batchAdd(@RequestBody List<DatasetTable> datasetTable) {
public void batchAdd(@RequestBody List<DatasetTable> datasetTable) throws Exception {
dataSetTableService.batchInsert(datasetTable);
}
@PostMapping("update")
public DatasetTable save(@RequestBody DatasetTable datasetTable) {
public DatasetTable save(@RequestBody DatasetTable datasetTable) throws Exception {
return dataSetTableService.save(datasetTable);
}

View File

@ -0,0 +1,31 @@
package io.dataease.controller.dataset;
import io.dataease.base.domain.DatasetTableField;
import io.dataease.service.dataset.DataSetTableFieldsService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author gin
* @Date 2021/2/24 4:28 下午
*/
@RestController
@RequestMapping("/dataset/field")
public class DataSetTableFieldController {
@Resource
private DataSetTableFieldsService dataSetTableFieldsService;
@PostMapping("list/{tableId}")
public List<DatasetTableField> list(@PathVariable String tableId) {
DatasetTableField datasetTableField = new DatasetTableField();
datasetTableField.setTableId(tableId);
return dataSetTableFieldsService.list(datasetTableField);
}
@PostMapping("batchEdit")
public void batchEdit(@RequestBody List<DatasetTableField> list) {
dataSetTableFieldsService.batchEdit(list);
}
}

View File

@ -14,6 +14,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@RestController
@ -29,15 +30,11 @@ public class SysMenuController {
@PostMapping("/childNodes/{pid}")
public List<MenuNodeResponse> childNodes(@PathVariable("pid") Long pid){
List<SysMenu> nodes = menuService.nodesByPid(pid);
List<MenuNodeResponse> nodeResponses = nodes.stream().map(node -> {
MenuNodeResponse menuNodeResponse = BeanUtils.copyBean(new MenuNodeResponse(), node);
menuNodeResponse.setHasChildren(node.getSubCount() > 0);
menuNodeResponse.setTop(node.getPid() == menuService.MENU_ROOT_PID);
return menuNodeResponse;
}).collect(Collectors.toList());
return nodeResponses;
return menuService.convert(nodes);
}
@ApiOperation("新增菜单")
@PostMapping("/create")
public void create(@RequestBody MenuCreateRequest request){
@ -49,6 +46,7 @@ public class SysMenuController {
public void delete(@RequestBody MenuDeleteRequest request){
menuService.delete(request);
}
@ApiOperation("更新菜单")
@PostMapping("/update")
public void update(@RequestBody MenuCreateRequest menu){
@ -56,4 +54,14 @@ public class SysMenuController {
}
@PostMapping("/childMenus/{pid}")
public Set<Long> childMenus(@PathVariable Long pid){
List<MenuNodeResponse> childs = menuService.childs(pid);
Set<Long> sets = childs.stream().map(MenuNodeResponse::getMenuId).collect(Collectors.toSet());
sets.add(pid);
return sets;
}
}

View File

@ -7,7 +7,9 @@ import io.dataease.base.domain.SysRole;
import io.dataease.commons.utils.PageUtils;
import io.dataease.commons.utils.Pager;
import io.dataease.controller.sys.request.RoleGridRequest;
import io.dataease.controller.sys.request.RoleMenusRequest;
import io.dataease.controller.sys.response.RoleNodeResponse;
import io.dataease.controller.sys.response.RoleUserItem;
import io.dataease.service.sys.SysRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -34,8 +36,8 @@ public class SysRoleController {
@ApiOperation("删除角色")
@PostMapping("/delete")
public void delete(Long roleId){
@PostMapping("/delete/{roleId}")
public void delete(@PathVariable("roleId") Long roleId){
sysRoleService.delete(roleId);
}
@ -52,4 +54,16 @@ public class SysRoleController {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, sysRoleService.query(request));
}
@PostMapping("/saveRolesMenus")
public void saveRolesMenus(@RequestBody RoleMenusRequest request){
sysRoleService.batchSaveRolesMenus(request);
}
@PostMapping("/all")
public List<RoleUserItem> all(){
return sysRoleService.allRoles();
}
}

View File

@ -0,0 +1,50 @@
package io.dataease.controller.sys;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.dataease.commons.utils.PageUtils;
import io.dataease.commons.utils.Pager;
import io.dataease.controller.sys.request.SysUserCreateRequest;
import io.dataease.controller.sys.request.UserGridRequest;
import io.dataease.controller.sys.response.SysUserGridResponse;
import io.dataease.service.sys.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@Api(tags = "系统:用户管理")
@RequestMapping("/api/user")
public class SysUserController {
@Resource
private SysUserService sysUserService;
@ApiOperation("查询用户")
@PostMapping("/userGrid/{goPage}/{pageSize}")
public Pager<List<SysUserGridResponse>> userGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody UserGridRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, sysUserService.query(request));
}
@ApiOperation("创建用户")
@PostMapping("/create")
public void create(@RequestBody SysUserCreateRequest request){
sysUserService.save(request);
}
@ApiOperation("更新用户")
@PostMapping("/update")
public void update(@RequestBody SysUserCreateRequest request){
sysUserService.update(request);
}
@ApiOperation("更新用户")
@PostMapping("/delete/{userId}")
public void delete(@PathVariable("userId") Long userId){
sysUserService.delete(userId);
}
}

View File

@ -0,0 +1,13 @@
package io.dataease.controller.sys.request;
import lombok.Data;
import java.util.List;
@Data
public class RoleMenusRequest {
private Long roleId;
private List<Long> menuIds;
}

View File

@ -0,0 +1,13 @@
package io.dataease.controller.sys.request;
import io.dataease.base.domain.SysUser;
import lombok.Data;
import java.util.List;
@Data
public class SysUserCreateRequest extends SysUser {
private List<Long> roleIds;
}

View File

@ -0,0 +1,10 @@
package io.dataease.controller.sys.request;
import lombok.Data;
import java.io.Serializable;
@Data
public class UserGridRequest implements Serializable {
private String name;
}

View File

@ -0,0 +1,13 @@
package io.dataease.controller.sys.response;
import lombok.Data;
import java.io.Serializable;
@Data
public class RoleUserItem implements Serializable {
private Long id;
private String name;
}

View File

@ -0,0 +1,15 @@
package io.dataease.controller.sys.response;
import lombok.Data;
import java.io.Serializable;
@Data
public class SysUserDept implements Serializable {
private Long deptId;
private Long pid;
private String deptName;
}

View File

@ -0,0 +1,18 @@
package io.dataease.controller.sys.response;
import io.dataease.base.domain.SysUser;
import lombok.Data;
import java.util.List;
@Data
public class SysUserGridResponse extends SysUser {
private Long id;
private List<SysUserRole> roles;
private SysUserDept dept;
private List<Long> roleIds;
}

View File

@ -0,0 +1,13 @@
package io.dataease.controller.sys.response;
import lombok.Data;
import java.io.Serializable;
@Data
public class SysUserRole implements Serializable {
private Long roleId;
private String roleName;
}

View File

@ -6,7 +6,7 @@ import io.dataease.commons.exception.DEException;
import io.dataease.datasource.provider.DatasourceProvider;
import io.dataease.datasource.provider.ProviderFactory;
import io.dataease.datasource.request.DatasourceRequest;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

View File

@ -1,19 +1,19 @@
package io.dataease.service.dataset;
import com.alibaba.nacos.common.util.UuidUtils;
import io.dataease.base.domain.DatasetGroup;
import io.dataease.base.domain.DatasetGroupExample;
import io.dataease.base.mapper.DatasetGroupMapper;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.dto.dataset.DataSetGroupDTO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.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.UUID;
import java.util.stream.Collectors;
/**
@ -27,7 +27,7 @@ public class DataSetGroupService {
public DataSetGroupDTO save(DatasetGroup datasetGroup) {
if (StringUtils.isEmpty(datasetGroup.getId())) {
datasetGroup.setId(UuidUtils.generateUuid());
datasetGroup.setId(UUID.randomUUID().toString());
datasetGroup.setCreateTime(System.currentTimeMillis());
datasetGroupMapper.insert(datasetGroup);
} else {

View File

@ -0,0 +1,57 @@
package io.dataease.service.dataset;
import io.dataease.base.domain.DatasetTableField;
import io.dataease.base.domain.DatasetTableFieldExample;
import io.dataease.base.mapper.DatasetTableFieldMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;
/**
* @Author gin
* @Date 2021/2/24 2:03 下午
*/
@Service
public class DataSetTableFieldsService {
@Resource
private DatasetTableFieldMapper datasetTableFieldMapper;
public void batchEdit(List<DatasetTableField> list) {
for (DatasetTableField field : list) {
save(field);
}
}
public DatasetTableField save(DatasetTableField datasetTableField) {
if (StringUtils.isEmpty(datasetTableField.getId())) {
datasetTableField.setId(UUID.randomUUID().toString());
datasetTableFieldMapper.insert(datasetTableField);
} else {
datasetTableFieldMapper.updateByPrimaryKey(datasetTableField);
}
return datasetTableField;
}
public List<DatasetTableField> list(DatasetTableField datasetTableField) {
DatasetTableFieldExample datasetTableFieldExample = new DatasetTableFieldExample();
DatasetTableFieldExample.Criteria criteria = datasetTableFieldExample.createCriteria();
if (StringUtils.isNotEmpty(datasetTableField.getTableId())) {
criteria.andTableIdEqualTo(datasetTableField.getTableId());
}
if (ObjectUtils.isNotEmpty(datasetTableField.getChecked())) {
criteria.andCheckedEqualTo(datasetTableField.getChecked());
}
datasetTableFieldExample.setOrderByClause("column_index asc");
return datasetTableFieldMapper.selectByExample(datasetTableFieldExample);
}
public void deleteByTableId(String tableId) {
DatasetTableFieldExample datasetTableFieldExample = new DatasetTableFieldExample();
datasetTableFieldExample.createCriteria().andTableIdEqualTo(tableId);
datasetTableFieldMapper.deleteByExample(datasetTableFieldExample);
}
}

View File

@ -1,27 +1,28 @@
package io.dataease.service.dataset;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.util.UuidUtils;
import com.google.gson.Gson;
import io.dataease.base.domain.DatasetTable;
import io.dataease.base.domain.DatasetTableExample;
import io.dataease.base.domain.DatasetTableField;
import io.dataease.base.domain.Datasource;
import io.dataease.base.mapper.DatasetTableMapper;
import io.dataease.base.mapper.DatasourceMapper;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.datasource.constants.DatasourceTypes;
import io.dataease.datasource.dto.TableFiled;
import io.dataease.datasource.provider.DatasourceProvider;
import io.dataease.datasource.provider.ProviderFactory;
import io.dataease.datasource.request.DatasourceRequest;
import io.dataease.dto.dataset.DataTableInfoDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.MessageFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author gin
@ -33,23 +34,29 @@ public class DataSetTableService {
private DatasetTableMapper datasetTableMapper;
@Resource
private DatasourceMapper datasourceMapper;
@Resource
private DataSetTableFieldsService dataSetTableFieldsService;
public void batchInsert(List<DatasetTable> datasetTable) {
public void batchInsert(List<DatasetTable> datasetTable) throws Exception {
for (DatasetTable table : datasetTable) {
save(table);
}
}
public DatasetTable save(DatasetTable datasetTable) {
public DatasetTable save(DatasetTable datasetTable) throws Exception {
if (StringUtils.isEmpty(datasetTable.getId())) {
datasetTable.setId(UuidUtils.generateUuid());
datasetTable.setId(UUID.randomUUID().toString());
datasetTable.setCreateTime(System.currentTimeMillis());
DataTableInfoDTO dataTableInfoDTO = new DataTableInfoDTO();
if (StringUtils.equalsIgnoreCase("db", datasetTable.getType())) {
dataTableInfoDTO.setTable(datasetTable.getName());
}
datasetTable.setInfo(new Gson().toJson(dataTableInfoDTO));
datasetTableMapper.insert(datasetTable);
int insert = datasetTableMapper.insert(datasetTable);
// 添加表成功后获取当前表字段和类型抽象到dataease数据库
if (insert == 1) {
saveTableField(datasetTable);
}
} else {
datasetTableMapper.updateByPrimaryKeyWithBLOBs(datasetTable);
}
@ -58,6 +65,7 @@ public class DataSetTableService {
public void delete(String id) {
datasetTableMapper.deleteByPrimaryKey(id);
dataSetTableFieldsService.deleteByTableId(id);
}
public List<DatasetTable> list(DataSetTableRequest dataSetTableRequest) {
@ -88,7 +96,14 @@ public class DataSetTableService {
DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(ds);
String table = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class).getTable();
datasourceRequest.setQuery("SELECT * FROM " + table + ";");
DatasetTableField datasetTableField = new DatasetTableField();
datasetTableField.setTableId(dataSetTableRequest.getId());
datasetTableField.setChecked(Boolean.TRUE);
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
String[] fieldArray = fields.stream().map(DatasetTableField::getOriginName).toArray(String[]::new);
datasourceRequest.setQuery(createQuerySQL(ds.getType(), table, fieldArray));
return datasourceProvider.getData(datasourceRequest);
}
@ -98,25 +113,83 @@ public class DataSetTableService {
DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(ds);
String table = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class).getTable();
datasourceRequest.setTable(table);
datasourceRequest.setQuery("SELECT * FROM " + table + " LIMIT 0,10;");
// datasourceRequest.setTable(table);
List<TableFiled> fields = datasourceProvider.getTableFileds(datasourceRequest);
List<String[]> data = datasourceProvider.getData(datasourceRequest);
DatasetTableField datasetTableField = new DatasetTableField();
datasetTableField.setTableId(dataSetTableRequest.getId());
datasetTableField.setChecked(Boolean.TRUE);
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
String[] fieldArray = fields.stream().map(DatasetTableField::getOriginName).toArray(String[]::new);
// datasourceRequest.setQuery("SELECT " + StringUtils.join(fieldArray, ",") + " FROM " + table + " LIMIT 0,10;");
datasourceRequest.setQuery(createQuerySQL(ds.getType(), table, fieldArray) + " LIMIT 0,10");
List<String[]> data = new ArrayList<>();
try {
data.addAll(datasourceProvider.getData(datasourceRequest));
} catch (Exception e) {
}
/*JSONArray jsonArray = new JSONArray();
if (CollectionUtils.isNotEmpty(data)) {
data.forEach(ele -> {
JSONObject jsonObject = new JSONObject();
for (int i = 0; i < ele.length; i++) {
jsonObject.put(fieldArray[i], ele[i]);
}
jsonArray.add(jsonObject);
});
}*/
List<Map<String, Object>> jsonArray = new ArrayList<>();
if (CollectionUtils.isNotEmpty(data)) {
jsonArray = data.stream().map(ele -> {
Map<String, Object> map = new HashMap<>();
for (int i = 0; i < ele.length; i++) {
map.put(fieldArray[i], ele[i]);
}
return map;
}).collect(Collectors.toList());
}
JSONArray jsonArray = new JSONArray();
data.forEach(ele -> {
JSONObject jsonObject = new JSONObject();
for (int i = 0; i < ele.length; i++) {
jsonObject.put(fields.get(i).getFieldName(), ele[i]);
}
jsonArray.add(jsonObject);
});
Map<String, Object> map = new HashMap<>();
map.put("fields",fields);
map.put("data",jsonArray);
map.put("fields", fields);
map.put("data", jsonArray);
return map;
}
public void saveTableField(DatasetTable datasetTable) throws Exception {
DataSetTableRequest dataSetTableRequest = new DataSetTableRequest();
BeanUtils.copyBean(dataSetTableRequest, datasetTable);
List<TableFiled> fields = getFields(dataSetTableRequest);
long syncTime = System.currentTimeMillis();
if (CollectionUtils.isNotEmpty(fields)) {
for (int i = 0; i < fields.size(); i++) {
TableFiled filed = fields.get(i);
DatasetTableField datasetTableField = new DatasetTableField();
datasetTableField.setTableId(datasetTable.getId());
datasetTableField.setOriginName(filed.getFieldName());
datasetTableField.setName(filed.getRemarks());
datasetTableField.setType(filed.getFieldType());
datasetTableField.setChecked(true);
datasetTableField.setColumnIndex(i);
datasetTableField.setLastSyncTime(syncTime);
dataSetTableFieldsService.save(datasetTableField);
}
}
}
public String createQuerySQL(String type, String table, String[] fields) {
DatasourceTypes datasourceType = DatasourceTypes.valueOf(type);
switch (datasourceType) {
case mysql:
return MessageFormat.format("SELECT {0} FROM {1}", StringUtils.join(fields, ","), table);
case sqlServer:
return MessageFormat.format("SELECT {0} FROM {1}", StringUtils.join(fields, ","), table);
default:
return MessageFormat.format("SELECT {0} FROM {1}", StringUtils.join(fields, ","), table);
}
}
}

View File

@ -7,11 +7,16 @@ import io.dataease.base.mapper.ext.ExtMenuMapper;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.sys.request.MenuCreateRequest;
import io.dataease.controller.sys.request.MenuDeleteRequest;
import io.dataease.controller.sys.response.MenuNodeResponse;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Service
public class MenuService {
@ -108,5 +113,32 @@ public class MenuService {
return sysMenuMapper.updateByPrimaryKeySelective(sysMenu);
}
public List<MenuNodeResponse> childs(Long pid){
Set<SysMenu> childs = getChilds(nodesByPid(pid), new HashSet());
List<SysMenu> menus = childs.stream().collect(Collectors.toList());
List<MenuNodeResponse> responses = convert(menus);
return responses;
}
private Set<SysMenu> getChilds(List<SysMenu> lists, Set<SysMenu> sets){
lists.forEach(menu -> {
sets.add(menu);
List<SysMenu> kidMenus = nodesByPid(menu.getMenuId());
if (CollectionUtils.isNotEmpty(kidMenus)){
getChilds(kidMenus, sets);
}
});
return sets;
}
public List<MenuNodeResponse> convert(List<SysMenu> menus){
return menus.stream().map(node -> {
MenuNodeResponse menuNodeResponse = BeanUtils.copyBean(new MenuNodeResponse(), node);
menuNodeResponse.setHasChildren(node.getSubCount() > 0);
menuNodeResponse.setTop(node.getPid() == MENU_ROOT_PID);
return menuNodeResponse;
}).collect(Collectors.toList());
}
}

View File

@ -2,14 +2,22 @@ package io.dataease.service.sys;
import io.dataease.base.domain.SysRole;
import io.dataease.base.domain.SysUsersRolesExample;
import io.dataease.base.mapper.SysRoleMapper;
import io.dataease.base.mapper.SysUsersRolesMapper;
import io.dataease.base.mapper.ext.ExtSysRoleMapper;
import io.dataease.controller.sys.request.RoleGridRequest;
import io.dataease.controller.sys.request.RoleMenusRequest;
import io.dataease.controller.sys.response.RoleNodeResponse;
import io.dataease.controller.sys.response.RoleUserItem;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class SysRoleService {
@ -20,6 +28,9 @@ public class SysRoleService {
@Resource
private ExtSysRoleMapper extSysRoleMapper;
@Resource
private SysUsersRolesMapper sysUsersRolesMapper;
public int add(SysRole role){
Long now = System.currentTimeMillis();
@ -35,7 +46,12 @@ public class SysRoleService {
return mapper.updateByPrimaryKey(role);
}
@Transactional
public int delete(Long roleId){
SysUsersRolesExample example = new SysUsersRolesExample();
example.createCriteria().andRoleIdEqualTo(roleId);
sysUsersRolesMapper.deleteByExample(example);//删除用户角色关联关系
extSysRoleMapper.deleteRoleMenu(roleId);//删除菜单角色关联关系
return mapper.deleteByPrimaryKey(roleId);
}
@ -45,4 +61,23 @@ public class SysRoleService {
return result;
}
@Transactional
public int batchSaveRolesMenus(RoleMenusRequest request){
extSysRoleMapper.deleteRoleMenu(request.getRoleId());
List<Map<String, Long>> maps = request.getMenuIds().stream().map(menuId -> {
Map<String, Long> map = new HashMap<>();
map.put("roleId", request.getRoleId());
map.put("menuId", menuId);
return map;
}).collect(Collectors.toList());
return extSysRoleMapper.batchInsertRoleMenu(maps);
}
public List<RoleUserItem> allRoles(){
return extSysRoleMapper.queryAll();
}
}

View File

@ -0,0 +1,125 @@
package io.dataease.service.sys;
import io.dataease.base.domain.SysUser;
import io.dataease.base.domain.SysUserExample;
import io.dataease.base.domain.SysUsersRolesExample;
import io.dataease.base.domain.SysUsersRolesKey;
import io.dataease.base.mapper.SysUserMapper;
import io.dataease.base.mapper.SysUsersRolesMapper;
import io.dataease.base.mapper.ext.ExtSysUserMapper;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.commons.utils.CodingUtil;
import io.dataease.controller.sys.request.SysUserCreateRequest;
import io.dataease.controller.sys.request.UserGridRequest;
import io.dataease.controller.sys.response.SysUserGridResponse;
import io.dataease.controller.sys.response.SysUserRole;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
public class SysUserService {
private final static String DEFAULT_PWD = "DataEase123..";
@Resource
private SysUserMapper sysUserMapper;
@Resource
private SysUsersRolesMapper sysUsersRolesMapper;
@Resource
private ExtSysUserMapper extSysUserMapper;
public List<SysUserGridResponse> query(UserGridRequest request){
List<SysUserGridResponse> lists = extSysUserMapper.query(request);
lists.forEach(item -> {
List<SysUserRole> roles = item.getRoles();
List<Long> roleIds = roles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
item.setRoleIds(roleIds);
});
return lists;
}
@Transactional
public int save(SysUserCreateRequest request){
SysUser user = BeanUtils.copyBean(new SysUser(), request);
long now = System.currentTimeMillis();
user.setCreateTime(now);
user.setUpdateTime(now);
user.setIsAdmin(false);
if (ObjectUtils.isEmpty(user.getPassword()) || StringUtils.equals(user.getPassword(), DEFAULT_PWD)){
user.setPassword(CodingUtil.md5(DEFAULT_PWD));
}else{
user.setPassword(CodingUtil.md5(user.getPassword()));
}
int insert = sysUserMapper.insert(user);
SysUser dbUser = findOne(user);
saveUserRoles(dbUser.getUserId(), request.getRoleIds());//插入用户角色关联
return insert;
}
@Transactional
public int update(SysUserCreateRequest request){
SysUser user = BeanUtils.copyBean(new SysUser(), request);
long now = System.currentTimeMillis();
user.setUpdateTime(now);
deleteUserRoles(user.getUserId());//先删除用户角色关联
saveUserRoles(user.getUserId(), request.getRoleIds());//再插入角色关联
return sysUserMapper.updateByPrimaryKey(user);
}
/**
* 删除用户角色关联
* @param userId
* @return
*/
private int deleteUserRoles(Long userId){
SysUsersRolesExample example = new SysUsersRolesExample();
example.createCriteria().andUserIdEqualTo(userId);
return sysUsersRolesMapper.deleteByExample(example);
}
/**
* 保存用户角色关联
* @param userId
* @param roleIds
*/
private void saveUserRoles(Long userId, List<Long> roleIds){
roleIds.forEach(roleId -> {
SysUsersRolesKey sysUsersRolesKey = new SysUsersRolesKey();
sysUsersRolesKey.setUserId(userId);
sysUsersRolesKey.setRoleId(roleId);
sysUsersRolesMapper.insert(sysUsersRolesKey);
});
}
@Transactional
public int delete(Long userId){
deleteUserRoles(userId);
return sysUserMapper.deleteByPrimaryKey(userId);
}
public SysUser findOne(SysUser user){
if (ObjectUtils.isEmpty(user)) return null;
if (ObjectUtils.isNotEmpty(user.getUserId())){
return sysUserMapper.selectByPrimaryKey(user.getUserId());
}
SysUserExample example = new SysUserExample();
SysUserExample.Criteria criteria = example.createCriteria();
if (ObjectUtils.isNotEmpty(user.getUsername())){
criteria.andUsernameEqualTo(user.getUsername());
List<SysUser> sysUsers = sysUserMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(sysUsers))return sysUsers.get(0);
}
return null;
}
}

View File

@ -61,4 +61,37 @@ CREATE TABLE IF NOT EXISTS `sys_roles_menus` (
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`menu_id`,`role_id`) USING BTREE,
KEY `FKcngg2qadojhi3a651a5adkvbq` (`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色菜单关联';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色菜单关联';
CREATE TABLE IF NOT EXISTS `sys_user` (
`user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`dept_id` bigint(20) DEFAULT NULL COMMENT '部门名称',
`username` varchar(255) DEFAULT NULL COMMENT '用户名',
`nick_name` varchar(255) DEFAULT NULL COMMENT '昵称',
`gender` varchar(2) DEFAULT NULL COMMENT '性别',
`phone` varchar(255) DEFAULT NULL COMMENT '手机号码',
`email` varchar(255) DEFAULT NULL COMMENT '邮箱',
`password` varchar(255) DEFAULT NULL COMMENT '密码',
`is_admin` bit(1) DEFAULT b'0' COMMENT '是否为admin账号',
`enabled` bigint(20) DEFAULT NULL COMMENT '状态1启用、0禁用',
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
`update_by` varchar(255) DEFAULT NULL COMMENT '更新着',
`pwd_reset_time` bigint(13) DEFAULT NULL COMMENT '修改密码的时间',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建日期',
`update_time` bigint(13) DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`user_id`) USING BTREE,
UNIQUE KEY `UK_kpubos9gc2cvtkb0thktkbkes` (`email`) USING BTREE,
UNIQUE KEY `username` (`username`) USING BTREE,
UNIQUE KEY `uniq_username` (`username`),
UNIQUE KEY `uniq_email` (`email`),
KEY `FK5rwmryny6jthaaxkogownknqp` (`dept_id`) USING BTREE,
KEY `inx_enabled` (`enabled`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统用户';
CREATE TABLE IF NOT EXISTS `sys_users_roles` (
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`user_id`,`role_id`) USING BTREE,
KEY `FKq4eq273l04bpu4efj0jd0jb98` (`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户角色关联';

View File

@ -1,12 +1,29 @@
CREATE TABLE IF NOT EXISTS `dataset_table` (
`id` varchar(50) NOT NULL COMMENT 'ID',
`name` varchar(64) NOT NULL COMMENT '表名称',
`scene_id` varchar(50) NOT NULL COMMENT '场景ID',
`data_source_id` varchar(50) NOT NULL COMMENT '数据源ID',
`type` varchar(50) COMMENT 'db,sql,excel,custom',
`info` longtext COMMENT '表原始信息',
`create_by` varchar(50) COMMENT '创建人ID',
`create_time` bigint(13) COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `dataset_table`
(
`id` varchar(50) NOT NULL COMMENT 'ID',
`name` varchar(64) NOT NULL COMMENT '表名称',
`scene_id` varchar(50) NOT NULL COMMENT '场景ID',
`data_source_id` varchar(50) NOT NULL COMMENT '数据源ID',
`type` varchar(50) COMMENT 'db,sql,excel,custom',
`info` longtext COMMENT '表原始信息',
`create_by` varchar(50) COMMENT '创建人ID',
`create_time` bigint(13) COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;
CREATE TABLE IF NOT EXISTS `dataset_table_field`
(
`id` varchar(50) NOT NULL COMMENT 'ID',
`table_id` varchar(50) NOT NULL COMMENT '表ID',
`origin_name` varchar(255) NOT NULL COMMENT '原始名',
`name` varchar(255) NOT NULL COMMENT '字段名',
`type` varchar(50) NOT NULL COMMENT '字段类型',
`checked` tinyint(1) NOT NULL DEFAULT true COMMENT '是否选中',
`column_index` int(10) NOT NULL COMMENT '列位置',
`last_sync_time` bigint(13) COMMENT '同步时间',
PRIMARY KEY (`id`),
KEY `IDX_TABLE_ID` (`table_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;

View File

@ -1,33 +1,33 @@
<template>
<ms-container>
<ms-container>
<ms-aside-container>
<group/>
</ms-aside-container>
<ms-aside-container>
<group/>
</ms-aside-container>
<ms-main-container>
<keep-alive>
<router-view/>
</keep-alive>
</ms-main-container>
</ms-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";
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: "DataSet",
components: {MsMainContainer, MsContainer, MsAsideContainer, MsSettingMenu, MsCurrentUser, Group},
data() {
return {}
}
export default {
name: "DataSet",
components: {MsMainContainer, MsContainer, MsAsideContainer, MsSettingMenu, MsCurrentUser, Group},
data() {
return {}
}
}
</script>
<style scoped>

View File

@ -6,11 +6,11 @@
border
style="width: 100%;">
<el-table-column
width="180px"
min-width="200px"
v-for="field in fields"
:key="field.fieldName"
:prop="field.fieldName"
:label="field.fieldName">
:key="field.originName"
:prop="field.originName"
:label="field.name">
</el-table-column>
</el-table>
</el-col>
@ -26,23 +26,6 @@ export default {
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: {},

View File

@ -7,10 +7,10 @@
{{table.name}}
</span>
<el-row style="float: right">
<el-button size="mini">
<el-button size="mini" @click="edit">
{{$t('dataset.edit')}}
</el-button>
<el-button size="mini">
<el-button size="mini" type="primary">
{{$t('dataset.create_view')}}
</el-button>
</el-row>
@ -21,16 +21,45 @@
<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 :label="$t('dataset.join_view')" name="joinView">
关联视图 TODO
</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 :label="$t('dataset.update_info')" name="updateInfo">
更新信息 TODO
</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-dialog :title="table.name" :visible.sync="editField" :fullscreen="true" :show-close="false">
<el-table :data="tableFields" size="mini" max-height="600px">
<el-table-column property="type" :label="$t('dataset.field_type')" width="100">
</el-table-column>
<el-table-column property="name" :label="$t('dataset.field_name')" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.name" size="mini"></el-input>
</template>
</el-table-column>
<el-table-column property="originName" :label="$t('dataset.field_origin_name')" width="180">
</el-table-column>
<el-table-column property="checked" :label="$t('dataset.field_check')" width="80">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.checked"></el-checkbox>
</template>
</el-table-column>
<!--下面这一列占位-->
<el-table-column property="">
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="closeEdit" size="mini">{{$t('dataset.cancel')}}</el-button>
<el-button type="primary" @click="saveEdit" size="mini">{{$t('dataset.confirm')}}</el-button>
</div>
</el-dialog>
</el-row>
</el-col>
</template>
@ -43,17 +72,18 @@ export default {
components: {TabDataPreview},
data() {
return {
editField: false,
table: {
name: ''
},
fields: [],
data: [],
tabActive: 'dataPreview',
tableFields: []
}
},
computed: {
tableId() {
console.log(this.$store.state.dataset.table);
this.initTable(this.$store.state.dataset.table);
return this.$store.state.dataset.table;
}
@ -90,16 +120,28 @@ export default {
},
initTableFields() {
if (this.table.id) {
this.$post('/dataset/table/getFields', this.table, response => {
});
}
this.$post('/dataset/field/list/' + this.table.id, null, response => {
this.tableFields = response.data;
});
},
initTableData() {
if (this.table.id) {
this.$post('/dataset/table/getData', this.table, response => {
});
}
edit() {
this.editField = true;
//
this.initTableFields();
},
saveEdit() {
console.log(this.tableFields);
this.$post('/dataset/field/batchEdit', this.tableFields, response => {
this.closeEdit();
this.initTable(this.table.id);
})
},
closeEdit() {
this.editField = false;
this.tableFields = [];
},
resetTable() {

View File

@ -124,7 +124,7 @@
</el-row>
<el-divider/>
<el-row>
<el-dropdown style="margin-right: 10px;" size="small" @command="clickAddData">
<el-dropdown style="margin-right: 10px;" size="small" @command="clickAddData" trigger="click">
<el-button type="primary" size="mini" plain>
{{$t('dataset.add_table')}}
</el-button>
@ -178,7 +178,7 @@
</span>
<span>
<span @click.stop style="margin-left: 12px;">
<el-dropdown trigger="click" @command="clickMore">
<el-dropdown trigger="click" @command="clickMore" size="small">
<span class="el-dropdown-link">
<el-button
icon="el-icon-more"
@ -268,11 +268,13 @@ export default {
this.tree(this.groupForm);
this.tableTree();
this.$router.push('/dataset');
this.$store.commit('setTable', null);
},
activated() {
this.tree(this.groupForm);
this.tableTree();
this.$router.push('/dataset');
this.$store.commit('setTable', null);
},
watch: {
// search(val){
@ -523,6 +525,7 @@ export default {
sceneClick(data, node) {
// console.log(data);
this.$store.commit('setTable', null);
this.$store.commit('setTable', data.id);
this.$router.push({
name: 'table',

View File

@ -1,7 +1,8 @@
const DataSet = () => import('@/business/components/dataset/DataSet');
const DataSetHome = () => import('@/business/components/dataset/data/DataHome');
const DataSetAddDB = () => import('@/business/components/dataset/data/AddDB');
const DataSetTable = () => import('@/business/components/dataset/data/ViewTable');
const DataSetAddDB = () => import('@/business/components/dataset/add/AddDB');
// const PerformanceTestHome = () => import('@/business/components/performance/home/PerformanceTestHome')
// const EditPerformanceTest = () => import('@/business/components/performance/test/EditPerformanceTest')
// const PerformanceTestList = () => import('@/business/components/performance/test/PerformanceTestList')

View File

@ -32,6 +32,11 @@ export default {
component: () => import('@/business/components/settings/sys/role'),
meta: {system: true, title: 'commons.role'}
},
{
path: 'sysuser',
component: () => import('@/business/components/settings/sys/user'),
meta: {system: true, title: 'commons.user'}
},
// {
// path: 'systemworkspace',
// component: () => import('@/business/components/settings/system/SystemWorkspace'),

View File

@ -4,12 +4,12 @@
<el-aside width="70%" style="border: 1px solid #eee">
<el-card class="table-card">
<template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" @create="create" :create-tip="$t('user.create')" :title="$t('commons.user')"/>
<ms-table-header :condition.sync="condition" @search="search" @create="create" :create-tip="$t('role.add')" :title="$t('commons.role')"/>
</template>
<el-table border class="adjust-table" :data="tableData" style="width: 100%;">
<el-table border highlight-current-row class="adjust-table" :data="tableData" style="width: 100%;" @row-click="rowClick">
<el-table-column prop="name" label="名称" />
<el-table-column :show-overflow-tooltip="true" width="135px" prop="createTime" label="创建日期">
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
@ -35,9 +35,8 @@
:load="getMenuDatas"
:props="defaultProps"
check-strictly
accordion
show-checkbox
node-key="menuId"
node-key="id"
@check="menuChange"
/>
</el-tab-pane>
@ -45,6 +44,26 @@
</el-tabs>
</el-main>
</el-container>
<el-dialog :close-on-click-modal="false" :title="formType=='add' ? $t('role.add') : $t('role.modify')" :visible.sync="dialogVisible" width="580px" @closed="closeFunc"
:destroy-on-close="true">
<el-form ref="roleForm" inline :model="form" :rules="rule" size="small" label-width="80px">
<el-form-item label="角色名称" prop="name">
<el-input v-model="form.name" style="width: 380px;" />
</el-form-item>
<el-form-item label="描述信息" prop="description">
<el-input v-model="form.description" style="width: 380px;" rows="5" type="textarea" />
</el-form-item>
</el-form>
<template v-slot:footer>
<ms-dialog-footer
@cancel="dialogVisible = false"
@confirm="saveRole('roleForm')"/>
</template>
</el-dialog>
</div>
</template>
@ -55,7 +74,10 @@ import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import {
listenGoBack,
removeGoBackListener
} from "@/common/js/utils";
export default {
name: 'role',
components: {
@ -70,9 +92,12 @@ export default {
return {
result: {},
queryPath: '/api/role/roleGrid',
deletePath: '/user/special/delete/',
createPath: '/user/special/add',
updatePath: '/user/special/update',
deletePath: '/api/role/delete/',
createPath: '/api/role/create',
updatePath: '/api/role/update',
queryMenusPath: '/api/menu/childNodes/',
childMenusPath: '/api/menu/childMenus/',
saveRoleMenusPath: '/api/role/saveRolesMenus',
currentPage: 1,
pageSize: 10,
total: 0,
@ -80,37 +105,147 @@ export default {
tableData: [],
menus: [],
menuIds: [],
defaultProps: {},
activeName: 'second'
defaultProps: { children: 'children', label: 'label' ,isLeaf: 'isLeaf'},
activeName: 'first',
dialogVisible: false,
formType: 'add',
form: {},
rule: {
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
]
},
currentRow: null
};
},
activated() {
this.search();
},
watch: {
currentRow: 'currentRowChange'
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
},
create(){},
create(){
this.form = {}
this.formType = "add";
this.dialogVisible = true
listenGoBack(this.closeFunc)
},
search(){
this.result = this.$post(this.queryPath+ "/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
let data = response.data
this.total = data.itemCount
this.tableData = data.listObject
})
},
edit(row){
this.formType = 'modify'
this.dialogVisible = true
this.form = Object.assign({}, row)
listenGoBack(this.closeFunc)
},
getMenuDatas(node, resolve){
saveRole(roleForm){
this.$refs[roleForm].validate(valid => {
if (valid) {
const url = this.formType=='add' ? this.createPath : this.updatePath
this.result = this.$post(url, this.form, () => {
this.$success(this.$t('commons.save_success'))
this.search();
this.dialogVisible = false
});
} else {
return false;
}
})
},
closeFunc() {
this.dialogVisible = false
removeGoBackListener(this.closeFunc);
},
getMenuDatas(node, resolve){
this.$post(this.queryMenusPath+(node.data.id ? node.data.id : 0), null, (res) => {
const datas = res.data
const nodes = datas.map(data => this.formatNode(data))
resolve && resolve(nodes)
})
},
formatNode(node) {
const result = {
id: node.menuId,
label: node.title,
isLeaf: !node.hasChildren,
children: node.children
}
return result
},
menuChange(menu){
this.$post(this.childMenusPath + menu.id, null, res => {
const childIds = res.data
if (this.menuIds.indexOf(menu.id) !== -1) {
for (let i = 0; i < childIds.length; i++) {
const index = this.menuIds.indexOf(childIds[i])
if (index !== -1) {
this.menuIds.splice(index, 1)
}
}
} else {
for (let i = 0; i < childIds.length; i++) {
const index = this.menuIds.indexOf(childIds[i])
if (index === -1) {
this.menuIds.push(childIds[i])
}
}
}
console.log(this.menuIds)
this.$refs.menu.setCheckedKeys(this.menuIds)
this.saveMenus()
})
},
saveMenus(){
if (!this.currentRow) {
return
}
const param = {roleId: this.currentRow.roleId, menuIds: this.menuIds}
this.$post(this.saveRoleMenusPath, param, res => {
this.search()
})
},
rowClick(row,column, event){
this.currentRow = row
},
currentRowChange(newVal, oldVal){
if (newVal == oldVal) {
return
}
if (!newVal) {
this.menuIds = []
return
}
this.menuIds = newVal.menuIds;
this.$refs.menu.setCheckedKeys(this.menuIds)
},
handleDelete(row){
this.$confirm('确认删除角色['+row.name+']', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const url = this.deletePath+row.roleId
this.$post(url, null, () => {
this.$success(this.$t('commons.modify_success'))
this.search()
});
}).catch(() => {
})
}
}
}

View File

@ -0,0 +1,422 @@
<template>
<div v-loading="result.loading">
<el-card class="table-card">
<template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" @create="create"
:create-tip="$t('user.create')" :title="$t('commons.user')"/>
</template>
<el-table border class="adjust-table" :data="tableData" style="width: 100%">
<el-table-column prop="username" label="ID"/>
<el-table-column prop="nickName" :label="$t('commons.name')" width="200"/>
<el-table-column prop="gender" label="性别" />
<el-table-column :show-overflow-tooltip="true" prop="phone" width="100" label="电话" />
<el-table-column :show-overflow-tooltip="true" width="135" prop="email" :label="$t('commons.email')" />
<el-table-column :show-overflow-tooltip="true" prop="dept" :label="$t('commons.organization')">
<template slot-scope="scope">
<div>{{ scope.row.dept.deptName }}</div>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('commons.status')" width="120">
<template v-slot:default="scope">
<el-switch v-model="scope.row.enabled" inactive-color="#DCDFE6" @change="changeSwitch(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="source" :label="$t('user.source')"/> -->
<el-table-column :label="$t('commons.operating')" min-width="120px">
<template v-slot:default="scope">
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)">
<template v-slot:behind>
<ms-table-operator-button :tip="$t('member.edit_password')" icon="el-icon-s-tools"
type="success" @exec="editPassword(scope.row)" v-if="scope.row.isLocalUser"/>
</template>
</ms-table-operator>
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize" :total="total"/>
</el-card>
<el-dialog append-to-body :close-on-click-modal="false" :title="formType=='add' ? $t('user.create') : $t('user.modify')" :visible.sync="dialogVisible" width="570px" @closed="handleClose"
:destroy-on-close="true">
<el-form ref="createUserForm" :inline="true" :model="form" :rules="rule" size="small" label-width="66px">
<el-form-item label="用户名" prop="username">
<el-input v-model="form.username" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model.number="form.phone" />
</el-form-item>
<el-form-item label="昵称" prop="nickName">
<el-input v-model="form.nickName" />
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" />
</el-form-item>
<el-form-item label="性别">
<el-radio-group v-model="form.gender" style="width: 178px">
<el-radio label="男"></el-radio>
<el-radio label="女"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.enabled" style="width: 140px">
<el-radio label='1'>启用</el-radio>
<el-radio label='0'>停用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="部门" prop="dept">
<treeselect
v-model="form.deptId"
:options="depts"
:load-options="loadDepts"
style="width: 430px"
placeholder="选择部门"
/>
</el-form-item>
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles">
<el-select
v-model="form.roleIds"
style="width: 430px"
multiple
placeholder="请选择"
@remove-tag="deleteTag"
@change="changeRole"
>
<el-option
v-for="item in roles"
:key="item.name"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<ms-dialog-footer
@cancel="dialogVisible = false"
@confirm="createUser('createUserForm')"/>
</template>
</el-dialog>
<!--Changing user password in system settings-->
<el-dialog :close-on-click-modal="false" :title="$t('member.edit_password')" :visible.sync="editPasswordVisible"
width="30%"
:destroy-on-close="true" @close="handleClose" left>
<el-form :model="ruleForm" label-position="right" label-width="120px" size="small" :rules="rule"
ref="editPasswordForm" class="demo-ruleForm">
<el-form-item :label="$t('member.new_password')" prop="newpassword">
<el-input type="password" v-model="ruleForm.newpassword" autocomplete="off" show-password></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="ruleForm.id" autocomplete="off" :disabled="true" style="display:none"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<ms-dialog-footer
@cancel="editPasswordVisible = false"
@confirm="editUserPassword('editPasswordForm')"/>
</span>
</el-dialog>
</div>
</template>
<script>
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import {hasRole, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {ROLE_ADMIN} from "@/common/js/constants";
import {getCurrentUser} from "../../../../common/js/utils";
import {PHONE_REGEX} from "@/common/js/regex";
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: "MsUser",
components: {
MsCreateBox,
MsTablePagination,
MsTableHeader,
MsTableOperator,
MsDialogFooter,
MsTableOperatorButton,
Treeselect
},
data() {
return {
queryPath: '/api/user/userGrid',
deletePath: '/api/user/delete/',
createPath: '/api/user/create',
updatePath: '/api/user/update',
editPasswordPath: '/api/user/password',
result: {},
dialogVisible: false,
editPasswordVisible: false,
multipleSelection: [],
currentPage: 1,
pageSize: 10,
total: 0,
condition: {},
tableData: [],
form: {
roles: [{
id: ''
}]
},
checkPasswordForm: {},
ruleForm: {},
rule: {
id: [
{required: true, message: this.$t('user.input_id'), trigger: 'blur'},
{min: 1, max: 50, message: this.$t('commons.input_limit', [1, 50]), trigger: 'blur'},
{
required: true,
pattern: '^[^\u4e00-\u9fa5]+$',
message: this.$t('user.special_characters_are_not_supported'),
trigger: 'blur'
}
],
name: [
{required: true, message: this.$t('user.input_name'), trigger: 'blur'},
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
{
required: true,
message: this.$t('user.special_characters_are_not_supported'),
trigger: 'blur'
}
],
phone: [
{
pattern: PHONE_REGEX,
message: this.$t('user.mobile_number_format_is_incorrect'),
trigger: 'blur'
}
],
email: [
{required: true, message: this.$t('user.input_email'), trigger: 'blur'},
{
required: true,
pattern: /^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
message: this.$t('user.email_format_is_incorrect'),
trigger: 'blur'
}
],
password: [
{required: true, message: this.$t('user.input_password'), trigger: 'blur'},
{
required: true,
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/,
message: this.$t('member.password_format_is_incorrect'),
trigger: 'blur'
}
],
newpassword: [
{required: true, message: this.$t('user.input_password'), trigger: 'blur'},
{
required: true,
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/,
message: this.$t('member.password_format_is_incorrect'),
trigger: 'blur'
}
]
},
defaultForm: { id: null, username: null, nickName: null, gender: '男', email: null, enabled: '1', deptId: null, phone: null },
depts: null,
roles: [],
roleDatas: [],
userRoles: [],
formType: 'add'
}
},
activated() {
//this.form = Object.assign({}, this.defaultForm);
this.allRoles()
this.search()
},
methods: {
create() {
this.formType = 'add'
this.form = Object.assign({}, this.defaultForm);
this.dialogVisible = true;
listenGoBack(this.handleClose);
},
edit(row) {
this.formType = 'modify'
this.dialogVisible = true;
this.form = Object.assign({}, row);
listenGoBack(this.handleClose);
},
editPassword(row) {
this.editPasswordVisible = true;
this.ruleForm = Object.assign({}, row);
listenGoBack(this.handleClose);
},
del(row) {
this.$confirm(this.$t('user.delete_confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get(this.deletePath + encodeURIComponent(row.userId), () => {
this.$success(this.$t('commons.delete_success'));
this.search();
});
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'));
});
},
createUser(createUserForm) {
this.$refs[createUserForm].validate(valid => {
if (valid) {
const url = this.formType == 'add' ? this.createPat : this.updatePath
this.result = this.$post(url, this.form, () => {
this.$success(this.$t('commons.save_success'));
this.search();
this.dialogVisible = false;
});
} else {
return false;
}
})
},
updateUser(updateUserForm) {
this.$refs[updateUserForm].validate(valid => {
if (valid) {
this.result = this.$post(this.updatePath, this.form, () => {
this.$success(this.$t('commons.modify_success'));
this.dialogVisible = false;
this.search();
});
} else {
return false;
}
})
},
editUserPassword(editPasswordForm) {
this.$refs[editPasswordForm].validate(valid => {
if (valid) {
this.result = this.$post(this.editPasswordPath, this.ruleForm, () => {
this.$success(this.$t('commons.modify_success'));
this.editPasswordVisible = false;
this.search();
window.location.reload();
});
} else {
return false;
}
})
},
search() {
this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
// let url = "/user/special/user/role";
// for (let i = 0; i < this.tableData.length; i++) {
// if (this.tableData[i].id) {
// this.$get(url + '/' + encodeURIComponent(this.tableData[i].id), result => {
// let data = result.data;
// let roles = data.roles;
// // let userRoles = result.userRoles;
// this.$set(this.tableData[i], "roles", roles);
// this.$set(this.tableData[i], "isLocalUser", this.tableData[i].source === 'LOCAL');
// });
// }
// }
})
},
handleClose() {
this.formType = 'add'
this.form = {};
removeGoBackListener(this.handleClose);
this.editPasswordVisible = false;
this.dialogVisible = false;
},
changeSwitch(row) {
this.$post('/api/user/update_status', row, () => {
this.$success(this.$t('commons.modify_success'));
})
},
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_ROOT_OPTIONS) {
let _self = this;
!this.depts && this.$post("api/dept/childNodes/0", null, (res) => {
_self.depts = res.data.map(node => _self.normalizer(node))
callback()
})
}
if (action === LOAD_CHILDREN_OPTIONS) {
let _self = this;
this.$post("api/dept/childNodes/"+parentNode.id, null, (res) => {
parentNode.children = res.data.map(function(obj) {
return _self.normalizer(obj)
})
callback()
})
}
},
normalizer(node) {
if(node.hasChildren){
node.children = null
}
return {
id: node.deptId,
label:node.name,
children:node.children
}
},
deleteTag(value) {
this.userRoles.forEach(function(data, index) {
if (data.id === value) {
this.userRoles.splice(index, value)
}
}.bind(this))
},
changeRole(value) {
this.userRoles = []
value.forEach(function(data, index) {
const role = { id: data }
this.userRoles.push(role)
}.bind(this))
},
allRoles(){
this.$post("/api/role/all", null, res => {
this.roles = res.data
})
}
}
}
</script>
<style scoped>
</style>

View File

@ -1549,6 +1549,12 @@ export default {
table:'Table',
edit: 'Edit',
create_view: 'Create View',
data_preview:'Data Preview'
data_preview:'Data Preview',
field_type:'Field Type',
field_name:'Field Name',
field_origin_name:'Origin Name',
field_check:'Checked',
update_info:'Update Info',
join_view: 'Relation View'
}
};

View File

@ -385,6 +385,8 @@ export default {
test_user: '测试人员',
test_viewer: '只读用户',
add: '添加角色',
delete: '删除角色',
modify: '修改角色',
},
report: {
api_test_report: '接口测试报告',
@ -1588,8 +1590,14 @@ export default {
pls_slc_data_source: '请选择数据库连接',
table: '表',
edit: '编辑',
create_view: '创建试图',
data_preview:'数据预览'
create_view: '创建视图',
data_preview: '数据预览',
field_type: '字段类型',
field_name: '字段名',
field_origin_name: '原始名',
field_check: '选中',
update_info: '更新信息',
join_view: '关联视图'
},
datasource: {
create: '新建数据连接',

View File

@ -1549,7 +1549,13 @@ export default {
pls_slc_data_source:'請選擇數據庫連接',
table:'表',
edit: '編輯',
create_view: '創建試圖',
data_preview:'數據預覽'
create_view: '創建視圖',
data_preview:'數據預覽',
field_type:'字段類型',
field_name:'字段名',
field_origin_name:'原始名',
field_check:'選中',
update_info:'更新信息',
join_view: '關聯視圖'
}
};