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
c05d100b
Commit
c05d100b
authored
Nov 06, 2020
by
张烨
Browse files
Options
Browse Files
Download
Plain Diff
merge: fxi conflict
parents
a04ec4e0
3c0d42a8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
11 deletions
+93
-11
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+82
-10
UserManage.js
src/pages/userCenter/UserManage.js
+0
-0
DelModal.jsx
src/pages/userCenter/siteManage/DelModal.jsx
+1
-1
api.js
src/services/database/api.js
+10
-0
web4site.js
src/services/mocks/web4site.js
+0
-0
No files found.
src/pages/database/InitDataBase.jsx
View file @
c05d100b
...
...
@@ -15,6 +15,7 @@ import {
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
connect
}
from
'react-redux'
;
import
{
get
,
post
}
from
'../../services'
;
import
{
setTableSQLDirName
,
deleteConn
}
from
'@/services/database/api'
import
styles
from
'./InitDataBase.less'
;
const
{
Option
}
=
Select
;
...
...
@@ -38,6 +39,8 @@ const InitDataBase = props => {
const
[
upData
,
setUpData
]
=
useState
(
1
);
// 列表刷新标记
const
[
option
,
setOption
]
=
useState
([]);
// 下拉列表数据
const
[
desc
,
setDesc
]
=
useState
(
''
);
// 修改描述
const
[
allSqlDir
,
setAllSqulDir
]
=
useState
([])
//修改产品方案
const
[
defaultSqlDir
,
setDefaultSqlDir
]
=
useState
(
''
)
//修改产品方案默认值
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
console
.
log
(
window
.
location
.
host
);
// 获取数据库链接记录
...
...
@@ -77,6 +80,8 @@ const InitDataBase = props => {
});
form
.
setFieldsValue
(
obj
);
setDbForm
(
val
=>
({
...
val
,
...
obj
}));
setAllSqulDir
(
res
.
allSqlDir
)
setDefaultSqlDir
(
res
.
tableSQLDirName
)
}
})
.
catch
(
err
=>
{
...
...
@@ -203,6 +208,30 @@ const InitDataBase = props => {
});
form
.
setFieldsValue
(
obj
);
};
// 产品方案选择框回调
const
handleSelect
=
(
value
)
=>
{
setTableSQLDirName
({
dirName
:
value
,
_version
:
9999
,
_dc
:
new
Date
().
getTime
()
}).
then
(
res
=>
{
if
(
res
.
success
){
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
`已切换初始化脚本为:
${
value
}
`
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
message
,
});
}
}).
catch
(
err
=>
{
console
.
error
(
err
)
})
}
// 展示修改描述
const
changeDesc
=
()
=>
{
setModalVisible
(
true
);
...
...
@@ -236,6 +265,34 @@ const InitDataBase = props => {
setModalVisible
(
false
);
});
};
//删除数据库连接记录
const
delConn
=
(
value
)
=>
{
setTableLoading
(
true
)
const
{
key
=
''
}
=
value
deleteConn
({
rowIndex
:
key
,
_version
:
9999
,
_dc
:
new
Date
().
getTime
()
}).
then
(
res
=>
{
setTableLoading
(
false
)
if
(
res
.
success
){
setUpData
(
upData
+
1
);
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'操作成功'
})
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
message
})
}
}).
catch
(
err
=>
{
setTableLoading
(
false
)
console
.
error
(
err
)})
}
const
columns
=
[
{
title
:
'服务器名或IP地址'
,
...
...
@@ -280,11 +337,12 @@ const InitDataBase = props => {
},
{
title
:
'删除'
,
dataIndex
:
'name'
,
key
:
'name'
,
render
:
()
=>
(
<
Button
size=
"small"
danger
>
dataIndex
:
'del'
,
key
:
'del'
,
render
:
(
text
,
record
)
=>
(
<
Button
size=
"small"
danger
onClick=
{
()
=>
delConn
(
record
)
}
>
删除
</
Button
>
),
...
...
@@ -360,7 +418,20 @@ const InitDataBase = props => {
>
数据库初始化
</
Button
>
<
span
>
{
dbForm
.
inUse
}
</
span
>
{
defaultSqlDir
&&
<
Select
placeholder=
'请选择解决方案'
style=
{
{
width
:
'200px'
}
}
defaultValue=
{
defaultSqlDir
}
onChange
=
{
(
e
)=
>
{
handleSelect
(
e
)
}
}
>
{
allSqlDir
&&
allSqlDir
.
map
(
(
item
,
index
)
=>
{
console
.
log
(
defaultSqlDir
)
return
<
Option
value=
{
item
}
key=
{
index
}
>
{
item
}
</
Option
>
})
}
</
Select
>
}
{
/* <span>{dbForm.inUse}</span> */
}
</
Space
>
</
div
>
</
Form
.
Item
>
...
...
@@ -389,19 +460,20 @@ const InitDataBase = props => {
maskClosable
onOk=
{
()
=>
modalOkCallback
()
}
onCancel=
{
()
=>
setModalVisible
(
false
)
}
width=
"
10
00px"
width=
"
8
00px"
bodyStyle=
{
{
minHeight
:
'100px'
,
}
}
cancelText=
"取消"
okText=
"确认修改"
destroyOnClose
destroyOnClose
=
{
true
}
>
<
Row
>
<
Col
span=
{
1
}
className=
{
styles
.
decsBox
}
>
<
Col
span=
{
2
}
className=
{
styles
.
decsBox
}
>
描述:
</
Col
>
<
Col
span=
{
11
}
>
<
Col
span=
{
22
}
>
<
Input
placeholder=
"请输入描述"
onChange=
{
value
=>
{
...
...
src/pages/userCenter/UserManage.js
View file @
c05d100b
This diff is collapsed.
Click to expand it.
src/pages/userCenter/siteManage/DelModal.jsx
View file @
c05d100b
...
...
@@ -41,7 +41,7 @@ const DelModal = (props) =>{
return
(
<
SiteModal
{
...
props
}
title=
'删除站点'
bodyStyle
={{
width
:"100%",
minHeight
:"50
px
",}}
style=
{
{
top
:
'500px'
}
}
style=
{
{
top
:
200
}
}
width=
"400px"
destroyOnClose=
{
true
}
cancelText=
'取消'
...
...
src/services/database/api.js
View file @
c05d100b
import
{
get
,
post
}
from
'@/services/index'
;
// 修改产品解决方案
export
const
setTableSQLDirName
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/S_SetTableSQLDirName'
,
params
);
// 删除数据库连接记录
export
const
deleteConn
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/S_DeleteConn'
,
params
);
src/services/mocks/web4site.js
View file @
c05d100b
This diff is collapsed.
Click to expand it.
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