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
374c13ad
Commit
374c13ad
authored
Dec 08, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Plain Diff
merge: merge
parents
a3bf4073
7213e1ef
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
140 additions
and
62 deletions
+140
-62
webpack.base.babel.js
internals/webpack/webpack.base.babel.js
+1
-1
webpack.prod.babel.js
internals/webpack/webpack.prod.babel.js
+2
-2
index.jsx
src/components/CheckGroup/index.jsx
+28
-1
index.less
src/components/Upload/index.less
+23
-3
index.tsx
src/components/Upload/index.tsx
+67
-27
index.js
src/pages/user/login/index.js
+7
-4
UserManage.js
src/pages/userCenter/UserManage.js
+9
-10
UserManage.less
src/pages/userCenter/UserManage.less
+1
-0
api.js
src/services/userCenter/userManage/api.js
+2
-14
No files found.
internals/webpack/webpack.base.babel.js
View file @
374c13ad
...
...
@@ -9,7 +9,7 @@ module.exports = options => ({
output
:
Object
.
assign
(
{
path
:
path
.
resolve
(
process
.
cwd
(),
'build'
),
publicPath
:
process
.
env
.
PUBLIC_PATH
||
'/
reactOMS
'
,
publicPath
:
process
.
env
.
PUBLIC_PATH
||
'/
CivManage
'
,
},
options
.
output
,
),
// Merge with env dependent settings
...
...
internals/webpack/webpack.prod.babel.js
View file @
374c13ad
...
...
@@ -18,8 +18,8 @@ module.exports = require('./webpack.base.babel')({
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
output
:
{
filename
:
'static/[name].[chunkhash].js'
,
chunkFilename
:
'static/[name].[chunkhash].chunk.js'
,
filename
:
'static/[name].[chunkhash
:8
].js'
,
chunkFilename
:
'static/[name].[chunkhash
:8
].chunk.js'
,
},
optimization
:
{
...
...
src/components/CheckGroup/index.jsx
View file @
374c13ad
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Spin
,
Button
,
Empty
}
from
'antd'
;
import
{
Spin
,
Checkbox
,
Button
,
Empty
}
from
'antd'
;
import
_
from
'lodash'
;
import
ListCardItem
from
'./ItemCard'
;
import
styles
from
'./ItemCard.less'
;
...
...
@@ -60,6 +60,32 @@ const ListCard = props => {
// console.timeEnd('updateValueList:');
};
const
checkAll
=
e
=>
{
if
(
e
.
target
.
checked
)
{
const
result
=
dataList
.
map
(
item
=>
getAllID
(
item
)).
flat
(
Infinity
);
setValueList
(
result
);
// eslint-disable-next-line no-unused-expressions
onChange
&&
onChange
(
result
);
}
else
{
setValueList
([]);
// eslint-disable-next-line no-unused-expressions
onChange
&&
onChange
([]);
}
};
const
getAllID
=
item
=>
{
let
result
=
[];
const
haveChildren
=
Array
.
isArray
(
item
.
children
)
&&
item
.
children
.
length
>
0
;
// 统一使用 getId
result
.
push
(
getId
(
item
));
if
(
haveChildren
)
{
// 每次递归result被置空,所以要另外保存
result
=
[...
item
.
children
.
map
(
i
=>
getAllID
(
i
)),
...
result
];
}
return
result
;
};
return
(
<
div
>
{
loading
?
(
...
...
@@ -77,6 +103,7 @@ const ListCard = props => {
/>
)
:
(
<>
<
Checkbox
onChange=
{
checkAll
}
>
全选/全不选
</
Checkbox
>
{
dataList
&&
dataList
.
length
>
0
?
(
dataList
.
filter
(
d
=>
d
.
type
===
'widgetGroup'
||
'widget'
)
...
...
src/components/Upload/index.less
View file @
374c13ad
...
...
@@ -17,7 +17,21 @@
background-size: 75px 75px, 75px 75px, 15px 15px, 15px 15px;
}
}
.modal {
.ant-tabs-content{
height: 100%;
.ant-tabs-tabpane{
padding-left: 0 !important;
}
}
.ant-tabs-content-holder{
padding: 5px 0;
}
.ant-modal-body{
padding-top: 0;
padding-bottom: 0;
}
}
.wallBtn {
position: absolute;
left: 140px;
...
...
@@ -42,9 +56,15 @@
.imgBox {
display: flex;
flex-wrap: wrap;
max-height:
520px
;
max-height:
calc(100% - 40px)
;
overflow: auto;
.ant-collapse-content-box{
display: flex;
flex-wrap: wrap;
}
.ant-collapse{
width: 100%;
}
.imgItem {
flex: 0 0 75px;
position: relative;
...
...
src/components/Upload/index.tsx
View file @
374c13ad
import
React
from
'react'
;
import
{
Upload
,
Modal
,
message
,
Tabs
,
Result
,
Input
}
from
'antd'
;
import
{
Upload
,
Modal
,
message
,
Tabs
,
Result
,
Input
,
Collapse
}
from
'antd'
;
import
{
PlusOutlined
,
CheckCircleFilled
}
from
'@ant-design/icons'
;
import
ImgCrop
from
'antd-img-crop'
;
import
classnames
from
'classnames'
;
...
...
@@ -47,6 +47,7 @@ interface PicturesWallType {
value
?:
string
|
string
[],
uploadContext
:
any
,
search
:
string
,
actives
:
any
,
}
class
PicturesWall
extends
React
.
Component
<
PicturesWallType
>
{
...
...
@@ -59,6 +60,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
curSelectedImg
:
''
,
prevProps
:{},
search
:
''
,
actives
:
{},
fileList
:
this
.
props
.
value
?
Array
.
isArray
(
this
.
props
.
value
)
?
this
.
props
.
value
.
map
((
v
)
=>
({
url
:
v
,
uid
:
uuid
(
8
,
16
),
...
...
@@ -100,9 +102,12 @@ class PicturesWall extends React.Component<PicturesWallType> {
}
}
if
(
imgBed
!=
state
.
prevProps
.
uploadContext
?.
imgBed
){
const
activeKeys
=
{};
imgBed
.
forEach
(
item
=>
activeKeys
[
item
.
moduleName
]
=
item
.
child
.
map
(
c
=>
c
.
moduleName
));
return
{
prevProps
:
props
,
imgBed
imgBed
,
actives
:
activeKeys
,
}
}
return
{
...
...
@@ -234,6 +239,57 @@ class PicturesWall extends React.Component<PicturesWallType> {
return
match
&&
match
[
1
]
||
''
}
renderImgItem
(
url
){
const
fileName
=
this
.
getFileName
(
url
)
const
{
curSelectedImg
,
search
}
=
this
.
state
;
return
(
<
div
className=
{
classnames
({
[
styles
.
imgItem
]:
true
,
[
styles
.
hide
]:
!
fileName
.
includes
(
search
)
})
}
key=
{
url
}
onClick=
{
()
=>
this
.
handleImgSelected
(
url
)
}
>
<
div
className=
{
classnames
(
curSelectedImg
===
url
?
styles
.
seleted
:
''
,
)
}
>
<
img
className=
{
classnames
({
[
styles
.
svgGray
]:
/
\
.
svg$
/
.
test
(
url
)
})
}
src=
{
this
.
getImageUrl
(
url
)
}
title=
{
url
}
alt=
"熊猫运维中台系统"
/>
<
span
className=
{
styles
.
iconBtn
}
>
<
CheckCircleFilled
/>
</
span
>
</
div
>
<
span
>
{
fileName
}
</
span
>
</
div
>
);
}
renderCollapse
(
module
){
const
{
Panel
}
=
Collapse
;
const
items
=
module
.
fileUrls
.
map
(
url
=>
this
.
renderImgItem
(
url
))
return
items
.
length
>
0
&&
<
Panel
forceRender
header=
{
module
.
moduleName
}
key=
{
module
.
moduleName
}
>
{
items
}
</
Panel
>
}
handleCollapseChange
(
v
,
moduleName
){
const
activeKeys
=
{...
this
.
state
.
actives
}
activeKeys
[
moduleName
]
=
v
;
this
.
setState
({
actives
:
activeKeys
})
}
render
()
{
const
{
previewVisible
,
...
...
@@ -242,6 +298,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
previewTitle
,
wallModalVisible
,
imgBed
,
actives
,
curSelectedImg
,
}
=
this
.
state
;
const
{
...
...
@@ -328,11 +385,12 @@ class PicturesWall extends React.Component<PicturesWallType> {
width=
{
860
}
onCancel=
{
this
.
handleModalCancel
}
onOk=
{
this
.
handleModalOk
}
className=
{
styles
.
modal
}
>
<
Tabs
defaultActiveKey=
{
imgBed
[
0
]?.
moduleName
}
tabPosition=
"left"
style=
{
{
height
:
520
}
}
>
{
imgBed
.
map
((
item
,
i
)
=>
{
return
(
<
TabPane
tab=
{
tabNames
[
item
.
moduleName
]
}
key=
{
item
.
moduleName
}
>
<
TabPane
tab=
{
tabNames
[
item
.
moduleName
]
||
item
.
moduleName
}
key=
{
item
.
moduleName
}
>
<
Input
placeholder=
"搜索图库"
className=
{
styles
.
search
}
...
...
@@ -341,30 +399,12 @@ class PicturesWall extends React.Component<PicturesWallType> {
onChange=
{
e
=>
this
.
setState
({
search
:
e
.
target
.
value
})
}
allowClear
/>
<
div
className=
{
styles
.
imgBox
}
>
{
item
.
child
?.
map
(
m
=>
m
.
fileUrls
).
flat
(
Infinity
).
map
((
item
:
string
,
i
:
number
)
=>
{
const
fileName
=
this
.
getFileName
(
item
)
return
(
<
div
className=
{
classnames
({
[
styles
.
imgItem
]:
true
,
[
styles
.
hide
]:
!
fileName
.
includes
(
this
.
state
.
search
)
})
}
key=
{
i
}
onClick=
{
()
=>
this
.
handleImgSelected
(
item
)
}
>
<
div
className=
{
classnames
(
curSelectedImg
===
item
?
styles
.
seleted
:
''
,
)
}
>
<
img
className=
{
classnames
({[
styles
.
svgGray
]:
/
\
.
svg$
/
.
test
(
item
)})
}
src=
{
this
.
getImageUrl
(
item
)
}
title=
{
item
}
alt=
"熊猫运维中台系统"
/>
<
span
className=
{
styles
.
iconBtn
}
>
<
CheckCircleFilled
/>
</
span
>
</
div
>
<
span
>
{
fileName
}
</
span
>
</
div
>
);
})
}
<
Collapse
bordered
activeKey=
{
actives
[
item
.
moduleName
]
}
onChange=
{
(
v
)
=>
this
.
handleCollapseChange
(
v
,
item
.
moduleName
)
}
>
{
item
.
child
?.
map
(
child
=>
this
.
renderCollapse
(
child
))
}
</
Collapse
>
</
div
>
</
TabPane
>
);
...
...
src/pages/user/login/index.js
View file @
374c13ad
...
...
@@ -59,10 +59,13 @@ const Login = props => {
}
}
if
(
userMode
===
USER_MODE
.
COMMON
)
{
const
authority
=
[
AUTHORITY
.
LOGIN
,
AUTHORITY
.
COMMON
];
setAuthority
(
authority
);
setAuth
(
authority
);
history
.
push
(
`/userCenter/UserManage`
);
// const authority = [AUTHORITY.LOGIN, AUTHORITY.COMMON];
// setAuthority(authority);
// setAuth(authority);
// history.push(`/userCenter/UserManage`);
notification
.
warning
({
message
:
msg
||
'没有权限!'
,
});
}
}
else
{
notification
.
warning
({
...
...
src/pages/userCenter/UserManage.js
View file @
374c13ad
...
...
@@ -496,7 +496,7 @@ const UserManage = () => {
const
changePassword
=
record
=>
{
setPasswordVisible
(
true
);
passwordForm
.
setFieldsValue
({
old
p
assword
:
record
.
password
,
old
P
assword
:
record
.
password
,
newPassword
:
''
,
passwordConfirm
:
''
,
});
...
...
@@ -867,7 +867,7 @@ const UserManage = () => {
});
// 提交-修改密码
const
submitChangePassword
=
()
=>
{
const
password
=
passwordForm
.
getFieldValue
(
'p
assword'
);
const
oldPassword
=
passwordForm
.
getFieldValue
(
'oldP
assword'
);
const
newPassword
=
passwordForm
.
getFieldValue
(
'newPassword'
);
const
passwordConfirm
=
passwordForm
.
getFieldValue
(
'passwordConfirm'
);
if
(
...
...
@@ -877,14 +877,13 @@ const UserManage = () => {
newPassword
.
length
>=
6
&&
newPassword
===
passwordConfirm
)
{
updateUserPassword
(
currentUser
.
userID
,
password
,
newPassword
,
passwordConfirm
,
)
updateUserPassword
({
UserId
:
+
currentUser
.
userID
,
OldPassWord
:
oldPassword
,
NewPassWord
:
newPassword
,
})
.
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
code
===
0
)
{
setPasswordVisible
(
false
);
notification
.
success
({
message
:
'提交成功'
,
...
...
@@ -1404,7 +1403,7 @@ const UserManage = () => {
cancelText
=
"取消"
>
<
Form
form
=
{
passwordForm
}
labelCol
=
{{
span
:
4
}}
>
<
Form
.
Item
name
=
"old
p
assword"
label
=
"原始密码"
>
<
Form
.
Item
name
=
"old
P
assword"
label
=
"原始密码"
>
<
Input
disabled
/>
<
/Form.Item
>
<
Form
.
Item
...
...
src/pages/userCenter/UserManage.less
View file @
374c13ad
...
...
@@ -185,6 +185,7 @@
.ant-tree-switcher{
line-height: 1;
color:#1890FF;
margin-right: 0px !important;
}
.ant-checkbox-group .ant-checkbox-group-item {
margin-right: 0px !important;
...
...
src/services/userCenter/userManage/api.js
View file @
374c13ad
...
...
@@ -110,20 +110,8 @@ export const addToOrgs = (userIDs, orgIDs, newOrgID) =>
newGroupId
:
newOrgID
,
});
export
const
updateUserPassword
=
(
userID
,
oldpassword
,
newPassword
,
passwordConfirm
,
)
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/U_UpdatePassword`
,
{
_version
:
9999
,
_dc
:
Date
.
now
(),
userID
,
oldpassword
,
newPassword
,
passwordConfirm
,
});
export
const
updateUserPassword
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/UserCenter/UpdateUserPassword`
,
params
);
export
const
editUser
=
(
userID
,
loginName
,
userName
,
phone
,
email
)
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/U_EditUser`
,
{
...
...
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