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
6596ed93
Commit
6596ed93
authored
Nov 09, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(pages/database): a new feature currentsolution
parent
8e393159
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
155 additions
and
14 deletions
+155
-14
CurrentSolution.jsx
src/pages/database/CurrentSolution.jsx
+101
-0
CurrentSolution.less
src/pages/database/CurrentSolution.less
+16
-0
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+1
-2
index.js
src/pages/mobileConfig/index.js
+4
-1
ListCard.jsx
src/pages/orgnazation/ListCard.jsx
+8
-4
listCardItem.jsx
src/pages/orgnazation/listCardItem.jsx
+0
-1
RoleManage.jsx
src/pages/userCenter/RoleManage/RoleManage.jsx
+5
-5
SiteManage.jsx
src/pages/userCenter/siteManage/SiteManage.jsx
+5
-0
config.js
src/routes/config.js
+8
-1
api.js
src/services/database/api.js
+7
-0
No files found.
src/pages/database/CurrentSolution.jsx
0 → 100644
View file @
6596ed93
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Select
,
Card
,
Row
,
Col
,
Button
,
Spin
,
notification
}
from
'antd'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
getSolutionList
,
changeSolution
}
from
'@/services/database/api'
;
import
styles
from
'./CurrentSolution.less'
;
const
{
Option
}
=
Select
;
const
CurrentSolution
=
()
=>
{
const
[
currentData
,
setCurrentData
]
=
useState
(
''
);
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
setLoading
(
true
);
getSolutionList
({
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
})
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
setCurrentData
(
res
.
currentSolution
);
setDataList
(
res
.
solutions
);
}
})
.
catch
(
err
=>
{
setLoading
(
false
);
console
.
error
(
err
);
});
},
[]);
const
handleSelect
=
e
=>
{
setCurrentData
(
e
);
console
.
log
(
e
);
};
const
submit
=
params
=>
{
setLoading
(
true
);
console
.
log
(
params
);
changeSolution
({
solution
:
currentData
,
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
})
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
notification
.
success
({
message
:
'提示'
,
description
:
'切换成功'
,
duration
:
3
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
description
:
res
.
message
,
duration
:
3
,
});
}
})
.
catch
(
err
=>
{
setLoading
(
false
);
console
.
error
(
err
);
});
};
return
(
<
PageContainer
>
<
Card
className=
{
styles
.
cardbox
}
>
<
Spin
tip=
"Loading..."
spinning=
{
loading
}
className=
{
styles
.
tAlign
}
>
<
Row
>
<
Col
span=
{
2
}
className=
{
styles
.
divbox
}
>
<
div
>
切换解决方案:
</
div
>
</
Col
>
<
Col
span=
{
21
}
>
{
currentData
&&
(
<
Select
style=
{
{
width
:
'100%'
}
}
placeholder=
"请切换解决方案"
defaultValue=
{
currentData
}
onChange=
{
e
=>
{
handleSelect
(
e
);
}
}
>
{
dataList
&&
dataList
.
map
((
item
,
index
)
=>
(
<
Option
value=
{
item
}
key=
{
`item${index}`
}
>
{
item
}
</
Option
>
))
}
</
Select
>
)
}
</
Col
>
</
Row
>
<
div
className=
{
styles
.
btnBox
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
submit
()
}
>
提交
</
Button
>
</
div
>
</
Spin
>
</
Card
>
</
PageContainer
>
);
};
export
default
CurrentSolution
;
src/pages/database/CurrentSolution.less
0 → 100644
View file @
6596ed93
.divbox{
display: flex;
align-items: center;
}
.cardbox{
min-height: 200px;
}
.btnBox{
margin-top: 70px;
display: flex;
justify-content: center;
}
.tAlign{
text-align: center;
}
\ No newline at end of file
src/pages/database/InitDataBase.jsx
View file @
6596ed93
...
...
@@ -430,8 +430,7 @@ const InitDataBase = props => {
console
.
log
(
defaultSqlDir
);
return
(
<
Option
value=
{
item
}
key=
{
index
}
>
{
' '
}
{
item
}{
' '
}
{
item
}
</
Option
>
);
})
}
...
...
src/pages/mobileConfig/index.js
View file @
6596ed93
import
React
from
'react'
;
import
{
Card
}
from
'antd'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
const
MobileConfigPage
=
props
=>
(
<
PageContainer
>
mobileConfigPage
<
/PageContainer
>
<
PageContainer
>
<
Card
>
MobileConfigPage
<
/Card
>
<
/PageContainer
>
);
export
default
MobileConfigPage
;
src/pages/orgnazation/ListCard.jsx
View file @
6596ed93
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useCallback
,
useRef
}
from
'react'
;
import
{
Spin
,
Button
}
from
'antd'
;
import
ListCardItem
from
'./listCardItem'
;
import
{
get
,
post
}
from
'../../services'
;
...
...
@@ -10,10 +10,11 @@ const ListCard = props => {
const
[
valueList
,
setValueList
]
=
useState
([]);
const
[
dataList
,
setdataList
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
{
optionsList
}
=
props
;
const
callbackValue
=
useRef
([])
;
const
getValueCallback
=
useCallback
((
value
,
index
)
=>
{
console
.
log
(
value
,
index
);
setValueList
((
valueList
[
index
]
=
value
));
callbackValue
.
current
=
valueList
;
console
.
log
(
valueList
,
'valueList'
);
},
[]);
useEffect
(()
=>
{
...
...
@@ -47,6 +48,9 @@ const ListCard = props => {
// orgTest().then(res =>{
// console.log(res,'res')
// })
return
()
=>
{
callbackValue
.
current
=
[];
};
},
[
ouid
]);
return
(
<
div
>
...
...
@@ -77,10 +81,10 @@ const ListCard = props => {
/>
))
)
}
{
fals
e
&&
!
loading
&&
dataList
&&
(
{
tru
e
&&
!
loading
&&
dataList
&&
(
<
Button
type=
"primary"
onClick=
{
()
=>
valueCallback
(
valueList
)
}
onClick=
{
()
=>
valueCallback
()
}
style=
{
{
marginTop
:
'20px'
}
}
>
提交
...
...
src/pages/orgnazation/listCardItem.jsx
View file @
6596ed93
...
...
@@ -34,7 +34,6 @@ const ListCardItem = props => {
setDefaultList
(
arr
);
},
[
searchWord
]);
useEffect
(()
=>
{
console
.
log
(
userList
,
'执行了`````'
);
let
arr2
=
[];
userList
.
map
((
item
,
index
)
=>
{
if
(
item
.
isChecked
)
{
...
...
src/pages/userCenter/RoleManage/RoleManage.jsx
View file @
6596ed93
...
...
@@ -2,9 +2,9 @@ import React, { useState, useEffect } from 'react';
import
{
Row
,
Col
,
Tree
,
Card
,
Input
,
Tooltip
,
Button
}
from
'antd'
;
import
{
FileAddTwoTone
,
EditTwoTone
,
DeleteTwoTone
}
from
'@ant-design/icons'
;
import
{
PageContainer
,
GridContent
}
from
'@ant-design/pro-layout'
;
import
{
getWebModuleTree
}
from
'@/services/userCenter/
R
oleManage/api'
;
import
{
getWebModuleTree
}
from
'@/services/userCenter/
r
oleManage/api'
;
import
ListCard
from
'@/pages/orgnazation/ListCard'
;
import
styles
from
'@/pages/userCenter/
R
oleManage/RoleManage.less'
;
import
styles
from
'@/pages/userCenter/
r
oleManage/RoleManage.less'
;
import
AddModal
from
'./AddModal'
;
import
DelModal
from
'./DelModal'
;
import
EditModal
from
'./EditModal'
;
...
...
@@ -61,21 +61,21 @@ const SiteManage = () => {
<
div
className=
{
styles
.
treeTitle
}
>
{
text
}
<
div
className=
{
styles
.
titleBox
}
>
<
Tooltip
title=
"新增
站点
"
>
<
Tooltip
title=
"新增
角色
"
>
<
FileAddTwoTone
onClick=
{
()
=>
{
handleAdd
(
props
);
}
}
/>
</
Tooltip
>
<
Tooltip
title=
"编辑
站点
"
>
<
Tooltip
title=
"编辑
角色
"
>
<
EditTwoTone
onClick=
{
()
=>
{
handleEdit
(
props
);
}
}
/>
</
Tooltip
>
<
Tooltip
title=
"删除
站点
"
>
<
Tooltip
title=
"删除
角色
"
>
<
DeleteTwoTone
onClick=
{
()
=>
{
handleDel
(
props
);
...
...
src/pages/userCenter/siteManage/SiteManage.jsx
View file @
6596ed93
...
...
@@ -118,6 +118,10 @@ const SiteManage = () => {
const
handleSearch
=
value
=>
{
setSearchWord
(
value
);
};
const
handleChange
=
e
=>
{
const
{
value
}
=
e
.
target
;
setSearchWord
(
value
);
};
const
confirmModal
=
e
=>
{
setModalVisible
(
false
);
setFlag
(
flag
+
1
);
...
...
@@ -173,6 +177,7 @@ const SiteManage = () => {
allowClear
placeholder=
{
placeholder
}
onSearch=
{
handleSearch
}
onChange=
{
handleChange
}
enterButton
/>
</
Col
>
...
...
src/routes/config.js
View file @
6596ed93
...
...
@@ -16,8 +16,9 @@ import Welcome from '../pages/Welcome';
import
RequestTest
from
'../pages/testPages/request'
;
import
InitDataBase
from
'../pages/database/InitDataBase'
;
import
ManagementDataBase
from
'../pages/database/ManagementDataBase'
;
import
CurrentSolution
from
'@/pages/database/CurrentSolution'
;
import
UserManage
from
'../pages/userCenter/UserManage'
;
import
RoleManage
from
'../pages/userCenter/
R
oleManage/RoleManage'
;
import
RoleManage
from
'../pages/userCenter/
r
oleManage/RoleManage'
;
import
SiteManage
from
'../pages/userCenter/siteManage/SiteManage'
;
// import DefaultComponent from '../pages/orgnazation/DefaultComponent';
import
TestTable
from
'../pages/orgnazation/TestTable'
;
...
...
@@ -73,6 +74,12 @@ export default {
authority
:
superAuthority
,
component
:
ManagementDataBase
,
},
{
path
:
'/dbm/solution'
,
name
:
'数据库解决方案'
,
authority
:
superAuthority
,
component
:
CurrentSolution
,
},
],
},
{
...
...
src/services/database/api.js
View file @
6596ed93
...
...
@@ -8,3 +8,10 @@ export const setTableSQLDirName = params =>
export
const
deleteConn
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/S_DeleteConn'
,
params
);
// 切换解决方案配置
export
const
getSolutionList
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/W4_GetSolutionList'
,
params
);
// 切换解决方案
export
const
changeSolution
=
params
=>
get
(
'/Cityinterface/rest/services/OMS.svc/W4_ChangeSolution'
,
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