diff --git a/backend/src/main/java/io/dataease/base/domain/SysMenu.java b/backend/src/main/java/io/dataease/base/domain/SysMenu.java new file mode 100644 index 0000000000..b103528cb9 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMenu.java @@ -0,0 +1,45 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class SysMenu implements Serializable { + private Long menuId; + + private Long pid; + + private Integer subCount; + + private Integer type; + + private String title; + + private String name; + + private String component; + + private Integer menuSort; + + private String icon; + + private String path; + + private Boolean iFrame; + + private Boolean cache; + + private Boolean hidden; + + private String permission; + + private String createBy; + + private String updateBy; + + private Long createTime; + + private Long updateTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/SysMenuExample.java b/backend/src/main/java/io/dataease/base/domain/SysMenuExample.java new file mode 100644 index 0000000000..568db3af27 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMenuExample.java @@ -0,0 +1,1360 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class SysMenuExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysMenuExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andMenuIdIsNull() { + addCriterion("menu_id is null"); + return (Criteria) this; + } + + public Criteria andMenuIdIsNotNull() { + addCriterion("menu_id is not null"); + return (Criteria) this; + } + + public Criteria andMenuIdEqualTo(Long value) { + addCriterion("menu_id =", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotEqualTo(Long value) { + addCriterion("menu_id <>", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdGreaterThan(Long value) { + addCriterion("menu_id >", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdGreaterThanOrEqualTo(Long value) { + addCriterion("menu_id >=", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdLessThan(Long value) { + addCriterion("menu_id <", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdLessThanOrEqualTo(Long value) { + addCriterion("menu_id <=", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdIn(List values) { + addCriterion("menu_id in", values, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotIn(List values) { + addCriterion("menu_id not in", values, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdBetween(Long value1, Long value2) { + addCriterion("menu_id between", value1, value2, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotBetween(Long value1, Long value2) { + addCriterion("menu_id not between", value1, value2, "menuId"); + return (Criteria) this; + } + + public Criteria andPidIsNull() { + addCriterion("pid is null"); + return (Criteria) this; + } + + public Criteria andPidIsNotNull() { + addCriterion("pid is not null"); + return (Criteria) this; + } + + public Criteria andPidEqualTo(Long value) { + addCriterion("pid =", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidNotEqualTo(Long value) { + addCriterion("pid <>", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidGreaterThan(Long value) { + addCriterion("pid >", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidGreaterThanOrEqualTo(Long value) { + addCriterion("pid >=", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidLessThan(Long value) { + addCriterion("pid <", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidLessThanOrEqualTo(Long value) { + addCriterion("pid <=", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidIn(List values) { + addCriterion("pid in", values, "pid"); + return (Criteria) this; + } + + public Criteria andPidNotIn(List values) { + addCriterion("pid not in", values, "pid"); + return (Criteria) this; + } + + public Criteria andPidBetween(Long value1, Long value2) { + addCriterion("pid between", value1, value2, "pid"); + return (Criteria) this; + } + + public Criteria andPidNotBetween(Long value1, Long value2) { + addCriterion("pid not between", value1, value2, "pid"); + return (Criteria) this; + } + + public Criteria andSubCountIsNull() { + addCriterion("sub_count is null"); + return (Criteria) this; + } + + public Criteria andSubCountIsNotNull() { + addCriterion("sub_count is not null"); + return (Criteria) this; + } + + public Criteria andSubCountEqualTo(Integer value) { + addCriterion("sub_count =", value, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountNotEqualTo(Integer value) { + addCriterion("sub_count <>", value, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountGreaterThan(Integer value) { + addCriterion("sub_count >", value, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountGreaterThanOrEqualTo(Integer value) { + addCriterion("sub_count >=", value, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountLessThan(Integer value) { + addCriterion("sub_count <", value, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountLessThanOrEqualTo(Integer value) { + addCriterion("sub_count <=", value, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountIn(List values) { + addCriterion("sub_count in", values, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountNotIn(List values) { + addCriterion("sub_count not in", values, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountBetween(Integer value1, Integer value2) { + addCriterion("sub_count between", value1, value2, "subCount"); + return (Criteria) this; + } + + public Criteria andSubCountNotBetween(Integer value1, Integer value2) { + addCriterion("sub_count not between", value1, value2, "subCount"); + 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(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTitleIsNull() { + addCriterion("title is null"); + return (Criteria) this; + } + + public Criteria andTitleIsNotNull() { + addCriterion("title is not null"); + return (Criteria) this; + } + + public Criteria andTitleEqualTo(String value) { + addCriterion("title =", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotEqualTo(String value) { + addCriterion("title <>", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThan(String value) { + addCriterion("title >", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThanOrEqualTo(String value) { + addCriterion("title >=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThan(String value) { + addCriterion("title <", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThanOrEqualTo(String value) { + addCriterion("title <=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLike(String value) { + addCriterion("title like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotLike(String value) { + addCriterion("title not like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleIn(List values) { + addCriterion("title in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotIn(List values) { + addCriterion("title not in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleBetween(String value1, String value2) { + addCriterion("title between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotBetween(String value1, String value2) { + addCriterion("title not between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andComponentIsNull() { + addCriterion("component is null"); + return (Criteria) this; + } + + public Criteria andComponentIsNotNull() { + addCriterion("component is not null"); + return (Criteria) this; + } + + public Criteria andComponentEqualTo(String value) { + addCriterion("component =", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotEqualTo(String value) { + addCriterion("component <>", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentGreaterThan(String value) { + addCriterion("component >", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentGreaterThanOrEqualTo(String value) { + addCriterion("component >=", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLessThan(String value) { + addCriterion("component <", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLessThanOrEqualTo(String value) { + addCriterion("component <=", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLike(String value) { + addCriterion("component like", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotLike(String value) { + addCriterion("component not like", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentIn(List values) { + addCriterion("component in", values, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotIn(List values) { + addCriterion("component not in", values, "component"); + return (Criteria) this; + } + + public Criteria andComponentBetween(String value1, String value2) { + addCriterion("component between", value1, value2, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotBetween(String value1, String value2) { + addCriterion("component not between", value1, value2, "component"); + return (Criteria) this; + } + + public Criteria andMenuSortIsNull() { + addCriterion("menu_sort is null"); + return (Criteria) this; + } + + public Criteria andMenuSortIsNotNull() { + addCriterion("menu_sort is not null"); + return (Criteria) this; + } + + public Criteria andMenuSortEqualTo(Integer value) { + addCriterion("menu_sort =", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortNotEqualTo(Integer value) { + addCriterion("menu_sort <>", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortGreaterThan(Integer value) { + addCriterion("menu_sort >", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortGreaterThanOrEqualTo(Integer value) { + addCriterion("menu_sort >=", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortLessThan(Integer value) { + addCriterion("menu_sort <", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortLessThanOrEqualTo(Integer value) { + addCriterion("menu_sort <=", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortIn(List values) { + addCriterion("menu_sort in", values, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortNotIn(List values) { + addCriterion("menu_sort not in", values, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortBetween(Integer value1, Integer value2) { + addCriterion("menu_sort between", value1, value2, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortNotBetween(Integer value1, Integer value2) { + addCriterion("menu_sort not between", value1, value2, "menuSort"); + return (Criteria) this; + } + + public Criteria andIconIsNull() { + addCriterion("icon is null"); + return (Criteria) this; + } + + public Criteria andIconIsNotNull() { + addCriterion("icon is not null"); + return (Criteria) this; + } + + public Criteria andIconEqualTo(String value) { + addCriterion("icon =", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotEqualTo(String value) { + addCriterion("icon <>", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconGreaterThan(String value) { + addCriterion("icon >", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconGreaterThanOrEqualTo(String value) { + addCriterion("icon >=", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLessThan(String value) { + addCriterion("icon <", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLessThanOrEqualTo(String value) { + addCriterion("icon <=", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLike(String value) { + addCriterion("icon like", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotLike(String value) { + addCriterion("icon not like", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconIn(List values) { + addCriterion("icon in", values, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotIn(List values) { + addCriterion("icon not in", values, "icon"); + return (Criteria) this; + } + + public Criteria andIconBetween(String value1, String value2) { + addCriterion("icon between", value1, value2, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotBetween(String value1, String value2) { + addCriterion("icon not between", value1, value2, "icon"); + return (Criteria) this; + } + + public Criteria andPathIsNull() { + addCriterion("`path` is null"); + return (Criteria) this; + } + + public Criteria andPathIsNotNull() { + addCriterion("`path` is not null"); + return (Criteria) this; + } + + public Criteria andPathEqualTo(String value) { + addCriterion("`path` =", value, "path"); + return (Criteria) this; + } + + public Criteria andPathNotEqualTo(String value) { + addCriterion("`path` <>", value, "path"); + return (Criteria) this; + } + + public Criteria andPathGreaterThan(String value) { + addCriterion("`path` >", value, "path"); + return (Criteria) this; + } + + public Criteria andPathGreaterThanOrEqualTo(String value) { + addCriterion("`path` >=", value, "path"); + return (Criteria) this; + } + + public Criteria andPathLessThan(String value) { + addCriterion("`path` <", value, "path"); + return (Criteria) this; + } + + public Criteria andPathLessThanOrEqualTo(String value) { + addCriterion("`path` <=", value, "path"); + return (Criteria) this; + } + + public Criteria andPathLike(String value) { + addCriterion("`path` like", value, "path"); + return (Criteria) this; + } + + public Criteria andPathNotLike(String value) { + addCriterion("`path` not like", value, "path"); + return (Criteria) this; + } + + public Criteria andPathIn(List values) { + addCriterion("`path` in", values, "path"); + return (Criteria) this; + } + + public Criteria andPathNotIn(List values) { + addCriterion("`path` not in", values, "path"); + return (Criteria) this; + } + + public Criteria andPathBetween(String value1, String value2) { + addCriterion("`path` between", value1, value2, "path"); + return (Criteria) this; + } + + public Criteria andPathNotBetween(String value1, String value2) { + addCriterion("`path` not between", value1, value2, "path"); + return (Criteria) this; + } + + public Criteria andIFrameIsNull() { + addCriterion("i_frame is null"); + return (Criteria) this; + } + + public Criteria andIFrameIsNotNull() { + addCriterion("i_frame is not null"); + return (Criteria) this; + } + + public Criteria andIFrameEqualTo(Boolean value) { + addCriterion("i_frame =", value, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameNotEqualTo(Boolean value) { + addCriterion("i_frame <>", value, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameGreaterThan(Boolean value) { + addCriterion("i_frame >", value, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameGreaterThanOrEqualTo(Boolean value) { + addCriterion("i_frame >=", value, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameLessThan(Boolean value) { + addCriterion("i_frame <", value, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameLessThanOrEqualTo(Boolean value) { + addCriterion("i_frame <=", value, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameIn(List values) { + addCriterion("i_frame in", values, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameNotIn(List values) { + addCriterion("i_frame not in", values, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameBetween(Boolean value1, Boolean value2) { + addCriterion("i_frame between", value1, value2, "iFrame"); + return (Criteria) this; + } + + public Criteria andIFrameNotBetween(Boolean value1, Boolean value2) { + addCriterion("i_frame not between", value1, value2, "iFrame"); + return (Criteria) this; + } + + public Criteria andCacheIsNull() { + addCriterion("`cache` is null"); + return (Criteria) this; + } + + public Criteria andCacheIsNotNull() { + addCriterion("`cache` is not null"); + return (Criteria) this; + } + + public Criteria andCacheEqualTo(Boolean value) { + addCriterion("`cache` =", value, "cache"); + return (Criteria) this; + } + + public Criteria andCacheNotEqualTo(Boolean value) { + addCriterion("`cache` <>", value, "cache"); + return (Criteria) this; + } + + public Criteria andCacheGreaterThan(Boolean value) { + addCriterion("`cache` >", value, "cache"); + return (Criteria) this; + } + + public Criteria andCacheGreaterThanOrEqualTo(Boolean value) { + addCriterion("`cache` >=", value, "cache"); + return (Criteria) this; + } + + public Criteria andCacheLessThan(Boolean value) { + addCriterion("`cache` <", value, "cache"); + return (Criteria) this; + } + + public Criteria andCacheLessThanOrEqualTo(Boolean value) { + addCriterion("`cache` <=", value, "cache"); + return (Criteria) this; + } + + public Criteria andCacheIn(List values) { + addCriterion("`cache` in", values, "cache"); + return (Criteria) this; + } + + public Criteria andCacheNotIn(List values) { + addCriterion("`cache` not in", values, "cache"); + return (Criteria) this; + } + + public Criteria andCacheBetween(Boolean value1, Boolean value2) { + addCriterion("`cache` between", value1, value2, "cache"); + return (Criteria) this; + } + + public Criteria andCacheNotBetween(Boolean value1, Boolean value2) { + addCriterion("`cache` not between", value1, value2, "cache"); + return (Criteria) this; + } + + public Criteria andHiddenIsNull() { + addCriterion("hidden is null"); + return (Criteria) this; + } + + public Criteria andHiddenIsNotNull() { + addCriterion("hidden is not null"); + return (Criteria) this; + } + + public Criteria andHiddenEqualTo(Boolean value) { + addCriterion("hidden =", value, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenNotEqualTo(Boolean value) { + addCriterion("hidden <>", value, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenGreaterThan(Boolean value) { + addCriterion("hidden >", value, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenGreaterThanOrEqualTo(Boolean value) { + addCriterion("hidden >=", value, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenLessThan(Boolean value) { + addCriterion("hidden <", value, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenLessThanOrEqualTo(Boolean value) { + addCriterion("hidden <=", value, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenIn(List values) { + addCriterion("hidden in", values, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenNotIn(List values) { + addCriterion("hidden not in", values, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenBetween(Boolean value1, Boolean value2) { + addCriterion("hidden between", value1, value2, "hidden"); + return (Criteria) this; + } + + public Criteria andHiddenNotBetween(Boolean value1, Boolean value2) { + addCriterion("hidden not between", value1, value2, "hidden"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andCreateByIsNull() { + addCriterion("create_by is null"); + return (Criteria) this; + } + + public Criteria andCreateByIsNotNull() { + addCriterion("create_by is not null"); + return (Criteria) this; + } + + public Criteria andCreateByEqualTo(String value) { + addCriterion("create_by =", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotEqualTo(String value) { + addCriterion("create_by <>", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThan(String value) { + addCriterion("create_by >", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThanOrEqualTo(String value) { + addCriterion("create_by >=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThan(String value) { + addCriterion("create_by <", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThanOrEqualTo(String value) { + addCriterion("create_by <=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLike(String value) { + addCriterion("create_by like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotLike(String value) { + addCriterion("create_by not like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByIn(List values) { + addCriterion("create_by in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotIn(List values) { + addCriterion("create_by not in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByBetween(String value1, String value2) { + addCriterion("create_by between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotBetween(String value1, String value2) { + addCriterion("create_by not between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andUpdateByIsNull() { + addCriterion("update_by is null"); + return (Criteria) this; + } + + public Criteria andUpdateByIsNotNull() { + addCriterion("update_by is not null"); + return (Criteria) this; + } + + public Criteria andUpdateByEqualTo(String value) { + addCriterion("update_by =", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotEqualTo(String value) { + addCriterion("update_by <>", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByGreaterThan(String value) { + addCriterion("update_by >", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByGreaterThanOrEqualTo(String value) { + addCriterion("update_by >=", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLessThan(String value) { + addCriterion("update_by <", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLessThanOrEqualTo(String value) { + addCriterion("update_by <=", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLike(String value) { + addCriterion("update_by like", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotLike(String value) { + addCriterion("update_by not like", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByIn(List values) { + addCriterion("update_by in", values, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotIn(List values) { + addCriterion("update_by not in", values, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByBetween(String value1, String value2) { + addCriterion("update_by between", value1, value2, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotBetween(String value1, String value2) { + addCriterion("update_by not between", value1, value2, "updateBy"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/SysMenuMapper.java b/backend/src/main/java/io/dataease/base/mapper/SysMenuMapper.java new file mode 100644 index 0000000000..94501b6600 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/SysMenuMapper.java @@ -0,0 +1,30 @@ +package io.dataease.base.mapper; + +import io.dataease.base.domain.SysMenu; +import io.dataease.base.domain.SysMenuExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysMenuMapper { + long countByExample(SysMenuExample example); + + int deleteByExample(SysMenuExample example); + + int deleteByPrimaryKey(Long menuId); + + int insert(SysMenu record); + + int insertSelective(SysMenu record); + + List selectByExample(SysMenuExample example); + + SysMenu selectByPrimaryKey(Long menuId); + + int updateByExampleSelective(@Param("record") SysMenu record, @Param("example") SysMenuExample example); + + int updateByExample(@Param("record") SysMenu record, @Param("example") SysMenuExample example); + + int updateByPrimaryKeySelective(SysMenu record); + + int updateByPrimaryKey(SysMenu record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/SysMenuMapper.xml b/backend/src/main/java/io/dataease/base/mapper/SysMenuMapper.xml new file mode 100644 index 0000000000..83c01e5890 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/SysMenuMapper.xml @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + menu_id, pid, sub_count, `type`, title, `name`, component, menu_sort, icon, `path`, + i_frame, `cache`, hidden, permission, create_by, update_by, create_time, update_time + + + + + delete from sys_menu + where menu_id = #{menuId,jdbcType=BIGINT} + + + delete from sys_menu + + + + + + insert into sys_menu (menu_id, pid, sub_count, + `type`, title, `name`, + component, menu_sort, icon, + `path`, i_frame, `cache`, hidden, + permission, create_by, update_by, + create_time, update_time) + values (#{menuId,jdbcType=BIGINT}, #{pid,jdbcType=BIGINT}, #{subCount,jdbcType=INTEGER}, + #{type,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{component,jdbcType=VARCHAR}, #{menuSort,jdbcType=INTEGER}, #{icon,jdbcType=VARCHAR}, + #{path,jdbcType=VARCHAR}, #{iFrame,jdbcType=BIT}, #{cache,jdbcType=BIT}, #{hidden,jdbcType=BIT}, + #{permission,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}) + + + insert into sys_menu + + + menu_id, + + + pid, + + + sub_count, + + + `type`, + + + title, + + + `name`, + + + component, + + + menu_sort, + + + icon, + + + `path`, + + + i_frame, + + + `cache`, + + + hidden, + + + permission, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{menuId,jdbcType=BIGINT}, + + + #{pid,jdbcType=BIGINT}, + + + #{subCount,jdbcType=INTEGER}, + + + #{type,jdbcType=INTEGER}, + + + #{title,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{component,jdbcType=VARCHAR}, + + + #{menuSort,jdbcType=INTEGER}, + + + #{icon,jdbcType=VARCHAR}, + + + #{path,jdbcType=VARCHAR}, + + + #{iFrame,jdbcType=BIT}, + + + #{cache,jdbcType=BIT}, + + + #{hidden,jdbcType=BIT}, + + + #{permission,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + + + + update sys_menu + + + menu_id = #{record.menuId,jdbcType=BIGINT}, + + + pid = #{record.pid,jdbcType=BIGINT}, + + + sub_count = #{record.subCount,jdbcType=INTEGER}, + + + `type` = #{record.type,jdbcType=INTEGER}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + component = #{record.component,jdbcType=VARCHAR}, + + + menu_sort = #{record.menuSort,jdbcType=INTEGER}, + + + icon = #{record.icon,jdbcType=VARCHAR}, + + + `path` = #{record.path,jdbcType=VARCHAR}, + + + i_frame = #{record.iFrame,jdbcType=BIT}, + + + `cache` = #{record.cache,jdbcType=BIT}, + + + hidden = #{record.hidden,jdbcType=BIT}, + + + permission = #{record.permission,jdbcType=VARCHAR}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + update_by = #{record.updateBy,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + + + + + + update sys_menu + set menu_id = #{record.menuId,jdbcType=BIGINT}, + pid = #{record.pid,jdbcType=BIGINT}, + sub_count = #{record.subCount,jdbcType=INTEGER}, + `type` = #{record.type,jdbcType=INTEGER}, + title = #{record.title,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + component = #{record.component,jdbcType=VARCHAR}, + menu_sort = #{record.menuSort,jdbcType=INTEGER}, + icon = #{record.icon,jdbcType=VARCHAR}, + `path` = #{record.path,jdbcType=VARCHAR}, + i_frame = #{record.iFrame,jdbcType=BIT}, + `cache` = #{record.cache,jdbcType=BIT}, + hidden = #{record.hidden,jdbcType=BIT}, + permission = #{record.permission,jdbcType=VARCHAR}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + update_by = #{record.updateBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update sys_menu + + + pid = #{pid,jdbcType=BIGINT}, + + + sub_count = #{subCount,jdbcType=INTEGER}, + + + `type` = #{type,jdbcType=INTEGER}, + + + title = #{title,jdbcType=VARCHAR}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + component = #{component,jdbcType=VARCHAR}, + + + menu_sort = #{menuSort,jdbcType=INTEGER}, + + + icon = #{icon,jdbcType=VARCHAR}, + + + `path` = #{path,jdbcType=VARCHAR}, + + + i_frame = #{iFrame,jdbcType=BIT}, + + + `cache` = #{cache,jdbcType=BIT}, + + + hidden = #{hidden,jdbcType=BIT}, + + + permission = #{permission,jdbcType=VARCHAR}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + where menu_id = #{menuId,jdbcType=BIGINT} + + + update sys_menu + set pid = #{pid,jdbcType=BIGINT}, + sub_count = #{subCount,jdbcType=INTEGER}, + `type` = #{type,jdbcType=INTEGER}, + title = #{title,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, + component = #{component,jdbcType=VARCHAR}, + menu_sort = #{menuSort,jdbcType=INTEGER}, + icon = #{icon,jdbcType=VARCHAR}, + `path` = #{path,jdbcType=VARCHAR}, + i_frame = #{iFrame,jdbcType=BIT}, + `cache` = #{cache,jdbcType=BIT}, + hidden = #{hidden,jdbcType=BIT}, + permission = #{permission,jdbcType=VARCHAR}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} + where menu_id = #{menuId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtMenuMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtMenuMapper.java new file mode 100644 index 0000000000..ff36fa674b --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtMenuMapper.java @@ -0,0 +1,15 @@ +package io.dataease.base.mapper.ext; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Update; + +@Mapper +public interface ExtMenuMapper { + + @Update(" update sys_menu set sub_count = sub_count+1 where menu_id = #{menuId} ") + int incrementalSubcount(@Param("deptId") Long menuId); + + @Update(" update sys_menu set sub_count = sub_count-1 where menu_id = #{menuId} and sub_count > 0") + int decreasingSubcount(@Param("deptId") Long menuId); +} diff --git a/backend/src/main/java/io/dataease/controller/sys/SysMenuController.java b/backend/src/main/java/io/dataease/controller/sys/SysMenuController.java new file mode 100644 index 0000000000..f454aa5c0f --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/sys/SysMenuController.java @@ -0,0 +1,59 @@ +package io.dataease.controller.sys; + + +import io.dataease.base.domain.SysMenu; +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 io.dataease.service.sys.MenuService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + +@RestController +@RequiredArgsConstructor +@Api(tags = "系统:菜单管理") +@RequestMapping("/api/menu") +public class SysMenuController { + + @Resource + private MenuService menuService; + + @ApiOperation("查询跟节点菜单") + @PostMapping("/childNodes/{pid}") + public List childNodes(@PathVariable("pid") Long pid){ + List nodes = menuService.nodesByPid(pid); + List 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; + } + + @ApiOperation("新增菜单") + @PostMapping("/create") + public void create(@RequestBody MenuCreateRequest request){ + menuService.add(request); + } + + @ApiOperation("删除菜单") + @PostMapping("/delete") + public void delete(@RequestBody MenuDeleteRequest request){ + menuService.delete(request); + } + @ApiOperation("更新菜单") + @PostMapping("/update") + public void update(@RequestBody MenuCreateRequest menu){ + menuService.update(menu); + } + + +} diff --git a/backend/src/main/java/io/dataease/controller/sys/request/MenuCreateRequest.java b/backend/src/main/java/io/dataease/controller/sys/request/MenuCreateRequest.java new file mode 100644 index 0000000000..aaeb55b0cf --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/sys/request/MenuCreateRequest.java @@ -0,0 +1,10 @@ +package io.dataease.controller.sys.request; + +import io.dataease.base.domain.SysMenu; +import lombok.Data; + +@Data +public class MenuCreateRequest extends SysMenu { + + private boolean top; +} diff --git a/backend/src/main/java/io/dataease/controller/sys/request/MenuDeleteRequest.java b/backend/src/main/java/io/dataease/controller/sys/request/MenuDeleteRequest.java new file mode 100644 index 0000000000..6aad45e5a4 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/sys/request/MenuDeleteRequest.java @@ -0,0 +1,11 @@ +package io.dataease.controller.sys.request; + +import lombok.Data; + +@Data +public class MenuDeleteRequest { + + private Long menuId; + + private Long pid; +} diff --git a/backend/src/main/java/io/dataease/controller/sys/response/MenuNodeResponse.java b/backend/src/main/java/io/dataease/controller/sys/response/MenuNodeResponse.java new file mode 100644 index 0000000000..60fa6f57d4 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/sys/response/MenuNodeResponse.java @@ -0,0 +1,12 @@ +package io.dataease.controller.sys.response; + +import io.dataease.base.domain.SysMenu; +import lombok.Data; + +@Data +public class MenuNodeResponse extends SysMenu { + + private boolean hasChildren; + + private boolean top; +} diff --git a/backend/src/main/java/io/dataease/service/sys/MenuService.java b/backend/src/main/java/io/dataease/service/sys/MenuService.java new file mode 100644 index 0000000000..9b04ee6d0e --- /dev/null +++ b/backend/src/main/java/io/dataease/service/sys/MenuService.java @@ -0,0 +1,112 @@ +package io.dataease.service.sys; + +import io.dataease.base.domain.SysMenu; +import io.dataease.base.domain.SysMenuExample; +import io.dataease.base.mapper.SysMenuMapper; +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 org.apache.commons.lang3.ObjectUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; +import java.util.List; + +@Service +public class MenuService { + + + + private final static Integer DEFAULT_SUBCOUNT = 0; + public final static Long MENU_ROOT_PID = 0L; + + @Resource + private SysMenuMapper sysMenuMapper; + + + @Resource + private ExtMenuMapper extMenuMapper; + + public List nodesByPid(Long pid){ + SysMenuExample example = new SysMenuExample(); + SysMenuExample.Criteria criteria = example.createCriteria(); + if (ObjectUtils.isEmpty(pid)){ + criteria.andPidEqualTo(MENU_ROOT_PID); + }else { + criteria.andPidEqualTo(pid); + } + example.setOrderByClause("menu_sort"); + List sysMenus = sysMenuMapper.selectByExample(example); + return sysMenus; + } + + @Transactional + public boolean add(MenuCreateRequest menuCreateRequest){ + SysMenu sysMenu = BeanUtils.copyBean(new SysMenu(), menuCreateRequest); + if (menuCreateRequest.isTop()){ + sysMenu.setPid(MENU_ROOT_PID); + } + long now = System.currentTimeMillis(); + sysMenu.setCreateTime(now); + sysMenu.setUpdateTime(now); + sysMenu.setCreateBy(null); + sysMenu.setUpdateBy(null); + sysMenu.setSubCount(DEFAULT_SUBCOUNT); + try { + int insert = sysMenuMapper.insert(sysMenu); + Long pid = null; + if ((pid = sysMenu.getPid()) != MENU_ROOT_PID ){ + //这里需要更新上级节点SubCount + extMenuMapper.incrementalSubcount(pid); + } + if (insert == 1){ + return true; + } + }catch (Exception e){ + e.printStackTrace(); + } + return false; + } + + @Transactional + public int delete(MenuDeleteRequest request){ + Long pid = request.getPid(); + if (pid != MENU_ROOT_PID){ + extMenuMapper.decreasingSubcount(pid); + } + Long menuId = request.getMenuId(); + + return sysMenuMapper.deleteByPrimaryKey(menuId); + } + + + + @Transactional + public int update(MenuCreateRequest menuCreateRequest){ + SysMenu sysMenu = BeanUtils.copyBean(new SysMenu(), menuCreateRequest); + if (menuCreateRequest.isTop()){ + sysMenu.setPid(MENU_ROOT_PID); + } + + sysMenu.setUpdateBy(null); + sysMenu.setUpdateTime(System.currentTimeMillis()); + Long menuId = sysMenu.getMenuId(); + SysMenu menu_old = sysMenuMapper.selectByPrimaryKey(menuId); + //如果PID发生了改变 + //判断oldPid是否是跟节点PID ? nothing : parent.subcount-1 + //判断newPid是否是跟节点PID ? nothing : parent.subcount+1 + if (menu_old.getPid() != sysMenu.getPid()){ + Long oldPid = menu_old.getPid(); + if (oldPid != MENU_ROOT_PID){ + extMenuMapper.decreasingSubcount(oldPid); + } + if (sysMenu.getPid() != MENU_ROOT_PID){ + extMenuMapper.incrementalSubcount(sysMenu.getPid()); + } + } + return sysMenuMapper.updateByPrimaryKeySelective(sysMenu); + } + + +} diff --git a/backend/src/main/resources/db/migration/V8__system.sql b/backend/src/main/resources/db/migration/V8__system.sql index 9e0094ff4e..7473ec3193 100644 --- a/backend/src/main/resources/db/migration/V8__system.sql +++ b/backend/src/main/resources/db/migration/V8__system.sql @@ -13,4 +13,30 @@ CREATE TABLE IF NOT EXISTS `sys_dept` ( PRIMARY KEY (`dept_id`) USING BTREE, KEY `inx_pid` (`pid`), KEY `inx_enabled` (`enabled`) -) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='部门'; \ No newline at end of file +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='部门'; + + +CREATE TABLE IF NOT EXISTS `sys_menu` ( + `menu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `pid` bigint(20) DEFAULT NULL COMMENT '上级菜单ID', + `sub_count` int(5) DEFAULT 0 COMMENT '子菜单数目', + `type` int(11) DEFAULT NULL COMMENT '菜单类型', + `title` varchar(255) DEFAULT NULL COMMENT '菜单标题', + `name` varchar(255) DEFAULT NULL COMMENT '组件名称', + `component` varchar(255) DEFAULT NULL COMMENT '组件', + `menu_sort` int(5) DEFAULT NULL COMMENT '排序', + `icon` varchar(255) DEFAULT NULL COMMENT '图标', + `path` varchar(255) DEFAULT NULL COMMENT '链接地址', + `i_frame` bit(1) DEFAULT NULL COMMENT '是否外链', + `cache` bit(1) DEFAULT b'0' COMMENT '缓存', + `hidden` bit(1) DEFAULT b'0' COMMENT '隐藏', + `permission` varchar(255) DEFAULT NULL COMMENT '权限', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建者', + `update_by` varchar(255) DEFAULT NULL COMMENT '更新者', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`menu_id`) USING BTREE, + UNIQUE KEY `uniq_title` (`title`), + UNIQUE KEY `uniq_name` (`name`), + KEY `inx_pid` (`pid`) +) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统菜单'; \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index b49ee6fbc8..c7d883e0b4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,8 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "svgo": "svgo -f src/assets/icons/svg --config=src/assets/icons/svgo.yml" }, "dependencies": { "@ckeditor/ckeditor5-build-classic": "^18.0.0", @@ -47,7 +48,10 @@ "vuedraggable": "^2.24.3", "vuex": "^3.1.2", "xml-js": "^1.6.11", - "yan-progress": "^1.0.3" + "yan-progress": "^1.0.3", + "sass": "^1.26.10", + "sass-loader": "^7.1.0", + "svgo": "1.2.0" }, "devDependencies": { "@vue/cli-plugin-babel": "^4.1.0", diff --git a/frontend/src/assets/icons/index.js b/frontend/src/assets/icons/index.js new file mode 100644 index 0000000000..9a796fbc23 --- /dev/null +++ b/frontend/src/assets/icons/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/business/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/frontend/src/assets/icons/svg/Steve-Jobs.svg b/frontend/src/assets/icons/svg/Steve-Jobs.svg new file mode 100644 index 0000000000..53843e2461 --- /dev/null +++ b/frontend/src/assets/icons/svg/Steve-Jobs.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/alipay.svg b/frontend/src/assets/icons/svg/alipay.svg new file mode 100644 index 0000000000..9138981301 --- /dev/null +++ b/frontend/src/assets/icons/svg/alipay.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/anq.svg b/frontend/src/assets/icons/svg/anq.svg new file mode 100644 index 0000000000..a466608db5 --- /dev/null +++ b/frontend/src/assets/icons/svg/anq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/app.svg b/frontend/src/assets/icons/svg/app.svg new file mode 100644 index 0000000000..0796da3510 --- /dev/null +++ b/frontend/src/assets/icons/svg/app.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/backup.svg b/frontend/src/assets/icons/svg/backup.svg new file mode 100644 index 0000000000..a3272a4697 --- /dev/null +++ b/frontend/src/assets/icons/svg/backup.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/chain.svg b/frontend/src/assets/icons/svg/chain.svg new file mode 100644 index 0000000000..ed3317f4f2 --- /dev/null +++ b/frontend/src/assets/icons/svg/chain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/chart.svg b/frontend/src/assets/icons/svg/chart.svg new file mode 100644 index 0000000000..27728fb0ba --- /dev/null +++ b/frontend/src/assets/icons/svg/chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/codeConsole.svg b/frontend/src/assets/icons/svg/codeConsole.svg new file mode 100644 index 0000000000..672ec6e4e3 --- /dev/null +++ b/frontend/src/assets/icons/svg/codeConsole.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/dashboard.svg b/frontend/src/assets/icons/svg/dashboard.svg new file mode 100644 index 0000000000..5317d37029 --- /dev/null +++ b/frontend/src/assets/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/database.svg b/frontend/src/assets/icons/svg/database.svg new file mode 100644 index 0000000000..7fbad9b802 --- /dev/null +++ b/frontend/src/assets/icons/svg/database.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/date.svg b/frontend/src/assets/icons/svg/date.svg new file mode 100644 index 0000000000..0540e99355 --- /dev/null +++ b/frontend/src/assets/icons/svg/date.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/deploy.svg b/frontend/src/assets/icons/svg/deploy.svg new file mode 100644 index 0000000000..f4a1c56e63 --- /dev/null +++ b/frontend/src/assets/icons/svg/deploy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/dept.svg b/frontend/src/assets/icons/svg/dept.svg new file mode 100644 index 0000000000..894e4bff6c --- /dev/null +++ b/frontend/src/assets/icons/svg/dept.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/dev.svg b/frontend/src/assets/icons/svg/dev.svg new file mode 100644 index 0000000000..ed4d23cf40 --- /dev/null +++ b/frontend/src/assets/icons/svg/dev.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/develop.svg b/frontend/src/assets/icons/svg/develop.svg new file mode 100644 index 0000000000..e189223dd5 --- /dev/null +++ b/frontend/src/assets/icons/svg/develop.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/dictionary.svg b/frontend/src/assets/icons/svg/dictionary.svg new file mode 100644 index 0000000000..6e83c43540 --- /dev/null +++ b/frontend/src/assets/icons/svg/dictionary.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/doc.svg b/frontend/src/assets/icons/svg/doc.svg new file mode 100644 index 0000000000..9160de8c90 --- /dev/null +++ b/frontend/src/assets/icons/svg/doc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/download.svg b/frontend/src/assets/icons/svg/download.svg new file mode 100644 index 0000000000..0243c6a701 --- /dev/null +++ b/frontend/src/assets/icons/svg/download.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/edit.svg b/frontend/src/assets/icons/svg/edit.svg new file mode 100644 index 0000000000..d26101f298 --- /dev/null +++ b/frontend/src/assets/icons/svg/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/education.svg b/frontend/src/assets/icons/svg/education.svg new file mode 100644 index 0000000000..7bfb01d180 --- /dev/null +++ b/frontend/src/assets/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/email.svg b/frontend/src/assets/icons/svg/email.svg new file mode 100644 index 0000000000..f1cf3ae8e7 --- /dev/null +++ b/frontend/src/assets/icons/svg/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/error.svg b/frontend/src/assets/icons/svg/error.svg new file mode 100644 index 0000000000..fd935da9b7 --- /dev/null +++ b/frontend/src/assets/icons/svg/error.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/exit-fullscreen.svg b/frontend/src/assets/icons/svg/exit-fullscreen.svg new file mode 100644 index 0000000000..485c128b61 --- /dev/null +++ b/frontend/src/assets/icons/svg/exit-fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/fullscreen.svg b/frontend/src/assets/icons/svg/fullscreen.svg new file mode 100644 index 0000000000..0e86b6fa80 --- /dev/null +++ b/frontend/src/assets/icons/svg/fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/fwb.svg b/frontend/src/assets/icons/svg/fwb.svg new file mode 100644 index 0000000000..59933fc75d --- /dev/null +++ b/frontend/src/assets/icons/svg/fwb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/github.svg b/frontend/src/assets/icons/svg/github.svg new file mode 100644 index 0000000000..8145e9579f --- /dev/null +++ b/frontend/src/assets/icons/svg/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/gonggao.svg b/frontend/src/assets/icons/svg/gonggao.svg new file mode 100644 index 0000000000..22aed08fdb --- /dev/null +++ b/frontend/src/assets/icons/svg/gonggao.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/icon.svg b/frontend/src/assets/icons/svg/icon.svg new file mode 100644 index 0000000000..82fbdd9808 --- /dev/null +++ b/frontend/src/assets/icons/svg/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/image.svg b/frontend/src/assets/icons/svg/image.svg new file mode 100644 index 0000000000..16d572fd14 --- /dev/null +++ b/frontend/src/assets/icons/svg/image.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/index.svg b/frontend/src/assets/icons/svg/index.svg new file mode 100644 index 0000000000..fdb38269c7 --- /dev/null +++ b/frontend/src/assets/icons/svg/index.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/international.svg b/frontend/src/assets/icons/svg/international.svg new file mode 100644 index 0000000000..e9b56eee2c --- /dev/null +++ b/frontend/src/assets/icons/svg/international.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/ipvisits.svg b/frontend/src/assets/icons/svg/ipvisits.svg new file mode 100644 index 0000000000..4ca473d702 --- /dev/null +++ b/frontend/src/assets/icons/svg/ipvisits.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/java.svg b/frontend/src/assets/icons/svg/java.svg new file mode 100644 index 0000000000..e2effbbf0a --- /dev/null +++ b/frontend/src/assets/icons/svg/java.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/link.svg b/frontend/src/assets/icons/svg/link.svg new file mode 100644 index 0000000000..48197ba4da --- /dev/null +++ b/frontend/src/assets/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/list.svg b/frontend/src/assets/icons/svg/list.svg new file mode 100644 index 0000000000..20259eddb7 --- /dev/null +++ b/frontend/src/assets/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/lock.svg b/frontend/src/assets/icons/svg/lock.svg new file mode 100644 index 0000000000..0f842ea4ec --- /dev/null +++ b/frontend/src/assets/icons/svg/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/log.svg b/frontend/src/assets/icons/svg/log.svg new file mode 100644 index 0000000000..4fefe747c6 --- /dev/null +++ b/frontend/src/assets/icons/svg/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/login.svg b/frontend/src/assets/icons/svg/login.svg new file mode 100644 index 0000000000..cc5a854e09 --- /dev/null +++ b/frontend/src/assets/icons/svg/login.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/markdown.svg b/frontend/src/assets/icons/svg/markdown.svg new file mode 100644 index 0000000000..7cd67475b3 --- /dev/null +++ b/frontend/src/assets/icons/svg/markdown.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/menu.svg b/frontend/src/assets/icons/svg/menu.svg new file mode 100644 index 0000000000..e4360a021f --- /dev/null +++ b/frontend/src/assets/icons/svg/menu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/message.svg b/frontend/src/assets/icons/svg/message.svg new file mode 100644 index 0000000000..14ca81728a --- /dev/null +++ b/frontend/src/assets/icons/svg/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/mnt.svg b/frontend/src/assets/icons/svg/mnt.svg new file mode 100644 index 0000000000..502a7c055f --- /dev/null +++ b/frontend/src/assets/icons/svg/mnt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/money.svg b/frontend/src/assets/icons/svg/money.svg new file mode 100644 index 0000000000..c1580de10e --- /dev/null +++ b/frontend/src/assets/icons/svg/money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/monitor.svg b/frontend/src/assets/icons/svg/monitor.svg new file mode 100644 index 0000000000..fbf0a2f2a7 --- /dev/null +++ b/frontend/src/assets/icons/svg/monitor.svg @@ -0,0 +1 @@ + diff --git a/frontend/src/assets/icons/svg/nested.svg b/frontend/src/assets/icons/svg/nested.svg new file mode 100644 index 0000000000..06713a86c6 --- /dev/null +++ b/frontend/src/assets/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/password.svg b/frontend/src/assets/icons/svg/password.svg new file mode 100644 index 0000000000..4ab451f085 --- /dev/null +++ b/frontend/src/assets/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/people.svg b/frontend/src/assets/icons/svg/people.svg new file mode 100644 index 0000000000..2bd54aeb72 --- /dev/null +++ b/frontend/src/assets/icons/svg/people.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/peoples.svg b/frontend/src/assets/icons/svg/peoples.svg new file mode 100644 index 0000000000..2c911615dc --- /dev/null +++ b/frontend/src/assets/icons/svg/peoples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/permission.svg b/frontend/src/assets/icons/svg/permission.svg new file mode 100644 index 0000000000..c4c7409102 --- /dev/null +++ b/frontend/src/assets/icons/svg/permission.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/phone.svg b/frontend/src/assets/icons/svg/phone.svg new file mode 100644 index 0000000000..da339f978c --- /dev/null +++ b/frontend/src/assets/icons/svg/phone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/qiniu.svg b/frontend/src/assets/icons/svg/qiniu.svg new file mode 100644 index 0000000000..c2f9f8b246 --- /dev/null +++ b/frontend/src/assets/icons/svg/qiniu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/redis.svg b/frontend/src/assets/icons/svg/redis.svg new file mode 100644 index 0000000000..bef111b63e --- /dev/null +++ b/frontend/src/assets/icons/svg/redis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/role.svg b/frontend/src/assets/icons/svg/role.svg new file mode 100644 index 0000000000..76cb18ff3a --- /dev/null +++ b/frontend/src/assets/icons/svg/role.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/search.svg b/frontend/src/assets/icons/svg/search.svg new file mode 100644 index 0000000000..84233ddaa9 --- /dev/null +++ b/frontend/src/assets/icons/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/server.svg b/frontend/src/assets/icons/svg/server.svg new file mode 100644 index 0000000000..db6dcdf59f --- /dev/null +++ b/frontend/src/assets/icons/svg/server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/shopping.svg b/frontend/src/assets/icons/svg/shopping.svg new file mode 100644 index 0000000000..87513e7c5f --- /dev/null +++ b/frontend/src/assets/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/size.svg b/frontend/src/assets/icons/svg/size.svg new file mode 100644 index 0000000000..ddb25b8d58 --- /dev/null +++ b/frontend/src/assets/icons/svg/size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/skill.svg b/frontend/src/assets/icons/svg/skill.svg new file mode 100644 index 0000000000..a3b7312186 --- /dev/null +++ b/frontend/src/assets/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/source.svg b/frontend/src/assets/icons/svg/source.svg new file mode 100644 index 0000000000..1c3a03805d --- /dev/null +++ b/frontend/src/assets/icons/svg/source.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/sqlMonitor.svg b/frontend/src/assets/icons/svg/sqlMonitor.svg new file mode 100644 index 0000000000..950a430d15 --- /dev/null +++ b/frontend/src/assets/icons/svg/sqlMonitor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/swagger.svg b/frontend/src/assets/icons/svg/swagger.svg new file mode 100644 index 0000000000..ded7de81ac --- /dev/null +++ b/frontend/src/assets/icons/svg/swagger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/sys-tools.svg b/frontend/src/assets/icons/svg/sys-tools.svg new file mode 100644 index 0000000000..324aa04f21 --- /dev/null +++ b/frontend/src/assets/icons/svg/sys-tools.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/system.svg b/frontend/src/assets/icons/svg/system.svg new file mode 100644 index 0000000000..9333c60ae8 --- /dev/null +++ b/frontend/src/assets/icons/svg/system.svg @@ -0,0 +1 @@ + diff --git a/frontend/src/assets/icons/svg/system1.svg b/frontend/src/assets/icons/svg/system1.svg new file mode 100644 index 0000000000..37b0a0a8d9 --- /dev/null +++ b/frontend/src/assets/icons/svg/system1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/tab.svg b/frontend/src/assets/icons/svg/tab.svg new file mode 100644 index 0000000000..b4b48e4808 --- /dev/null +++ b/frontend/src/assets/icons/svg/tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/theme.svg b/frontend/src/assets/icons/svg/theme.svg new file mode 100644 index 0000000000..5982a2f784 --- /dev/null +++ b/frontend/src/assets/icons/svg/theme.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/timing.svg b/frontend/src/assets/icons/svg/timing.svg new file mode 100644 index 0000000000..f8fdc6dd0c --- /dev/null +++ b/frontend/src/assets/icons/svg/timing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/tools.svg b/frontend/src/assets/icons/svg/tools.svg new file mode 100644 index 0000000000..aba1a40194 --- /dev/null +++ b/frontend/src/assets/icons/svg/tools.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/tree-table.svg b/frontend/src/assets/icons/svg/tree-table.svg new file mode 100644 index 0000000000..8aafdb829e --- /dev/null +++ b/frontend/src/assets/icons/svg/tree-table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/tree.svg b/frontend/src/assets/icons/svg/tree.svg new file mode 100644 index 0000000000..dd4b7dd22f --- /dev/null +++ b/frontend/src/assets/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/unlock.svg b/frontend/src/assets/icons/svg/unlock.svg new file mode 100644 index 0000000000..1219e41d4b --- /dev/null +++ b/frontend/src/assets/icons/svg/unlock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/user.svg b/frontend/src/assets/icons/svg/user.svg new file mode 100644 index 0000000000..09d7a812b8 --- /dev/null +++ b/frontend/src/assets/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/user1.svg b/frontend/src/assets/icons/svg/user1.svg new file mode 100644 index 0000000000..14ca51e4e5 --- /dev/null +++ b/frontend/src/assets/icons/svg/user1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/validCode.svg b/frontend/src/assets/icons/svg/validCode.svg new file mode 100644 index 0000000000..a1feb74aed --- /dev/null +++ b/frontend/src/assets/icons/svg/validCode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/visits.svg b/frontend/src/assets/icons/svg/visits.svg new file mode 100644 index 0000000000..8425662dac --- /dev/null +++ b/frontend/src/assets/icons/svg/visits.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/web.svg b/frontend/src/assets/icons/svg/web.svg new file mode 100644 index 0000000000..9c574156f5 --- /dev/null +++ b/frontend/src/assets/icons/svg/web.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/wechat.svg b/frontend/src/assets/icons/svg/wechat.svg new file mode 100644 index 0000000000..c586e55117 --- /dev/null +++ b/frontend/src/assets/icons/svg/wechat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/weixin.svg b/frontend/src/assets/icons/svg/weixin.svg new file mode 100644 index 0000000000..8dbcfa5c2a --- /dev/null +++ b/frontend/src/assets/icons/svg/weixin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svg/zujian.svg b/frontend/src/assets/icons/svg/zujian.svg new file mode 100644 index 0000000000..2aba32fc7f --- /dev/null +++ b/frontend/src/assets/icons/svg/zujian.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/icons/svgo.yml b/frontend/src/assets/icons/svgo.yml new file mode 100644 index 0000000000..d11906aec2 --- /dev/null +++ b/frontend/src/assets/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/frontend/src/business/components/IconSelect/index.vue b/frontend/src/business/components/IconSelect/index.vue new file mode 100644 index 0000000000..b0ec9fa1a4 --- /dev/null +++ b/frontend/src/business/components/IconSelect/index.vue @@ -0,0 +1,68 @@ + + + + + + diff --git a/frontend/src/business/components/IconSelect/requireIcons.js b/frontend/src/business/components/IconSelect/requireIcons.js new file mode 100644 index 0000000000..b06348310b --- /dev/null +++ b/frontend/src/business/components/IconSelect/requireIcons.js @@ -0,0 +1,11 @@ + +const req = require.context('../../../assets/icons/svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys() + +const re = /\.\/(.*)\.svg/ + +const icons = requireAll(req).map(i => { + return i.match(re)[1] +}) + +export default icons diff --git a/frontend/src/business/components/SvgIcon/index.vue b/frontend/src/business/components/SvgIcon/index.vue new file mode 100644 index 0000000000..9a3318e5e6 --- /dev/null +++ b/frontend/src/business/components/SvgIcon/index.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/frontend/src/business/components/settings/router.js b/frontend/src/business/components/settings/router.js index 38ba994e9a..89cc3f9b1c 100644 --- a/frontend/src/business/components/settings/router.js +++ b/frontend/src/business/components/settings/router.js @@ -22,6 +22,11 @@ export default { component: () => import('@/business/components/settings/sys/dept'), meta: {system: true, title: 'commons.organization'} }, + { + path: 'menu', + component: () => import('@/business/components/settings/sys/menu'), + meta: {system: true, title: 'commons.menu'} + }, // { // path: 'systemworkspace', // component: () => import('@/business/components/settings/system/SystemWorkspace'), diff --git a/frontend/src/business/components/settings/sys/menu.vue b/frontend/src/business/components/settings/sys/menu.vue new file mode 100644 index 0000000000..5ebc140e3b --- /dev/null +++ b/frontend/src/business/components/settings/sys/menu.vue @@ -0,0 +1,434 @@ + + + + + diff --git a/frontend/src/business/main.js b/frontend/src/business/main.js index ed78b3c9c7..bafc5c80d6 100644 --- a/frontend/src/business/main.js +++ b/frontend/src/business/main.js @@ -3,6 +3,7 @@ import ElementUI from 'element-ui'; import Fit2CloudUI from 'fit2cloud-ui'; import '../assets/theme/index.css'; import icon from "../common/js/icon"; +import '../assets/icons' // icon import filters from "../common/js/filter"; import ajax from "../common/js/ajax"; import App from './App.vue'; diff --git a/frontend/src/common/js/constants.js b/frontend/src/common/js/constants.js index 33e7a474a3..17a4eea5b7 100644 --- a/frontend/src/common/js/constants.js +++ b/frontend/src/common/js/constants.js @@ -16,6 +16,7 @@ export const PROJECT_NAME = 'project_name'; export const REFRESH_SESSION_USER_URL = 'user/refresh'; export const WORKSPACE = 'workspace'; export const ORGANIZATION = 'organization'; +export const MENU = 'menu'; export const DEFAULT = 'default'; export const ZH_CN = 'zh_CN'; diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 08bddcee23..614a8b7618 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -13,6 +13,7 @@ export default { delete_cancelled: 'Delete cancelled', workspace: 'Workspace', organization: 'Organization', + menu: 'Menu', setting: 'Setting', project: 'Project', about_us: 'About Us', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index a03eb0e502..a0d6e3c408 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -14,6 +14,7 @@ export default { delete_cancelled: '已取消删除', workspace: '工作空间', organization: '组织', + menu: '菜单', setting: '设置', project: '项目', about_us: '关于', @@ -242,6 +243,11 @@ export default { special_characters_are_not_supported: '格式错误(不支持特殊字符,且不能以\'-\'开头结尾)', delete_warning: '删除该工作空间将同步删除该工作空间下所有项目,以及项目中的所有用例、接口测试、性能测试等,确定要删除吗?', }, + menu: { + create: '创建菜单', + modify: '修改菜单', + delete: '删除菜单', + }, organization: { create: '创建组织', modify: '修改组织', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 22f979aaf9..c4e5afc17a 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -14,6 +14,7 @@ export default { delete_cancelled: '已取消刪除', workspace: '工作空間', organization: '組織', + menu: '菜單', setting: '設置', project: '項目', about_us: '關於', diff --git a/frontend/src/utils/validate.js b/frontend/src/utils/validate.js new file mode 100644 index 0000000000..6e21835108 --- /dev/null +++ b/frontend/src/utils/validate.js @@ -0,0 +1,169 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) + } + + /** + * @param {string} str + * @returns {Boolean} + */ + export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 + } + + /** + * @param {string} url + * @returns {Boolean} + */ + export function validURL(url) { + const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/ + return reg.test(url) + } + + /** + * @param {string} str + * @returns {Boolean} + */ + export function validLowerCase(str) { + const reg = /^[a-z]+$/ + return reg.test(str) + } + + /** + * @param {string} str + * @returns {Boolean} + */ + export function validUpperCase(str) { + const reg = /^[A-Z]+$/ + return reg.test(str) + } + + /** + * @param {string} str + * @returns {Boolean} + */ + export function validAlphabets(str) { + const reg = /^[A-Za-z]+$/ + return reg.test(str) + } + + /** + * @param {string} email + * @returns {Boolean} + */ + export function validEmail(email) { + const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + return reg.test(email) + } + + export function isvalidPhone(phone) { + const reg = /^1[3|4|5|7|8][0-9]\d{8}$/ + return reg.test(phone) + } + + /** + * @param {string} str + * @returns {Boolean} + */ + export function isString(str) { + if (typeof str === 'string' || str instanceof String) { + return true + } + return false + } + + /** + * @param {Array} arg + * @returns {Boolean} + */ + export function isArray(arg) { + if (typeof Array.isArray === 'undefined') { + return Object.prototype.toString.call(arg) === '[object Array]' + } + return Array.isArray(arg) + } + + /** + * 是否合法IP地址 + * @param rule + * @param value + * @param callback + */ + export function validateIP(rule, value, callback) { + if (value === '' || value === undefined || value == null) { + callback() + } else { + const reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/ + if ((!reg.test(value)) && value !== '') { + callback(new Error('请输入正确的IP地址')) + } else { + callback() + } + } + } + + /* 是否手机号码或者固话*/ + export function validatePhoneTwo(rule, value, callback) { + const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/ + if (value === '' || value === undefined || value == null) { + callback() + } else { + if ((!reg.test(value)) && value !== '') { + callback(new Error('请输入正确的电话号码或者固话号码')) + } else { + callback() + } + } + } + + /* 是否固话*/ + export function validateTelephone(rule, value, callback) { + const reg = /0\d{2}-\d{7,8}/ + if (value === '' || value === undefined || value == null) { + callback() + } else { + if ((!reg.test(value)) && value !== '') { + callback(new Error('请输入正确的固话(格式:区号+号码,如010-1234567)')) + } else { + callback() + } + } + } + + /* 是否手机号码*/ + export function validatePhone(rule, value, callback) { + const reg = /^[1][3,4,5,7,8][0-9]{9}$/ + if (value === '' || value === undefined || value == null) { + callback() + } else { + if ((!reg.test(value)) && value !== '') { + callback(new Error('请输入正确的电话号码')) + } else { + callback() + } + } + } + + /* 是否身份证号码*/ + export function validateIdNo(rule, value, callback) { + const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ + if (value === '' || value === undefined || value == null) { + callback() + } else { + if ((!reg.test(value)) && value !== '') { + callback(new Error('请输入正确的身份证号码')) + } else { + callback() + } + } + } + + \ No newline at end of file