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
92267adc
Commit
92267adc
authored
Jun 02, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
4a076d4a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
68 deletions
+21
-68
urlConsts.js
src/consts/urlConsts.js
+3
-1
monitorService.js
src/services/monitorService.js
+13
-0
index.js
src/view/bank/financialCityLan/index.js
+5
-67
No files found.
src/consts/urlConsts.js
View file @
92267adc
...
...
@@ -389,7 +389,9 @@ export const SpcSerUrl = {
updateSelfUrl
:
completePrefix
(
baseURI
,
'bank/topography/selfnodes'
),
//更新自建系统节点
listSelfDevice
:
completePrefix
(
baseURI
,
'bank/equipment/selfDevice?fname={fname}&pageNumber={page}&pageSize={size}'
),
getTopoTreeByTypeUrl
:
completePrefix
(
baseURI
,
'bank/topography/treeByType/{type}'
)
//监控系统树
getTopoTreeByTypeUrl
:
completePrefix
(
baseURI
,
'bank/topography/treeByType/{type}'
),
//监控系统树
getNodesByTypeAndTreeIdUrl
:
completePrefix
(
baseURI
,
'bank/topography/getNodesByTypeAndTreeId/{type}/{treeId}'
),
//根据类型查询拓扑图列表
saveNodesByTypeUrl
:
completePrefix
(
baseURI
,
'bank/topography/saveNodesByType/{type}'
),
//保存拓扑图数据
};
export
const
patrolUrls
=
{
...
...
src/services/monitorService.js
View file @
92267adc
...
...
@@ -6,3 +6,16 @@ import { commonPost, commonGet, formatUrl } from './../utils/request';
export
const
getTopoTreeByTypeAction
=
(
type
)
=>
{
return
commonGet
(
formatUrl
(
SpcSerUrl
.
getTopoTreeByTypeUrl
,
{
type
}));
};
// 拓扑图查询
export
const
getNodesByTypeAndTreeIdAction
=
(
type
,
treeId
)
=>
{
console
.
log
(
treeId
);
return
commonGet
(
formatUrl
(
SpcSerUrl
.
getNodesByTypeAndTreeIdUrl
,
{
type
,
treeId
}));
};
// 拓扑图更新数据
export
const
saveNodesByTypeUrlAction
=
(
type
,
params
)
=>
{
return
commonPost
(
formatUrl
(
SpcSerUrl
.
saveNodesByTypeUrl
,
{
type
}),
params
);
};
src/view/bank/financialCityLan/index.js
View file @
92267adc
...
...
@@ -8,14 +8,13 @@ import TopologyComponent from './TopologyComponent';
import
TreeComponent
from
'./TreeComponent'
;
import
mqtt
from
'mqtt'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
{
getSelfTopoTreeAction
,
getSelfTopographyAction
,
updateSelfTopographyAction
,
getTopographyEventsAction
,
getDeivceListAction
}
from
'./../../..//services/selfServices'
;
import
{
getTypeBySystem
}
from
'./conf'
;
import
{
getTopoTreeByTypeAction
}
from
'SERVICES/monitorService'
;
import
{
getTopoTreeByTypeAction
,
getNodesByTypeAndTreeIdAction
,
saveNodesByTypeUrlAction
}
from
'SERVICES/monitorService'
;
import
SysWsURL
from
'./../../../consts/wsUrlConsts'
;
const
type
=
getTypeBySystem
(
'
SelfSupport
'
);
const
type
=
getTypeBySystem
(
'
CityLan
'
);
//const type = getTypeBySystem('SelfSupport');
//偏移
const
offsetHeight
=
110
;
...
...
@@ -80,41 +79,6 @@ class FinancialCityLan extends Component {
}
receivcemqtt
=
()
=>
{
client
.
on
(
'connect'
,
(
e
)
=>
{
console
.
log
(
"连接成功!!!"
)
//QoS0,最多一次送达。也就是发出去就fire掉,没有后面的事情了。
// QoS1,至少一次送达。发出去之后必须等待ack,没有ack,就要找时机重发
// QoS2,准确一次送达。消息id将拥有一个简单的生命周期。
// client.subscribe('bank/equipment/ping', { qos: 1 }, (res) => {
client
.
subscribe
(
'bank/equipment/ping'
,
{
qos
:
1
},
(
res
)
=>
{
if
(
!
res
)
{
console
.
log
(
'订阅成功'
);
}
else
{
console
.
log
(
'订阅失败'
)
}
});
// 接收消息处理
client
.
on
(
'message'
,
(
topic
,
message
)
=>
{
// console.log('收到来自', topic, '的消息', message.toString());
const
{
selectedKeys
}
=
this
.
state
;
this
.
initTopologyData
(
selectedKeys
[
0
],
''
);
});
// 断开发起重连
client
.
on
(
'reconnect'
,
(
error
)
=>
{
console
.
log
(
'正在重连:'
,
error
)
});
// 链接异常处理
client
.
on
(
'error'
,
(
error
)
=>
{
console
.
log
(
'连接失败:'
,
error
)
});
});
}
//点击地图线操作
viewlineItem
=
()
=>
{
let
{
treeData
,
selectedKeys
,
cityLine
}
=
this
.
state
;
...
...
@@ -170,7 +134,7 @@ class FinancialCityLan extends Component {
// 拓扑图数据初始化
initTopologyData
=
(
id
,
value
=
''
)
=>
{
get
SelfTopographyAction
(
id
).
then
(
data
=>
{
get
NodesByTypeAndTreeIdAction
(
type
,
id
).
then
(
data
=>
{
if
(
value
===
'refresh'
)
{
message
.
success
(
'拓扑图刷新成功!'
);
}
...
...
@@ -180,22 +144,8 @@ class FinancialCityLan extends Component {
topologyData
:
data
});
});
getDeivceListAction
(
0
,
10
,
null
).
then
(
data
=>
{
// console.log('表格刷新成功!');
this
.
setState
({
tableData
:
data
.
content
,
totalCount
:
data
.
totalElements
});
});
}
// // 拓扑图事件数据初始化
// initTopologyEventData = () => {
// debugger
// getDeivceListAction().then(data => {
// this.setState({
// tableData: data
// });
// });
// }
/**
* 获取表格所选则的行数据
*/
...
...
@@ -233,18 +183,6 @@ class FinancialCityLan extends Component {
});
};
queryEquipPage
=
()
=>
{
let
pageConfig
=
this
.
pageConfig
;
let
pageNumber
=
pageConfig
.
pageNumber
-
1
;
let
pageSize
=
pageConfig
.
pageSize
;
getDeivceListAction
(
pageNumber
,
pageSize
,
null
).
then
(
data
=>
{
this
.
setState
({
tableData
:
data
.
content
,
totalCount
:
data
.
totalElements
});
});
}
// // 选择节点连线
// nodeSelectionLinkChanged = (node) => {
// if (node.isSelected) {
...
...
@@ -280,7 +218,7 @@ class FinancialCityLan extends Component {
nodeData
:
nodeDataArray
,
linkData
:
linkDataArray
};
updateSelfTopographyAction
(
params
).
then
(
data
=>
{
saveNodesByTypeUrlAction
(
type
,
params
).
then
(
data
=>
{
message
.
success
(
'拓扑图保存成功!'
);
});
}
...
...
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