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
40e94a25
Commit
40e94a25
authored
Nov 18, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: perf
parent
d777c01c
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
168 additions
and
45 deletions
+168
-45
index.jsx
src/components/CheckGroup/index.jsx
+13
-3
itemCard.less
src/components/CheckGroup/itemCard.less
+1
-1
InitDataBase.less
src/pages/database/InitDataBase.less
+2
-1
ManagementDataBase.jsx
src/pages/database/ManagementDataBase.jsx
+7
-0
MongDBTable.jsx
src/pages/database/databaseConfig/mongDB/MongDBTable.jsx
+1
-0
ListCard.jsx
src/pages/orgnazation/ListCard.jsx
+13
-3
ListCardItem.less
src/pages/orgnazation/ListCardItem.less
+1
-2
EditModal.jsx
src/pages/userCenter/roleManage/EditModal.jsx
+1
-1
RoleManage.jsx
src/pages/userCenter/roleManage/RoleManage.jsx
+55
-22
RoleManage.less
src/pages/userCenter/roleManage/RoleManage.less
+11
-0
SiteManage.jsx
src/pages/userCenter/siteManage/SiteManage.jsx
+34
-8
SiteManage.less
src/pages/userCenter/siteManage/SiteManage.less
+12
-1
api.js
src/services/database/api.js
+17
-3
No files found.
src/components/CheckGroup/index.jsx
View file @
40e94a25
...
...
@@ -19,8 +19,14 @@ export const checkChildrenByCondition = (item, fn, tag = 'every') => {
};
const
ListCard
=
props
=>
{
const
{
ouid
,
searchWord
,
onCommit
=
()
=>
{},
itemObj
}
=
props
;
const
[
valueList
,
setValueList
]
=
useState
([]);
const
{
ouid
,
searchWord
,
onCommit
=
()
=>
{},
itemObj
,
btnLoading
=
false
,
}
=
props
;
const
[
valueList
,
setValueList
]
=
useState
({});
const
[
dataList
,
setdataList
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
[
mapObj
,
setMapObj
]
=
useState
({});
...
...
@@ -131,7 +137,11 @@ const ListCard = props => {
)
}
{
true
&&
!
loading
&&
dataList
&&
(
<
div
className=
{
styles
.
btnBox
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
onCommit
(
valueList
)
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
onCommit
(
valueList
)
}
loading=
{
btnLoading
}
>
提交
</
Button
>
</
div
>
...
...
src/components/CheckGroup/itemCard.less
View file @
40e94a25
...
...
@@ -25,7 +25,7 @@
.divSingle{
border: none;
margin-top: 20px;
flex:0 0
20
0px;
flex:0 0
18
0px;
background: transparent;
}
.isSearch{
...
...
src/pages/database/InitDataBase.less
View file @
40e94a25
...
...
@@ -12,6 +12,6 @@
line-height: 32px;
}
.btnBox {
display: flex;
display: flex
!important
;
justify-content: space-around;
}
\ No newline at end of file
src/pages/database/ManagementDataBase.jsx
View file @
40e94a25
...
...
@@ -177,6 +177,13 @@ const ManagementDataBase = () => {
width
:
200
,
ellipsis
:
true
,
},
{
title
:
'解决方案'
,
dataIndex
:
'solutionName'
,
key
:
'solutionName'
,
width
:
200
,
ellipsis
:
true
,
},
{
title
:
'数据库版本'
,
dataIndex
:
'version'
,
...
...
src/pages/database/databaseConfig/mongDB/MongDBTable.jsx
View file @
40e94a25
...
...
@@ -163,6 +163,7 @@ const MongDBTable = props => {
title
:
'操作'
,
dataIndex
:
'options'
,
key
:
'options'
,
width
:
300
,
render
:
(
val
,
item
)
=>
[
<
Button
size=
"small"
...
...
src/pages/orgnazation/ListCard.jsx
View file @
40e94a25
import
React
,
{
useState
,
useEffect
,
useCallback
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
;
import
{
Spin
,
Button
}
from
'antd'
;
import
ListCardItem
from
'./listCardItem'
;
import
{
get
,
post
}
from
'../../services'
;
...
...
@@ -6,7 +6,13 @@ import styles from './listCardItem.less';
const
tip
=
'loading...'
;
const
ListCard
=
props
=>
{
const
{
ouid
,
searchWord
,
valueCallback
,
onCommit
=
()
=>
{}
}
=
props
;
const
{
ouid
,
searchWord
,
valueCallback
,
onCommit
=
()
=>
{},
btnLoading
=
false
,
}
=
props
;
const
[
valueList
,
setValueList
]
=
useState
({});
const
[
dataList
,
setdataList
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
true
);
...
...
@@ -77,7 +83,11 @@ const ListCard = props => {
)
}
{
true
&&
!
loading
&&
dataList
&&
(
<
div
className=
{
styles
.
btnBox
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
onCommit
()
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
onCommit
()
}
loading=
{
btnLoading
}
>
提交
</
Button
>
</
div
>
...
...
src/pages/orgnazation/ListCardItem.less
View file @
40e94a25
...
...
@@ -25,8 +25,7 @@
flex-wrap: wrap;
align-items: center;
.ant-checkbox-group-item{
flex:0 0 auto;
margin-right: 100px;
flex:0 0 150px;
margin-bottom: 5px;
}
}
...
...
src/pages/userCenter/roleManage/EditModal.jsx
View file @
40e94a25
...
...
@@ -9,7 +9,7 @@ const AddModal = props => {
const
[
formLayout
,
setFormLayout
]
=
useState
(
'horizontal'
);
const
[
groupList
,
setGroupList
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
{
confirmModal
,
itemObj
}
=
props
;
const
{
confirmModal
,
itemObj
,
editVisible
}
=
props
;
console
.
log
(
itemObj
,
'itemObj'
);
useEffect
(()
=>
{
...
...
src/pages/userCenter/roleManage/RoleManage.jsx
View file @
40e94a25
...
...
@@ -8,9 +8,11 @@ import {
Spin
,
notification
,
Button
,
Tooltip
,
Space
,
}
from
'antd'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
{
DoubleLeftOutlined
,
DoubleRightOutlined
}
from
'@ant-design/icons'
;
import
{
setMenuToRole
,
getRoleGroupList
,
...
...
@@ -29,7 +31,7 @@ const SiteManage = () => {
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
searchWord
,
setSearchWord
]
=
useState
(
''
);
const
[
roleID
,
setRoleID
]
=
useState
(
''
);
// 角色ID
const
[
saveTreeId
,
setSaveTreeId
]
=
useState
(
''
);
// 保存点击回调的
ir
d
const
[
saveTreeId
,
setSaveTreeId
]
=
useState
(
''
);
// 保存点击回调的
rolei
d
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 新增弹窗
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
itemObj
,
setItemObj
]
=
useState
({});
// 选择的角色item
...
...
@@ -38,29 +40,35 @@ const SiteManage = () => {
const
[
subList
,
setSubList
]
=
useState
([]);
// 选中的数组
const
[
spinLoading
,
setSpinLoading
]
=
useState
(
false
);
const
[
currentSelectId
,
setCurrentSelectId
]
=
useState
([]);
// 选中的树节点
const
[
saveCurId
,
setSaveCurId
]
=
useState
([]);
// 树节点ID
const
[
groupVisible
,
setGroupVisible
]
=
useState
(
false
);
// 分组编辑弹窗
const
[
btnLoading
,
setBtnLoading
]
=
useState
(
false
);
const
[
mulu
,
setMulu
]
=
useState
(
true
);
// 点击树的回调
const
handleTreeSelect
=
(
e
,
treenode
)
=>
{
const
{
node
}
=
treenode
;
setItemObj
(
node
);
console
.
log
(
e
,
node
,
'node'
);
const
{
roleID
:
id
}
=
node
;
// setCurrentSelectId(e);
if
(
e
[
0
])
{
setCurrentSelectId
(
e
);
if
(
treenode
)
{
console
.
log
(
e
,
node
,
'node'
);
const
{
node
}
=
treenode
;
const
{
roleID
:
id
}
=
node
;
setItemObj
(
node
);
if
(
id
)
{
setSaveTreeId
(
id
);
setRoleID
(
id
);
}
else
{
setRoleID
(
saveTreeId
);
}
}
if
(
e
[
0
])
{
setCurrentSelectId
(
e
);
setSaveCurId
(
e
);
}
else
{
setCurrentSelectId
(
saveCurId
);
}
};
useEffect
(()
=>
{
setSpinLoading
(
true
);
getRoleGroupList
({
userID
:
1
}).
then
(
res
=>
{
console
.
log
(
res
,
'res'
);
setSpinLoading
(
false
);
if
(
res
.
code
===
0
)
{
const
{
roleList
}
=
res
.
data
;
...
...
@@ -68,6 +76,9 @@ const SiteManage = () => {
setTreeData
(
arr
);
}
});
return
()
=>
{
setItemObj
({});
};
},
[
flag
]);
const
handleAdd
=
e
=>
{
setModalVisible
(
true
);
...
...
@@ -99,23 +110,29 @@ const SiteManage = () => {
item
.
title
=
item
.
visibleTitle
||
''
;
item
.
key
=
item
.
visibleValue
||
''
;
if
(
item
.
roleList
&&
item
.
roleList
.
length
>
0
)
{
item
.
roleList
.
map
(
itemRole
=>
{
item
.
roleList
.
map
(
(
itemRole
,
index
)
=>
{
if
(
itemRole
.
roleList
)
{
itemRole
.
title
=
itemRole
.
visibleTitle
||
''
;
itemRole
.
key
=
itemRole
.
visibleTitle
+
Math
.
floor
(
Math
.
random
()
*
100
+
1
)
||
''
;
itemRole
.
key
=
itemRole
.
visibleTitle
+
itemRole
.
visibleValue
||
''
;
itemRole
.
groupflag
=
itemRole
.
visibleTitle
;
itemRole
.
roleList
.
map
(
i
=>
{
i
.
title
=
i
.
roleName
;
i
.
key
=
i
.
roleID
;
i
.
subSystemValue
=
item
.
visibleValue
;
i
.
group
=
itemRole
.
visibleTitle
;
if
(
roleID
&&
roleID
==
i
.
roleID
)
{
setItemObj
(
i
);
}
});
itemRole
.
children
=
itemRole
.
roleList
;
}
else
{
itemRole
.
title
=
itemRole
.
roleName
;
itemRole
.
key
=
itemRole
.
roleID
;
itemRole
.
subSystemValue
=
item
.
visibleValue
;
if
(
roleID
&&
roleID
==
itemRole
.
roleID
)
{
setItemObj
(
itemRole
);
}
}
return
itemRole
;
});
...
...
@@ -149,19 +166,24 @@ const SiteManage = () => {
const
editModal
=
()
=>
{
setEditVisible
(
false
);
setFlag
(
flag
+
1
);
setItemObj
(
''
);
handleTreeSelect
(
saveCurId
);
// setItemObj('');
};
// 分组编辑回调
const
groupModal
=
()
=>
{
setGroupVisible
(
false
);
setFlag
(
flag
+
1
);
setItemObj
(
''
);
handleTreeSelect
(
saveCurId
);
};
const
valueCallback
=
valueObj
=>
{
setSubList
(
valueObj
);
};
const
handleHide
=
()
=>
{
setMulu
(
!
mulu
);
};
const
handleCommit
=
rusults
=>
{
console
.
log
(
rusults
);
setBtnLoading
(
true
);
setMenuToRole
(
qs
.
stringify
({
roleID
,
...
...
@@ -174,6 +196,7 @@ const SiteManage = () => {
},
)
.
then
(
res
=>
{
setBtnLoading
(
false
);
if
(
res
.
success
)
{
notification
.
success
({
message
:
'提示'
,
...
...
@@ -189,14 +212,15 @@ const SiteManage = () => {
}
})
.
catch
(
err
=>
{
setBtnLoading
(
false
);
console
.
log
(
err
);
});
};
return
(
<
PageContainer
>
{
/* <GridContent> */
}
<
Row
gutter=
{
12
}
>
<
Col
lg=
{
6
}
>
<
Row
gutter=
{
0
}
>
<
Col
lg=
{
mulu
?
5
:
0
}
>
<
Card
className=
{
styles
.
cardBox
}
>
<
Spin
tip=
"loading...."
...
...
@@ -209,12 +233,8 @@ const SiteManage = () => {
showIcon
onSelect=
{
handleTreeSelect
}
treeData=
{
treeData
}
//
selectedKeys=
{
currentSelectId
}
selectedKeys=
{
currentSelectId
}
blockNode
defaultExpandAll
// defaultExpandedKeys=
{
currentSelectId
}
autoExpandParent
expandedKeys=
{
currentSelectId
}
/>
)
}
</
Spin
>
...
...
@@ -244,7 +264,19 @@ const SiteManage = () => {
/>
</
Card
>
</
Col
>
<
Col
lg=
{
18
}
>
<
Col
span=
{
1
}
>
{
mulu
&&
(
<
Tooltip
title=
"隐藏站点"
className=
{
styles
.
hide
}
>
<
DoubleLeftOutlined
onClick=
{
()
=>
handleHide
()
}
/>
</
Tooltip
>
)
}
{
!
mulu
&&
(
<
Tooltip
title=
"显示站点"
className=
{
styles
.
hide
}
>
<
DoubleRightOutlined
onClick=
{
()
=>
handleHide
()
}
/>
</
Tooltip
>
)
}
</
Col
>
<
Col
lg=
{
mulu
?
18
:
23
}
>
<
Card
style=
{
{
marginBottom
:
'10px'
}
}
>
<
Row
align=
"middle"
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
...
...
@@ -306,6 +338,7 @@ const SiteManage = () => {
itemObj=
{
itemObj
}
searchWord=
{
searchWord
}
onCommit=
{
handleCommit
}
btnLoading=
{
btnLoading
}
/>
)
}
</
Card
>
...
...
src/pages/userCenter/roleManage/RoleManage.less
View file @
40e94a25
...
...
@@ -39,4 +39,14 @@
margin-left: 5px;
}
}
}
.hide{
display: block;
position: relative;
font-size: 20px;
color: #1890FF!important;
top: 45%;
left: 50%;
transform: translate(-50%,-50%);
}
\ No newline at end of file
src/pages/userCenter/siteManage/SiteManage.jsx
View file @
40e94a25
...
...
@@ -11,7 +11,13 @@ import {
List
,
Space
,
}
from
'antd'
;
import
{
FileAddTwoTone
,
EditTwoTone
,
DeleteTwoTone
}
from
'@ant-design/icons'
;
import
{
FileAddTwoTone
,
EditTwoTone
,
DeleteTwoTone
,
DoubleLeftOutlined
,
DoubleRightOutlined
,
}
from
'@ant-design/icons'
;
import
{
GridContent
}
from
'@ant-design/pro-layout'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
{
...
...
@@ -38,7 +44,8 @@ const SiteManage = () => {
const
[
editVisible
,
setEditVisible
]
=
useState
(
false
);
// 修改弹窗
const
[
subList
,
setSubList
]
=
useState
([]);
// 选中的数组
const
[
spinLoading
,
setSpinLoading
]
=
useState
(
false
);
const
now
=
new
Date
().
getTime
();
const
[
btnLoading
,
setBtnLoading
]
=
useState
(
false
);
const
[
mulu
,
setMulu
]
=
useState
(
true
);
useEffect
(()
=>
{
setSpinLoading
(
true
);
...
...
@@ -46,7 +53,7 @@ const SiteManage = () => {
userMode
:
'super'
,
select
:
''
,
_version
:
9999
,
_dc
:
now
,
_dc
:
Date
.
now
()
,
node
:
-
2
,
})
.
then
(
res
=>
{
...
...
@@ -157,6 +164,7 @@ const SiteManage = () => {
};
const
handleCommit
=
value
=>
{
let
arr
=
Object
.
values
(
subList
);
setBtnLoading
(
true
);
chooseUserToStation
(
qs
.
stringify
({
userList
:
String
(
arr
.
flat
()),
...
...
@@ -169,6 +177,7 @@ const SiteManage = () => {
},
)
.
then
(
res
=>
{
setBtnLoading
(
false
);
if
(
res
.
success
)
{
notification
.
success
({
message
:
'提示'
,
...
...
@@ -184,10 +193,13 @@ const SiteManage = () => {
}
})
.
catch
(
err
=>
{
setBtnLoading
(
false
);
console
.
log
(
err
);
});
};
const
handleHide
=
()
=>
{
setMulu
(
!
mulu
);
};
const
renderListItem
=
items
=>
items
.
map
(
t
=>
(
<
List
.
Item
...
...
@@ -207,8 +219,8 @@ const SiteManage = () => {
return
(
<
PageContainer
>
<
GridContent
>
<
Row
gutter=
{
12
}
>
<
Col
lg=
{
6
}
>
<
Row
gutter=
{
0
}
>
<
Col
lg=
{
mulu
?
4
:
0
}
>
<
Card
className=
{
styles
.
cardBox
}
>
<
Spin
tip=
"loading...."
...
...
@@ -236,7 +248,20 @@ const SiteManage = () => {
/>
</
Card
>
</
Col
>
<
Col
lg=
{
18
}
>
<
Col
span=
{
1
}
>
{
mulu
&&
(
<
Tooltip
title=
"隐藏站点"
className=
{
styles
.
hide
}
>
<
DoubleLeftOutlined
onClick=
{
()
=>
handleHide
()
}
/>
</
Tooltip
>
)
}
{
!
mulu
&&
(
<
Tooltip
title=
"显示站点"
className=
{
styles
.
hide
}
>
<
DoubleRightOutlined
onClick=
{
()
=>
handleHide
()
}
/>
</
Tooltip
>
)
}
</
Col
>
<
Col
lg=
{
mulu
?
19
:
23
}
>
<
Card
style=
{
{
marginBottom
:
'10px'
}
}
>
<
Row
align=
"middle"
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
...
...
@@ -251,7 +276,7 @@ const SiteManage = () => {
</
Col
>
<
Col
span=
{
3
}
/>
<
Col
span=
{
8
}
>
<
Space
>
<
Space
size=
"large"
>
<
Button
type=
"primary"
onClick=
{
()
=>
{
...
...
@@ -289,6 +314,7 @@ const SiteManage = () => {
searchWord=
{
searchWord
}
valueCallback=
{
valueCallback
}
onCommit=
{
handleCommit
}
btnLoading=
{
btnLoading
}
/>
)
}
</
Card
>
...
...
src/pages/userCenter/siteManage/SiteManage.less
View file @
40e94a25
...
...
@@ -32,7 +32,7 @@
.listItem{
padding-left: 5px;
cursor: pointer;
font-size: 1
6
px;
font-size: 1
4
px;
}
.listItem:hover{
background-color: #f8f8f8 ;
...
...
@@ -40,4 +40,14 @@
.selected{
font-weight: bold;
background-color: #bae7ff!important;
}
.hide{
display: block;
position: relative;
font-size: 20px;
color: #1890FF!important;
top: 45%;
left: 50%;
transform: translate(-50%,-50%);
}
\ No newline at end of file
src/services/database/api.js
View file @
40e94a25
...
...
@@ -113,6 +113,9 @@ export const getSQLServerConnectionTest = params =>
get
(
'/Cityinterface/rest/services/OMS.svc/S_GetSQLServerConnectionTest'
,
params
,
{
timeout
:
30000
,
},
);
/**
* @Oracle数据库
...
...
@@ -128,7 +131,13 @@ export const editOracleConnString = params =>
get
(
'/Cityinterface/rest/services/OMS.svc/S_EditOracleConnString'
,
params
);
// 测试连接
export
const
getOracleConnectionTest
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/S_GetOracleConnectionTest'
,
params
);
get
(
'/Cityinterface/rest/services/OMS.svc/S_GetOracleConnectionTest'
,
params
,
{
timeout
:
30000
,
},
);
/**
* @MongoDB连接
...
...
@@ -144,7 +153,9 @@ export const editMongoDBConnString = params =>
get
(
'/Cityinterface/rest/services/OMS.svc/S_EditMongoDBConnString'
,
params
);
// 测试连接
export
const
getMongoDBConnectionTest
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/S_MongoDBConnectionTest'
,
params
);
get
(
'/Cityinterface/rest/services/OMS.svc/S_MongoDBConnectionTest'
,
params
,
{
timeout
:
30000
,
});
/**
* @MySQL连接
*/
...
...
@@ -157,5 +168,8 @@ export const addMySQLConnString = params =>
// 测试连接
export
const
getMySQLConnectionTest
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/S_GetMySQLConnectionTest'
,
params
);
// 编辑
export
const
editMySQLConnString
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/S_EditMySQLConnString'
,
params
);
get
(
'/Cityinterface/rest/services/OMS.svc/S_EditMySQLConnString'
,
params
,
{
timeout
:
300000
,
});
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