Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AmosBankView
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
bank
AmosBankView
Commits
4a076d4a
Commit
4a076d4a
authored
Jun 02, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交传入类型
parent
f073bda6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
78 deletions
+29
-78
urlConsts.js
src/consts/urlConsts.js
+3
-1
monitorService.js
src/services/monitorService.js
+8
-0
conf.js
src/view/bank/financialCityLan/conf.js
+10
-0
index.js
src/view/bank/financialCityLan/index.js
+8
-77
No files found.
src/consts/urlConsts.js
View file @
4a076d4a
...
@@ -387,7 +387,9 @@ export const SpcSerUrl = {
...
@@ -387,7 +387,9 @@ export const SpcSerUrl = {
getSelfTopoTreeUrl
:
completePrefix
(
baseURI
,
'bank/topography/selftree'
),
//自建系统树
getSelfTopoTreeUrl
:
completePrefix
(
baseURI
,
'bank/topography/selftree'
),
//自建系统树
getSelfTopographyUrl
:
completePrefix
(
baseURI
,
'bank/topography/selfnodes'
),
//自建系统树节点
getSelfTopographyUrl
:
completePrefix
(
baseURI
,
'bank/topography/selfnodes'
),
//自建系统树节点
updateSelfUrl
:
completePrefix
(
baseURI
,
'bank/topography/selfnodes'
),
//更新自建系统节点
updateSelfUrl
:
completePrefix
(
baseURI
,
'bank/topography/selfnodes'
),
//更新自建系统节点
listSelfDevice
:
completePrefix
(
baseURI
,
'bank/equipment/selfDevice?fname={fname}&pageNumber={page}&pageSize={size}'
)
listSelfDevice
:
completePrefix
(
baseURI
,
'bank/equipment/selfDevice?fname={fname}&pageNumber={page}&pageSize={size}'
),
getTopoTreeByTypeUrl
:
completePrefix
(
baseURI
,
'bank/topography/treeByType/{type}'
)
//监控系统树
};
};
export
const
patrolUrls
=
{
export
const
patrolUrls
=
{
...
...
src/services/monitorService.js
0 → 100644
View file @
4a076d4a
import
{
SpcSerUrl
}
from
'./../consts/urlConsts'
;
import
{
commonPost
,
commonGet
,
formatUrl
}
from
'./../utils/request'
;
// 监控系统树查询
export
const
getTopoTreeByTypeAction
=
(
type
)
=>
{
return
commonGet
(
formatUrl
(
SpcSerUrl
.
getTopoTreeByTypeUrl
,
{
type
}));
};
src/view/bank/financialCityLan/conf.js
0 → 100644
View file @
4a076d4a
// 获取类型
export
const
getTypeBySystem
=
(
name
)
=>
{
const
typeParams
=
{
PAMS
:
1
,
SelfSupport
:
5
,
CityLan
:
6
,
CloudPlatform
:
7
};
return
typeParams
[
name
];
};
src/view/bank/financialCityLan/index.js
View file @
4a076d4a
...
@@ -9,79 +9,12 @@ import TreeComponent from './TreeComponent';
...
@@ -9,79 +9,12 @@ import TreeComponent from './TreeComponent';
import
mqtt
from
'mqtt'
;
import
mqtt
from
'mqtt'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
{
getSelfTopoTreeAction
,
getSelfTopographyAction
,
updateSelfTopographyAction
,
getTopographyEventsAction
,
getDeivceListAction
}
from
'./../../..//services/selfServices'
;
import
{
getSelfTopoTreeAction
,
getSelfTopographyAction
,
updateSelfTopographyAction
,
getTopographyEventsAction
,
getDeivceListAction
}
from
'./../../..//services/selfServices'
;
import
{
getTypeBySystem
}
from
'./conf'
;
// import AmosGridTable from './../../bizview/common/tableComponent/table/AmosGridTable';
import
{
getTopoTreeByTypeAction
}
from
'SERVICES/monitorService'
;
import
AmosGridTable
from
'./../../component/table/table/AmosGridTable'
;
import
SysWsURL
from
'./../../../consts/wsUrlConsts'
;
import
SysWsURL
from
'./../../../consts/wsUrlConsts'
;
const
AmosConfig
=
endConf
.
AmosConfig
;
const
mqttURI
=
AmosConfig
.
wsURI
.
mqttURI
;
const
options
=
{
//默认 30 * 1000毫秒,收到 CONNACK 之前等待的时间,即连接超时时间。
connectTimeout
:
40000
,
// 客户端 ID,随机生成
clientId
:
'bank_financialCityLan_mqtt'
+
Math
.
random
().
toString
(
16
).
substr
(
2
,
8
),
clean
:
true
,
//默认 1000 毫秒,两次重新连接之间的间隔,客户端 ID 重复、认证失败等客户端会重新连接;
reconnectPeriod
:
1000
*
50
}
let
client
=
mqtt
.
connect
(
mqttURI
,
options
)
const
checkListColumns
=
(
financialCityLan
)
=>
{
return
[
{
title
:
'时间'
,
dataIndex
:
'updateDate'
,
key
:
'updateDate'
,
width
:
'45%'
,
render
:
(
text
,
record
)
=>
{
let
font
=
document
.
createElement
(
'font'
);
if
(
record
.
deviceStatus
===
1
)
{
font
.
innerText
=
text
;
font
.
style
.
color
=
'red'
;
}
else
{
font
.
innerText
=
text
;
}
return
<
div
dangerouslySetInnerHTML
=
{{
__html
:
font
.
outerHTML
}}
><
/div
>
}
},
{
title
:
'设备名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
width
:
'30%'
,
render
:
(
text
,
record
)
=>
{
let
font
=
document
.
createElement
(
'font'
);
if
(
record
.
deviceStatus
===
1
)
{
font
.
innerText
=
text
;
font
.
style
.
color
=
'red'
;
}
else
{
font
.
innerText
=
text
;
}
return
<
div
dangerouslySetInnerHTML
=
{{
__html
:
font
.
outerHTML
}}
><
/div
>
}
},
{
title
:
'ping结果'
,
dataIndex
:
'deviceStatus'
,
key
:
'deviceStatus'
,
render
:
(
text
,
record
)
=>
{
let
p
=
document
.
createElement
(
'span'
);
if
(
text
===
0
)
{
let
font
=
document
.
createElement
(
'font'
);
font
.
innerText
=
'连接正常'
;
p
.
append
(
font
);
}
if
(
text
===
1
)
{
const
type
=
getTypeBySystem
(
'SelfSupport'
);
let
font
=
document
.
createElement
(
'font'
);
font
.
innerText
=
'连接异常'
;
font
.
style
.
color
=
'red'
;
p
.
append
(
font
);
}
return
<
div
dangerouslySetInnerHTML
=
{{
__html
:
p
.
outerHTML
}}
><
/div
>
}
}
];
};
//偏移
//偏移
...
@@ -121,13 +54,13 @@ class FinancialCityLan extends Component {
...
@@ -121,13 +54,13 @@ class FinancialCityLan extends Component {
selectedRows
:
[],
selectedRows
:
[],
selectedRowKeys
:
[],
selectedRowKeys
:
[],
pagination
:
true
,
pagination
:
true
,
isChecked
:
false
,
isChecked
:
false
};
};
this
.
updateTopologyData
=
{};
this
.
updateTopologyData
=
{};
this
.
mapView
=
true
;
this
.
mapView
=
true
;
}
}
componentWillMount
()
{
componentWillMount
()
{
}
}
componentDidMount
()
{
componentDidMount
()
{
...
@@ -137,8 +70,6 @@ class FinancialCityLan extends Component {
...
@@ -137,8 +70,6 @@ class FinancialCityLan extends Component {
this
.
viewlineItem
();
this
.
viewlineItem
();
}
}
// this.receivcemqtt();
// this.receivcemqtt();
}
}
componentWillReceiveProps
(
nextProps
)
{
componentWillReceiveProps
(
nextProps
)
{
...
@@ -220,7 +151,7 @@ class FinancialCityLan extends Component {
...
@@ -220,7 +151,7 @@ class FinancialCityLan extends Component {
// 数据初始化
// 数据初始化
initData
=
()
=>
{
initData
=
()
=>
{
let
expandedKeysData
=
[];
let
expandedKeysData
=
[];
get
SelfTopoTreeAction
(
).
then
(
data
=>
{
get
TopoTreeByTypeAction
(
type
).
then
(
data
=>
{
data
.
map
(
item
=>
{
data
.
map
(
item
=>
{
expandedKeysData
.
push
(
item
.
id
);
expandedKeysData
.
push
(
item
.
id
);
});
});
...
@@ -468,7 +399,7 @@ class FinancialCityLan extends Component {
...
@@ -468,7 +399,7 @@ class FinancialCityLan extends Component {
<
div
className
=
{
`middle-content
${
isTreeDisplay
&&
isTableDisplay
?
''
:
'only-middle'
}
`
}
>
<
div
className
=
{
`middle-content
${
isTreeDisplay
&&
isTableDisplay
?
''
:
'only-middle'
}
`
}
>
<
div
className
=
"paslogy-content"
>
<
div
className
=
"paslogy-content"
>
<
div
className
=
"middle-content-div"
>
<
div
className
=
"middle-content-div"
>
<
/div
>
<
/div
>
<
div
className
=
"net-topo-content"
>
<
div
className
=
"net-topo-content"
>
<
TopologyComponent
<
TopologyComponent
...
@@ -493,7 +424,7 @@ class FinancialCityLan extends Component {
...
@@ -493,7 +424,7 @@ class FinancialCityLan extends Component {
</div>
</div>
</div> */
}
</div> */
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
);
...
...
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