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
94862471
Commit
94862471
authored
Jun 30, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '消息平台新增版本配置'
parent
065f813e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
17 deletions
+68
-17
messageConfig.jsx
...latformCenter/hostmanager/messageConfig/messageConfig.jsx
+68
-17
No files found.
src/pages/platformCenter/hostmanager/messageConfig/messageConfig.jsx
View file @
94862471
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Card
,
Form
,
Input
,
Button
,
Select
,
message
,
Divider
,
Spin
,
Row
,
Col
}
from
'antd'
;
import
styles
from
'./messageConfig.less'
;
import
{
GetMessageConfigInfo
,
SaveSystemInfo
,
...
...
@@ -8,9 +7,11 @@ import {
GetBasicInfo
,
GetDataBaseConfig
,
}
from
'@/services/hostmanager/hostmanager'
;
import
{
GetMessageVersion
}
from
'@/services/messagemanage/messagemanage'
;
import
{
CloseCircleFilled
}
from
'@ant-design/icons'
;
import
message11
from
'../../../../assets/images/icons/消息.svg'
;
import
Yes
from
'../../../../assets/images/icons/正确.svg'
;
import
{
CloseCircleFilled
}
from
'@ant-design/icon
s'
;
import
styles
from
'./messageConfig.les
s'
;
const
layout
=
{
labelCol
:
{
span
:
2
},
...
...
@@ -26,11 +27,13 @@ const MessageConfig = () => {
const
[
currentSiteInfo
,
setcurrentSiteInfo
]
=
useState
(
''
);
const
[
show1
,
setShow1
]
=
useState
(
'none'
);
const
[
show2
,
setShow2
]
=
useState
(
'none'
);
const
[
messageVersion
,
setMessageVersion
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
(
0
);
const
[
form
]
=
Form
.
useForm
();
const
onFinish
=
values
=>
{
//先测试连接再保存
//1.测试链接
//
先测试连接再保存
//
1.测试链接
setLoading
(
true
);
ConnectMessPlatform
({
messAddress
:
values
.
messageAddress
,
...
...
@@ -44,15 +47,15 @@ const MessageConfig = () => {
if
(
res
.
code
===
0
)
{
setShow1
(
'block'
);
setShow2
(
'none'
);
//2.保存连接
//
2.保存连接
SaveSystemInfo
({
configName
:
'消息平台连接地址'
,
configValue
:
values
.
messageAddress
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
}).
then
(
res
data
=>
{
if
(
res
data
.
code
===
0
)
{
message
.
info
(
'配置保存成功'
);
}
else
{
message
.
error
(
res
.
msg
);
message
.
error
(
res
data
.
msg
);
}
});
}
else
{
...
...
@@ -95,14 +98,14 @@ const MessageConfig = () => {
let
CurrentAddress
=
res
.
data
;
setCurrentAddress
(
res
.
data
);
form
.
setFieldsValue
({
messageAddress
:
res
.
data
});
GetDataBaseConfig
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
CurrentDataBase
=
res
.
data
;
setCurrentDataBase
(
res
.
data
);
GetBasicInfo
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
currentSiteInfo
=
res
.
data
;
setcurrentSiteInfo
(
res
.
data
);
GetDataBaseConfig
().
then
(
res
data
=>
{
if
(
res
data
.
code
===
0
)
{
let
CurrentDataBase
=
res
data
.
data
;
setCurrentDataBase
(
res
data
.
data
);
GetBasicInfo
().
then
(
res
list
=>
{
if
(
res
list
.
code
===
0
)
{
let
currentSiteInfo
=
res
list
.
data
;
setcurrentSiteInfo
(
res
list
.
data
);
// getMessageConfig(CurrentAddress, CurrentDataBase, currentSiteInfo);
}
});
...
...
@@ -112,7 +115,36 @@ const MessageConfig = () => {
message
.
info
(
'获取消息平台配置失败!'
);
}
});
},
[]);
getMessageVersion
();
},
[
flag
]);
const
getMessageVersion
=
()
=>
{
GetMessageVersion
().
then
(
res
=>
{
console
.
log
(
res
.
data
);
setMessageVersion
(
res
.
data
);
});
};
const
butn
=
()
=>
{
console
.
log
(
messageVersion
);
let
data
=
''
;
if
(
messageVersion
==
'1.0'
)
{
data
=
'2.0'
;
}
else
{
data
=
'1.0'
;
}
SaveSystemInfo
({
configName
:
'消息解析规则版本'
,
configValue
:
data
,
}).
then
(
resdata
=>
{
if
(
resdata
.
code
===
0
)
{
message
.
info
(
'配置保存成功'
);
getMessageVersion
();
}
else
{
message
.
error
(
resdata
.
msg
);
}
});
};
return
(
<
div
className=
{
styles
.
message_container
}
>
...
...
@@ -191,6 +223,25 @@ const MessageConfig = () => {
保存连接
</
Button
>
</
Form
.
Item
>
<
Form
.
Item
label=
"消息版本"
style=
{
{
marginLeft
:
'67px'
,
marginBottom
:
'0px'
}
}
>
<
span
style=
{
{
marginLeft
:
'15px'
,
color
:
'red'
,
fontWeight
:
'bold'
}
}
>
{
messageVersion
}
</
span
>
</
Form
.
Item
>
<
Form
.
Item
>
<
Button
type=
"primary"
style=
{
{
marginLeft
:
'152px'
,
marginTop
:
'13px'
,
width
:
'88px'
}
}
onClick=
{
butn
}
>
{
messageVersion
==
'1.0'
?
'升级'
:
'回退'
}
</
Button
>
<
br
/>
<
br
/>
<
span
style=
{
{
color
:
'red'
,
fontWeight
:
'bold'
,
marginLeft
:
'152px'
}
}
>
提示:web4请使用1.0版本,web5请使用2.0版本,请根据项目的实际情况决定
</
span
>
</
Form
.
Item
>
</
Form
>
</
Spin
>
</
Card
>
...
...
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