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
a2316832
Commit
a2316832
authored
Mar 17, 2021
by
mayongxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:宿主管理-消息平台
parent
33191327
Pipeline
#24575
passed with stages
in 17 minutes 8 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
2 deletions
+142
-2
IotConfig.jsx
src/pages/platformCenter/hostmanager/IotConfig/IotConfig.jsx
+1
-1
index.jsx
src/pages/platformCenter/hostmanager/index.jsx
+2
-1
messageConfig.jsx
...latformCenter/hostmanager/messageConfig/messageConfig.jsx
+125
-0
messageConfig.less
...atformCenter/hostmanager/messageConfig/messageConfig.less
+8
-0
hostmanager.jsx
src/services/platform/hostmanager.jsx
+6
-0
No files found.
src/pages/platformCenter/hostmanager/IotConfig/IotConfig.jsx
View file @
a2316832
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
Card
,
Form
,
Input
,
Button
,
Select
,
message
}
from
'antd'
import
styles
from
'./IotConfig.less'
import
{
GetIOTPlatformVersion
,
GetTCPConfigInfo
,
PingIOTPlatform
,
SaveTcpAddress
}
from
'
../../../..
/services/platform/hostmanager'
import
{
GetIOTPlatformVersion
,
GetTCPConfigInfo
,
PingIOTPlatform
,
SaveTcpAddress
}
from
'
@
/services/platform/hostmanager'
const
layout
=
{
labelCol
:
{
span
:
8
},
wrapperCol
:
{
span
:
16
},
...
...
src/pages/platformCenter/hostmanager/index.jsx
View file @
a2316832
...
...
@@ -3,6 +3,7 @@ import { Tabs } from 'antd';
import
PageContainer
from
'@/components/BasePageContainer'
;
import
BaseConfig
from
'./baseConfig/BaseConfig'
import
IotConfig
from
'./IotConfig/IotConfig'
import
MessageConfig
from
'./messageConfig/messageConfig'
const
{
TabPane
}
=
Tabs
;
...
...
@@ -23,7 +24,7 @@ const HostManager = () => {
<
IotConfig
/>
</
TabPane
>
<
TabPane
tab=
"消息配置"
key=
"3"
>
Content of Tab Pane 3
<
MessageConfig
/>
</
TabPane
>
<
TabPane
tab=
"代理配置"
key=
"4"
>
Content of Tab Pane 3
...
...
src/pages/platformCenter/hostmanager/messageConfig/messageConfig.jsx
0 → 100644
View file @
a2316832
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
Card
,
Form
,
Input
,
Button
,
Select
,
message
}
from
'antd'
import
styles
from
'./messageConfig.less'
;
import
{
GetMessageConfigInfo
,
SaveSystemInfo
,
ConnectMessPlatform
,
GetBasicInfo
,
GetDataBaseConfig
}
from
'@/services/platform/hostmanager'
const
layout
=
{
labelCol
:
{
span
:
8
},
wrapperCol
:
{
span
:
16
},
};
const
tailLayout
=
{
wrapperCol
:
{
offset
:
8
,
span
:
16
},
};
const
MessageConfig
=
()
=>
{
const
[
currentAddress
,
setCurrentAddress
]
=
useState
(
""
)
const
[
currentDataBase
,
setCurrentDataBase
]
=
useState
({});
const
[
currentSiteInfo
,
setcurrentSiteInfo
]
=
useState
(
""
);
const
[
form
]
=
Form
.
useForm
();
const
onFinish
=
(
values
)
=>
{
//先测试连接再保存
//1.测试链接
ConnectMessPlatform
({
messAddress
:
values
.
messageAddress
,
sqlServerIP
:
currentDataBase
.
ip
,
loginName
:
currentDataBase
.
userName
,
password
:
currentDataBase
.
password
,
sqlName
:
currentDataBase
.
dbName
,
siteCode
:
currentSiteInfo
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
//2.保存连接
SaveSystemInfo
({
configName
:
"消息平台连接地址"
,
configValue
:
values
.
messageAddress
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
message
.
info
(
"配置保存成功"
)
}
else
{
message
.
errorInfo
(
res
.
msg
)
}
}
)
}
else
{
message
.
errorInfo
(
res
.
msg
)
}
})
};
const
onFinishFailed
=
(
errorInfo
)
=>
{
console
.
log
(
'Failed:'
,
errorInfo
);
};
useEffect
(()
=>
{
GetMessageConfigInfo
().
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
setCurrentAddress
(
res
.
data
)
form
.
setFieldsValue
({
messageAddress
:
res
.
data
});
GetDataBaseConfig
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setCurrentDataBase
(
res
.
data
)
GetBasicInfo
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setcurrentSiteInfo
(
res
.
data
)
}
}
)
}
}
)
}
else
{
message
.
info
(
"获取消息平台配置失败!"
)
}
}
)
},
[])
return
(
<
div
className=
{
styles
.
message_container
}
>
<
Card
title=
{
`消息平台`
}
style=
{
{
width
:
430
}
}
>
<
Form
{
...
layout
}
form=
{
form
}
name=
"basic"
initialValues=
{
{
remember
:
true
}
}
onFinish=
{
onFinish
}
onFinishFailed=
{
onFinishFailed
}
>
<
Form
.
Item
label=
"服务器地址(平台)"
name=
"messageAddress"
rules=
{
[{
required
:
true
,
message
:
'请输入服务器地址!'
}]
}
>
<
Input
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
tailLayout
}
>
<
Button
type=
"primary"
htmlType=
"submit"
disabled=
{
currentSiteInfo
.
length
>
0
?
false
:
true
}
>
保存连接
</
Button
>
</
Form
.
Item
>
</
Form
>
</
Card
>
</
div
>
)
}
export
default
MessageConfig
\ No newline at end of file
src/pages/platformCenter/hostmanager/messageConfig/messageConfig.less
0 → 100644
View file @
a2316832
.message_container{
display: flex;
height: 100%;
width: 100%;
flex-direction: row;
justify-content: flex-start;
}
\ No newline at end of file
src/services/platform/hostmanager.jsx
View file @
a2316832
...
...
@@ -19,4 +19,10 @@ export const PingIOTPlatform = param =>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/PingIOTPlatform`
,
param
);
export
const
SaveTcpAddress
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/SaveTcpAddress`
,
param
);
export
const
GetMessageConfigInfo
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/GetMessageConfigInfo`
,
param
);
export
const
ConnectMessPlatform
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/ConnectMessagePlatform`
,
param
);
export
const
SaveSystemInfo
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/SaveSystemInfo`
,
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