Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
a3c8111c
Commit
a3c8111c
authored
Dec 07, 2022
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 消息模板修改
parent
d8eb5a36
Pipeline
#65105
passed with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
60 deletions
+65
-60
NoticeIconView.js
src/components/GlobalHeader/NoticeIconView.js
+4
-1
constants.js
src/layouts/AppLayout/notifier/constants.js
+0
-1
index.js
src/layouts/AppLayout/notifier/index.js
+8
-7
list.js
src/layouts/AppLayout/notifier/list.js
+4
-6
message.js
src/layouts/AppLayout/notifier/message.js
+3
-3
index.js
src/layouts/AppLayout/notifier/templates/alarm/index.js
+16
-14
index.js
src/layouts/AppLayout/notifier/templates/case/index.js
+30
-28
No files found.
src/components/GlobalHeader/NoticeIconView.js
View file @
a3c8111c
...
...
@@ -314,7 +314,7 @@ class NoticeIconView extends Component {
this
.
renderSysPlatform
(
message
);
};
handlerUnknowDetail
=
message
=>
{
handlerUnknowDetail
=
(
message
,
type
)
=>
{
// 需要有跳转路径
if
(
!
message
.
webPath
)
return
notification
.
info
({
message
:
'提示'
,
duration
:
3
,
description
:
'未配置跳转路径'
});
...
...
@@ -343,6 +343,9 @@ class NoticeIconView extends Component {
}
params
.
_source
=
'消息通知'
;
params
.
_target
=
message
.
webPath
;
if
(
type
)
{
if
(
/civweb4/
.
test
(
targetMenuPath
))
return
true
;
}
sessionStorage
.
setItem
(
'routerParams'
,
JSON
.
stringify
(
params
));
window
.
history
.
pushState
(
params
,
''
,
`/civbase/
${
targetMenuPath
}
?v=
${
Date
.
now
()}
`
);
}
...
...
src/layouts/AppLayout/notifier/constants.js
View file @
a3c8111c
...
...
@@ -17,7 +17,6 @@ export const MESSAGE_TYPE = {
export
const
NEW_MESSAGE
=
'NEW_MESSAGE'
;
export
const
USERNAME
=
'mao2080'
;
export
const
PASSWORD
=
'123'
;
export
const
PLATFORM_LEVEL
=
'4'
;
...
...
src/layouts/AppLayout/notifier/index.js
View file @
a3c8111c
import
React
from
'react'
;
import
{
Badge
,
Button
,
ConfigProvider
}
from
'antd'
;
// eslint-disable-next-line import/no-unresolved
import
classNames
from
'classnames'
;
import
useMergeValue
from
'use-merge-value'
;
...
...
@@ -40,8 +41,8 @@ const messageSvg = () => (
/>
<
/svg
>
);
const
BellOutlined
=
(
props
)
=>
<
Icon
component
=
{
messageSvg
}
{...
props
}
/>
;
const
NoticeIcon
=
(
props
)
=>
{
const
BellOutlined
=
props
=>
<
Icon
component
=
{
messageSvg
}
{...
props
}
/>
;
const
NoticeIcon
=
props
=>
{
const
{
getPrefixCls
}
=
React
.
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
props
.
prefixCls
||
getPrefixCls
();
const
btnPrefixCls
=
`
${
prefixCls
}
-head-notifier-button`
;
...
...
@@ -54,14 +55,12 @@ const NoticeIcon = (props) => {
}
const
panes
=
[];
React
.
Children
.
forEach
(
children
,
(
child
)
=>
{
React
.
Children
.
forEach
(
children
,
child
=>
{
if
(
!
child
)
{
return
;
}
const
{
list
,
title
}
=
child
.
props
;
panes
.
push
(
<
NoticeList
{...
child
.
props
}
data
=
{
list
}
key
=
{
child
}
title
=
{
title
}
config
=
{
props
.
config
}
/>
,
);
panes
.
push
(
<
NoticeList
{...
child
.
props
}
data
=
{
list
}
key
=
{
child
}
title
=
{
title
}
config
=
{
props
.
config
}
/>
)
;
});
const
childProps
=
panes
.
length
===
1
?
panes
[
0
].
props
:
{
list
:
[]
};
return
(
...
...
@@ -72,7 +71,9 @@ const NoticeIcon = (props) => {
type
=
"link"
onClick
=
{()
=>
(
childProps
.
list
.
length
>
0
?
confirmRead
(
true
)
:
null
)}
disabled
=
{
childProps
.
list
.
length
===
0
}
>
全部标记已读
<
/Button
>
>
全部标记已读
<
/Button
>
<
/div
>
{
panes
}
{
renderFooter
&&
renderFooter
()}
...
...
src/layouts/AppLayout/notifier/list.js
View file @
a3c8111c
import
React
from
'react'
;
import
{
List
,
Spin
,
ConfigProvider
}
from
'antd'
;
// eslint-disable-next-line import/no-unresolved
import
classNames
from
'classnames'
;
import
'./style/list.less'
;
import
{
Alarm
,
Case
,
Notice
,
Unknown
}
from
'./templates'
;
...
...
@@ -11,10 +12,7 @@ const Empty = ({ emptyText, ...props }) => {
const
prefixCls
=
props
.
prefixCls
||
getPrefixCls
();
return
(
<
div
className
=
{
`
${
prefixCls
}
-notFound`
}
>
<
img
src
=
"https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
alt
=
"not found"
/>
<
img
src
=
"https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
alt
=
"not found"
/>
<
div
>
{
emptyText
}
<
/div
>
<
/div
>
);
...
...
@@ -113,11 +111,11 @@ class NoticeList extends React.Component {
switch
(
item
.
infoClasses
)
{
case
MESSAGE_TYPE
.
ALARM_TYPE
:
messageTemplate
=
(
<
Alarm
message
=
{
item
}
confirmRead
=
{
this
.
confirmRead
}
config
=
{
this
.
props
.
config
}
/
>
<
Alarm
message
=
{
item
}
confirmRead
=
{
this
.
confirmRead
}
config
=
{
this
.
props
.
config
}
handlerUnknowDetail
=
{
this
.
handlerUnknowDetail
}
/
>
);
break
;
case
MESSAGE_TYPE
.
CASE_TYPE
:
messageTemplate
=
<
Case
message
=
{
item
}
confirmRead
=
{
this
.
confirmRead
}
/>
;
messageTemplate
=
<
Case
message
=
{
item
}
confirmRead
=
{
this
.
confirmRead
}
handlerUnknowDetail
=
{
this
.
handlerUnknowDetail
}
/>
;
break
;
case
MESSAGE_TYPE
.
SYS_TYPE
:
messageTemplate
=
(
...
...
src/layouts/AppLayout/notifier/message.js
View file @
a3c8111c
...
...
@@ -99,9 +99,9 @@ export const createMessageFromReal = (realMesssage, options = {}) => {
// 2.0 消息
infoContent
=
JSON
.
parse
(
realMesssage
.
content
||
'{}'
);
}
const
template
=
{
id
:
realMesssage
.
infoId
,
id
:
realMesssage
.
infoId
||
realMesssage
.
ID
,
infoContent
,
time
,
infoType
:
realMesssage
.
infoType
,
...
...
@@ -109,7 +109,7 @@ export const createMessageFromReal = (realMesssage, options = {}) => {
dateTime
:
realMesssage
.
createTime
,
webConfig
:
realMesssage
.
web_config
,
webPath
:
realMesssage
.
web_path
,
messType
:
realMesssage
.
messType
,
messType
:
realMesssage
.
messType
||
realMesssage
.
MessType
,
defaultContent
:
(
_
.
isString
(
realMesssage
.
defaultContent
)
&&
realMesssage
.
defaultContent
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
realMesssage
.
defaultContent
:
null
,
webIcon
:
(
_
.
isString
(
realMesssage
.
webIcon
)
&&
realMesssage
.
webIcon
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
realMesssage
.
webIcon
:
null
,
title
:
(
_
.
isString
(
realMesssage
.
title
)
&&
realMesssage
.
title
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
realMesssage
.
title
:
null
,
...
...
src/layouts/AppLayout/notifier/templates/alarm/index.js
View file @
a3c8111c
...
...
@@ -28,7 +28,7 @@ export class AlarmContent {
}
}
const
Alarm
=
({
message
,
confirmRead
,
config
})
=>
{
const
Alarm
=
({
message
,
confirmRead
,
config
,
handlerUnknowDetail
})
=>
{
const
{
getPrefixCls
}
=
React
.
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
();
...
...
@@ -41,20 +41,22 @@ const Alarm = ({ message, confirmRead, config }) => {
const
alarmThreshold
=
message
?.
infoContent
?.
alarmThreshold
;
const
goPath
=
(
item
)
=>
{
if
(
handlerUnknowDetail
&&
handlerUnknowDetail
(
message
,
'alarm'
))
{
const
widgetID
=
'widget_city_综合运营_管网监控_实时监控_报警监控'
;
const
webPath
=
'product/scada/AlertMonitoring/AlertMonitoring'
;
const
widget
=
findPathByWidget
(
'productex/water/IOTMonitor/RealTimeAlarm/RealTimeAlarm'
,
config
.
widgets
,
''
,
'url'
,
);
window
.
share
.
event
.
emit
(
'listenerMointer'
,
{
widgetId
:
widgetID
,
label
:
'实时报警'
,
url
:
widget
.
url
||
webPath
,
});
}
confirmRead
(
false
,
[
message
.
id
]);
const
widgetID
=
'widget_city_综合运营_管网监控_实时监控_报警监控'
;
const
webPath
=
'product/scada/AlertMonitoring/AlertMonitoring'
;
const
widget
=
findPathByWidget
(
'productex/water/IOTMonitor/RealTimeAlarm/RealTimeAlarm'
,
config
.
widgets
,
''
,
'url'
,
);
window
.
share
.
event
.
emit
(
'listenerMointer'
,
{
widgetId
:
widgetID
,
label
:
'实时报警'
,
url
:
widget
.
url
||
webPath
,
});
};
...
...
src/layouts/AppLayout/notifier/templates/case/index.js
View file @
a3c8111c
...
...
@@ -19,7 +19,7 @@ export class CaseContent {
}
}
const
Case
=
({
message
,
confirmRead
})
=>
{
const
Case
=
({
message
,
confirmRead
,
handlerUnknowDetail
})
=>
{
const
{
getPrefixCls
}
=
React
.
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
();
const
caseType
=
message
?.
infoContent
?.
caseType
;
...
...
@@ -29,34 +29,36 @@ const Case = ({ message, confirmRead }) => {
const
content
=
message
?.
infoContent
?.
content
;
const
goPath
=
item
=>
{
confirmRead
(
false
,
[
message
.
id
]);
const
messageType
=
item
.
messType
;
let
label
=
''
;
let
widgetID
=
''
;
switch
(
messageType
)
{
case
'任务派发'
:
label
=
'任务派发'
;
widgetID
=
'widget_city_综合运营_二供管理_维修管理_工单办理'
;
break
;
case
'任务驳回'
:
label
=
'任务驳回'
;
widgetID
=
'widget_city_综合运营_二供管理_维修管理_工单办理'
;
// eslint-disable-next-line no-underscore-dangle,no-case-declarations
let
_tab
;
// eslint-disable-next-line prefer-const
_tab
=
'任务驳回'
;
break
;
default
:
label
=
'工单办理'
;
widgetID
=
'widget_city_综合运营_二供管理_维修管理_工单办理'
;
break
;
if
(
handlerUnknowDetail
&&
handlerUnknowDetail
(
message
,
'case'
))
{
const
messageType
=
item
.
messType
;
let
label
=
''
;
let
widgetID
=
''
;
switch
(
messageType
)
{
case
'任务派发'
:
label
=
'任务派发'
;
widgetID
=
'widget_city_综合运营_二供管理_维修管理_工单办理'
;
break
;
case
'任务驳回'
:
label
=
'任务驳回'
;
widgetID
=
'widget_city_综合运营_二供管理_维修管理_工单办理'
;
// eslint-disable-next-line no-underscore-dangle,no-case-declarations
let
_tab
;
// eslint-disable-next-line prefer-const
_tab
=
'任务驳回'
;
break
;
default
:
label
=
'工单办理'
;
widgetID
=
'widget_city_综合运营_二供管理_维修管理_工单办理'
;
break
;
}
const
webPath
=
item
.
webPath
||
'product/maintenance/CaseManage/CaseDoingBox/StardCaseDoingBoxView|isDelay=1'
;
window
.
share
.
event
.
emit
(
'listenerMointer'
,
{
widgetId
:
widgetID
,
label
,
url
:
webPath
,
});
}
const
webPath
=
item
.
webPath
||
'product/maintenance/CaseManage/CaseDoingBox/StardCaseDoingBoxView|isDelay=1'
;
window
.
share
.
event
.
emit
(
'listenerMointer'
,
{
widgetId
:
widgetID
,
label
,
url
:
webPath
,
});
confirmRead
(
false
,
[
message
.
id
]);
};
return
(
...
...
Write
Preview
Markdown
is supported
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