Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
b329f894
提交
b329f894
authored
7月 12, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 完善消息接收设置
上级
ff82cfff
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
206 行增加
和
59 行删除
+206
-59
SysMsgConstants.java
...n/java/io/dataease/commons/constants/SysMsgConstants.java
+1
-0
MsgController.java
...in/java/io/dataease/controller/message/MsgController.java
+2
-5
SubscribeNode.java
...ava/io/dataease/controller/message/dto/SubscribeNode.java
+20
-0
DeMsgutil.java
.../src/main/java/io/dataease/service/message/DeMsgutil.java
+8
-9
MsgAop.java
...end/src/main/java/io/dataease/service/message/MsgAop.java
+12
-7
SysMsgService.java
.../main/java/io/dataease/service/message/SysMsgService.java
+39
-7
V10__web_msg.sql
backend/src/main/resources/db/migration/V10__web_msg.sql
+61
-4
ehcache.xml
backend/src/main/resources/ehcache/ehcache.xml
+15
-2
index.vue
frontend/src/components/Notification/index.vue
+2
-2
en.js
frontend/src/lang/en.js
+8
-1
tw.js
frontend/src/lang/tw.js
+8
-1
zh.js
frontend/src/lang/zh.js
+8
-1
webMsg.js
frontend/src/utils/webMsg.js
+1
-1
index.vue
frontend/src/views/dataset/index.vue
+4
-3
all.vue
frontend/src/views/msg/all.vue
+3
-3
readed.vue
frontend/src/views/msg/readed.vue
+4
-4
setting.vue
frontend/src/views/msg/setting.vue
+2
-2
unread.vue
frontend/src/views/msg/unread.vue
+4
-4
index.vue
frontend/src/views/panel/index.vue
+4
-3
没有找到文件。
backend/src/main/java/io/dataease/commons/constants/SysMsgConstants.java
浏览文件 @
b329f894
...
...
@@ -4,4 +4,5 @@ public class SysMsgConstants {
public
final
static
String
SYS_MSG_CHANNEL
=
"sys_msg_channel"
;
public
final
static
String
SYS_MSG_TYPE
=
"sys_msg_type"
;
public
final
static
String
SYS_MSG_USER_SUBSCRIBE
=
"sys_msg_user_subscribe"
;
}
backend/src/main/java/io/dataease/controller/message/MsgController.java
浏览文件 @
b329f894
...
...
@@ -8,7 +8,6 @@ import io.dataease.base.domain.SysMsgType;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.PageUtils
;
import
io.dataease.commons.utils.Pager
;
import
io.dataease.controller.handler.annotation.I18n
;
import
io.dataease.controller.message.dto.MsgGridDto
;
import
io.dataease.controller.message.dto.MsgRequest
;
import
io.dataease.controller.message.dto.MsgSettingRequest
;
...
...
@@ -53,14 +52,12 @@ public class MsgController {
sysMsgService
.
batchDelete
(
msgIds
);
}
@I18n
@PostMapping
(
"/treeNodes"
)
public
List
<
SettingTreeNode
>
treeNodes
()
{
return
sysMsgService
.
treeNodes
();
}
@I18n
@PostMapping
(
"/channelList"
)
public
List
<
SysMsgChannel
>
channelList
()
{
return
sysMsgService
.
channelList
();
...
...
@@ -73,10 +70,10 @@ public class MsgController {
@PostMapping
(
"/updateSetting"
)
public
void
updateSetting
(
@RequestBody
MsgSettingRequest
request
)
{
sysMsgService
.
updateSetting
(
request
);
Long
userId
=
AuthUtils
.
getUser
().
getUserId
();
sysMsgService
.
updateSetting
(
request
,
userId
);
}
@I18n
@PostMapping
(
"/types"
)
public
List
<
SysMsgType
>
allTypes
()
{
List
<
SysMsgType
>
sysMsgTypes
=
sysMsgService
.
queryMsgTypes
();
...
...
backend/src/main/java/io/dataease/controller/message/dto/SubscribeNode.java
0 → 100644
浏览文件 @
b329f894
package
io
.
dataease
.
controller
.
message
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
SubscribeNode
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1680823237289721438L
;
private
Long
typeId
;
private
Long
channelId
;
public
Boolean
match
(
Long
type
,
Long
channel
)
{
return
type
==
typeId
&&
channel
==
channelId
;
}
}
backend/src/main/java/io/dataease/service/message/DeMsgutil.java
浏览文件 @
b329f894
package
io
.
dataease
.
service
.
message
;
import
io.dataease.base.domain.SysMsg
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -20,14 +19,14 @@ public class DeMsgutil {
public
static
void
sendMsg
(
Long
userId
,
Long
typeId
,
Long
channelId
,
String
content
,
String
param
)
{
SysMsg
sysMsg
=
new
SysMsg
();
sysMsg
.
setUserId
(
userId
);
sysMsg
.
setTypeId
(
typeId
);
sysMsg
.
setContent
(
content
);
sysMsg
.
setStatus
(
false
);
sysMsg
.
setCreateTime
(
System
.
currentTimeMillis
());
sysMsg
.
setParam
(
param
);
sysMsgService
.
s
ave
(
sysMsg
);
//
SysMsg sysMsg = new SysMsg();
//
sysMsg.setUserId(userId);
//
sysMsg.setTypeId(typeId);
//
sysMsg.setContent(content);
//
sysMsg.setStatus(false);
//
sysMsg.setCreateTime(System.currentTimeMillis());
//
sysMsg.setParam(param);
sysMsgService
.
s
endMsg
(
userId
,
typeId
,
channelId
,
content
,
param
);
}
...
...
backend/src/main/java/io/dataease/service/message/MsgAop.java
浏览文件 @
b329f894
package
io
.
dataease
.
service
.
message
;
import
io.dataease.base.domain.SysMsgSettingExample
;
import
io.dataease.base.mapper.SysMsgSettingMapper
;
import
io.dataease.controller.message.dto.SubscribeNode
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Aspect
@Component
public
class
MsgAop
{
@Resource
private
SysMsgSe
ttingMapper
sysMsgSettingMapper
;
private
SysMsgSe
rvice
sysMsgService
;
...
...
@@ -24,7 +29,7 @@ public class MsgAop {
* 对sendMsg 切面拦截
* @param point
*/
@Around
(
"(execution(* io.dataease.service.message.
DeMsgutil
.sendMsg(..)))"
)
@Around
(
"(execution(* io.dataease.service.message.
SysMsgService
.sendMsg(..)))"
)
public
Object
cutPoint
(
ProceedingJoinPoint
point
)
{
Object
[]
args
=
point
.
getArgs
();
...
...
@@ -39,11 +44,11 @@ public class MsgAop {
Long
typeId
=
(
Long
)
arg1
;
Long
channelId
=
(
Long
)
arg2
;
SysMsgSettingExample
example
=
new
SysMsgSettingExample
();
example
.
createCriteria
().
andChannelIdEqualTo
(
channelId
).
andUserIdEqualTo
(
userId
).
andTypeIdEqualTo
(
typeId
).
andEnableEqualTo
(
true
);
List
<
SubscribeNode
>
subscribes
=
sysMsgService
.
subscribes
(
userId
);
try
{
if
(
sysMsgSettingMapper
.
countByExample
(
example
)
>
0
)
// 如果已经订阅了这种类型的消息 直接发送 否则直接返回
if
(
CollectionUtils
.
isNotEmpty
(
subscribes
)
&&
subscribes
.
stream
().
anyMatch
(
item
->
item
.
match
(
typeId
,
channelId
)))
return
point
.
proceed
(
args
);
return
null
;
}
catch
(
Throwable
throwable
)
{
...
...
backend/src/main/java/io/dataease/service/message/SysMsgService.java
浏览文件 @
b329f894
...
...
@@ -7,16 +7,13 @@ import io.dataease.base.mapper.SysMsgMapper;
import
io.dataease.base.mapper.SysMsgSettingMapper
;
import
io.dataease.base.mapper.SysMsgTypeMapper
;
import
io.dataease.base.mapper.ext.ExtSysMsgMapper
;
import
io.dataease.commons.constants.AuthConstants
;
import
io.dataease.commons.constants.SysMsgConstants
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.CommonBeanFactory
;
import
io.dataease.controller.message.dto.MsgGridDto
;
import
io.dataease.controller.message.dto.MsgRequest
;
import
io.dataease.controller.message.dto.MsgSettingRequest
;
import
io.dataease.controller.message.dto.SettingTreeNode
;
import
io.dataease.controller.message.dto.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -179,11 +176,17 @@ public class SysMsgService {
return
sysMsgSettings
;
}
/**
* 修改了订阅信息 需要清除缓存
* @param request
* @param userId
*/
@Transactional
public
void
updateSetting
(
MsgSettingRequest
request
)
{
@CacheEvict
(
value
=
SysMsgConstants
.
SYS_MSG_USER_SUBSCRIBE
,
key
=
"#userId"
)
public
void
updateSetting
(
MsgSettingRequest
request
,
Long
userId
)
{
Long
typeId
=
request
.
getTypeId
();
Long
channelId
=
request
.
getChannelId
();
Long
userId
=
AuthUtils
.
getUser
().
getUserId
();
//
Long userId = AuthUtils.getUser().getUserId();
SysMsgSettingExample
example
=
new
SysMsgSettingExample
();
example
.
createCriteria
().
andUserIdEqualTo
(
userId
).
andTypeIdEqualTo
(
typeId
).
andChannelIdEqualTo
(
channelId
);
List
<
SysMsgSetting
>
sysMsgSettings
=
sysMsgSettingMapper
.
selectByExample
(
example
);
...
...
@@ -202,5 +205,34 @@ public class SysMsgService {
sysMsgSettingMapper
.
insert
(
sysMsgSetting
);
}
public
void
sendMsg
(
Long
userId
,
Long
typeId
,
Long
channelId
,
String
content
,
String
param
)
{
SysMsg
sysMsg
=
new
SysMsg
();
sysMsg
.
setUserId
(
userId
);
sysMsg
.
setTypeId
(
typeId
);
sysMsg
.
setContent
(
content
);
sysMsg
.
setStatus
(
false
);
sysMsg
.
setCreateTime
(
System
.
currentTimeMillis
());
sysMsg
.
setParam
(
param
);
save
(
sysMsg
);
}
/**
* 查询用户订阅的消息 并缓存
* @param userId
* @return
*/
@Cacheable
(
value
=
SysMsgConstants
.
SYS_MSG_USER_SUBSCRIBE
,
key
=
"#userId"
)
public
List
<
SubscribeNode
>
subscribes
(
Long
userId
)
{
SysMsgSettingExample
example
=
new
SysMsgSettingExample
();
example
.
createCriteria
().
andUserIdEqualTo
(
userId
).
andEnableEqualTo
(
true
);
List
<
SysMsgSetting
>
sysMsgSettings
=
sysMsgSettingMapper
.
selectByExample
(
example
);
List
<
SubscribeNode
>
resultLists
=
sysMsgSettings
.
stream
().
map
(
item
->
{
SubscribeNode
subscribeNode
=
new
SubscribeNode
();
subscribeNode
.
setTypeId
(
item
.
getTypeId
());
subscribeNode
.
setChannelId
(
item
.
getChannelId
());
return
subscribeNode
;
}).
collect
(
Collectors
.
toList
());
return
resultLists
;
}
}
backend/src/main/resources/db/migration/V10__web_msg.sql
浏览文件 @
b329f894
...
...
@@ -5,24 +5,81 @@ 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
'类型'
,
`type
_id`
bigint
(
20
)
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_type`
(
`type
_id
`
)
USING
BTREE
,
KEY
`inx_msg_status`
(
`status`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
DEFAULT
CHARSET
=
utf8
COMMENT
=
'消息通知表'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
COMMENT
=
'消息通知表'
;
-- ----------------------------
-- Table structure for sys_msg_channel
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_msg_channel`
;
CREATE
TABLE
`sys_msg_channel`
(
`msg_channel_id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`channel_name`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'渠道名称'
,
PRIMARY
KEY
(
`msg_channel_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
4
DEFAULT
CHARSET
=
utf8
COMMENT
=
'消息渠道表'
;
-- ----------------------------
-- Records of sys_msg_channel
-- ----------------------------
BEGIN
;
INSERT
INTO
`sys_msg_channel`
VALUES
(
1
,
'webmsg.channel_inner_msg'
);
COMMIT
;
-- ----------------------------
-- Table structure for sys_msg_type
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_msg_type`
;
CREATE
TABLE
`sys_msg_type`
(
`msg_type_id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`pid`
bigint
(
20
)
NOT
NULL
COMMENT
'父类ID'
,
`type_name`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'类型名称'
,
`router`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'跳转路由'
,
`callback`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'回调方法'
,
PRIMARY
KEY
(
`msg_type_id`
)
USING
BTREE
,
KEY
`inx_msgtype_pid`
(
`pid`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
7
DEFAULT
CHARSET
=
utf8
COMMENT
=
'消息类型表'
;
-- ----------------------------
-- Records of sys_msg_type
-- ----------------------------
BEGIN
;
INSERT
INTO
`sys_msg_type`
VALUES
(
1
,
0
,
'i18n_msg_type_panel_share'
,
'panel'
,
'to-msg-share'
);
INSERT
INTO
`sys_msg_type`
VALUES
(
2
,
1
,
'i18n_msg_type_panel_share'
,
'panel'
,
'to-msg-share'
);
INSERT
INTO
`sys_msg_type`
VALUES
(
3
,
1
,
'i18n_msg_type_panel_share_cacnel'
,
'panel'
,
'to-msg-share'
);
INSERT
INTO
`sys_msg_type`
VALUES
(
4
,
0
,
'i18n_msg_type_dataset_sync'
,
'dataset'
,
'to-msg-dataset'
);
INSERT
INTO
`sys_msg_type`
VALUES
(
5
,
4
,
'i18n_msg_type_dataset_sync_success'
,
'dataset'
,
'to-msg-dataset'
);
INSERT
INTO
`sys_msg_type`
VALUES
(
6
,
4
,
'i18n_msg_type_dataset_sync_faild'
,
'dataset'
,
'to-msg-dataset'
);
COMMIT
;
-- ----------------------------
-- Table structure for sys_msg_setting
-- ----------------------------
DROP
TABLE
IF
EXISTS
`sys_msg_setting`
;
CREATE
TABLE
`sys_msg_setting`
(
`msg_setting_id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`user_id`
bigint
(
20
)
NOT
NULL
COMMENT
'用户ID'
,
`type_id`
bigint
(
20
)
NOT
NULL
COMMENT
'类型ID'
,
`channel_id`
bigint
(
20
)
NOT
NULL
COMMENT
'渠道ID'
,
`enable`
tinyint
(
1
)
DEFAULT
NULL
COMMENT
'是否启用'
,
PRIMARY
KEY
(
`msg_setting_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
COMMENT
=
'消息设置表'
;
BEGIN
;
INSERT
INTO
`sys_menu`
VALUES
(
53
,
1
,
3
,
1
,
'站内消息'
,
'sys-msg-web'
,
'msg/index'
,
1000
,
'all-msg'
,
'system-msg-web'
,
b
'0'
,
b
'0'
,
b
'0'
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`sys_menu`
VALUES
(
54
,
53
,
0
,
1
,
'所有消息'
,
'sys-msg-web-all'
,
'msg/all'
,
1
,
'web-msg'
,
'all'
,
b
'0'
,
b
'0'
,
b
'0'
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`sys_menu`
VALUES
(
55
,
53
,
0
,
1
,
'未读消息'
,
'sys-msg-web-unread'
,
'msg/unread'
,
2
,
'unread-msg'
,
'unread'
,
b
'0'
,
b
'0'
,
b
'0'
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`sys_menu`
VALUES
(
56
,
53
,
0
,
1
,
'已读消息'
,
'sys-msg-web-readed'
,
'msg/readed'
,
3
,
'readed-msg'
,
'readed'
,
b
'0'
,
b
'0'
,
b
'0'
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`sys_menu`
VALUES
(
59
,
53
,
0
,
1
,
'接收管理'
,
'sys-msg-setting'
,
'msg/setting'
,
4
,
'msg-setting'
,
'setting'
,
b
'0'
,
b
'0'
,
b
'0'
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
COMMIT
;
BEGIN
;
...
...
backend/src/main/resources/ehcache/ehcache.xml
浏览文件 @
b329f894
...
...
@@ -102,7 +102,7 @@
maxElementsInMemory=
"100"
maxElementsOnDisk=
"1000"
overflowToDisk=
"true"
diskPersistent=
"
tru
e"
diskPersistent=
"
fals
e"
/>
<!--消息类型缓存-->
...
...
@@ -112,7 +112,20 @@
maxElementsInMemory=
"100"
maxElementsOnDisk=
"1000"
overflowToDisk=
"true"
diskPersistent=
"true"
diskPersistent=
"false"
/>
<!--消息类型缓存-->
<cache
name=
"sys_msg_user_subscribe"
eternal=
"false"
maxElementsInMemory=
"100"
maxElementsOnDisk=
"10000"
overflowToDisk=
"true"
diskPersistent=
"false"
timeToIdleSeconds=
"28800"
timeToLiveSeconds=
"86400"
memoryStoreEvictionPolicy=
"LRU"
/>
...
...
frontend/src/components/Notification/index.vue
浏览文件 @
b329f894
...
...
@@ -108,7 +108,7 @@ export default {
// console.log(lang)
// },
showDetail
(
row
)
{
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
,
sourceParam
:
row
.
param
}}
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
Id
,
sourceParam
:
row
.
param
}}
this
.
visible
=
false
// if (this.$route && this.$route.name && this.$route.name.includes('panel') && row.type === 0) {
// bus.$emit('to-msg-share', param)
...
...
@@ -162,7 +162,7 @@ export default {
})
},
getTypeName
(
value
)
{
return
getTypeName
(
value
)
return
this
.
$t
(
'webmsg.'
+
getTypeName
(
value
)
)
},
open
()
{
this
.
visible
=
true
...
...
frontend/src/lang/en.js
浏览文件 @
b329f894
...
...
@@ -1240,6 +1240,13 @@ export default {
mark_readed
:
'Mark As Read'
,
please_select
:
'Please select at least one message'
,
mark_success
:
'Mark read successfully'
,
receive_manage
:
'Receive Manage'
receive_manage
:
'Receive Manage'
,
i18n_msg_type_panel_share
:
'Dashboard sharing'
,
i18n_msg_type_panel_share_cacnel
:
'Dashboard unshared'
,
i18n_msg_type_dataset_sync
:
'Data set synchronization'
,
i18n_msg_type_dataset_sync_success
:
'Dataset synchronization successful'
,
i18n_msg_type_dataset_sync_faild
:
'Dataset synchronization failed'
,
i18n_msg_type_all
:
'All type'
,
channel_inner_msg
:
'On site news'
}
}
frontend/src/lang/tw.js
浏览文件 @
b329f894
...
...
@@ -1240,6 +1240,13 @@ export default {
mark_readed
:
'標記已讀'
,
please_select
:
'請至少選擇一條消息'
,
mark_success
:
'標記已讀成功'
,
receive_manage
:
'接收管理'
receive_manage
:
'接收管理'
,
i18n_msg_type_panel_share
:
'儀表板分享'
,
i18n_msg_type_panel_share_cacnel
:
'儀表板取消分享'
,
i18n_msg_type_dataset_sync
:
'數據集同步'
,
i18n_msg_type_dataset_sync_success
:
'數據集同步成功'
,
i18n_msg_type_dataset_sync_faild
:
'數據集同步失敗'
,
i18n_msg_type_all
:
'全部類型'
,
channel_inner_msg
:
'站內消息'
}
}
frontend/src/lang/zh.js
浏览文件 @
b329f894
...
...
@@ -1242,6 +1242,13 @@ export default {
mark_readed
:
'标记已读'
,
please_select
:
'请至少选择一条消息'
,
mark_success
:
'标记已读成功'
,
receive_manage
:
'接收管理'
receive_manage
:
'接收管理'
,
i18n_msg_type_panel_share
:
'仪表板分享'
,
i18n_msg_type_panel_share_cacnel
:
'仪表板取消分享'
,
i18n_msg_type_dataset_sync
:
'数据集同步'
,
i18n_msg_type_dataset_sync_success
:
'数据集同步成功'
,
i18n_msg_type_dataset_sync_faild
:
'数据集同步失败'
,
i18n_msg_type_all
:
'全部类型'
,
channel_inner_msg
:
'站内消息'
}
}
frontend/src/utils/webMsg.js
浏览文件 @
b329f894
...
...
@@ -6,7 +6,7 @@ export const loadMsgTypes = value => {
if
(
!
msgTypes
||
Object
.
keys
(
msgTypes
).
length
===
0
)
{
allTypes
().
then
(
res
=>
{
msgTypes
=
res
.
data
const
defaultType
=
{
msgTypeId
:
-
1
,
pid
:
0
,
typeName
:
'
全部类型
'
}
const
defaultType
=
{
msgTypeId
:
-
1
,
pid
:
0
,
typeName
:
'
i18n_msg_type_all
'
}
msgTypes
.
splice
(
0
,
0
,
defaultType
)
store
.
dispatch
(
'msg/setMsgTypes'
,
msgTypes
)
})
...
...
frontend/src/views/dataset/index.vue
浏览文件 @
b329f894
...
...
@@ -99,15 +99,16 @@ export default {
toMsgShare
(
routerParam
)
{
if
(
routerParam
!==
null
&&
routerParam
.
msgNotification
)
{
// 说明是从消息通知跳转过来的
if
(
routerParam
.
msgType
===
1
)
{
// 是数据集同步
const
panelShareTypeIds
=
[
4
,
5
,
6
]
// 说明是从消息通知跳转过来的
if
(
panelShareTypeIds
.
includes
(
routerParam
.
msgType
))
{
// 是数据集同步
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
)
this
.
$refs
.
dynamic_component
&&
this
.
$refs
.
dynamic_component
.
msg2Current
&&
this
.
$refs
.
dynamic_component
.
msg2Current
(
routerParam
.
sourceParam
)
})
}
catch
(
error
)
{
console
.
error
(
error
)
...
...
frontend/src/views/msg/all.vue
浏览文件 @
b329f894
...
...
@@ -2,7 +2,7 @@
<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 $store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
item
.
typeName
)
}}
</el-radio-button>
<el-radio-button
v-for=
"(item,index) in $store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
'webmsg.'
+
item
.
typeName
)
}}
</el-radio-button>
</el-radio-group>
<complex-table
...
...
@@ -113,13 +113,13 @@ export default {
})
},
getTypeName
(
value
)
{
return
getTypeName
(
value
)
return
this
.
$t
(
'webmsg.'
+
getTypeName
(
value
)
)
},
typeChange
(
value
)
{
this
.
search
()
},
toDetail
(
row
)
{
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
,
sourceParam
:
row
.
param
}}
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
Id
,
sourceParam
:
row
.
param
}}
this
.
$router
.
push
({
name
:
row
.
router
,
params
:
param
})
row
.
status
||
this
.
setReaded
(
row
)
},
...
...
frontend/src/views/msg/readed.vue
浏览文件 @
b329f894
...
...
@@ -2,7 +2,7 @@
<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 $store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
item
.
typeName
)
}}
</el-radio-button>
<el-radio-button
v-for=
"(item,index) in $store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
'webmsg.'
+
item
.
typeName
)
}}
</el-radio-button>
</el-radio-group>
<complex-table
...
...
@@ -42,7 +42,7 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
2
0"
>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
getTypeName
(
scope
.
row
.
typeId
)
}}
</span>
</
template
>
...
...
@@ -118,13 +118,13 @@ export default {
})
},
getTypeName
(
value
)
{
return
getTypeName
(
value
)
return
this
.
$t
(
'webmsg.'
+
getTypeName
(
value
)
)
},
typeChange
(
value
)
{
this
.
search
()
},
toDetail
(
row
)
{
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
,
sourceParam
:
row
.
param
}}
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
Id
,
sourceParam
:
row
.
param
}}
this
.
$router
.
push
({
name
:
row
.
router
,
params
:
param
})
},
sortChange
({
column
,
prop
,
order
})
{
...
...
frontend/src/views/msg/setting.vue
浏览文件 @
b329f894
...
...
@@ -4,7 +4,7 @@
<el-row
class=
"tree-head"
>
<span
style=
"float: left;padding-left: 10px"
>
{{
$t
(
'webmsg.type'
)
}}
</span>
<span
v-for=
"channel in msg_channels"
:key=
"channel.msgChannelId"
class=
"auth-span"
>
{{
channel
.
channelName
}}
{{
$t
(
channel
.
channelName
)
}}
</span>
</el-row>
<el-row
style=
"margin-top: 5px"
>
...
...
@@ -18,7 +18,7 @@
>
<span
slot-scope=
"
{ node, data }" class="custom-tree-node">
<span>
<span
style=
"margin-left: 6px"
v-html=
"data.name"
/
>
<span
style=
"margin-left: 6px"
>
{{
$t
(
'webmsg.'
+
data
.
name
)
}}
</span
>
</span>
<span
@
click
.
stop
>
<!--
<div
v-if=
"setting_data[data.id]"
>
...
...
frontend/src/views/msg/unread.vue
浏览文件 @
b329f894
...
...
@@ -2,7 +2,7 @@
<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 $store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
item
.
typeName
)
}}
</el-radio-button>
<el-radio-button
v-for=
"(item,index) in $store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
'webmsg.'
+
item
.
typeName
)
}}
</el-radio-button>
</el-radio-group>
<complex-table
...
...
@@ -45,7 +45,7 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
2
0"
>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
getTypeName
(
scope
.
row
.
typeId
)
}}
</span>
</
template
>
...
...
@@ -128,13 +128,13 @@ export default {
})
},
getTypeName
(
value
)
{
return
getTypeName
(
value
)
return
this
.
$t
(
'webmsg.'
+
getTypeName
(
value
)
)
},
typeChange
(
value
)
{
this
.
search
()
},
toDetail
(
row
)
{
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
,
sourceParam
:
row
.
param
}}
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
Id
,
sourceParam
:
row
.
param
}}
this
.
$router
.
push
({
name
:
row
.
router
,
params
:
param
})
this
.
setReaded
(
row
)
},
...
...
frontend/src/views/panel/index.vue
浏览文件 @
b329f894
...
...
@@ -75,11 +75,12 @@ export default {
methods
:
{
toMsgShare
(
routerParam
)
{
if
(
routerParam
!==
null
&&
routerParam
.
msgNotification
)
{
// 说明是从消息通知跳转过来的
if
(
routerParam
.
msgType
===
0
)
{
// 是仪表板分享
const
panelShareTypeIds
=
[
1
,
2
,
3
]
// 说明是从消息通知跳转过来的
if
(
panelShareTypeIds
.
includes
(
routerParam
.
msgType
))
{
// 是仪表板分享
this
.
componentName
=
'PanelMain'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
panel_main
.
msg2Current
(
routerParam
.
sourceParam
)
this
.
$refs
.
panel_main
&&
this
.
$refs
.
panel_main
.
msg2Current
&&
this
.
$refs
.
panel_main
.
msg2Current
(
routerParam
.
sourceParam
)
})
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论