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
02a9c759
Commit
02a9c759
authored
Nov 20, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: upload callback url to string
parent
7b1a217c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
ItemCard.jsx
src/components/CheckGroup/ItemCard.jsx
+3
-1
index.jsx
src/components/CheckGroup/index.jsx
+12
-5
index.tsx
src/components/Upload/index.tsx
+2
-2
No files found.
src/components/CheckGroup/ItemCard.jsx
View file @
02a9c759
...
...
@@ -26,7 +26,9 @@ const ListCardItem = props => {
useEffect
(()
=>
{
if
(
isGroup
)
{
const
keys
=
item
.
children
.
map
(
child
=>
checkChildrenByCondition
(
child
,
c
=>
getId
(
c
),
'map'
))
.
map
(
child
=>
checkChildrenByCondition
(
child
,
c
=>
getId
(
c
),
true
,
'map'
),
)
.
flat
(
Infinity
);
setChildrenKeys
(
keys
);
}
else
{
...
...
src/components/CheckGroup/index.jsx
View file @
02a9c759
...
...
@@ -10,14 +10,21 @@ export const getId = item =>
item
.
userID
||
item
.
roleID
||
item
.
stationID
||
item
.
id
;
export
const
checkIsGroup
=
node
=>
[
'widgetGroup'
].
includes
(
node
?.
type
||
node
)
&&
node
.
children
?.
length
>
0
;
export
const
checkChildrenByCondition
=
(
item
,
fn
,
tag
=
'every'
)
=>
{
// 递归遍历节点的方法
export
const
checkChildrenByCondition
=
(
item
,
fn
,
withGroup
=
true
,
method
=
'every'
,
)
=>
{
if
(
!
checkIsGroup
(
item
))
{
return
fn
(
item
);
}
return
[
getId
(
item
),
...
item
.
children
[
tag
](
t
=>
checkChildrenByCondition
(
t
,
fn
,
tag
)),
];
const
childrenResults
=
item
.
children
[
method
](
t
=>
checkChildrenByCondition
(
t
,
fn
,
method
),
);
return
withGroup
?
[
fn
(
item
),
...
childrenResults
]
:
[...
childrenResults
];
};
const
ListCard
=
props
=>
{
...
...
src/components/Upload/index.tsx
View file @
02a9c759
...
...
@@ -90,10 +90,10 @@ class PicturesWall extends React.Component<PicturesWallType> {
uid
:
uuid
(
8
,
16
),
name
:
'熊猫运维中台系统'
,
status
:
'done'
,
url
:
this
.
getImageUrl
(
this
.
state
.
curSelectedImg
)
,
url
:
this
.
state
.
curSelectedImg
,
},
];
this
.
props
.
onChange
&&
this
.
props
.
onChange
(
fileList
);
this
.
props
.
onChange
&&
this
.
props
.
onChange
(
this
.
props
.
maxLen
===
1
?
fileList
[
0
].
url
:
fileList
.
map
(
f
=>
f
.
url
)
);
this
.
setState
({
fileList
,
wallModalVisible
:
false
});
};
...
...
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