Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
3bca1e6b
Commit
3bca1e6b
authored
Dec 10, 2021
by
季圣华
Browse files
增加消息页面
parent
a0bad81d
Changes
4
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/components/tools/HeaderNotice.vue
View file @
3bca1e6b
<
template
>
<a-popover
trigger=
"click"
placement=
"bottom
Right
"
placement=
"bottom"
:autoAdjustOverflow=
"true"
:arrowPointAtCenter=
"true"
overlayClassName=
"header-notice-wrapper"
...
...
@@ -14,35 +14,12 @@
<a-list>
<a-list-item
:key=
"index"
v-for=
"(record, index) in announcement1"
>
<div
style=
"margin-left: 5%;width: 80%"
>
<p><a
@
click=
"showAnnouncement(record)"
>
{{
record
.
titile
}}
</a></p>
<p
style=
"color: rgba(0,0,0,.45);margin-bottom: 0px"
>
{{
record
.
createTime
}}
发布
</p>
</div>
<div
style=
"text-align: right"
>
<a-tag
@
click=
"showAnnouncement(record)"
v-if=
"record.priority === 'L'"
color=
"blue"
>
一般消息
</a-tag>
<a-tag
@
click=
"showAnnouncement(record)"
v-if=
"record.priority === 'M'"
color=
"orange"
>
重要消息
</a-tag>
<a-tag
@
click=
"showAnnouncement(record)"
v-if=
"record.priority === 'H'"
color=
"red"
>
紧急消息
</a-tag>
<p><a
@
click=
"showAnnouncement(record)"
>
{{
record
.
msgTitle
}}
</a></p>
<p
style=
"color: rgba(0,0,0,.45);margin-bottom: 0px"
>
{{
record
.
createTimeStr
}}
发布
</p>
</div>
</a-list-item>
<div
style=
"margin-top: 5px;text-align: center"
>
<!--
<a-button
@
click=
"toMyAnnouncement()"
type=
"dashed"
block
>
查看更多
</a-button>
-->
</div>
</a-list>
</a-tab-pane>
<a-tab-pane
:tab=
"msg2Title"
key=
"2"
>
<a-list>
<a-list-item
:key=
"index"
v-for=
"(record, index) in announcement2"
>
<div
style=
"margin-left: 5%;width: 80%"
>
<p><a
@
click=
"showAnnouncement(record)"
>
{{
record
.
titile
}}
</a></p>
<p
style=
"color: rgba(0,0,0,.45);margin-bottom: 0px"
>
{{
record
.
createTime
}}
发布
</p>
</div>
<div
style=
"text-align: right"
>
<a-tag
@
click=
"showAnnouncement(record)"
v-if=
"record.priority === 'L'"
color=
"blue"
>
一般消息
</a-tag>
<a-tag
@
click=
"showAnnouncement(record)"
v-if=
"record.priority === 'M'"
color=
"orange"
>
重要消息
</a-tag>
<a-tag
@
click=
"showAnnouncement(record)"
v-if=
"record.priority === 'H'"
color=
"red"
>
紧急消息
</a-tag>
</div>
</a-list-item>
<div
style=
"margin-top: 5px;text-align: center"
>
<!--
<a-button
@
click=
"toMyAnnouncement()"
type=
"dashed"
block
>
查看更多
</a-button>
-->
<a-button
@
click=
"toMyAnnouncement()"
type=
"dashed"
block
>
查看更多
</a-button>
</div>
</a-list>
</a-tab-pane>
...
...
@@ -56,37 +33,36 @@
</span>
<show-announcement
ref=
"ShowAnnouncement"
@
ok=
"modalFormOk"
></show-announcement>
<dynamic-notice
ref=
"showDynamNotice"
:path=
"openPath"
:formData=
"formData"
/>
<msg-list
ref=
"modalList"
@
close=
"modalListCancel()"
></msg-list>
</a-popover>
</template>
<
script
>
import
{
getAction
,
p
u
tAction
}
from
'
@/api/manage
'
import
{
getAction
,
p
os
tAction
}
from
'
@/api/manage
'
import
ShowAnnouncement
from
'
./ShowAnnouncement
'
import
store
from
'
@/store/
'
import
DynamicNotice
from
'
./DynamicNotice
'
import
MsgList
from
'
@/views/system/MsgList
'
export
default
{
name
:
"
HeaderNotice
"
,
components
:
{
DynamicNotice
,
ShowAnnouncement
,
MsgList
},
data
()
{
return
{
loadding
:
false
,
url
:{
listCementByUser
:
"
/sys/annountCement/listByUser
"
,
editCementSend
:
"
/sys/sysAnnouncementSend/editByAnntIdAndUserId
"
,
getMsgByStatus
:
"
/msg/getMsgByStatus
"
,
batchUpdateStatus
:
"
/msg/batchUpdateStatus
"
,
queryById
:
"
/sys/annountCement/queryById
"
,
},
hovered
:
false
,
announcement1
:[],
announcement2
:[],
msg1Count
:
"
0
"
,
msg2Count
:
"
0
"
,
msg1Title
:
"
通知(0)
"
,
msg2Title
:
""
,
stopTimer
:
false
,
websock
:
null
,
lockReconnect
:
false
,
...
...
@@ -97,11 +73,11 @@
},
computed
:{
msgTotal
()
{
return
parseInt
(
this
.
msg1Count
)
+
parseInt
(
this
.
msg2Count
)
;
return
parseInt
(
this
.
msg1Count
);
}
},
mounted
()
{
//
this.loadData();
this
.
loadData
();
//this.timerFun();
//this.initWebSocket(); //注释by jishenghua 2021年1月13日
// this.heartCheckFun();
...
...
@@ -124,14 +100,11 @@
loadData
(){
try
{
// 获取系统消息
getAction
(
this
.
url
.
listCementByUser
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
announcement1
=
res
.
result
.
anntMsgList
;
this
.
msg1Count
=
res
.
result
.
anntMsgTotal
;
this
.
msg1Title
=
"
通知(
"
+
res
.
result
.
anntMsgTotal
+
"
)
"
;
this
.
announcement2
=
res
.
result
.
sysMsgList
;
this
.
msg2Count
=
res
.
result
.
sysMsgTotal
;
this
.
msg2Title
=
"
系统消息(
"
+
res
.
result
.
sysMsgTotal
+
"
)
"
;
getAction
(
this
.
url
.
getMsgByStatus
,
{
status
:
'
1
'
}).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
)
{
this
.
announcement1
=
res
.
data
;
this
.
msg1Count
=
res
.
data
.
length
;
this
.
msg1Title
=
"
通知(
"
+
res
.
data
.
length
+
"
)
"
;
}
}).
catch
(
error
=>
{
console
.
log
(
"
系统消息通知异常
"
,
error
);
//这行打印permissionName is undefined
...
...
@@ -154,29 +127,22 @@
},
200
)
},
showAnnouncement
(
record
){
p
u
tAction
(
this
.
url
.
editCementSend
,{
anntId
:
record
.
id
}).
then
((
res
)
=>
{
if
(
res
.
success
){
p
os
tAction
(
this
.
url
.
batchUpdateStatus
,{
ids
:
record
.
id
,
status
:
'
2
'
}).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
){
this
.
loadData
();
}
});
this
.
hovered
=
false
;
if
(
record
.
openType
===
'
component
'
){
this
.
openPath
=
record
.
openPage
;
this
.
formData
=
{
id
:
record
.
busId
};
this
.
$refs
.
showDynamNotice
.
detail
(
record
.
openPage
);
}
else
{
this
.
$refs
.
ShowAnnouncement
.
detail
(
record
);
}
this
.
$refs
.
ShowAnnouncement
.
detail
(
record
);
},
toMyAnnouncement
(){
this
.
$router
.
push
({
path
:
'
/isps/userAnnouncement
'
,
name
:
'
isps-userAnnouncement
'
});
this
.
$refs
.
modalList
.
handleDetail
();
},
modalFormOk
(){
},
modalListCancel
(){
this
.
loadData
()
},
handleHoverChange
(
visible
)
{
this
.
hovered
=
visible
;
},
...
...
jshERP-web/src/components/tools/ShowAnnouncement.vue
View file @
3bca1e6b
<
template
>
<j-modal
:title=
"title"
:width=
"modelStyle.width"
:visible=
"visible"
:bodyStyle =
"bodyStyle"
:switchFullscreen=
"switchFullscreen"
@
cancel=
"handleCancel"
>
<template
slot=
"footer"
>
<a-button
key=
"back"
@
click=
"handleCancel"
>
关闭
</a-button>
<a-button
v-if=
"record.openType==='url'"
type=
"primary"
@
click=
"toHandle"
>
去处理
</a-button>
</
template
>
<a-card
class=
"daily-article"
:loading=
"loading"
>
<a-card-meta
:title=
"record.titile"
:description=
"'
发布人:'+record.sender + ' 发布时间: ' + record.sendTim
e"
>
</a-card-meta>
<a-divider
/>
<span
v-html=
"record.msgContent"
class=
"article-content"
></span>
</a-card>
</j-modal>
</template>
<
script
>
export
default
{
name
:
"
SysAnnouncementModal
"
,
components
:
{
},
data
()
{
return
{
title
:
"
通知消息
"
,
record
:
{},
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
16
},
},
visible
:
false
,
switchFullscreen
:
true
,
loading
:
false
,
bodyStyle
:{
padding
:
"
0
"
,
height
:(
window
.
innerHeight
*
0.
8
)
+
"
px
"
,
"
overflow-y
"
:
"
auto
"
,
},
modelStyle
:{
width
:
'
60%
'
,
style
:
{
top
:
'
20px
'
},
fullScreen
:
false
}
}
},
created
()
{
},
methods
:
{
detail
(
record
)
{
this
.
visible
=
true
;
this
.
record
=
record
;
},
handleCancel
()
{
this
.
visible
=
false
;
},
/** 切换全屏显示 */
handleClickToggleFullScreen
()
{
let
mode
=
!
this
.
modelStyle
.
fullScreen
if
(
mode
)
{
this
.
modelStyle
.
width
=
'
100%
'
this
.
modelStyle
.
style
.
top
=
'
20px
'
}
else
{
this
.
modelStyle
.
width
=
'
60%
'
this
.
modelStyle
.
style
.
top
=
'
50px
'
}
this
.
modelStyle
.
fullScreen
=
mode
},
toHandle
(){
if
(
this
.
record
.
openType
===
'
url
'
){
this
.
visible
=
false
;
//链接跳转
this
.
$router
.
push
({
path
:
this
.
record
.
openPage
})
}
},
}
}
</
script
>
<
style
lang=
"less"
>
.announcementCustomModal{
.ant-modal-header {
border: none;
display: inline-block;
position: absolute;
z-index: 1;
right: 56px;
padding: 0;
.ant-modal-title{
.custom-btn{
width: 56px;
height: 56px;
border: none;
box-shadow: none;
}
}
}
.daily-article{
border-bottom: 0;
}
}
</
style
>
<
style
scoped
lang=
"less"
>
.daily-article {
.article-button {
font-size: 1.2rem !important;
}
.ant-card-body {
padding: 18px !important;
}
.ant-card-head {
padding: 0 1rem;
}
.ant-card-meta {
margin-bottom: 1rem;
}
.article-content {
p {
word-wrap: break-word;
word-break: break-all;
text-overflow: initial;
white-space: normal;
font-size: .9rem !important;
margin-bottom: .8rem;
}
}
}
</
style
>
<
template
>
<j-modal
:title=
"title"
:width=
"modelStyle.width"
:visible=
"visible"
:bodyStyle =
"bodyStyle"
:switchFullscreen=
"switchFullscreen"
@
cancel=
"handleCancel"
>
<template
slot=
"footer"
>
<a-button
key=
"back"
@
click=
"handleCancel"
>
关闭
</a-button>
<a-button
v-if=
"record.openType==='url'"
type=
"primary"
@
click=
"toHandle"
>
去处理
</a-button>
</
template
>
<a-card
class=
"daily-article"
:loading=
"loading"
>
<a-card-meta
:title=
"record.titile"
:description=
"'
标题:'+record.msgTitl
e"
>
</a-card-meta>
<a-divider
/>
<span
v-html=
"record.msgContent"
class=
"article-content"
></span>
</a-card>
</j-modal>
</template>
<
script
>
export
default
{
name
:
"
SysAnnouncementModal
"
,
components
:
{
},
data
()
{
return
{
title
:
"
通知消息
"
,
record
:
{},
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
16
},
},
visible
:
false
,
switchFullscreen
:
true
,
loading
:
false
,
bodyStyle
:{
padding
:
"
0
"
,
height
:(
window
.
innerHeight
*
0.
6
)
+
"
px
"
,
"
overflow-y
"
:
"
auto
"
,
},
modelStyle
:{
width
:
'
60%
'
,
style
:
{
top
:
'
20px
'
},
fullScreen
:
false
}
}
},
created
()
{
},
methods
:
{
detail
(
record
)
{
this
.
visible
=
true
;
this
.
record
=
record
;
},
handleCancel
()
{
this
.
visible
=
false
;
},
/** 切换全屏显示 */
handleClickToggleFullScreen
()
{
let
mode
=
!
this
.
modelStyle
.
fullScreen
if
(
mode
)
{
this
.
modelStyle
.
width
=
'
100%
'
this
.
modelStyle
.
style
.
top
=
'
20px
'
}
else
{
this
.
modelStyle
.
width
=
'
60%
'
this
.
modelStyle
.
style
.
top
=
'
50px
'
}
this
.
modelStyle
.
fullScreen
=
mode
},
toHandle
(){
if
(
this
.
record
.
openType
===
'
url
'
){
this
.
visible
=
false
;
//链接跳转
this
.
$router
.
push
({
path
:
this
.
record
.
openPage
})
}
},
}
}
</
script
>
<
style
lang=
"less"
>
.announcementCustomModal{
.ant-modal-header {
border: none;
display: inline-block;
position: absolute;
z-index: 1;
right: 56px;
padding: 0;
.ant-modal-title{
.custom-btn{
width: 56px;
height: 56px;
border: none;
box-shadow: none;
}
}
}
.daily-article{
border-bottom: 0;
}
}
</
style
>
<
style
scoped
lang=
"less"
>
.daily-article {
.article-button {
font-size: 1.2rem !important;
}
.ant-card-body {
padding: 18px !important;
}
.ant-card-head {
padding: 0 1rem;
}
.ant-card-meta {
margin-bottom: 1rem;
}
.article-content {
p {
word-wrap: break-word;
word-break: break-all;
text-overflow: initial;
white-space: normal;
font-size: .9rem !important;
margin-bottom: .8rem;
}
}
}
</
style
>
jshERP-web/src/views/dashboard/IndexChart.vue
View file @
3bca1e6b
...
...
@@ -99,7 +99,7 @@
import
Trend
from
'
@/components/Trend
'
import
{
getBuyAndSaleStatistics
,
buyOrSalePrice
,
getPlatformConfigByKey
}
from
'
@/api/api
'
import
{
handleIntroJs
}
from
"
@/utils/util
"
import
{
getAction
}
from
'
../../api/manage
'
import
{
getAction
,
postAction
}
from
'
../../api/manage
'
export
default
{
name
:
"
IndexChart
"
,
...
...
@@ -179,6 +179,27 @@
//如果距离到期还剩5天就进行提示续费
if
(
difftime
<
86400000
*
5
)
{
this
.
hasExpire
=
true
//针对免费租户发送试用到期的消息提醒
if
(
res
.
data
.
type
===
'
0
'
)
{
//先检查有无发送过,只发送一次
getAction
(
"
/msg/getMsgCountByType
"
,{
'
type
'
:
'
试用到期
'
}).
then
(
res
=>
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
.
data
.
count
===
0
)
{
//发送消息
let
msgParam
=
{
'
msgTitle
'
:
'
试用到期提醒
'
,
'
msgContent
'
:
'
试用期即将结束,请您及时续费,过期将会影响正常使用!
'
,
'
type
'
:
'
试用到期
'
}
postAction
(
"
/msg/add
"
,
msgParam
).
then
(
res
=>
{
if
(
res
&&
res
.
code
===
200
)
{
}
})
}
}
})
}
}
}
})
...
...
jshERP-web/src/views/system/
UserAnnouncement
List.vue
→
jshERP-web/src/views/system/
Msg
List.vue
View file @
3bca1e6b
<
template
>
<a-card
:bordered=
"false"
>
<!-- 查询区域 -->
<div
class=
"table-page-search-wrapper"
>
<a-form
layout=
"inline"
@
keyup.enter.native=
"searchQuery"
>
<a-row
:gutter=
"24"
>
<a-col
:span=
"6"
>
<a-form-item
label=
"标题"
>
<a-input
placeholder=
"请输入标题"
v-model=
"queryParam.titile"
></a-input>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
label=
"发布人"
>
<a-input
placeholder=
"请输入发布人"
v-model=
"queryParam.sender"
></a-input>
</a-form-item>
</a-col>
<a-col
:span=
"8"
>
<span
style=
"float: left;overflow: hidden;"
class=
"table-page-search-submitButtons"
>
<a-button
type=
"primary"
@
click=
"searchQuery"
icon=
"search"
>
查询
</a-button>
<a-button
type=
"primary"
@
click=
"searchReset"
icon=
"reload"
style=
"margin-left: 8px"
>
重置
</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div
class=
"table-operator"
>
<a-button
type=
"primary"
@
click=
"readAll"
icon=
"book"
>
全部标注已读
</a-button>
</div>
<a-table
ref=
"table"
size=
"default"
bordered
rowKey=
"id"
:columns=
"columns"
:dataSource=
"dataSource"
:pagination=
"ipagination"
:loading=
"loading"
@
change=
"handleTableChange"
>
<span
slot=
"action"
slot-scope=
"text, record"
>
<a
@
click=
"showAnnouncement(record)"
>
查看
</a>
</span>
</a-table>
<show-announcement
ref=
"ShowAnnouncement"
></show-announcement>
<dynamic-notice
ref=
"showDynamNotice"
:path=
"openPath"
:formData=
"formData"
/>
</a-card>
</
template
>
<
script
>
import
{
filterObj
}
from
'
@/utils/util
'
import
{
getAction
,
putAction
}
from
'
@/api/manage
'
import
ShowAnnouncement
from
'
@/components/tools/ShowAnnouncement
'
import
{
JeecgListMixin
}
from
'
@/mixins/JeecgListMixin
'
import
DynamicNotice
from
'
../../components/tools/DynamicNotice
'
export
default
{
name
:
"
UserAnnouncementList
"
,
mixins
:
[
JeecgListMixin
],
components
:
{
DynamicNotice
,
ShowAnnouncement
},
data
()
{
return
{
description
:
'
系统通告表管理页面
'
,
queryParam
:
{},
columns
:
[{
title
:
'
标题
'
,
align
:
"
center
"
,
dataIndex
:
'
titile
'
},{
title
:
'
消息类型
'
,
align
:
"
center
"
,
dataIndex
:
'
msgCategory
'
,
customRender
:
function
(
text
)
{
if
(
text
==
'
1
'
)
{
return
"
通知公告
"
;
}
else
if
(
text
==
"
2
"
)
{
return
"
系统消息
"
;
}
else
{
return
text
;
}
}
},{
title
:
'
发布人
'
,
align
:
"
center
"
,
dataIndex
:
'
sender
'
},{
title
:
'
发布时间
'
,
align
:
"
center
"
,
dataIndex
:
'
sendTime
'
},{
title
:
'
优先级
'
,
align
:
"
center
"
,
dataIndex
:
'
priority
'
,
customRender
:
function
(
text
)
{
if
(
text
==
'
L
'
){
return
"
低
"
;
}
else
if
(
text
==
"
M
"
){
return
"
中
"
;
}
else
if
(
text
==
"
H
"
){
return
"
高
"
;
}
else
{
return
text
;
}
}
},{
title
:
'
阅读状态
'
,
align
:
"
center
"
,
dataIndex
:
'
readFlag
'
,
customRender
:
function
(
text
)
{
if
(
text
==
'
0
'
){
return
"
未读
"
;
}
else
if
(
text
==
"
1
"
){
return
"
已读
"
;
}
else
{
return
text
;
}
}
},{
title
:
'
操作
'
,
dataIndex
:
'
action
'
,
align
:
"
center
"
,
scopedSlots
:
{
customRender
:
'
action
'
},
}],
url
:
{
list
:
"
/sys/sysAnnouncementSend/getMyAnnouncementSend
"
,
editCementSend
:
"
sys/sysAnnouncementSend/editByAnntIdAndUserId
"
,
readAllMsg
:
"
sys/sysAnnouncementSend/readAll
"
,
},
loading
:
false
,
openPath
:
''
,
formData
:
''
}
},
methods
:
{
handleDetail
:
function
(
record
){
this
.
$refs
.
sysAnnouncementModal
.
detail
(
record
);
this
.
$refs
.
sysAnnouncementModal
.
title
=
"
查看
"
;
},
showAnnouncement
(
record
){
putAction
(
this
.
url
.
editCementSend
,{
anntId
:
record
.
anntId
}).
then
((
res
)
=>
{
if
(
res
.
success
){
this
.
loadData
();
this
.
syncHeadNotic
(
record
.
anntId
)
}
});
if
(
record
.
openType
===
'
component
'
){
this
.
openPath
=
record
.
openPage
;
this
.
formData
=
{
id
:
record
.
busId
};
this
.
$refs
.
showDynamNotice
.
detail
();
}
else
{
this
.
$refs
.
ShowAnnouncement
.
detail
(
record
);
}
},
syncHeadNotic
(
anntId
){
getAction
(
"
sys/annountCement/syncNotic
"
,{
anntId
:
anntId
})
},
readAll
(){
var
that
=
this
;
that
.
$confirm
({
title
:
"
确认操作
"
,
content
:
"
是否全部标注已读?
"
,
onOk
:
function
(){
putAction
(
that
.
url
.
readAllMsg
).
then
((
res
)
=>
{
if
(
res
.
success
){
that
.
$message
.
success
(
res
.
message
);
that
.
loadData
();
that
.
syncHeadNotic
();
}
});
}
});
},
}
}
</
script
>
<
style
scoped
>
.ant-card-body
.table-operator
{
margin-bottom
:
18px
;
}
.anty-row-operator
button
{
margin
:
0
5px
}
.ant-btn-danger
{
background-color
:
#ffffff
}
z
.ant-modal-cust-warp
{
height
:
100%
}
.ant-modal-cust-warp
.ant-modal-body
{
height
:
calc
(
100%
-
110px
)
!important
;
overflow-y
:
auto
}
.ant-modal-cust-warp
.ant-modal-content
{
height
:
90%
!important
;
overflow-y
:
hidden
}
<
template
>
<a-modal
:title=
"title"
:width=
"modalWidth"
:visible=
"visible"
:confirmLoading=
"confirmLoading"
@
ok=
"handleOk"
@
cancel=
"handleCancel"
cancelText=
"关闭"
style=
"top:20%;height: 60%;overflow-y: hidden"
>
<template
slot=
"footer"
>
<a-button
key=
"back"
@
click=
"handleCancel"
>
关闭
</a-button>
</
template
>
<!-- 查询区域 -->
<div
class=
"table-page-search-wrapper"
>
<a-form
layout=
"inline"
@
keyup.enter.native=
"searchQuery"
>
<a-row
:gutter=
"24"
>
<a-col
:span=
"12"
>
<a-form-item
label=
"标题"
>
<a-input
placeholder=
"请输入标题"
v-model=
"queryParam.name"
></a-input>
</a-form-item>
</a-col>
<a-col
:span=
"12"
>
<span
style=
"float: left;overflow: hidden;"
class=
"table-page-search-submitButtons"
>
<a-button
type=
"primary"
@
click=
"searchQuery"
>
查询
</a-button>
<a-button
@
click=
"searchReset"
style=
"margin-left: 8px"
>
重置
</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- <div class="table-operator">-->
<!-- <a-button type="primary" @click="readAll" icon="book">全部标注已读</a-button>-->
<!-- </div>-->
<div
style=
"margin-top: 5px"
>
<a-table
ref=
"table"
size=
"default"
bordered
rowKey=
"id"
:columns=
"columns"
:dataSource=
"dataSource"
:pagination=
"ipagination"
:loading=
"loading"
@
change=
"handleTableChange"
>
<
template
slot=
"customRenderTitle"
slot-scope=
"text, record"
>
<span
v-if=
"record.status =='1'"
style=
"font-weight: bold"
>
{{
text
}}
</span>
<span
v-if=
"record.status =='2'"
>
{{
text
}}
</span>
</
template
>
<span
slot=
"action"
slot-scope=
"text, record"
>
<a
@
click=
"showAnnouncement(record)"
>
查看
</a>
</span>
</a-table>
</div>
<show-announcement
ref=
"ShowAnnouncement"
></show-announcement>
<dynamic-notice
ref=
"showDynamNotice"
:path=
"openPath"
:formData=
"formData"
/>
</a-modal>
</template>
<
script
>
import
{
filterObj
}
from
'
@/utils/util
'
import
{
getAction
,
putAction
,
postAction
}
from
'
@/api/manage
'
import
ShowAnnouncement
from
'
@/components/tools/ShowAnnouncement
'
import
{
JeecgListMixin
}
from
'
@/mixins/JeecgListMixin
'
import
DynamicNotice
from
'
../../components/tools/DynamicNotice
'
export
default
{
name
:
"
MsgList
"
,
mixins
:
[
JeecgListMixin
],
components
:
{
DynamicNotice
,
ShowAnnouncement
},
data
()
{
return
{
title
:
"
通知
"
,
modalWidth
:
800
,
visible
:
false
,
confirmLoading
:
false
,
queryParam
:
{
name
:
''
},
columns
:
[{
title
:
'
标题
'
,
dataIndex
:
'
msgTitle
'
,
scopedSlots
:
{
customRender
:
'
customRenderTitle
'
},
width
:
200
},
{
title
:
'
消息类型
'
,
dataIndex
:
'
type
'
,
width
:
80
},
{
title
:
'
时间
'
,
dataIndex
:
'
createTimeStr
'
,
width
:
90
},
{
title
:
'
操作
'
,
dataIndex
:
'
action
'
,
align
:
"
center
"
,
scopedSlots
:
{
customRender
:
'
action
'
},
width
:
50
}],
url
:
{
list
:
"
/msg/list
"
,
batchUpdateStatus
:
"
/msg/batchUpdateStatus
"
,
editCementSend
:
"
sys/sysAnnouncementSend/editByAnntIdAndUserId
"
,
readAllMsg
:
"
sys/sysAnnouncementSend/readAll
"
,
},
loading
:
false
,
openPath
:
''
,
formData
:
''
}
},
methods
:
{
handleDetail
:
function
(){
this
.
visible
=
true
},
showAnnouncement
(
record
){
postAction
(
this
.
url
.
batchUpdateStatus
,{
ids
:
record
.
id
,
status
:
'
2
'
}).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
){
this
.
loadData
();
//this.syncHeadNotic(record.anntId)
}
});
if
(
record
.
openType
===
'
component
'
){
this
.
openPath
=
record
.
openPage
;
this
.
formData
=
{
id
:
record
.
busId
};
this
.
$refs
.
showDynamNotice
.
detail
();
}
else
{
this
.
$refs
.
ShowAnnouncement
.
detail
(
record
);
}
},
syncHeadNotic
(
anntId
){
getAction
(
"
sys/annountCement/syncNotic
"
,{
anntId
:
anntId
})
},
readAll
(){
var
that
=
this
;
that
.
$confirm
({
title
:
"
确认操作
"
,
content
:
"
是否全部标注已读?
"
,
onOk
:
function
(){
putAction
(
that
.
url
.
readAllMsg
).
then
((
res
)
=>
{
if
(
res
.
success
){
that
.
$message
.
success
(
res
.
message
);
that
.
loadData
();
that
.
syncHeadNotic
();
}
});
}
});
},
close
()
{
this
.
$emit
(
'
close
'
);
this
.
visible
=
false
;
},
handleCancel
()
{
this
.
close
()
}
}
}
</
script
>
<
style
scoped
>
.ant-card-body
.table-operator
{
margin-bottom
:
18px
;
}
.anty-row-operator
button
{
margin
:
0
5px
}
.ant-btn-danger
{
background-color
:
#ffffff
}
z
.ant-modal-cust-warp
{
height
:
100%
}
.ant-modal-cust-warp
.ant-modal-body
{
height
:
calc
(
100%
-
110px
)
!important
;
overflow-y
:
auto
}
.ant-modal-cust-warp
.ant-modal-content
{
height
:
90%
!important
;
overflow-y
:
hidden
}
</
style
>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment