feat: 消息中心

This commit is contained in:
fit2cloud-chenyw 2021-07-02 19:19:38 +08:00
parent 162ac4d69a
commit 25203a6bb8
31 changed files with 2066 additions and 11 deletions

View File

@ -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;
}

View File

@ -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<Criteria> oredCriteria;
public SysMsgExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria 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<Long> values) {
addCriterion("msg_id in", values, "msgId");
return (Criteria) this;
}
public Criteria andMsgIdNotIn(List<Long> 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<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria 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<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> 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<Boolean> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Boolean> 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<String> values) {
addCriterion("router in", values, "router");
return (Criteria) this;
}
public Criteria andRouterNotIn(List<String> 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<String> values) {
addCriterion("param in", values, "param");
return (Criteria) this;
}
public Criteria andParamNotIn(List<String> 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<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria 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<Long> values) {
addCriterion("read_time in", values, "readTime");
return (Criteria) this;
}
public Criteria andReadTimeNotIn(List<Long> 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<String> values) {
addCriterion("content in", values, "content");
return (Criteria) this;
}
public Criteria andContentNotIn(List<String> 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);
}
}
}

View File

@ -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<SysMsg> 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);
}

View File

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.dataease.base.mapper.SysMsgMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysMsg">
<id column="msg_id" jdbcType="BIGINT" property="msgId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="status" jdbcType="BIT" property="status" />
<result column="router" jdbcType="VARCHAR" property="router" />
<result column="param" jdbcType="VARCHAR" property="param" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="read_time" jdbcType="BIGINT" property="readTime" />
<result column="content" jdbcType="VARCHAR" property="content" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
msg_id, user_id, `type`, `status`, router, param, create_time, read_time, content
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.SysMsgExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_msg
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_msg
where msg_id = #{msgId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sys_msg
where msg_id = #{msgId,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysMsgExample">
delete from sys_msg
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.SysMsg">
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>
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysMsg">
insert into sys_msg
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="msgId != null">
msg_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="type != null">
`type`,
</if>
<if test="status != null">
`status`,
</if>
<if test="router != null">
router,
</if>
<if test="param != null">
param,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="readTime != null">
read_time,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="msgId != null">
#{msgId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=BIT},
</if>
<if test="router != null">
#{router,jdbcType=VARCHAR},
</if>
<if test="param != null">
#{param,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="readTime != null">
#{readTime,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.SysMsgExample" resultType="java.lang.Long">
select count(*) from sys_msg
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_msg
<set>
<if test="record.msgId != null">
msg_id = #{record.msgId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=BIT},
</if>
<if test="record.router != null">
router = #{record.router,jdbcType=VARCHAR},
</if>
<if test="record.param != null">
param = #{record.param,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.readTime != null">
read_time = #{record.readTime,jdbcType=BIGINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysMsg">
update sys_msg
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
<if test="status != null">
`status` = #{status,jdbcType=BIT},
</if>
<if test="router != null">
router = #{router,jdbcType=VARCHAR},
</if>
<if test="param != null">
param = #{param,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="readTime != null">
read_time = #{readTime,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
</set>
where msg_id = #{msgId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysMsg">
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}
</update>
</mapper>

View File

@ -15,4 +15,8 @@ public interface ExtPanelShareMapper {
List<PanelSharePo> query(Map<String, Object> param);
List<PanelShare> queryWithResource(GridExample example);
List<Long> queryUserIdWithRoleIds(Map<String, List<Long>> param);
List<Long> queryUserIdWithDeptIds(Map<String, List<Long>> param);
}

View File

@ -46,6 +46,24 @@
</select>
<select id="queryUserIdWithRoleIds" >
select user_id
from sys_user
where role_id in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId}
</foreach>
</select>
<select id="queryUserIdWithDeptIds" >
select user_id
from sys_user
where dept_id in
<foreach collection="deptIds" item="deptId" open='(' separator=',' close=')'>
#{deptId}
</foreach>
</select>

View File

@ -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<List<SysMsg>> messages(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody MsgRequest msgRequest) {
Long userId = AuthUtils.getUser().getUserId();
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
Pager<List<SysMsg>> listPager = PageUtils.setPageInfo(page, sysMsgService.query(userId, msgRequest));
return listPager;
}
@PostMapping("/setReaded/{msgId}")
public void setReaded(@PathVariable Long msgId) {
sysMsgService.setReaded(msgId);
}
}

View File

@ -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;
}

View File

@ -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<Integer, String> 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);
}
}

View File

@ -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<SysMsg> 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<SysMsg> 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);
}
}

View File

@ -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<Long> userIdSet = new HashSet<Long>();
if (type == 0) {
userIdSet.addAll(targetIds);
}else if(type == 1) {
Map<String, List<Long>> param = new HashMap<>();
param.put("roleIds", targetIds);
List<Long> userIdList = extPanelShareMapper.queryUserIdWithRoleIds(param);
userIdSet.addAll(userIdList);
} else if (type == 2) {
Map<String, List<Long>> param = new HashMap<>();
param.put("deptIds", targetIds);
List<Long> userIdList = extPanelShareMapper.queryUserIdWithDeptIds(param);
userIdSet.addAll(userIdList);
}
CurrentUserDto user = AuthUtils.getUser();
userIdSet.forEach(userId -> {
DeMsgutil.sendMsg(userId, 0, "用户 [" + user.getNickName()+"] 分享了仪表板给您,请查收!");
});
}
/**

View File

@ -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='消息通知表';

View File

@ -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
})
}

View File

@ -0,0 +1,172 @@
<template>
<el-popover
v-model="visible"
width="350"
trigger="click"
placement="top-end"
style="display: flex;align-items: center;"
class="international"
>
<div style="height: 30px;">
<div style="float: left;font-size:16px;font-weight:bold;">
<span>站内消息通知</span>
</div>
<div v-if="showSetting" style="float: right;">
<a href="#" style="text-detext-decoratext-decoration:none;cursor:point;" @click="msgSetting">消息规则</a>
</div>
</div>
<el-divider class="msg-line-class" />
<el-table
class="de-msg-data-table"
:data="data"
:show-header="false"
:highlight-current-row="true"
style="width: 100%"
>
<el-table-column prop="content" :label="$t('commons.name')">
<template slot-scope="scope">
<div class="start-item">
<div class="filter-db-row star-item-content" @click="showDetail(scope.row)">
<!-- <svg-icon icon-class="panel" class="ds-icon-scene" /> -->
<div class="title-div"><span>{{ getTypeName(scope.row.type) }}&nbsp;&nbsp;{{ scope.row.content }}</span></div>
<div class="title-div"><span>{{ scope.row.createTime | timestampFormatDate }}</span></div>
</div>
<!-- <div class="star-item-close">
<i class="el-icon-delete " @click="remove(scope.row)" />
</div> -->
</div>
</template>
</el-table-column>
</el-table>
<div class="msg-foot-class">
<el-row style="padding: 5px 0;margin-bottom: -5px;cursor:point;" @click="showMore">
<span @click="showMore">查看更多</span>
</el-row>
</div>
<div slot="reference">
<div>
<svg-icon
class-name="notification"
icon-class="notification"
/>
<span class="msg-number">9</span>
</div>
</div>
</el-popover>
</template>
<script>
import { query, updateStatus } from '@/api/system/msg'
import { msgTypes, getTypeName } from '@/utils/webMsg'
export default {
data() {
return {
msgTypes: msgTypes,
showSetting: false,
data: [],
visible: false,
paginationConfig: {
currentPage: 1,
pageSize: 5,
total: 0
}
}
},
computed: {
},
created() {
this.search()
},
methods: {
handClick(lang) {
console.log(lang)
},
showDetail(row) {
const param = { ...{ msgNotification: true, msgType: row.type }}
this.visible = false
this.$router.push({ name: 'panel', params: param })
this.setReaded(row.msgId)
},
remove(row) {
},
msgSetting() {
},
showMore() {
const routerName = 'sys-msg-web-all'
this.visible = false
this.$router.push({ name: routerName })
this.$emit('refresh-top-bar')
},
search() {
const param = {}
const { currentPage, pageSize } = this.paginationConfig
query(currentPage, pageSize, param).then(response => {
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
},
getTypeName(value) {
return getTypeName(value)
},
open() {
this.visible = true
},
//
setReaded(msgId) {
updateStatus(msgId).then(res => {
this.search()
})
}
}
}
</script>
<style lang="scss" scoped>
.msg-number {
min-width: 14px;
text-align: center;
line-height: 14px;
display: inline-block;
position: fixed;
right: 155px;
top: 8px;
background: red;
color: #fff;
border-radius: 17px;
padding: 4px 7px;
font-size: 16px;
transform: scale(.7);
font-family: Tahoma!important;
}
.title-div {
width: 100%;
span {
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space:nowrap;
width:290px;
height:24px;
display:block;
font-size: 10px !important;
}
}
.msg-line-class {
margin: 0 0 !important;
}
.msg-foot-class {
padding-top: 5px;
:hover {
cursor: pointer;
background-color: #f4f4f5;
}
}
</style>

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625194186074" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5368" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M542.865473 179.373297c-11.667737-5.553483-25.564235-3.748371-35.536354 4.592598l-191.97122 160.771637-153.038512-0.632403-0.141216 0c-8.810666 0-17.328667 3.467985-23.538089 9.771551-6.291287 6.28003-9.853415 14.809287-9.853415 23.736611l-0.704035 268.632203c0 8.904811 3.479241 17.48114 9.760295 23.784706 6.26775 6.349615 14.774495 9.864672 23.654746 9.864672l154.842601 0 190.986799 160.16277c6.139837 5.131881 13.766538 7.756661 21.383006 7.756661 4.802376 0 9.619078-1.031493 14.152325-3.186576 11.7056-5.482875 19.21462-17.339924 19.21462-30.369681L562.077024 209.742978C562.104653 196.784852 554.617122 184.927803 542.865473 179.373297zM495.321644 742.55498l-0.022513 0L349.757361 620.517529c-6.010901-4.991688-13.568017-7.733125-21.35947-7.733125L194.938296 612.784404l0.550539-201.38052 131.750673 0.562818 0.116657 0c7.814989 0 15.394618-2.717901 21.370727-7.756661l146.594753-122.786511L495.321644 742.55498zM776.185426 248.66443c-15.349593-9.958816-35.805484-5.41329-45.834908 10.051937-10.004865 15.418154-5.600555 36.20355 9.677407 46.373167 3.609201 2.412956 89.137133 60.994166 89.137133 206.910467 0 146.195663-82.013899 204.871017-85.282339 207.120244-15.383362 10.310833-19.507286 31.142278-9.268084 46.583968 6.4192 9.700943 17.036002 14.926968 27.815509 14.926968 6.374174 0 12.793374-1.852184 18.48705-5.624091 4.686742-3.139503 114.996081-79.225389 114.996081-263.008112C895.950114 327.842747 781.130042 251.827469 776.185426 248.66443zM672.284031 347.292728c-16.448624-7.826246-35.991726-0.704035-44.00626 15.770172-7.990998 16.542768-1.077541 36.531008 15.255449 44.802392 2.084475 1.101077 52.114938 27.228131 52.114938 101.673657 0 79.531358-46.795792 105.891725-48.307216 106.759489-16.48444 8.29492-23.186072 28.493961-14.938224 45.084824 5.881964 11.762905 17.643845 18.582217 29.933753 18.582217 4.968152 0 10.077519-1.14815 14.869662-3.538593 3.467985-1.780553 85.22401-44.358277 85.22401-166.887938C762.383072 391.322523 675.962817 349.026208 672.284031 347.292728z" p-id="5369"></path></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625126274902" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1191" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M757.76 819.2h-491.52A61.44 61.44 0 0 1 204.8 757.76v-286.72a307.2 307.2 0 0 1 614.4 0v286.72a61.44 61.44 0 0 1-61.44 61.44z m-245.76-614.4A266.6496 266.6496 0 0 0 245.76 471.04v286.72a20.48 20.48 0 0 0 20.48 20.48h491.52a20.48 20.48 0 0 0 20.48-20.48v-286.72A266.6496 266.6496 0 0 0 512 204.8zM512 942.08a102.4 102.4 0 0 1-102.4-102.4h40.96a61.44 61.44 0 0 0 122.88 0h40.96a102.4 102.4 0 0 1-102.4 102.4z" p-id="1192"></path><path d="M491.52 81.92h40.96v81.92h-40.96zM837.2224 298.5984a383.7952 383.7952 0 0 0-111.0016-111.4112l22.528-34.4064a428.4416 428.4416 0 0 1 122.88 122.88zM186.7776 298.5984l-34.4064-22.9376a428.4416 428.4416 0 0 1 122.88-122.88l22.528 34.4064a383.7952 383.7952 0 0 0-111.0016 111.4112z" p-id="1193"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625194105498" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4691" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M897.2 341v1.8L567.8 87.2c-32.6-25.3-78.3-25.4-111.1-0.3L123.5 343.1c-35.3 19.8-59.1 56.8-59.1 99.2v405.5c0 63.1 52.8 114.4 117.7 114.4h660.4c64.9 0 117.7-51.3 117.7-114.4V442.3c0-43.9-25.6-82.2-63-101.3zM484.9 123.2c16.1-12.4 38.6-12.3 54.7 0.1l323.7 251.1-330 229.5c-12.7 8.8-29.8 9-42.6 0.4L153.5 377.9l331.4-254.7zM108.2 847.8V442.3c0-12.3 3.2-23.8 8.8-33.9 0.8 0.7 1.7 1.5 2.6 2.1L465 642.3c1.8 1.2 3.7 2.4 5.7 3.5-5.1 2.2-10 5-14.7 8.1L118.3 884c-6.4-10.6-10.1-23-10.1-36.2z m734.3 71.9H182.1c-9.6 0-18.8-1.8-27.2-5.1l327-222.9c15.3-10.4 35.9-10.4 51.2 0l330.1 225.1c-6.5 1.9-13.5 2.9-20.7 2.9z m74-71.9c0 15.2-4.9 29.2-13.1 40.8L559.1 653.9c-3.3-2.2-6.7-4.3-10.2-6 3.7-1.8 7.3-4 10.8-6.4l342.2-238c0.7-0.5 1.3-1 1.9-1.5 8 11.5 12.7 25.4 12.7 40.3v405.5z" p-id="4692"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625194120904" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4859" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M128 331.392V810.666667h725.333333V327.68L469.077333 597.333333 128 331.392zM747.264 298.666667H223.744l247.978667 193.365333L747.264 298.666667zM938.666667 213.333333v682.666667H42.666667V213.333333h896z" p-id="4860"></path><path d="M853.333333 256m-128 0a128 128 0 1 0 256 0 128 128 0 1 0-256 0Z" p-id="4861"></path></svg>

After

Width:  |  Height:  |  Size: 701 B

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625193768947" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1789" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M862.528 225.536c29.12 0 52.864 23.68 52.864 52.8v467.264a52.992 52.992 0 0 1-52.864 52.864H161.472a52.992 52.992 0 0 1-52.864-52.864V278.336c0-29.12 23.744-52.8 52.864-52.8h701.056m0-64H161.472A116.864 116.864 0 0 0 44.608 278.336v467.264c0 64.64 52.288 116.864 116.864 116.864h700.992a116.8 116.8 0 0 0 116.864-116.864V278.336a116.8 116.8 0 0 0-116.8-116.8z" fill="#231815" p-id="1790"></path><path d="M512 607.872a32.064 32.064 0 0 1-19.52-6.592L83.584 287.36a32 32 0 0 1 38.976-50.752L512 535.552l388.288-298.88a32 32 0 0 1 38.976 50.688L531.52 601.28A32.064 32.064 0 0 1 512 607.872z" fill="#231815" p-id="1791"></path></svg>

After

Width:  |  Height:  |  Size: 1007 B

View File

@ -35,7 +35,7 @@
<!-- <el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> -->
<notification class="right-menu-item hover-effect" @refresh-top-bar="initCurrentRoutes" />
<lang-select class="right-menu-item hover-effect" />
<div style="height: 100%;padding: 0 8px;" class="right-menu-item hover-effect">
<a href="https://dataease.io/docs/" target="_blank" style="display: flex;height: 100%;width: 100%;justify-content: center;align-items: center;">
@ -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
},

View File

@ -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

View File

@ -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 {

View File

@ -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;
}
}
}

View File

@ -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);

View File

@ -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
}
}
}

View File

@ -0,0 +1,146 @@
<template>
<layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<el-radio-group v-model="selectType" style="margin-bottom: 15px;" @change="typeChange">
<el-radio-button v-for="(item,index) in msgTypes" :key="index" class="de-msg-radio-class" :label="item.value">{{ item.label }}</el-radio-button>
</el-radio-group>
<complex-table
:data="data"
:columns="columns"
:pagination-config="paginationConfig"
@select="select"
@search="search"
>
<el-table-column prop="content" :label="$t('commons.name')">
<template v-slot:default="scope">
<span style="display: flex;flex: 1;">
<span>
<svg-icon v-if="!scope.row.status" icon-class="unread-msg" style="color: red;" />
<svg-icon v-else icon-class="readed-msg" />
</span>
<span style="margin-left: 6px;" class="de-msg-a" @click="toDetail(scope.row)">
{{ scope.row.content }}
</span>
</span>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column prop="type" :label="$t('datasource.type')" width="120">
<template slot-scope="scope">
<span>{{ getTypeName(scope.row.type) }}</span>
</template>
</el-table-column>
</complex-table>
</layout-content>
</template>
<script>
import LayoutContent from '@/components/business/LayoutContent'
import ComplexTable from '@/components/business/complex-table'
import { query, updateStatus } from '@/api/system/msg'
import { msgTypes, getTypeName } from '@/utils/webMsg'
export default {
components: {
LayoutContent,
ComplexTable
},
data() {
return {
selectType: -1,
// msgTypes: [
// { value: -1, label: '' },
// { value: 0, label: '' },
// { value: 1, label: '' }
// ],
msgTypes: msgTypes,
data: [],
allTypes: [{ name: 'mysql', type: 'jdbc' }, { name: 'sqlServer', type: 'jdbc' }],
columns: [],
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0
}
}
},
mounted() {
this.search()
},
methods: {
select(selection) {
},
search() {
const param = {}
if (this.selectType >= 0) {
param.type = this.selectType
}
const { currentPage, pageSize } = this.paginationConfig
query(currentPage, pageSize, param).then(response => {
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
},
getTypeName(value) {
return getTypeName(value)
},
typeChange(value) {
this.search()
},
toDetail(row) {
const param = { ...{ msgNotification: true, msgType: row.type }}
this.$router.push({ name: 'panel', params: param })
this.setReaded(row)
},
//
setReaded(row) {
updateStatus(row.msgId).then(res => {
this.search()
})
}
}
}
</script>
<style lang="scss" scoped>
.de-msg-radio-class {
padding: 0 5px;
>>>.el-radio-button__inner {
border-radius: 4px 4px 4px 4px !important;
border-left: 1px solid #dcdfe6 !important;
padding: 10px 10px;
}
>>>.el-radio-button__orig-radio:checked+.el-radio-button__inner {
color: #fff;
background-color: #0a7be0;
border-color: #0a7be0;
-webkit-box-shadow: 0px 0 0 0 #0a7be0;
box-shadow: 0px 0 0 0 #0a7be0;
}
}
.de-msg-a:hover {
text-decoration: underline !important;
color: #0a7be0 !important;
cursor: pointer !important;
}
</style>

View File

@ -0,0 +1,21 @@
<template>
<router-view />
</template>
<script>
export default ({
data() {
return {
}
},
created() {
this.$store.dispatch('app/toggleSideBarHide', false)
},
method: {
}
})
</script>

View File

@ -0,0 +1,141 @@
<template>
<layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<el-radio-group v-model="selectType" style="margin-bottom: 15px;" @change="typeChange">
<el-radio-button v-for="(item,index) in msgTypes" :key="index" class="de-msg-radio-class" :label="item.value">{{ item.label }}</el-radio-button>
</el-radio-group>
<complex-table
:data="data"
:columns="columns"
:pagination-config="paginationConfig"
@select="select"
@search="search"
>
<el-table-column prop="content" :label="$t('commons.name')">
<template v-slot:default="scope">
<span style="display: flex;flex: 1;">
<span>
<svg-icon v-if="!scope.row.status" icon-class="unread-msg" style="color: red;" />
<svg-icon v-else icon-class="readed-msg" />
</span>
<span style="margin-left: 6px;" class="de-msg-a" @click="toDetail(scope.row)">
{{ scope.row.content }}
</span>
</span>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column prop="type" :label="$t('datasource.type')" width="120">
<template slot-scope="scope">
<span>{{ getTypeName(scope.row.type) }}</span>
</template>
</el-table-column>
</complex-table>
</layout-content>
</template>
<script>
import LayoutContent from '@/components/business/LayoutContent'
import ComplexTable from '@/components/business/complex-table'
import { query } from '@/api/system/msg'
import { msgTypes, getTypeName } from '@/utils/webMsg'
export default {
components: {
LayoutContent,
ComplexTable
},
data() {
return {
selectType: -1,
// msgTypes: [
// { value: -1, label: '' },
// { value: 0, label: '' },
// { value: 1, label: '' }
// ],
msgTypes: msgTypes,
data: [],
allTypes: [{ name: 'mysql', type: 'jdbc' }, { name: 'sqlServer', type: 'jdbc' }],
columns: [],
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0
}
}
},
mounted() {
this.search()
},
methods: {
select(selection) {
},
search() {
const param = {}
if (this.selectType >= 0) {
param.type = this.selectType
param.status = true
}
const { currentPage, pageSize } = this.paginationConfig
query(currentPage, pageSize, param).then(response => {
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
},
getTypeName(value) {
return getTypeName(value)
},
typeChange(value) {
this.search()
},
toDetail(row) {
const param = { ...{ msgNotification: true, msgType: row.type }}
this.$router.push({ name: 'panel', params: param })
}
}
}
</script>
<style lang="scss" scoped>
.de-msg-radio-class {
padding: 0 5px;
>>>.el-radio-button__inner {
border-radius: 4px 4px 4px 4px !important;
border-left: 1px solid #dcdfe6 !important;
padding: 10px 10px;
}
>>>.el-radio-button__orig-radio:checked+.el-radio-button__inner {
color: #fff;
background-color: #0a7be0;
border-color: #0a7be0;
-webkit-box-shadow: 0px 0 0 0 #0a7be0;
box-shadow: 0px 0 0 0 #0a7be0;
}
}
.de-msg-a:hover {
text-decoration: underline !important;
color: #0a7be0 !important;
cursor: pointer !important;
}
</style>

View File

@ -0,0 +1,147 @@
<template>
<layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<el-radio-group v-model="selectType" style="margin-bottom: 15px;" @change="typeChange">
<el-radio-button v-for="(item,index) in msgTypes" :key="index" class="de-msg-radio-class" :label="item.value">{{ item.label }}</el-radio-button>
</el-radio-group>
<complex-table
:data="data"
:columns="columns"
:pagination-config="paginationConfig"
@select="select"
@search="search"
>
<el-table-column prop="content" :label="$t('commons.name')">
<template v-slot:default="scope">
<span style="display: flex;flex: 1;">
<span>
<svg-icon v-if="!scope.row.status" icon-class="unread-msg" style="color: red;" />
<svg-icon v-else icon-class="readed-msg" />
</span>
<span style="margin-left: 6px;" class="de-msg-a" @click="toDetail(scope.row)">
{{ scope.row.content }}
</span>
</span>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column prop="type" :label="$t('datasource.type')" width="120">
<template slot-scope="scope">
<span>{{ getTypeName(scope.row.type) }}</span>
</template>
</el-table-column>
</complex-table>
</layout-content>
</template>
<script>
import LayoutContent from '@/components/business/LayoutContent'
import ComplexTable from '@/components/business/complex-table'
import { query, updateStatus } from '@/api/system/msg'
import { msgTypes, getTypeName } from '@/utils/webMsg'
export default {
components: {
LayoutContent,
ComplexTable
},
data() {
return {
selectType: -1,
// msgTypes: [
// { value: -1, label: '' },
// { value: 0, label: '' },
// { value: 1, label: '' }
// ],
msgTypes: msgTypes,
data: [],
allTypes: [{ name: 'mysql', type: 'jdbc' }, { name: 'sqlServer', type: 'jdbc' }],
columns: [],
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0
}
}
},
mounted() {
this.search()
},
methods: {
select(selection) {
},
search() {
const param = {}
if (this.selectType >= 0) {
param.type = this.selectType
param.status = false
}
const { currentPage, pageSize } = this.paginationConfig
query(currentPage, pageSize, param).then(response => {
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
},
getTypeName(value) {
return getTypeName(value)
},
typeChange(value) {
this.search()
},
toDetail(row) {
const param = { ...{ msgNotification: true, msgType: row.type }}
this.$router.push({ name: 'panel', params: param })
this.setReaded(row)
},
//
setReaded(row) {
updateStatus(row.msgId).then(res => {
this.search()
})
}
}
}
</script>
<style lang="scss" scoped>
.de-msg-radio-class {
padding: 0 5px;
>>>.el-radio-button__inner {
border-radius: 4px 4px 4px 4px !important;
border-left: 1px solid #dcdfe6 !important;
padding: 10px 10px;
}
>>>.el-radio-button__orig-radio:checked+.el-radio-button__inner {
color: #fff;
background-color: #0a7be0;
border-color: #0a7be0;
-webkit-box-shadow: 0px 0 0 0 #0a7be0;
box-shadow: 0px 0 0 0 #0a7be0;
}
}
.de-msg-a:hover {
text-decoration: underline !important;
color: #0a7be0 !important;
cursor: pointer !important;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" style="background-color: #f7f8fa">
<de-main-container>
<panel-main v-show="componentName==='PanelMain'" />
<panel-main v-show="componentName==='PanelMain'" ref="panel_main" />
<chart-edit v-if="componentName==='ChartEdit'" :param="param" />
<panel-edit v-if="componentName==='PanelEdit'" />
<!-- <component :is="component" :param="param" />-->
@ -48,6 +48,20 @@ export default {
// }
})
},
created() {
this.$store.dispatch('app/toggleSideBarHide', true)
let routerParam
if ((routerParam = this.$router.currentRoute.params) !== null && routerParam.msgNotification) {
//
console.log(this.$router.currentRoute.params)
if (routerParam.msgType === 0) { //
this.componentName = 'PanelMain'
this.$nextTick(() => {
this.$refs.panel_main.msg2Current()
})
}
}
},
methods: {
}

View File

@ -86,6 +86,10 @@ export default {
preStyle: null
})
this.$store.dispatch('panel/setMainActiveName', 'PanelMain')
},
msg2Current() {
this.activeName = 'panels_share'
this.refreshShare()
}
}