From 25203a6bb80adc0edf67d4632920b7b7371ca87c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 2 Jul 2021 19:19:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=B6=88=E6=81=AF=E4=B8=AD?= =?UTF-8?q?=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/base/domain/SysMsg.java | 27 + .../dataease/base/domain/SysMsgExample.java | 770 ++++++++++++++++++ .../io/dataease/base/mapper/SysMsgMapper.java | 30 + .../io/dataease/base/mapper/SysMsgMapper.xml | 275 +++++++ .../base/mapper/ext/ExtPanelShareMapper.java | 4 + .../base/mapper/ext/ExtPanelShareMapper.xml | 18 + .../controller/message/MsgController.java | 39 + .../controller/message/dto/MsgRequest.java | 13 + .../dataease/service/message/DeMsgutil.java | 41 + .../service/message/SysMsgService.java | 61 ++ .../dataease/service/panel/ShareService.java | 27 +- .../resources/db/migration/V10__web_msg.sql | 19 + frontend/src/api/system/msg.js | 19 + .../src/components/Notification/index.vue | 172 ++++ frontend/src/icons/svg/all-msg.svg | 1 + frontend/src/icons/svg/notification.svg | 1 + frontend/src/icons/svg/readed-msg.svg | 1 + frontend/src/icons/svg/unread-msg.svg | 1 + frontend/src/icons/svg/web-msg.svg | 1 + frontend/src/layout/components/Topbar.vue | 5 +- frontend/src/permission.js | 39 + frontend/src/styles/index.scss | 18 +- frontend/src/styles/sidebar.scss | 4 +- frontend/src/styles/variables.scss | 2 +- frontend/src/utils/webMsg.js | 14 + frontend/src/views/msg/all.vue | 146 ++++ frontend/src/views/msg/index.vue | 21 + frontend/src/views/msg/readed.vue | 141 ++++ frontend/src/views/msg/unread.vue | 147 ++++ frontend/src/views/panel/index.vue | 16 +- frontend/src/views/panel/list/PanelMain.vue | 4 + 31 files changed, 2066 insertions(+), 11 deletions(-) create mode 100644 backend/src/main/java/io/dataease/base/domain/SysMsg.java create mode 100644 backend/src/main/java/io/dataease/base/domain/SysMsgExample.java create mode 100644 backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.java create mode 100644 backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml create mode 100644 backend/src/main/java/io/dataease/controller/message/MsgController.java create mode 100644 backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java create mode 100644 backend/src/main/java/io/dataease/service/message/DeMsgutil.java create mode 100644 backend/src/main/java/io/dataease/service/message/SysMsgService.java create mode 100644 backend/src/main/resources/db/migration/V10__web_msg.sql create mode 100644 frontend/src/api/system/msg.js create mode 100644 frontend/src/components/Notification/index.vue create mode 100644 frontend/src/icons/svg/all-msg.svg create mode 100644 frontend/src/icons/svg/notification.svg create mode 100644 frontend/src/icons/svg/readed-msg.svg create mode 100644 frontend/src/icons/svg/unread-msg.svg create mode 100644 frontend/src/icons/svg/web-msg.svg create mode 100644 frontend/src/utils/webMsg.js create mode 100644 frontend/src/views/msg/all.vue create mode 100644 frontend/src/views/msg/index.vue create mode 100644 frontend/src/views/msg/readed.vue create mode 100644 frontend/src/views/msg/unread.vue diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsg.java b/backend/src/main/java/io/dataease/base/domain/SysMsg.java new file mode 100644 index 0000000000..d18c3eada6 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMsg.java @@ -0,0 +1,27 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class SysMsg implements Serializable { + private Long msgId; + + private Long userId; + + private Integer type; + + private Boolean status; + + private String router; + + private String param; + + private Long createTime; + + private Long readTime; + + private String content; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsgExample.java b/backend/src/main/java/io/dataease/base/domain/SysMsgExample.java new file mode 100644 index 0000000000..60c1d39c54 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMsgExample.java @@ -0,0 +1,770 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class SysMsgExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysMsgExample() { + 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 andMsgIdIsNull() { + addCriterion("msg_id is null"); + return (Criteria) this; + } + + public Criteria andMsgIdIsNotNull() { + addCriterion("msg_id is not null"); + return (Criteria) this; + } + + public Criteria andMsgIdEqualTo(Long value) { + addCriterion("msg_id =", value, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdNotEqualTo(Long value) { + addCriterion("msg_id <>", value, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdGreaterThan(Long value) { + addCriterion("msg_id >", value, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdGreaterThanOrEqualTo(Long value) { + addCriterion("msg_id >=", value, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdLessThan(Long value) { + addCriterion("msg_id <", value, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdLessThanOrEqualTo(Long value) { + addCriterion("msg_id <=", value, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdIn(List values) { + addCriterion("msg_id in", values, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdNotIn(List values) { + addCriterion("msg_id not in", values, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdBetween(Long value1, Long value2) { + addCriterion("msg_id between", value1, value2, "msgId"); + return (Criteria) this; + } + + public Criteria andMsgIdNotBetween(Long value1, Long value2) { + addCriterion("msg_id not between", value1, value2, "msgId"); + return (Criteria) this; + } + + 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 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 andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Boolean value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Boolean value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Boolean value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Boolean value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Boolean value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Boolean value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Boolean value1, Boolean value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Boolean value1, Boolean value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andRouterIsNull() { + addCriterion("router is null"); + return (Criteria) this; + } + + public Criteria andRouterIsNotNull() { + addCriterion("router is not null"); + return (Criteria) this; + } + + public Criteria andRouterEqualTo(String value) { + addCriterion("router =", value, "router"); + return (Criteria) this; + } + + public Criteria andRouterNotEqualTo(String value) { + addCriterion("router <>", value, "router"); + return (Criteria) this; + } + + public Criteria andRouterGreaterThan(String value) { + addCriterion("router >", value, "router"); + return (Criteria) this; + } + + public Criteria andRouterGreaterThanOrEqualTo(String value) { + addCriterion("router >=", value, "router"); + return (Criteria) this; + } + + public Criteria andRouterLessThan(String value) { + addCriterion("router <", value, "router"); + return (Criteria) this; + } + + public Criteria andRouterLessThanOrEqualTo(String value) { + addCriterion("router <=", value, "router"); + return (Criteria) this; + } + + public Criteria andRouterLike(String value) { + addCriterion("router like", value, "router"); + return (Criteria) this; + } + + public Criteria andRouterNotLike(String value) { + addCriterion("router not like", value, "router"); + return (Criteria) this; + } + + public Criteria andRouterIn(List values) { + addCriterion("router in", values, "router"); + return (Criteria) this; + } + + public Criteria andRouterNotIn(List values) { + addCriterion("router not in", values, "router"); + return (Criteria) this; + } + + public Criteria andRouterBetween(String value1, String value2) { + addCriterion("router between", value1, value2, "router"); + return (Criteria) this; + } + + public Criteria andRouterNotBetween(String value1, String value2) { + addCriterion("router not between", value1, value2, "router"); + return (Criteria) this; + } + + public Criteria andParamIsNull() { + addCriterion("param is null"); + return (Criteria) this; + } + + public Criteria andParamIsNotNull() { + addCriterion("param is not null"); + return (Criteria) this; + } + + public Criteria andParamEqualTo(String value) { + addCriterion("param =", value, "param"); + return (Criteria) this; + } + + public Criteria andParamNotEqualTo(String value) { + addCriterion("param <>", value, "param"); + return (Criteria) this; + } + + public Criteria andParamGreaterThan(String value) { + addCriterion("param >", value, "param"); + return (Criteria) this; + } + + public Criteria andParamGreaterThanOrEqualTo(String value) { + addCriterion("param >=", value, "param"); + return (Criteria) this; + } + + public Criteria andParamLessThan(String value) { + addCriterion("param <", value, "param"); + return (Criteria) this; + } + + public Criteria andParamLessThanOrEqualTo(String value) { + addCriterion("param <=", value, "param"); + return (Criteria) this; + } + + public Criteria andParamLike(String value) { + addCriterion("param like", value, "param"); + return (Criteria) this; + } + + public Criteria andParamNotLike(String value) { + addCriterion("param not like", value, "param"); + return (Criteria) this; + } + + public Criteria andParamIn(List values) { + addCriterion("param in", values, "param"); + return (Criteria) this; + } + + public Criteria andParamNotIn(List values) { + addCriterion("param not in", values, "param"); + return (Criteria) this; + } + + public Criteria andParamBetween(String value1, String value2) { + addCriterion("param between", value1, value2, "param"); + return (Criteria) this; + } + + public Criteria andParamNotBetween(String value1, String value2) { + addCriterion("param not between", value1, value2, "param"); + 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 andReadTimeIsNull() { + addCriterion("read_time is null"); + return (Criteria) this; + } + + public Criteria andReadTimeIsNotNull() { + addCriterion("read_time is not null"); + return (Criteria) this; + } + + public Criteria andReadTimeEqualTo(Long value) { + addCriterion("read_time =", value, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeNotEqualTo(Long value) { + addCriterion("read_time <>", value, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeGreaterThan(Long value) { + addCriterion("read_time >", value, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeGreaterThanOrEqualTo(Long value) { + addCriterion("read_time >=", value, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeLessThan(Long value) { + addCriterion("read_time <", value, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeLessThanOrEqualTo(Long value) { + addCriterion("read_time <=", value, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeIn(List values) { + addCriterion("read_time in", values, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeNotIn(List values) { + addCriterion("read_time not in", values, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeBetween(Long value1, Long value2) { + addCriterion("read_time between", value1, value2, "readTime"); + return (Criteria) this; + } + + public Criteria andReadTimeNotBetween(Long value1, Long value2) { + addCriterion("read_time not between", value1, value2, "readTime"); + return (Criteria) this; + } + + public Criteria andContentIsNull() { + addCriterion("content is null"); + return (Criteria) this; + } + + public Criteria andContentIsNotNull() { + addCriterion("content is not null"); + return (Criteria) this; + } + + public Criteria andContentEqualTo(String value) { + addCriterion("content =", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotEqualTo(String value) { + addCriterion("content <>", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThan(String value) { + addCriterion("content >", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThanOrEqualTo(String value) { + addCriterion("content >=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThan(String value) { + addCriterion("content <", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThanOrEqualTo(String value) { + addCriterion("content <=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLike(String value) { + addCriterion("content like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotLike(String value) { + addCriterion("content not like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentIn(List values) { + addCriterion("content in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentNotIn(List values) { + addCriterion("content not in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentBetween(String value1, String value2) { + addCriterion("content between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andContentNotBetween(String value1, String value2) { + addCriterion("content not between", value1, value2, "content"); + 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/SysMsgMapper.java b/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.java new file mode 100644 index 0000000000..8ba7f526c0 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.java @@ -0,0 +1,30 @@ +package io.dataease.base.mapper; + +import io.dataease.base.domain.SysMsg; +import io.dataease.base.domain.SysMsgExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysMsgMapper { + long countByExample(SysMsgExample example); + + int deleteByExample(SysMsgExample example); + + int deleteByPrimaryKey(Long msgId); + + int insert(SysMsg record); + + int insertSelective(SysMsg record); + + List selectByExample(SysMsgExample example); + + SysMsg selectByPrimaryKey(Long msgId); + + int updateByExampleSelective(@Param("record") SysMsg record, @Param("example") SysMsgExample example); + + int updateByExample(@Param("record") SysMsg record, @Param("example") SysMsgExample example); + + int updateByPrimaryKeySelective(SysMsg record); + + int updateByPrimaryKey(SysMsg record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml b/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml new file mode 100644 index 0000000000..d13dafb604 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + 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} + + + + + + + + + + + msg_id, user_id, `type`, `status`, router, param, create_time, read_time, content + + + + + delete from sys_msg + where msg_id = #{msgId,jdbcType=BIGINT} + + + delete from sys_msg + + + + + + insert into sys_msg (msg_id, user_id, `type`, + `status`, router, param, + create_time, read_time, content + ) + values (#{msgId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, + #{status,jdbcType=BIT}, #{router,jdbcType=VARCHAR}, #{param,jdbcType=VARCHAR}, + #{createTime,jdbcType=BIGINT}, #{readTime,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR} + ) + + + insert into sys_msg + + + msg_id, + + + user_id, + + + `type`, + + + `status`, + + + router, + + + param, + + + create_time, + + + read_time, + + + content, + + + + + #{msgId,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{type,jdbcType=INTEGER}, + + + #{status,jdbcType=BIT}, + + + #{router,jdbcType=VARCHAR}, + + + #{param,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{readTime,jdbcType=BIGINT}, + + + #{content,jdbcType=VARCHAR}, + + + + + + update sys_msg + + + msg_id = #{record.msgId,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + `type` = #{record.type,jdbcType=INTEGER}, + + + `status` = #{record.status,jdbcType=BIT}, + + + router = #{record.router,jdbcType=VARCHAR}, + + + param = #{record.param,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + read_time = #{record.readTime,jdbcType=BIGINT}, + + + content = #{record.content,jdbcType=VARCHAR}, + + + + + + + + update sys_msg + set msg_id = #{record.msgId,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + `type` = #{record.type,jdbcType=INTEGER}, + `status` = #{record.status,jdbcType=BIT}, + router = #{record.router,jdbcType=VARCHAR}, + param = #{record.param,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + read_time = #{record.readTime,jdbcType=BIGINT}, + content = #{record.content,jdbcType=VARCHAR} + + + + + + update sys_msg + + + user_id = #{userId,jdbcType=BIGINT}, + + + `type` = #{type,jdbcType=INTEGER}, + + + `status` = #{status,jdbcType=BIT}, + + + router = #{router,jdbcType=VARCHAR}, + + + param = #{param,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + read_time = #{readTime,jdbcType=BIGINT}, + + + content = #{content,jdbcType=VARCHAR}, + + + where msg_id = #{msgId,jdbcType=BIGINT} + + + update sys_msg + set user_id = #{userId,jdbcType=BIGINT}, + `type` = #{type,jdbcType=INTEGER}, + `status` = #{status,jdbcType=BIT}, + router = #{router,jdbcType=VARCHAR}, + param = #{param,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + read_time = #{readTime,jdbcType=BIGINT}, + content = #{content,jdbcType=VARCHAR} + where msg_id = #{msgId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java index a676b133e6..03f3aab385 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java @@ -15,4 +15,8 @@ public interface ExtPanelShareMapper { List query(Map param); List queryWithResource(GridExample example); + + List queryUserIdWithRoleIds(Map> param); + + List queryUserIdWithDeptIds(Map> param); } diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml index e880756b87..e116764758 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml @@ -46,6 +46,24 @@ + + + + diff --git a/backend/src/main/java/io/dataease/controller/message/MsgController.java b/backend/src/main/java/io/dataease/controller/message/MsgController.java new file mode 100644 index 0000000000..49d6de81c7 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/message/MsgController.java @@ -0,0 +1,39 @@ +package io.dataease.controller.message; + +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import io.dataease.base.domain.SysMsg; +import io.dataease.commons.utils.AuthUtils; +import io.dataease.commons.utils.PageUtils; +import io.dataease.commons.utils.Pager; +import io.dataease.controller.message.dto.MsgRequest; +import io.dataease.service.message.SysMsgService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +@Api(tags = "系统:消息管理") +@RequestMapping("/api/sys_msg") +@RestController +public class MsgController { + + @Resource + private SysMsgService sysMsgService; + + @ApiOperation("查询消息") + @PostMapping("/list/{goPage}/{pageSize}") + public Pager> messages(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody MsgRequest msgRequest) { + Long userId = AuthUtils.getUser().getUserId(); + Page page = PageHelper.startPage(goPage, pageSize, true); + Pager> listPager = PageUtils.setPageInfo(page, sysMsgService.query(userId, msgRequest)); + return listPager; + } + + @PostMapping("/setReaded/{msgId}") + public void setReaded(@PathVariable Long msgId) { + sysMsgService.setReaded(msgId); + } +} diff --git a/backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java b/backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java new file mode 100644 index 0000000000..c95b20d637 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java @@ -0,0 +1,13 @@ +package io.dataease.controller.message.dto; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class MsgRequest implements Serializable { + + private Integer type; + + private Boolean status; +} diff --git a/backend/src/main/java/io/dataease/service/message/DeMsgutil.java b/backend/src/main/java/io/dataease/service/message/DeMsgutil.java new file mode 100644 index 0000000000..0ffceb99ff --- /dev/null +++ b/backend/src/main/java/io/dataease/service/message/DeMsgutil.java @@ -0,0 +1,41 @@ +package io.dataease.service.message; + +import io.dataease.base.domain.SysMsg; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.HashMap; +import java.util.Map; + +@Component +public class DeMsgutil { + + private static Map routerMap ; + + @PostConstruct + public void init() { + routerMap = new HashMap<>(); + routerMap.put(0, "/panel/index"); + routerMap.put(1, "/dataset/index"); + } + + private static SysMsgService sysMsgService; + + @Autowired + public void setSysMsgService(SysMsgService sysMsgService) { + DeMsgutil.sysMsgService = sysMsgService; + } + + public static void sendMsg(Long userId, int type, String content) { + SysMsg sysMsg = new SysMsg(); + sysMsg.setUserId(userId); + sysMsg.setType(type); + sysMsg.setContent(content); + sysMsg.setRouter(routerMap.get(type)); + sysMsg.setStatus(false); + sysMsg.setCreateTime(System.currentTimeMillis()); + sysMsgService.save(sysMsg); + } + +} diff --git a/backend/src/main/java/io/dataease/service/message/SysMsgService.java b/backend/src/main/java/io/dataease/service/message/SysMsgService.java new file mode 100644 index 0000000000..754dc6d6ab --- /dev/null +++ b/backend/src/main/java/io/dataease/service/message/SysMsgService.java @@ -0,0 +1,61 @@ +package io.dataease.service.message; + + +import io.dataease.base.domain.SysMsg; +import io.dataease.base.domain.SysMsgExample; +import io.dataease.base.mapper.SysMsgMapper; +import io.dataease.controller.message.dto.MsgRequest; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + +@Service +public class SysMsgService { + + @Resource + private SysMsgMapper sysMsgMapper; + + public List query(Long userId, MsgRequest msgRequest) { + String orderClause = ""; + SysMsgExample example = new SysMsgExample(); + SysMsgExample.Criteria criteria = example.createCriteria(); + criteria.andUserIdEqualTo(userId); + + + if (ObjectUtils.isNotEmpty(msgRequest.getType())) { + criteria.andTypeEqualTo(msgRequest.getType()); + } + + if (ObjectUtils.isNotEmpty(msgRequest.getStatus())) { + criteria.andStatusEqualTo(msgRequest.getStatus()); + }else { + orderClause += " status asc ,"; + } + + orderClause += " create_time desc"; + example.setOrderByClause(orderClause); + List sysMsgs = sysMsgMapper.selectByExample(example); + return sysMsgs; + } + + public void setReaded(Long msgId) { + SysMsg sysMsg = new SysMsg(); + sysMsg.setMsgId(msgId); + sysMsg.setStatus(true); + sysMsgMapper.updateByPrimaryKeySelective(sysMsg); + } + + public void save(SysMsg sysMsg) { +// sysMsg.setStatus(false); +// sysMsg.setCreateTime(System.currentTimeMillis()); + sysMsgMapper.insert(sysMsg); + } + + public void update(SysMsg sysMsg) { + + sysMsgMapper.updateByPrimaryKey(sysMsg); + } + + +} diff --git a/backend/src/main/java/io/dataease/service/panel/ShareService.java b/backend/src/main/java/io/dataease/service/panel/ShareService.java index 6c2d7c1300..3df81fedd1 100644 --- a/backend/src/main/java/io/dataease/service/panel/ShareService.java +++ b/backend/src/main/java/io/dataease/service/panel/ShareService.java @@ -14,15 +14,14 @@ import io.dataease.controller.request.panel.PanelShareRequest; import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.dto.panel.PanelShareDto; import io.dataease.dto.panel.PanelSharePo; +import io.dataease.service.message.DeMsgutil; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; 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.*; import java.util.stream.Collectors; @@ -32,7 +31,6 @@ public class ShareService { @Autowired(required = false) private PanelShareMapper mapper; - @Resource private ExtPanelShareMapper extPanelShareMapper; @@ -66,6 +64,27 @@ public class ShareService { if (CollectionUtils.isNotEmpty(shares)){ extPanelShareMapper.batchInsert(shares); } + + // 下面是发送提醒消息逻辑 + Set userIdSet = new HashSet(); + if (type == 0) { + userIdSet.addAll(targetIds); + }else if(type == 1) { + Map> param = new HashMap<>(); + param.put("roleIds", targetIds); + List userIdList = extPanelShareMapper.queryUserIdWithRoleIds(param); + userIdSet.addAll(userIdList); + } else if (type == 2) { + Map> param = new HashMap<>(); + param.put("deptIds", targetIds); + List userIdList = extPanelShareMapper.queryUserIdWithDeptIds(param); + userIdSet.addAll(userIdList); + } + CurrentUserDto user = AuthUtils.getUser(); + userIdSet.forEach(userId -> { + DeMsgutil.sendMsg(userId, 0, "用户 [" + user.getNickName()+"] 分享了仪表板给您,请查收!"); + }); + } /** diff --git a/backend/src/main/resources/db/migration/V10__web_msg.sql b/backend/src/main/resources/db/migration/V10__web_msg.sql new file mode 100644 index 0000000000..dfb1d13e33 --- /dev/null +++ b/backend/src/main/resources/db/migration/V10__web_msg.sql @@ -0,0 +1,19 @@ +-- ---------------------------- +-- Table structure for sys_msg +-- ---------------------------- +DROP TABLE IF EXISTS `sys_msg`; +CREATE TABLE `sys_msg` ( + `msg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '消息主键', + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `type` int(4) NOT NULL COMMENT '类型', + `status` tinyint(1) NOT NULL COMMENT '状态', + `router` varchar(255) DEFAULT NULL COMMENT '跳转路由', + `param` varchar(255) DEFAULT NULL COMMENT '路由参数', + `create_time` bigint(13) NOT NULL COMMENT '发送时间', + `read_time` bigint(13) DEFAULT NULL COMMENT '读取时间', + `content` varchar(255) DEFAULT NULL COMMENT '消息内容', + PRIMARY KEY (`msg_id`) USING BTREE, + KEY `inx_msg_userid` (`user_id`) USING BTREE, + KEY `inx_msg_type` (`type`) USING BTREE, + KEY `inx_msg_status` (`status`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='消息通知表'; \ No newline at end of file diff --git a/frontend/src/api/system/msg.js b/frontend/src/api/system/msg.js new file mode 100644 index 0000000000..6b4638fc7d --- /dev/null +++ b/frontend/src/api/system/msg.js @@ -0,0 +1,19 @@ +import request from '@/utils/request' + +export function query(pageIndex, pageSize, data) { + return request({ + url: '/api/sys_msg/list/' + pageIndex + '/' + pageSize, + method: 'post', + loading: true, + data + }) +} + +export function updateStatus(msgId) { + return request({ + url: '/api/sys_msg/setReaded/' + msgId, + method: 'post', + loading: true + }) +} + diff --git a/frontend/src/components/Notification/index.vue b/frontend/src/components/Notification/index.vue new file mode 100644 index 0000000000..2a1c692936 --- /dev/null +++ b/frontend/src/components/Notification/index.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/frontend/src/icons/svg/all-msg.svg b/frontend/src/icons/svg/all-msg.svg new file mode 100644 index 0000000000..e8a1f85bad --- /dev/null +++ b/frontend/src/icons/svg/all-msg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/icons/svg/notification.svg b/frontend/src/icons/svg/notification.svg new file mode 100644 index 0000000000..4f7b1167d6 --- /dev/null +++ b/frontend/src/icons/svg/notification.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/icons/svg/readed-msg.svg b/frontend/src/icons/svg/readed-msg.svg new file mode 100644 index 0000000000..55ae26090c --- /dev/null +++ b/frontend/src/icons/svg/readed-msg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/icons/svg/unread-msg.svg b/frontend/src/icons/svg/unread-msg.svg new file mode 100644 index 0000000000..86c571f275 --- /dev/null +++ b/frontend/src/icons/svg/unread-msg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/icons/svg/web-msg.svg b/frontend/src/icons/svg/web-msg.svg new file mode 100644 index 0000000000..c3c609e73f --- /dev/null +++ b/frontend/src/icons/svg/web-msg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/layout/components/Topbar.vue b/frontend/src/layout/components/Topbar.vue index c7ef78be59..6b04a0790f 100644 --- a/frontend/src/layout/components/Topbar.vue +++ b/frontend/src/layout/components/Topbar.vue @@ -35,7 +35,7 @@ - +
@@ -75,7 +75,7 @@ import { mapGetters } from 'vuex' import AppLink from './Sidebar/Link' import variables from '@/styles/variables.scss' import { isExternal } from '@/utils/validate' -// import Doc from '@/components/Doc' +import Notification from '@/components/Notification' // import Screenfull from '@/components/Screenfull' // import SizeSelect from '@/components/SizeSelect' import LangSelect from '@/components/LangSelect' @@ -86,6 +86,7 @@ export default { AppLink, // Screenfull, // SizeSelect, + Notification, LangSelect // Doc }, diff --git a/frontend/src/permission.js b/frontend/src/permission.js index dda02c2b86..4dd236cfc0 100644 --- a/frontend/src/permission.js +++ b/frontend/src/permission.js @@ -76,6 +76,7 @@ export const loadMenus = (next, to) => { buildMenus().then(res => { const filterDatas = filterRouter(res.data) const asyncRouter = filterAsyncRouter(filterDatas) + addMsgMenu(asyncRouter) asyncRouter.push({ path: '*', redirect: '/404', hidden: true }) store.dispatch('permission/GenerateRoutes', asyncRouter).then(() => { // 存储路由 router.addRoutes(asyncRouter) @@ -87,6 +88,44 @@ export const loadMenus = (next, to) => { }) }) } + +export const addMsgMenu = asyncRouter => { + const menu = { + path: 'system-msg-web', + component: () => import('@/views/msg/index'), + name: 'sys-msg-web', + meta: { title: '站内消息', icon: 'all-msg' }, + children: [ + { + path: 'all', + component: () => import('@/views/msg/all'), + name: 'sys-msg-web-all', + meta: { title: '所有消息', icon: 'web-msg' } + }, + { + path: 'unread', + component: () => import('@/views/msg/unread'), + name: 'sys-msg-web-unread', + meta: { title: '未读消息', icon: 'unread-msg' } + + }, + { + path: 'readed', + component: () => import('@/views/msg/readed'), + name: 'sys-msg-web-readed', + meta: { title: '已读消息', icon: 'readed-msg' } + } + ] + } + asyncRouter.forEach(element => { + if (element.name === 'system') { + if (element.children) { + element.children.splice(0, 0, menu) + } + // element.children.push(menu) + } + }) +} /** * 验证path是否有效 * @param {*} path diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index 0301675a23..b3a814f0ae 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -190,10 +190,26 @@ div:focus { } } } +.de-msg-data-table { + .el-table__body-wrapper >table>{ + tbody { + .el-table__row { + :hover { + cursor: pointer; + } + } + td { + padding: 3px 0 !important; + } + } + } +} .de-filter-data-table::before { height: 0px !important; } - +.de-msg-data-table::before { + height: 0px !important; +} .custom-component-class { width: 100%; div.el-input-group__append { diff --git a/frontend/src/styles/sidebar.scss b/frontend/src/styles/sidebar.scss index 6f5fdcafab..7f92d75481 100644 --- a/frontend/src/styles/sidebar.scss +++ b/frontend/src/styles/sidebar.scss @@ -85,7 +85,7 @@ } .is-active>.el-submenu__title { - color: $subMenuActiveText !important; + color: $menuActiveText !important; } & .nest-menu .el-submenu>.el-submenu__title, @@ -94,7 +94,7 @@ background-color: $subMenuBg !important; &:hover { - background-color: $subMenuHover !important; + background-color: $menuHover !important; } } } diff --git a/frontend/src/styles/variables.scss b/frontend/src/styles/variables.scss index 4dfe4ad8d9..0f4300f328 100644 --- a/frontend/src/styles/variables.scss +++ b/frontend/src/styles/variables.scss @@ -36,7 +36,7 @@ $menuBg:#ffffff; // $menuHover:#263445; $menuHover: rgba(158, 158, 158, 0.2); -$subMenuBg:#1f2d3d; +$subMenuBg:#ffffff; // $subMenuHover:#001528; $subMenuHover:#0a7be0; $colorBg:rgba(10,123,224,.1); diff --git a/frontend/src/utils/webMsg.js b/frontend/src/utils/webMsg.js new file mode 100644 index 0000000000..c917183480 --- /dev/null +++ b/frontend/src/utils/webMsg.js @@ -0,0 +1,14 @@ +export const msgTypes = [ + { value: -1, label: '全部类型' }, + { value: 0, label: '仪表板分享' }, + { value: 1, label: '数据集同步' } +] + +export const getTypeName = value => { + for (let index = 0; index < msgTypes.length; index++) { + const element = msgTypes[index] + if (element.value === value) { + return element.label + } + } +} diff --git a/frontend/src/views/msg/all.vue b/frontend/src/views/msg/all.vue new file mode 100644 index 0000000000..997f4e1320 --- /dev/null +++ b/frontend/src/views/msg/all.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/frontend/src/views/msg/index.vue b/frontend/src/views/msg/index.vue new file mode 100644 index 0000000000..0d8026c857 --- /dev/null +++ b/frontend/src/views/msg/index.vue @@ -0,0 +1,21 @@ + + + + diff --git a/frontend/src/views/msg/readed.vue b/frontend/src/views/msg/readed.vue new file mode 100644 index 0000000000..552d294d2c --- /dev/null +++ b/frontend/src/views/msg/readed.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/frontend/src/views/msg/unread.vue b/frontend/src/views/msg/unread.vue new file mode 100644 index 0000000000..c789e0f5ee --- /dev/null +++ b/frontend/src/views/msg/unread.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/frontend/src/views/panel/index.vue b/frontend/src/views/panel/index.vue index 2cc254e1c9..42ef9353ae 100644 --- a/frontend/src/views/panel/index.vue +++ b/frontend/src/views/panel/index.vue @@ -1,7 +1,7 @@ @@ -40,6 +40,27 @@ export default { mounted() { removeClass(document.body, 'showRightPanel') }, + created() { + this.$store.dispatch('app/toggleSideBarHide', true) + let routerParam + if ((routerParam = this.$router.currentRoute.params) !== null && routerParam.msgNotification) { + // 说明是从消息通知跳转过来的 + if (routerParam.msgType === 1) { // 是数据集同步 + if (routerParam.sourceParam) { + try { + const msgParam = JSON.parse(routerParam.sourceParam) + this.param = msgParam.tableId + this.component = ViewTable + this.$nextTick(() => { + this.$refs.dynamic_component.msg2Current(routerParam.sourceParam) + }) + } catch (error) { + console.error(error) + } + } + } + } + }, methods: { switchComponent(c) { this.param = c.param diff --git a/frontend/src/views/msg/all.vue b/frontend/src/views/msg/all.vue index 997f4e1320..576a634137 100644 --- a/frontend/src/views/msg/all.vue +++ b/frontend/src/views/msg/all.vue @@ -2,7 +2,7 @@ - {{ item.label }} + {{ $t(item.label) }} @@ -104,8 +104,8 @@ export default { this.search() }, toDetail(row) { - const param = { ...{ msgNotification: true, msgType: row.type }} - this.$router.push({ name: 'panel', params: param }) + const param = { ...{ msgNotification: true, msgType: row.type, sourceParam: row.param }} + this.$router.push({ name: row.router, params: param }) this.setReaded(row) }, // 设置已读 diff --git a/frontend/src/views/msg/readed.vue b/frontend/src/views/msg/readed.vue index 552d294d2c..4683d5f533 100644 --- a/frontend/src/views/msg/readed.vue +++ b/frontend/src/views/msg/readed.vue @@ -2,7 +2,7 @@ - {{ item.label }} + {{ $t(item.label) }} @@ -87,10 +87,9 @@ export default { search() { const param = {} - + param.status = true if (this.selectType >= 0) { param.type = this.selectType - param.status = true } const { currentPage, pageSize } = this.paginationConfig query(currentPage, pageSize, param).then(response => { @@ -105,8 +104,8 @@ export default { this.search() }, toDetail(row) { - const param = { ...{ msgNotification: true, msgType: row.type }} - this.$router.push({ name: 'panel', params: param }) + const param = { ...{ msgNotification: true, msgType: row.type, sourceParam: row.param }} + this.$router.push({ name: row.router, params: param }) } } diff --git a/frontend/src/views/msg/unread.vue b/frontend/src/views/msg/unread.vue index c789e0f5ee..ee069a5921 100644 --- a/frontend/src/views/msg/unread.vue +++ b/frontend/src/views/msg/unread.vue @@ -2,7 +2,7 @@ - {{ item.label }} + {{ $t(item.label) }} @@ -87,10 +87,9 @@ export default { search() { const param = {} - + param.status = false if (this.selectType >= 0) { param.type = this.selectType - param.status = false } const { currentPage, pageSize } = this.paginationConfig query(currentPage, pageSize, param).then(response => { @@ -105,8 +104,8 @@ export default { this.search() }, toDetail(row) { - const param = { ...{ msgNotification: true, msgType: row.type }} - this.$router.push({ name: 'panel', params: param }) + const param = { ...{ msgNotification: true, msgType: row.type, sourceParam: row.param }} + this.$router.push({ name: row.router, params: param }) this.setReaded(row) }, // 设置已读 diff --git a/frontend/src/views/panel/GrantAuth/shareTree.vue b/frontend/src/views/panel/GrantAuth/shareTree.vue index acc3747ce4..f9b353538c 100644 --- a/frontend/src/views/panel/GrantAuth/shareTree.vue +++ b/frontend/src/views/panel/GrantAuth/shareTree.vue @@ -1,9 +1,9 @@