Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
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
CivManage
Commits
5b9c70fe
Commit
5b9c70fe
authored
Feb 28, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '物联网统一接入平台增加升级功能'
parent
c57480b4
Pipeline
#68167
passed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
20 deletions
+62
-20
incident.jsx
src/pages/bsmanager/workOrder/incident/incident.jsx
+2
-0
IotConfig.jsx
src/pages/platformCenter/hostmanager/IotConfig/IotConfig.jsx
+55
-19
hostmanager.js
src/services/hostmanager/hostmanager.js
+5
-1
No files found.
src/pages/bsmanager/workOrder/incident/incident.jsx
View file @
5b9c70fe
...
...
@@ -231,6 +231,8 @@ const incident = () => {
return
<
span
>
前端+手持
</
span
>;
}
else
if
(
item
===
''
||
item
===
'否'
)
{
return
<
span
>
内置用法
</
span
>;
}
else
if
(
item
===
'是'
)
{
return
<
span
>
(无)
</
span
>;
}
else
{
return
<
span
>
{
item
}
</
span
>;
}
...
...
src/pages/platformCenter/hostmanager/IotConfig/IotConfig.jsx
View file @
5b9c70fe
...
...
@@ -37,6 +37,8 @@ import {
DepositServiceDisable
,
// 停止数据库服务
DepositServiceEnable
,
// 启动数据库服务
GetGateWay
,
IsIotUpgrade
,
// 判断是否需要升级物联网统一接入平台
IotUpgrade
,
// 升级物联网统一接入平台
}
from
'@/services/hostmanager/hostmanager'
;
import
{
GetDbProduct
,
// 获取产品方案配置
...
...
@@ -80,28 +82,37 @@ const IotConfig = props => {
const
[
buStatus
,
setBuStatus
]
=
useState
(
''
);
// 按钮状态
const
[
keep
,
setKeep
]
=
useState
(
''
);
const
[
getWayVisible
,
setGetWayVisible
]
=
useState
(
false
);
const
[
upgrade
,
setUpgrade
]
=
useState
(
false
);
useEffect
(()
=>
{
HealthCheck
()
.
then
(
res
=>
{
if
(
res
.
success
)
{
setFlag
(
1
);
getCurrentConfig
();
getSiteCode
();
GetGateWay
().
then
(
resdata
=>
{
if
(
resdata
.
code
===
0
)
{
if
(
resdata
.
data
===
false
)
{
setGetWayVisible
(
true
);
}
}
});
GetGateWay
().
then
(
resdata
=>
{
if
(
resdata
.
code
===
0
)
{
if
(
resdata
.
data
===
false
)
{
setGetWayVisible
(
true
);
}
else
{
setFlag
(
0
);
HealthCheck
()
.
then
(
res
=>
{
if
(
res
.
success
)
{
setFlag
(
1
);
getCurrentConfig
();
getSiteCode
();
}
else
{
setFlag
(
0
);
}
})
.
catch
(
err
=>
{
console
.
log
(
err
);
});
}
})
.
catch
(
err
=>
{
console
.
log
(
err
);
});
}
});
IsIotUpgrade
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setUpgrade
(
res
.
data
);
console
.
log
(
res
);
}
});
GetCurentIotVerison
();
GetIotConfig
();
...
...
@@ -256,6 +267,20 @@ const IotConfig = props => {
console
.
log
(
'Failed:'
,
errorInfo
);
};
// 物联网升级
const
PingIotUpdata
=
()
=>
{
setLoading
(
true
);
IotUpgrade
().
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
code
===
0
)
{
setUpgrade
(
false
);
message
.
success
(
'升级成功!'
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
};
const
PingIot
=
({
ip
,
values
})
=>
{
SaveIotConfig
({
tcpAddress
:
values
.
TcpAddress
,
...
...
@@ -465,6 +490,15 @@ const IotConfig = props => {
<
Button
type=
"primary"
onClick=
{
()
=>
PingIot1
()
}
style=
{
{
marginLeft
:
'25px'
}
}
>
测试连接
</
Button
>
{
upgrade
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
PingIotUpdata
()
}
style=
{
{
marginLeft
:
'25px'
}
}
>
物联网升级
</
Button
>
)
}
<
span
style=
{
{
display
:
show1
}
}
>
<
img
src=
{
Yes
}
...
...
@@ -582,7 +616,9 @@ const IotConfig = props => {
visible=
{
getWayVisible
}
title=
"提示"
width=
"350px"
closable=
{
false
}
closable
maskClosable=
{
false
}
onCancel=
{
()
=>
setGetWayVisible
(
false
)
}
all
footer=
{
<
Space
>
...
...
src/services/hostmanager/hostmanager.js
View file @
5b9c70fe
...
...
@@ -22,6 +22,10 @@ export const GetTCPConfigInfo = param =>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/GetTCPConfigInfo`
,
param
);
export
const
PingIOTPlatform
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/PingIOTPlatform`
,
param
);
// 判断是否需要升级物联网统一接入平台
export
const
IsIotUpgrade
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/IsIotUpgrade`
,
param
);
// 升级物联网统一接入平台
export
const
IotUpgrade
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/IotUpgrade`
,
param
);
export
const
SaveTcpAddress
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/SaveTcpAddress`
,
param
);
// 健康检查接口
export
const
HealthCheck
=
param
=>
get
(
`/Iot/api/HealthCheck`
,
param
);
...
...
@@ -33,7 +37,7 @@ export const GetServiceInfo = param => post(`/Iot/api/DB/GetServiceInfo`, param)
export
const
AddDB
=
param
=>
post
(
`/Iot/api/DB/AddDBV2`
,
param
);
// 停止数据库服务
export
const
DepositServiceDisable
=
param
=>
post
(
`/Iot/api/DB/DepositServiceDisable`
,
param
);
// 启用数据库服务
// 启用数据库服务
export
const
DepositServiceEnable
=
param
=>
post
(
`/Iot/api/DB/DepositServiceEnable`
,
param
);
// 消息平台接口
...
...
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