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
9d819d1e
Commit
9d819d1e
authored
Jan 18, 2024
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '首页操作数据库初始化'
parent
0e46664d
Pipeline
#84341
waiting for manual action with stages
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
0 deletions
+83
-0
DatabaseInitialization.jsx
...atabase/databaseInitialization/DatabaseInitialization.jsx
+0
-0
index.jsx
src/pages/homePage/index.jsx
+72
-0
index.less
src/pages/homePage/index.less
+11
-0
No files found.
src/pages/database/databaseInitialization/DatabaseInitialization.jsx
View file @
9d819d1e
This diff is collapsed.
Click to expand it.
src/pages/homePage/index.jsx
View file @
9d819d1e
...
...
@@ -16,6 +16,7 @@ import {
Menu
,
Empty
,
Tabs
,
Modal
,
}
from
'antd'
;
import
dengPao
from
'@/assets/images/icons/dengpao.png'
;
import
icon
from
'@/assets/images/icons/icon.png'
;
...
...
@@ -49,11 +50,13 @@ import {
getDataBaseConfigNew
,
connectionTest
,
changeSolution
,
saveConnectionNew
,
}
from
'@/services/database/api'
;
import
ReactEcharts
from
'echarts-for-react'
;
import
{
GetBasicInfo
,
GetGateWay
}
from
'@/services/hostmanager/hostmanager'
;
import
{
GetWebSiteConfig
}
from
'@/services/gis/gis'
;
import
{
GetOMSDashboard
,
GetWayPages
}
from
'@/services/homePage/api'
;
import
DatabaseInitialization
from
'@/pages/database/databaseInitialization/DatabaseInitialization'
;
import
{
GetVectorService
,
GetMaplayerByTerminalType
,
...
...
@@ -93,6 +96,7 @@ const HomePage = () => {
const
[
loadingApi
,
setLoadingApi
]
=
useState
(
false
);
const
[
loadingDatabase
,
setLoadingDatabase
]
=
useState
(
false
);
const
[
loadingProduct
,
setLoadingProduct
]
=
useState
(
false
);
const
[
dataBaseVisible
,
setDataBaseVisible
]
=
useState
(
false
);
const
[
allTime
,
setAllTime
]
=
useState
([
moment
().
startOf
(
'month'
),
moment
(
new
Date
(),
'YYYY-MM-DD HH:mm:ss'
),
...
...
@@ -288,6 +292,7 @@ const HomePage = () => {
});
}
}
else
{
setDataBaseVisible
(
true
);
setState
(
false
);
notification
.
error
({
message
:
'提示'
,
...
...
@@ -829,6 +834,41 @@ const HomePage = () => {
}
};
// 数据库连接失败时弹窗系统初始化或跳转切换数据库连接界面
const
onOk
=
value
=>
{
// 在首页系统初始化完成直接保存连接刷新界面
saveConnectionNew
({
ip
:
value
.
ip
,
dbName
:
value
.
dbName
,
userName
:
value
.
userName
,
password
:
value
.
password
,
providerType
:
value
.
providerType
,
})
.
then
(
resnew
=>
{
if
(
resnew
.
code
===
0
)
{
setFlag
(
flag
+
1
);
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'保存成功'
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
15
,
description
:
resnew
.
msg
,
});
}
})
.
catch
(
err
=>
{
notification
.
error
({
message
:
'提示'
,
duration
:
15
,
description
:
err
,
});
});
};
return
(
<
div
className=
{
styles
.
homePage
}
>
<
div
className=
{
styles
.
header
}
>
...
...
@@ -1271,6 +1311,38 @@ const HomePage = () => {
</
Spin
>
</
div
>
</
div
>
<
Modal
title=
{
<
div
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
}
}
>
<
div
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
}
}
>
<
div
style=
{
{
width
:
'3px'
,
height
:
'15px'
,
backgroundColor
:
'#096dd9'
,
borderRadius
:
'10px'
,
marginRight
:
'10px'
,
}
}
/>
<
span
>
系统初始化
</
span
>
</
div
>
<
div
style=
{
{
marginRight
:
'30px'
,
color
:
'#096dd9'
,
fontSize
:
'12px'
}
}
>
<
span
style=
{
{
cursor
:
'pointer'
}
}
onClick=
{
()
=>
toDataCenter
()
}
>
已有数据库?点击进行配置
</
span
>
</
div
>
</
div
>
}
visible=
{
dataBaseVisible
}
onCancel=
{
()
=>
setDataBaseVisible
(
false
)
}
width=
"1400px"
className=
{
styles
.
dataBaseVisible
}
footer=
{
false
}
maskClosable=
{
false
}
destroyOnClose=
{
true
}
>
<
DatabaseInitialization
callBackSubmit=
{
onOk
}
visible=
{
dataBaseVisible
}
/>
</
Modal
>
</
div
>
);
};
...
...
src/pages/homePage/index.less
View file @
9d819d1e
...
...
@@ -773,3 +773,14 @@
}
}
}
.dataBaseVisible {
margin-top: -88px;
:global {
.ant-modal-body {
padding: 0;
}
.ant-modal-header {
height: 50px;
}
}
}
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