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
54b1ec53
Commit
54b1ec53
authored
Aug 31, 2021
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改数据库初始化选择对应产品方式,初始化后日志模块,二次初始化接口调用
parent
fd923672
Pipeline
#33719
passed with stages
in 32 minutes 47 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
31 deletions
+48
-31
index.jsx
src/components/RadioGroup/index.jsx
+8
-2
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+36
-28
api.js
src/services/database/api.js
+4
-1
No files found.
src/components/RadioGroup/index.jsx
View file @
54b1ec53
...
...
@@ -19,9 +19,15 @@ const RadioBox = props => {
<
div
className=
{
styles
.
radioBox
}
>
<
div
className=
{
styles
.
radioTitle
}
>
{
radioTitle
}
:
</
div
>
<
div
className=
{
styles
.
radioContent
}
>
<
Radio
.
Group
onChange=
{
onChange
}
value=
{
currentVal
}
>
<
Radio
.
Group
value=
{
currentVal
}
>
{
radioOptions
.
map
((
item
,
num
)
=>
(
<
Radio
value=
{
item
.
version
}
key=
{
num
}
className=
{
styles
.
radio
}
>
<
Radio
disabled=
{
item
.
disabled
}
value=
{
item
.
version
}
key=
{
num
}
className=
{
styles
.
radio
}
onClick=
{
onChange
}
>
{
item
.
functionName
+
item
.
version
}
</
Radio
>
))
}
...
...
src/pages/database/InitDataBase.jsx
View file @
54b1ec53
...
...
@@ -34,6 +34,7 @@ import {
GetProductList
,
// 获取产品列表
GetDbProduct
,
// 获取产品方案配置
InitAddDataBase
,
// 数据库初始化
InitEditDataBase
,
// 二次初始化
}
from
'@/services/database/api'
;
import
styles
from
'./InitDataBase.less'
;
...
...
@@ -148,6 +149,7 @@ const InitDataBase = props => {
.
split
(
/
(\r\n)
|
(\n)
/
)
.
map
((
item
,
index
)
=>
<
p
key=
{
index
}
>
{
item
}
</
p
>),
);
console
.
log
(
arr
);
setInitContent
(
arr
);
scroll
.
current
.
scrollTop
=
scroll
.
current
.
scrollHeight
;
}
...
...
@@ -426,7 +428,7 @@ const InitDataBase = props => {
});
return
;
}
setDbExists
(
res
[
1
].
DBExists
);
setDbExists
(
res
[
1
].
data
.
DBExists
);
let
fileList
=
res
[
0
].
data
?
res
[
0
].
data
:
[];
let
dataList
=
res
[
1
].
data
.
Product
?
res
[
1
].
data
.
Product
:
[];
// 没有库或者dataList为[]直接用fileList作为回显
...
...
@@ -468,14 +470,22 @@ const InitDataBase = props => {
mapCheckVersion
.
check
===
undefined
?
null
:
mapCheckVersion
.
check
;
if
(
item
.
check
)
{
item
.
hasCheck
=
true
;
}
item
.
functionrSolutions
.
forEach
(
val
=>
{
// 根据三级目录对应的选中key匹配isCheck
let
isCheck
=
mapList
.
get
(
val
.
key
);
val
.
isCheck
=
isCheck
===
undefined
?
null
:
isCheck
;
// 版本号低于当前版本号禁止选用
if
(
item
.
checkVersion
&&
val
.
version
<
item
.
checkVersion
)
{
val
.
disabled
=
true
;
}
else
{
val
.
disabled
=
false
;
}
});
});
});
console
.
log
(
fileList
);
setInitList
(
fileList
);
setInitLoading
(
false
);
})
...
...
@@ -512,18 +522,25 @@ const InitDataBase = props => {
const
radioChange
=
(
index
,
value
)
=>
{
setInitList
(
val
=>
{
const
list
=
JSON
.
parse
(
JSON
.
stringify
(
val
));
// 修改一级菜单的check字段
list
[
index
.
tabIndex
].
check
=
true
;
// 修改二级菜单的check字段
list
[
index
.
tabIndex
].
modularSolutions
[
index
.
radioIndex
].
check
=
true
;
const
secondList
=
list
[
index
.
tabIndex
].
modularSolutions
[
index
.
radioIndex
];
// 取消功能 一开始未选中的才能取消
if
(
value
===
secondList
.
checkVersion
&&
!
secondList
.
hasCheck
)
{
secondList
.
checkVersion
=
null
;
value
=
null
;
secondList
.
check
=
false
;
}
else
{
// 修改选中的checkVersion值
list
[
index
.
tabIndex
].
modularSolutions
[
index
.
radioIndex
].
checkVersion
=
value
;
secondList
.
checkVersion
=
value
;
// 修改二级菜单的check字段
secondList
.
check
=
true
;
}
// 修改一级菜单的check字段
list
[
index
.
tabIndex
].
check
=
!
list
[
index
.
tabIndex
].
modularSolutions
.
every
(
version
=>
version
.
checkVersion
===
null
,
);
// 修改单选isCheck字段
list
[
index
.
tabIndex
].
modularSolutions
[
index
.
radioIndex
].
functionrSolutions
.
forEach
(
item
=>
{
secondList
.
functionrSolutions
.
forEach
(
item
=>
{
if
(
item
.
version
===
value
)
{
item
.
isCheck
=
true
;
}
else
{
...
...
@@ -533,15 +550,17 @@ const InitDataBase = props => {
return
list
;
});
};
// 数据库初始化
const
initDatabasePro
=
()
=>
{
// handleShowModal('versionVisible', true);
let
productSetting
=
initList
;
let
obj
=
form
.
getFieldsValue
();
console
.
log
({
...
obj
,
productSetting
});
// 数据库存在调用编辑接口否则调用新增接口
setInitLoading
(
true
);
handleShowModal
(
'initVisible'
,
false
);
setInitVisible
(
true
);
doInitLog
();
if
(
dbExists
)
{
Init
Add
DataBase
({
...
obj
,
productSetting
}).
then
(
res
=>
{
Init
Edit
DataBase
({
...
obj
,
productSetting
}).
then
(
res
=>
{
setInitLoading
(
false
);
if
(
res
.
code
===
0
)
{
notification
.
success
({
...
...
@@ -549,7 +568,6 @@ const InitDataBase = props => {
duration
:
3
,
description
:
'操作成功'
,
});
handleShowModal
(
'initVisible'
,
false
);
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -568,7 +586,6 @@ const InitDataBase = props => {
duration
:
3
,
description
:
'操作成功'
,
});
handleShowModal
(
'initVisible'
,
false
);
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -791,7 +808,7 @@ const InitDataBase = props => {
width=
{
800
}
maskClosable=
{
false
}
bodyStyle=
{
{
height
:
'
6
00px'
,
height
:
'
5
00px'
,
// overflowY: 'auto',
}
}
footer=
{
[
...
...
@@ -809,7 +826,7 @@ const InitDataBase = props => {
<
div
ref=
{
scroll
}
style=
{
{
maxHeight
:
'
5
70px'
,
maxHeight
:
'
4
70px'
,
overflowY
:
'auto'
,
marginRight
:
' -24px'
,
}
}
...
...
@@ -854,15 +871,6 @@ const InitDataBase = props => {
</
Col
>
</
Row
>
</
Modal
>
{
/* 检查版本弹窗 */
}
<
Modal
title=
"版本检查"
visible=
{
modalVisible
.
versionVisible
}
onOk=
{
()
=>
modalOkCallback
()
}
onCancel=
{
()
=>
handleShowModal
(
'versionVisible'
,
false
)
}
>
<
p
>
当前版本运行正常
</
p
>
</
Modal
>
{
/* 初始化选择产品弹窗 */
}
<
Modal
title=
"初始化"
...
...
src/services/database/api.js
View file @
54b1ec53
...
...
@@ -16,7 +16,7 @@ import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
*/
// 测试数据库连接
export
const
connectionTest
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/DBManager/ConnectionTest
`
,
params
);
post
(
`
${
PUBLISH_SERVICE
}
/DBManager/TestConnetions
`
,
params
);
// 获取数据库配置信息
export
const
getDataBaseConfigNew
=
params
=>
...
...
@@ -213,3 +213,6 @@ export const GetDbProduct = params =>
// 数据库初始化
export
const
InitAddDataBase
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/DBManager/InitAddDataBase`
,
params
);
// 二次初始化
export
const
InitEditDataBase
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/DBManager/InitEditDataBase`
,
params
);
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