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
95eacae1
Commit
95eacae1
authored
Nov 25, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: upload回显报错
parent
e3d514ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
.eslintrc.js
.eslintrc.js
+1
-0
index.tsx
src/components/Upload/index.tsx
+2
-1
utils.js
src/pages/webConfig/utils.js
+7
-5
No files found.
.eslintrc.js
View file @
95eacae1
...
...
@@ -22,6 +22,7 @@ module.exports = {
sourceType
:
'module'
,
ecmaFeatures
:
{
jsx
:
true
,
tsx
:
true
,
},
},
rules
:
{
...
...
src/components/Upload/index.tsx
View file @
95eacae1
...
...
@@ -63,7 +63,8 @@ class PicturesWall extends React.Component<PicturesWallType> {
static
getDerivedStateFromProps
=
(
props
,
state
)
=>
{
const
fileList
=
state
.
fileList
;
if
(
fileList
.
length
===
0
&&
props
.
value
){
const
shouldUpdate
=
props
.
value
&&
fileList
.
every
(
f
=>
Array
.
isArray
(
props
.
value
)
?
!
props
.
value
.
some
(
v
=>
f
.
url
===
v
)
:
f
.
url
!==
props
.
value
)
if
(
fileList
.
length
===
0
&&
props
.
value
&&
shouldUpdate
){
return
{
fileList
:
Array
.
isArray
(
props
.
value
)
?
props
.
value
.
map
((
v
)
=>
({
url
:
v
,
...
...
src/pages/webConfig/utils.js
View file @
95eacae1
...
...
@@ -253,10 +253,12 @@ export const getDefaultGetWebconfig = ({
],
},
};
Object
.
keys
(
config
).
forEach
(
k
=>
{
if
(
initialValues
[
k
])
{
config
[
k
].
initialValue
=
initialValues
[
k
];
}
});
if
(
initialValues
)
{
Object
.
keys
(
config
).
forEach
(
k
=>
{
if
(
initialValues
[
k
])
{
config
[
k
].
initialValue
=
initialValues
[
k
];
}
});
}
return
config
;
};
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