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
eb4e9796
Commit
eb4e9796
authored
Dec 30, 2020
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: alarm notice message
parent
6246d3d8
Pipeline
#21450
passed with stages
in 19 minutes 24 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
156 deletions
+56
-156
webpack.base.babel.js
internals/webpack/webpack.base.babel.js
+7
-0
index.dev.js
server/dist/index.dev.js
+0
-87
port.dev.js
server/dist/port.dev.js
+0
-7
NoticeIconView.js
src/components/GlobalHeader/NoticeIconView.js
+6
-55
NoticeList.js
src/components/NoticeIcon/NoticeList.js
+1
-1
index.js
src/components/NoticeIcon/Templates/Alarm/index.js
+7
-5
index.js
src/components/NoticeIcon/index.js
+7
-1
utils.js
src/utils/utils.js
+28
-0
No files found.
internals/webpack/webpack.base.babel.js
View file @
eb4e9796
...
...
@@ -183,6 +183,13 @@ module.exports = options => ({
`
${
pkg
.
name
.
toLocaleLowerCase
()}
/theme`
,
),
},
{
from
:
path
.
resolve
(
process
.
cwd
(),
'web.config'
),
to
:
path
.
resolve
(
process
.
env
.
npm_config_releasepath
||
process
.
cwd
(),
`
${
pkg
.
name
.
toLocaleLowerCase
()}
/web.config`
,
),
},
]),
]),
resolve
:
{
...
...
server/dist/index.dev.js
deleted
100644 → 0
View file @
6246d3d8
"use strict"
;
/* eslint consistent-return:0 import/order:0 */
var
express
=
require
(
'express'
);
var
logger
=
require
(
'./logger'
);
var
argv
=
require
(
'./argv'
);
var
port
=
require
(
'./port'
);
var
setup
=
require
(
'./middlewares/frontendMiddleware'
);
var
isDev
=
process
.
env
.
NODE_ENV
!==
'production'
;
var
pkg
=
require
(
'../package.json'
);
var
ngrok
=
isDev
&&
process
.
env
.
ENABLE_TUNNEL
||
argv
.
tunnel
?
require
(
'ngrok'
)
:
false
;
var
_require
=
require
(
'path'
),
resolve
=
_require
.
resolve
;
var
app
=
express
();
setup
(
app
,
{
outputPath
:
resolve
(
process
.
cwd
(),
pkg
.
name
.
toLocaleLowerCase
()),
publicPath
:
"/"
.
concat
(
pkg
.
name
.
toLocaleLowerCase
())
});
var
customHost
=
argv
.
host
||
process
.
env
.
HOST
;
var
host
=
customHost
||
null
;
var
prettyHost
=
customHost
||
'localhost'
;
// use the gzipped bundle
app
.
get
(
'*.js'
,
function
(
req
,
res
,
next
)
{
req
.
url
=
req
.
url
+
'.gz'
;
// eslint-disable-line
res
.
set
(
'Content-Encoding'
,
'gzip'
);
next
();
});
// Start your app.
app
.
listen
(
port
,
host
,
function
_callee
(
err
)
{
var
url
;
return
regeneratorRuntime
.
async
(
function
_callee$
(
_context
)
{
while
(
1
)
{
switch
(
_context
.
prev
=
_context
.
next
)
{
case
0
:
if
(
!
err
)
{
_context
.
next
=
2
;
break
;
}
return
_context
.
abrupt
(
"return"
,
logger
.
error
(
err
.
message
));
case
2
:
if
(
!
ngrok
)
{
_context
.
next
=
15
;
break
;
}
_context
.
prev
=
3
;
_context
.
next
=
6
;
return
regeneratorRuntime
.
awrap
(
ngrok
.
connect
(
port
));
case
6
:
url
=
_context
.
sent
;
_context
.
next
=
12
;
break
;
case
9
:
_context
.
prev
=
9
;
_context
.
t0
=
_context
[
"catch"
](
3
);
return
_context
.
abrupt
(
"return"
,
logger
.
error
(
_context
.
t0
));
case
12
:
logger
.
appStarted
(
port
,
prettyHost
,
url
);
_context
.
next
=
16
;
break
;
case
15
:
logger
.
appStarted
(
port
,
prettyHost
);
case
16
:
case
"end"
:
return
_context
.
stop
();
}
}
},
null
,
null
,
[[
3
,
9
]]);
});
\ No newline at end of file
server/dist/port.dev.js
deleted
100644 → 0
View file @
6246d3d8
"use strict"
;
var
argv
=
require
(
'./argv'
);
console
.
log
(
argv
.
port
);
module
.
exports
=
parseInt
(
argv
.
port
||
process
.
env
.
PORT
||
'3005'
,
10
);
\ No newline at end of file
src/components/GlobalHeader/NoticeIconView.js
View file @
eb4e9796
...
...
@@ -8,6 +8,7 @@ import NoticeIcon from '../NoticeIcon';
import
Notifier
from
'../Notifier'
;
import
{
NEW_MESSAGE
}
from
'../Notifier/constants'
;
import
styles
from
'./index.less'
;
import
{
findPathByWidget
}
from
'../../utils/utils'
;
class
NoticeIconView
extends
Component
{
constructor
(
props
)
{
...
...
@@ -164,12 +165,14 @@ class NoticeIconView extends Component {
this
.
notifier
.
confirmRead
(
false
,
[
item
.
id
]);
if
(
detail
)
{
const
widgetID
=
'widget_city_综合运营_管网监控_实时监控_报警监控'
;
const
webPath
=
item
.
webPath
||
'product/scada/AlertMonitoring/AlertMonitoring'
;
const
webPath
=
'product/scada/AlertMonitoring/AlertMonitoring'
;
debugger
let
widget
=
findPathByWidget
(
"productex/water/IOTMonitor/RealTimeAlarm/RealTimeAlarm"
,
this
.
props
.
global
.
widgets
,
""
,
"url"
);
console
.
log
(
widget
)
window
.
share
.
event
.
emit
(
'listenerMointer'
,
{
widgetId
:
widgetID
,
label
:
'报警监控'
,
url
:
webPath
,
url
:
w
idget
.
url
||
w
ebPath
,
});
}
this
.
setState
({
...
...
@@ -201,61 +204,9 @@ class NoticeIconView extends Component {
hasMore
=
{
this
.
notifier
.
hasMore
}
/
>
<
/NoticeIcon
>
{
/* {
this.state.platformVisible ? <Modal title="未读消息"
visible={this.state.platformVisible}
zIndex={5000}
className={styles.platformModal}
footer={null}
centered
maskClosable={false}
onCancel={(event) => this.handleClosePlatform(event)}>
<List
itemLayout="vertical"
dataSource={this.state.noticeData.filter(item => item.infoLevel === "4")}
pagination={{
size:"small",
onChange: page => {
console.log(page);
},
pageSize: 1,
}}
renderItem={
item => (
<List.Item
key={item.id}
extra={<img width={16} alt="点击标为已读" src="https://panda-water.com/web4/assets/images/message/%E5%B7%B2%E8%AF%BB-%E9%BB%98%E8%AE%A4.svg" onClick={() => this.handlerMointer(item, false)}/>}>
<List.Item.Meta
avatar={<img size="63" src="https://panda-water.com/web4/assets/images/message/%E6%8A%A5%E8%AD%A6%E5%9B%BE%E6%A0%87.svg" />}
title={<a onClick={() => this.handlerMointer(item, true)}>{item.infoContent.alarmDevice}</a>}
description={
<>
<div className={styles.content}>
<b>{item.infoContent.alarmType}</b>
{
'|' + item.infoContent.alarmContent
}
</div>
<div>
<span>
<b>{item.infoContent.alarmValue}/</b>
{item.infoContent.alarmThreshold}
</span>
<span>{item.time}</span>
</div>
</>
}
/>
</List.Item>
)
}>
</List>
</Modal>: null
} */
}
{
this
.
state
.
platformVisible
?
this
.
notifier
.
renderPlatformElement
:
null
// this.renderPlatform()
}
{
this
.
state
.
videoVisible
?
this
.
notifier
.
renderVideoElement
:
null
}
...
...
src/components/NoticeIcon/NoticeList.js
View file @
eb4e9796
...
...
@@ -114,7 +114,7 @@ class NoticeList extends React.Component {
switch
(
item
.
infoType
)
{
case
'scadaType'
:
messageTemplate
=
(
<
Alarm
message
=
{
item
}
confirmRead
=
{
this
.
confirmRead
}
/
>
<
Alarm
message
=
{
item
}
confirmRead
=
{
this
.
confirmRead
}
config
=
{
this
.
props
.
config
}
/
>
);
break
;
case
'caseType'
:
...
...
src/components/NoticeIcon/Templates/Alarm/index.js
View file @
eb4e9796
import
React
from
'react'
;
import
classNames
from
'classnames'
;
import
{
findPathByWidget
}
from
'../../../../utils/utils'
;
import
commonStyles
from
'../common.less'
;
import
styles
from
'./index.less'
;
/* eslint-disable */
...
...
@@ -25,17 +25,19 @@ export class AlarmContent {
}
}
const
Alarm
=
({
message
,
confirmRead
})
=>
{
const
Alarm
=
({
message
,
confirmRead
,
config
})
=>
{
const
alarmContent
=
message
.
infoContent
;
const
goPath
=
item
=>
{
confirmRead
(
false
,
[
message
.
id
]);
const
widgetID
=
'widget_city_综合运营_管网监控_实时监控_报警监控'
;
const
webPath
=
item
.
webPath
||
'product/scada/AlertMonitoring/AlertMonitoring'
;
const
webPath
=
'product/scada/AlertMonitoring/AlertMonitoring'
;
debugger
const
widget
=
findPathByWidget
(
"productex/water/IOTMonitor/RealTimeAlarm/RealTimeAlarm"
,
config
.
widgets
,
""
,
"url"
);
console
.
log
(
widget
)
window
.
share
.
event
.
emit
(
'listenerMointer'
,
{
widgetId
:
widgetID
,
label
:
'报警监控'
,
url
:
webPath
,
url
:
w
idget
.
url
||
w
ebPath
,
});
};
const
alarmValue
=
...
...
src/components/NoticeIcon/index.js
View file @
eb4e9796
...
...
@@ -56,7 +56,13 @@ const NoticeIcon = props => {
}
const
{
list
,
title
}
=
child
.
props
;
panes
.
push
(
<
NoticeList
{...
child
.
props
}
data
=
{
list
}
key
=
{
child
}
title
=
{
title
}
/>
,
<
NoticeList
{...
child
.
props
}
data
=
{
list
}
key
=
{
child
}
title
=
{
title
}
config
=
{
props
.
global
}
/>
,
);
});
return
(
...
...
src/utils/utils.js
View file @
eb4e9796
...
...
@@ -85,3 +85,31 @@ export function transformURL(path) {
String
.
fromCharCode
(
92
);
return
el
.
value
.
replace
(
/
\\
/g
,
'/'
);
}
export
function
findPathByWidget
(
leafId
,
nodes
,
path
,
key
)
{
if
(
path
===
undefined
)
{
path
=
{};
}
let
tmpPath
=
path
;
// eslint-disable-next-line no-plusplus
for
(
let
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
if
(
nodes
[
i
]
&&
nodes
[
i
][
key
]
&&
nodes
[
i
][
key
].
indexOf
(
leafId
)
>
-
1
)
{
tmpPath
=
nodes
[
i
];
return
tmpPath
;
}
if
(
nodes
[
i
]
&&
nodes
[
i
].
widgets
)
{
const
findResult
=
findPathByWidget
(
leafId
,
nodes
[
i
].
widgets
,
tmpPath
,
key
,
// eslint-disable-next-line no-restricted-globals
location
,
);
if
(
findResult
)
{
return
findResult
;
}
}
}
return
tmpPath
;
}
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