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
7be1624e
Commit
7be1624e
authored
Jan 04, 2021
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: message bug
parent
c2a85c3f
Pipeline
#21671
skipped with stages
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
6 deletions
+16
-6
NoticeIconView.js
src/components/GlobalHeader/NoticeIconView.js
+0
-0
NoticeList.js
src/components/NoticeIcon/NoticeList.js
+2
-1
index.js
src/components/NoticeIcon/Templates/Alarm/index.js
+3
-2
index.js
src/components/NoticeIcon/Templates/Notice/index.js
+7
-2
index.js
src/components/Notifier/index.js
+4
-1
No files found.
src/components/GlobalHeader/NoticeIconView.js
View file @
7be1624e
This diff is collapsed.
Click to expand it.
src/components/NoticeIcon/NoticeList.js
View file @
7be1624e
...
...
@@ -23,6 +23,7 @@ class NoticeList extends React.Component {
super
(
props
);
this
.
emptyText
=
props
.
emptyText
;
this
.
confirmRead
=
props
.
confirmRead
;
this
.
handlerSysDetail
=
props
.
handlerSysDetail
this
.
loadMore
=
props
.
loadMore
;
this
.
hasMore
=
props
.
hasMore
;
this
.
container
=
React
.
createRef
();
...
...
@@ -124,7 +125,7 @@ class NoticeList extends React.Component {
break
;
case
'sysType'
:
messageTemplate
=
(
<
Notice
message
=
{
item
}
confirmRead
=
{
this
.
confirmRead
}
config
=
{
this
.
props
.
config
}
/
>
<
Notice
message
=
{
item
}
confirmRead
=
{
this
.
confirmRead
}
config
=
{
this
.
props
.
config
}
handlerSysDetail
=
{
this
.
handlerSysDetail
}
/
>
);
break
;
default
:
...
...
src/components/NoticeIcon/Templates/Alarm/index.js
View file @
7be1624e
...
...
@@ -28,7 +28,6 @@ export class AlarmContent {
const
Alarm
=
({
message
,
confirmRead
,
config
})
=>
{
const
alarmContent
=
(
config
.
mqtt_mess
.
MessageLevel
===
"2.0"
&&
isJSON
(
message
.
infoContent
))
?
JSON
.
parse
(
message
.
infoContent
):
message
.
infoContent
;
const
goPath
=
item
=>
{
debugger
confirmRead
(
false
,
[
message
.
id
]);
const
widgetID
=
'widget_city_综合运营_管网监控_实时监控_报警监控'
;
const
webPath
=
'product/scada/AlertMonitoring/AlertMonitoring'
;
...
...
@@ -41,6 +40,8 @@ const Alarm = ({ message, confirmRead, config }) => {
});
};
const
alarmValue
=
alarmContent
&&
alarmContent
.
alarmValue
&&
alarmContent
.
alarmValue
.
split
(
' '
);
let
alarmTitle
=
alarmContent
&&
alarmContent
.
alarmValue
&&
alarmContent
.
title
.
split
(
' '
);
alarmTitle
=
alarmTitle
[
1
];
return
(
<
div
className
=
{
classNames
(
styles
.
scada
,
commonStyles
.
messageContainer
)}
...
...
@@ -63,7 +64,7 @@ const Alarm = ({ message, confirmRead, config }) => {
<
div
className
=
{
commonStyles
.
content
}
>
<
p
>
<
i
>
{
alarmContent
.
alarmType
}
<
/i
>
{
alarm
Content
.
alarmDevic
e
}
{
alarm
Titl
e
}
<
/p
>
<
p
>
{
alarmContent
.
alarmContent
}
<
/p
>
<
p
>
...
...
src/components/NoticeIcon/Templates/Notice/index.js
View file @
7be1624e
...
...
@@ -16,15 +16,19 @@ export class NoticeContent {
}
}
const
Notice
=
({
message
,
confirmRead
,
config
})
=>
{
const
Notice
=
({
message
,
confirmRead
,
config
,
handlerSysDetail
})
=>
{
// eslint-disable-next-line no-debugger
const
noticeContent
=
config
.
mqtt_mess
.
MessageLevel
===
'2.0'
&&
isJSON
(
message
.
infoContent
)
?
JSON
.
parse
(
message
.
infoContent
)
:
message
.
infoContent
;
const
goPath
=
item
=>
{
// eslint-disable-next-line no-debugger
debugger
// eslint-disable-next-line no-debugger
confirmRead
(
false
,
[
message
.
id
]);
handlerSysDetail
&&
handlerSysDetail
(
message
);
};
return
(
<
div
...
...
@@ -49,7 +53,8 @@ const Notice = ({ message, confirmRead, config }) => {
<
i
>
{
noticeContent
.
noticeType
}
<
/i
>
{
noticeContent
.
noticeTitle
}
<
/p
>
<
p
dangerouslySetInnerHTML
=
{{
__html
:
noticeContent
.
noticeContent
}}
><
/p
>
{
/* eslint-disable-next-line react/no-danger */
}
<
p
dangerouslySetInnerHTML
=
{{
__html
:
noticeContent
.
noticeContent
}}
/
>
<
p
className
=
{
commonStyles
.
messageTime
}
>
{
message
.
time
}
<
/p
>
<
/div
>
<
/div
>
...
...
src/components/Notifier/index.js
View file @
7be1624e
...
...
@@ -283,7 +283,7 @@ class Notifier {
const
userInfo
=
this
.
getUserInfo
();
const
infoType
=
this
.
getMessageType
(
parseMessage
.
infoType
);
let
state
=
null
;
debugger
if
(
_
.
isEmpty
(
parseMessage
.
tousers
)
||
userInfo
.
OID
==
parseMessage
.
tousers
||
...
...
@@ -375,6 +375,7 @@ class Notifier {
}
else
if
(
message
.
infoLevel
===
PLATFORM_LEVEL
)
{
console
.
log
(
messString
);
}
else
if
(
message
.
infoLevel
===
SYS_LEVEL
)
{
debugger
this
.
renderSysNoticePlatform
(
Object
.
assign
(
message
,
{
messContent
}))
}
else
{
state
.
lang
=
'zh'
;
...
...
@@ -489,6 +490,8 @@ class Notifier {
}
renderSysNoticePlatform
(
message
)
{
debugger
this
.
renderSysElement
=
null
;
this
.
renderSysElement
=
this
.
renderSysPlatform
&&
this
.
renderSysPlatform
(
message
)
}
...
...
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