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
bb3e1de2
Commit
bb3e1de2
authored
Nov 17, 2020
by
张烨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/test/maintenance
parents
cf20c7b5
2e55f28e
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
225 additions
and
136 deletions
+225
-136
index.jsx
src/components/CheckGroup/index.jsx
+17
-13
itemCard.less
src/components/CheckGroup/itemCard.less
+14
-5
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+11
-6
ManagementDataBase.jsx
src/pages/database/ManagementDataBase.jsx
+3
-1
MongDBTable.jsx
src/pages/database/databaseConfig/mongDB/MongDBTable.jsx
+45
-30
MySQLTable.jsx
src/pages/database/databaseConfig/mysqltable/MySQLTable.jsx
+20
-5
OracleTable.jsx
src/pages/database/databaseConfig/oracle/OracleTable.jsx
+20
-5
SQLServerTable.jsx
...ages/database/databaseConfig/sqlServer/SQLServerTable.jsx
+21
-6
ListCard.jsx
src/pages/orgnazation/ListCard.jsx
+6
-8
ListCardItem.less
src/pages/orgnazation/ListCardItem.less
+30
-5
listCardItem.jsx
src/pages/orgnazation/listCardItem.jsx
+0
-9
RoleManage.jsx
src/pages/userCenter/roleManage/RoleManage.jsx
+33
-40
RoleManage.less
src/pages/userCenter/roleManage/RoleManage.less
+1
-1
SiteManage.less
src/pages/userCenter/siteManage/SiteManage.less
+2
-0
api.js
src/services/database/api.js
+2
-2
No files found.
src/components/CheckGroup/index.jsx
View file @
bb3e1de2
...
...
@@ -2,11 +2,17 @@ import React, { useState, useEffect, useCallback, useRef } from 'react';
import
{
Spin
,
Button
}
from
'antd'
;
import
ListCardItem
from
'./ItemCard'
;
import
{
get
,
post
}
from
'@/services'
;
import
{
orgTest
}
from
'@/services/orgnazation/api
'
;
import
styles
from
'./ItemCard.less
'
;
const
tip
=
'loading...'
;
const
ListCard
=
props
=>
{
const
{
ouid
,
searchWord
,
valueCallback
,
onCommit
=
()
=>
{}
}
=
props
;
const
{
ouid
,
searchWord
,
valueCallback
,
onCommit
=
()
=>
{},
itemObj
,
}
=
props
;
const
[
valueList
,
setValueList
]
=
useState
({});
const
[
dataList
,
setdataList
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
true
);
...
...
@@ -16,7 +22,7 @@ const ListCard = props => {
setValueList
({
...
valueList
});
valueCallback
({
...
valueList
});
},
[]);
console
.
log
(
itemObj
,
'itemObj'
);
useEffect
(()
=>
{
setLoading
(
true
);
const
defaultConfig
=
{
...
...
@@ -30,9 +36,9 @@ const ListCard = props => {
get
(
'/Cityinterface/rest/services/OMS.svc/W4_GetMenuByRoleWithLevel'
,
{
// OUID:ouid||'',
// stationID: ouid || '',
roleID
:
ouid
,
subSystemValue
:
'city'
,
subSystemName
:
'city'
,
roleID
:
itemObj
.
roleID
,
subSystemValue
:
itemObj
.
subSystemValue
,
subSystemName
:
itemObj
.
subSystemValue
,
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
})
...
...
@@ -98,13 +104,11 @@ const ListCard = props => {
</>
)
}
{
true
&&
!
loading
&&
dataList
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
onCommit
(
valueList
)
}
style=
{
{
marginTop
:
'20px'
}
}
>
提交
</
Button
>
<
div
className=
{
styles
.
btnBox
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
onCommit
(
valueList
)
}
>
提交
</
Button
>
</
div
>
)
}
</
div
>
);
...
...
src/components/CheckGroup/itemCard.less
View file @
bb3e1de2
...
...
@@ -12,7 +12,7 @@
}
.topCheckbox{
height: 20px;
margin: -10px 0 0
2
0px;
margin: -10px 0 0 0px;
line-height: 20px;
}
.checkdiv {
...
...
@@ -25,7 +25,7 @@
.divSingle{
border: none;
margin-top: 20px;
flex:0 0
15
0px;
flex:0 0
20
0px;
background: transparent;
}
.isSearch{
...
...
@@ -33,9 +33,17 @@
background-color: yellow;
}
.boldLabel{
font-size: 1
4
px;
font-size: 1
5
px;
font-weight: bold;
background-color: #fff;
}
.btnBox{
position: sticky;
bottom: 0px;
background-color: #fff;
width: 100%;
height: 80px;
padding: 0 20px;
display: flex;
align-items: center;
}
\ No newline at end of file
src/pages/database/InitDataBase.jsx
View file @
bb3e1de2
...
...
@@ -190,7 +190,7 @@ const InitDataBase = props => {
if
(
res
.
GetMe
===
true
)
{
setUpData
(
upData
+
1
);
notification
.
success
({
message
:
'
通知
'
,
message
:
'
提示
'
,
duration
:
3
,
description
:
'保存成功'
,
});
...
...
@@ -535,11 +535,16 @@ const InitDataBase = props => {
}
}
>
{
allSqlDir
&&
allSqlDir
.
map
((
item
,
index
)
=>
(
<
Option
value=
{
item
}
key=
{
index
}
>
{
item
}
</
Option
>
))
}
allSqlDir
.
map
((
item
,
index
)
=>
{
if
(
item
===
'产品方案 (GCK平台)'
)
{
return
null
;
}
return
(
<
Option
value=
{
item
}
key=
{
index
}
>
{
item
}
</
Option
>
);
})
}
</
Select
>
)
}
</
Space
>
...
...
src/pages/database/ManagementDataBase.jsx
View file @
bb3e1de2
...
...
@@ -119,7 +119,9 @@ const ManagementDataBase = () => {
const
handleLog
=
text
=>
{
console
.
log
(
text
);
let
arr
=
[];
arr
.
push
(
text
.
split
(
/
(\r\n)
|
(\n)
/
).
map
(
item
=>
<
p
>
{
item
}
</
p
>));
arr
.
push
(
text
.
split
(
/
(\r\n)
|
(\n)
/
).
map
((
item
,
index
)
=>
<
p
key=
{
index
}
>
{
item
}
</
p
>),
);
setModalVisible
(
true
);
// setContent(text);
setContent
(
arr
);
...
...
src/pages/database/databaseConfig/mongDB/MongDBTable.jsx
View file @
bb3e1de2
...
...
@@ -164,12 +164,25 @@ const MongDBTable = props => {
dataIndex
:
'options'
,
key
:
'options'
,
render
:
(
val
,
item
)
=>
[
<
Tag
color=
"#2db7f5"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
>
<
Button
size=
"small"
type=
"primary"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
>
测试连接
</
Tag
>,
<
Tag
color=
"gold"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
</
Button
>,
<
Button
style=
{
{
margin
:
'0 10px'
,
backgroundColor
:
'#fffbe6'
,
color
:
'#faad14'
,
borderColor
:
'#ffe58f'
,
}
}
size=
"small"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
编辑
</
Tag
>,
</
Button
>,
<
Popconfirm
title=
{
`是否删除连接${item.name}`
}
cancelText=
"取消"
...
...
@@ -177,7 +190,9 @@ const MongDBTable = props => {
// placement="right"
onConfirm=
{
()
=>
handleDel
(
val
,
item
)
}
>
<
Tag
color=
"#f50"
>
删除
</
Tag
>
<
Button
size=
"small"
danger
>
删除
</
Button
>
</
Popconfirm
>,
],
},
...
...
@@ -202,31 +217,31 @@ const MongDBTable = props => {
>
添加MongDB数据库连接
</
Button
>,
<
Popconfirm
title=
{
<
div
>
<
p
>
是否将confcenter、citytemp、buffile、log文件内容迁移至
Mongodb数据库中(会覆盖重名文件)?
</
p
>
<
p
>
(连接配置取标签mongodb)
</
p
>
</
div
>
}
cancelText=
"取消"
okText=
"确认"
onConfirm=
{
handleConfirm
}
placement=
"rightTop"
>
<
Button
style=
{
{
color
:
'#fff'
,
background
:
'#e6a23c'
,
borderColor
:
'#f5dab1'
,
}
}
>
文件迁移
</
Button
>
</
Popconfirm
>,
//
<Popconfirm
//
title=
{
//
<div>
//
<p>
//
是否将confcenter、citytemp、buffile、log文件内容迁移至
//
Mongodb数据库中(会覆盖重名文件)?
//
</p>
//
<p>(连接配置取标签mongodb)</p>
//
</div>
//
}
//
cancelText="取消"
//
okText="确认"
//
onConfirm=
{
handleConfirm
}
//
placement="rightTop"
//
>
//
<Button
//
style=
{{
//
color: '#fff',
//
background: '#e6a23c',
//
borderColor: '#f5dab1',
//
}}
//
>
//
文件迁移
//
</Button>
//
</Popconfirm>,
]
}
/>
<
AddModal
...
...
src/pages/database/databaseConfig/mysqltable/MySQLTable.jsx
View file @
bb3e1de2
...
...
@@ -144,12 +144,25 @@ const MySQLTable = props => {
key
:
'options'
,
width
:
300
,
render
:
(
val
,
item
)
=>
[
<
Tag
color=
"#2db7f5"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
>
<
Button
size=
"small"
type=
"primary"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
>
测试连接
</
Tag
>,
<
Tag
color=
"gold"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
</
Button
>,
<
Button
style=
{
{
margin
:
'0 10px'
,
backgroundColor
:
'#fffbe6'
,
color
:
'#faad14'
,
borderColor
:
'#ffe58f'
,
}
}
size=
"small"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
编辑
</
Tag
>,
</
Button
>,
<
Popconfirm
title=
{
`是否删除连接${item.name}`
}
cancelText=
"取消"
...
...
@@ -157,7 +170,9 @@ const MySQLTable = props => {
// placement="right"
onConfirm=
{
()
=>
handleDel
(
val
,
item
)
}
>
<
Tag
color=
"#f50"
>
删除
</
Tag
>
<
Button
size=
"small"
danger
>
删除
</
Button
>
</
Popconfirm
>,
],
},
...
...
src/pages/database/databaseConfig/oracle/OracleTable.jsx
View file @
bb3e1de2
...
...
@@ -137,12 +137,25 @@ const OracleTable = props => {
key
:
'options'
,
width
:
300
,
render
:
(
val
,
item
)
=>
[
<
Tag
color=
"#2db7f5"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
>
<
Button
size=
"small"
type=
"primary"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
>
测试连接
</
Tag
>,
<
Tag
color=
"gold"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
</
Button
>,
<
Button
style=
{
{
margin
:
'0 10px'
,
backgroundColor
:
'#fffbe6'
,
color
:
'#faad14'
,
borderColor
:
'#ffe58f'
,
}
}
size=
"small"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
编辑
</
Tag
>,
</
Button
>,
<
Popconfirm
title=
{
`是否删除连接${item.name}`
}
cancelText=
"取消"
...
...
@@ -150,7 +163,9 @@ const OracleTable = props => {
// placement="right"
onConfirm=
{
()
=>
handleDel
(
val
,
item
)
}
>
<
Tag
color=
"#f50"
>
删除
</
Tag
>
<
Button
size=
"small"
danger
>
删除
</
Button
>
</
Popconfirm
>,
],
},
...
...
src/pages/database/databaseConfig/sqlServer/SQLServerTable.jsx
View file @
bb3e1de2
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
ProTable
from
'@ant-design/pro-table'
;
import
{
Button
,
Tag
,
Popconfirm
,
notification
}
from
'antd'
;
import
{
Button
,
Popconfirm
,
notification
}
from
'antd'
;
import
{
getSQLServerConnString
,
deleteConnString
,
...
...
@@ -144,12 +144,25 @@ const SQLServerTable = props => {
key
:
'options'
,
width
:
300
,
render
:
(
val
,
item
)
=>
[
<
Tag
color=
"#2db7f5"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
>
<
Button
size=
"small"
type=
"primary"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
>
测试连接
</
Tag
>,
<
Tag
color=
"gold"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
</
Button
>,
<
Button
style=
{
{
margin
:
'0 10px'
,
backgroundColor
:
'#fffbe6'
,
color
:
'#faad14'
,
borderColor
:
'#ffe58f'
,
}
}
size=
"small"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
编辑
</
Tag
>,
</
Button
>,
<
Popconfirm
title=
{
`是否删除连接${item.name}`
}
cancelText=
"取消"
...
...
@@ -157,7 +170,9 @@ const SQLServerTable = props => {
// placement="right"
onConfirm=
{
()
=>
handleDel
(
val
,
item
)
}
>
<
Tag
color=
"#f50"
>
删除
</
Tag
>
<
Button
size=
"small"
danger
>
删除
</
Button
>
</
Popconfirm
>,
],
},
...
...
src/pages/orgnazation/ListCard.jsx
View file @
bb3e1de2
...
...
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useCallback, useRef } from 'react';
import
{
Spin
,
Button
}
from
'antd'
;
import
ListCardItem
from
'./listCardItem'
;
import
{
get
,
post
}
from
'../../services'
;
import
{
orgTest
}
from
'@/services/orgnazation/api
'
;
import
styles
from
'./listCardItem.less
'
;
const
tip
=
'loading...'
;
const
ListCard
=
props
=>
{
...
...
@@ -76,13 +76,11 @@ const ListCard = props => {
))
)
}
{
true
&&
!
loading
&&
dataList
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
onCommit
()
}
style=
{
{
marginTop
:
'20px'
}
}
>
提交
</
Button
>
<
div
className=
{
styles
.
btnBox
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
onCommit
()
}
>
提交
</
Button
>
</
div
>
)
}
</
div
>
);
...
...
src/pages/orgnazation/ListCardItem.less
View file @
bb3e1de2
...
...
@@ -5,22 +5,46 @@
border: 1px solid #b5b8c8;
margin-top: 20px;
min-height: 50px;
padding: 10px 20px;
.topCheckbox{
height: 20px;
background-color: #fff;
margin: -10px 0 0 20px;
margin: -20px 0 0 0;
font-weight: bold;
line-height: 20px;
span{
font-size: 15px;
}
}
.checkdiv {
display: flex;
margin-left: 20px;
justify-content: space-between;
padding: 10px 0;
.ant-checkbox-group{
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: center;
.ant-checkbox-group-item{
flex:0 0 auto;
margin-right: 100px;
margin-bottom: 5px;
}
}
.check {
// margin: 10px 0 ;
// flex: 1;
}
}
}
.isSearch{
color: red;
background-color: yellow;
}
.btnBox{
position: sticky;
bottom: 0px;
background-color: #fff;
width: 100%;
height: 80px;
padding: 0 20px;
display: flex;
align-items: center;
}
\ No newline at end of file
src/pages/orgnazation/listCardItem.jsx
View file @
bb3e1de2
...
...
@@ -97,15 +97,6 @@ const ListCardItem = props => {
options=
{
defaultList
}
/>
)
}
{
/* { <CheckGroup onChange = {(e) => { handleChecked(e)}} >
{defaultList && defaultList.length>0 &&
defaultList.map( (item, index) =>{
return item.label.includes(searchWord) &&
<Checkbox key={index} value={item.value} >{item.label}{item.userID}{String(item.isChecked)}</Checkbox>
})
}
</CheckGroup>} */
}
</
div
>
</
div
>
</>
...
...
src/pages/userCenter/roleManage/RoleManage.jsx
View file @
bb3e1de2
...
...
@@ -10,10 +10,8 @@ import {
Button
,
Space
,
}
from
'antd'
;
import
{
PageContainer
,
GridContent
}
from
'@ant-design/pro-layout
'
;
import
PageContainer
from
'@/components/BasePageContainer
'
;
import
{
chooseUserToStation
,
getUserRelationList
,
setMenuToRole
,
getRoleGroupList
,
}
from
'@/services/userCenter/roleManage/api'
;
...
...
@@ -30,7 +28,7 @@ const placeholder = '请输入功能名称';
const
SiteManage
=
()
=>
{
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
searchWord
,
setSearchWord
]
=
useState
(
''
);
const
[
ouid
,
setOuid
]
=
useState
(
''
);
const
[
roleID
,
setRoleID
]
=
useState
(
''
);
// 角色ID
const
[
saveTreeId
,
setSaveTreeId
]
=
useState
(
''
);
// 保存点击回调的ird
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 新增弹窗
const
[
flag
,
setFlag
]
=
useState
(
1
);
...
...
@@ -46,13 +44,17 @@ const SiteManage = () => {
const
{
node
}
=
treenode
;
setItemObj
(
node
);
console
.
log
(
e
,
node
,
'node'
);
let
id
=
e
[
0
];
if
(
id
)
{
setCurrentSelectId
(
id
);
setSaveTreeId
(
id
);
setOuid
(
id
);
const
{
roleID
:
id
}
=
node
;
// setCurrentSelectId(e);
if
(
e
[
0
])
{
setCurrentSelectId
(
e
);
if
(
id
)
{
setSaveTreeId
(
id
);
setRoleID
(
id
);
}
else
{
setRoleID
(
saveTreeId
);
}
}
else
{
setOuid
(
saveTreeId
);
}
};
useEffect
(()
=>
{
...
...
@@ -67,21 +69,7 @@ const SiteManage = () => {
}
});
},
[
flag
]);
// useEffect(() => {
// setSpinLoading(true);
// getUserRelationList({
// userID: 82,
// _version: 9999,
// _dc: Date.now(),
// }).then(res => {
// setSpinLoading(false);
// let arr = res.roleList;
// let arr2 = transTree2(arr);
// setTreeData(arr2);
// });
// }, []);
const
handleAdd
=
e
=>
{
console
.
log
(
e
);
setModalVisible
(
true
);
};
// 角色删除
...
...
@@ -114,7 +102,8 @@ const SiteManage = () => {
item
.
roleList
.
map
(
itemRole
=>
{
if
(
itemRole
.
roleList
)
{
itemRole
.
title
=
itemRole
.
visibleTitle
||
''
;
itemRole
.
key
=
itemRole
.
visibleTitle
||
''
;
itemRole
.
key
=
itemRole
.
visibleTitle
+
Math
.
floor
(
Math
.
random
()
*
100
+
1
)
||
''
;
itemRole
.
groupflag
=
itemRole
.
visibleTitle
;
itemRole
.
roleList
.
map
(
i
=>
{
i
.
title
=
i
.
roleName
;
...
...
@@ -176,7 +165,7 @@ const SiteManage = () => {
let
arr
=
Object
.
values
(
subList
);
setMenuToRole
(
qs
.
stringify
({
roleID
:
ouid
,
roleID
,
menuNameList
:
String
(
arr
.
flat
()),
}),
{
...
...
@@ -213,19 +202,22 @@ const SiteManage = () => {
<
Spin
tip=
"loading...."
spinning=
{
spinLoading
}
style=
{
{
margin
Top
:
'20px
'
}
}
style=
{
{
margin
:
'20px auto '
,
display
:
'block
'
}
}
>
<
Tree
showLine=
{
{
showLeafIcon
:
false
}
}
showIcon
// onSelect={(e, node) => handleTreeSelect(e, node)}
onSelect=
{
handleTreeSelect
}
treeData=
{
treeData
}
// selectedKeys={[currentSelectId]}
blockNode
defaultExpandAll
/>
{
/* <Tree></Tree> */
}
{
treeData
&&
treeData
.
length
>
0
&&
(
<
Tree
showLine=
{
{
showLeafIcon
:
false
}
}
showIcon
onSelect=
{
handleTreeSelect
}
treeData=
{
treeData
}
// selectedKeys=
{
currentSelectId
}
blockNode
defaultExpandAll
// defaultExpandedKeys=
{
currentSelectId
}
autoExpandParent
expandedKeys=
{
currentSelectId
}
/>
)
}
</
Spin
>
<
AddModal
visible=
{
modalVisible
}
...
...
@@ -309,9 +301,10 @@ const SiteManage = () => {
</
Row
>
</
Card
>
<
Card
className=
{
styles
.
cardBoxR
}
>
{
ouid
&&
(
{
roleID
&&
(
<
ListCard
ouid=
{
ouid
}
ouid=
{
roleID
}
itemObj=
{
itemObj
}
searchWord=
{
searchWord
}
valueCallback=
{
valueCallback
}
onCommit=
{
handleCommit
}
...
...
src/pages/userCenter/roleManage/RoleManage.less
View file @
bb3e1de2
.cardBox{
min-height: calc(100vh -
20
0px);
min-height: calc(100vh -
8
0px);
// max-height: calc(100vh - 200px);
// overflow-y: scroll;
}
...
...
src/pages/userCenter/siteManage/SiteManage.less
View file @
bb3e1de2
...
...
@@ -4,6 +4,8 @@
}
.cardBoxR{
min-height: calc(100vh - 172px);
max-height: calc(100vh - 172px);
overflow-y: scroll;
}
.ant-tree-node-content-wrapper-open{
display: flex;
...
...
src/services/database/api.js
View file @
bb3e1de2
import
{
get
,
post
}
from
'@/services/index'
;
import
{
get
,
post
,
PUBLISH_SERVICE
}
from
'@/services/index'
;
/**
* @数据库初始化
...
...
@@ -15,7 +15,7 @@ import { get, post } from '@/services/index';
* }
*/
export
const
connectionTest
=
params
=>
get
(
'/DBManager/ConnectionTest'
,
params
);
get
(
`
${
PUBLISH_SERVICE
}
/DBManager/ConnectionTest`
,
params
);
// 获取数据库配置信息
export
const
getDataBaseConfig
=
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