Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
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
Maple
TOSTUMI
Commits
a9b87c90
Commit
a9b87c90
authored
Jan 22, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决编辑小区的时候重复添加到列表、图片返回值问题
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
b048b758
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
Adds.tsx
src/pages/CommunityManagement/CellList/Adds.tsx
+11
-6
Add.tsx
src/pages/CommunityManagement/CommunityAnnouncement/Add.tsx
+1
-0
ContractContent.tsx
src/pages/ContractManagement/ContractContent.tsx
+3
-2
No files found.
src/pages/CommunityManagement/CellList/Adds.tsx
View file @
a9b87c90
...
@@ -105,13 +105,15 @@ const Adds = (props: any) => {
...
@@ -105,13 +105,15 @@ const Adds = (props: any) => {
// 提交成功与否
// 提交成功与否
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
Result
!=
null
)
{
if
(
Result
!=
null
)
{
// 更新本地小区
// 如果不是编辑的话就更新本地小区
dispatch
({
type
:
'Init/addCommunityget'
,
playload
:
{
Result
:
new
Array
(
Result
.
data
)
}
});
if
(
!
Data
)
{
dispatch
({
type
:
'Init/addCommunityget'
,
playload
:
{
Result
:
new
Array
(
Result
.
data
)
}
});
}
// 提示跳转
// 提示跳转
message
.
success
(
`Information saved successfully!`
);
message
.
success
(
`Information saved successfully!`
);
history
.
push
(
'/CommunityManagement/CellList'
);
history
.
push
(
'/CommunityManagement/CellList'
);
}
}
},
[
Result
]);
},
[
Result
,
Data
]);
// 监听编辑预览是否获取到地址以及发生改变
// 监听编辑预览是否获取到地址以及发生改变
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -178,7 +180,8 @@ const Adds = (props: any) => {
...
@@ -178,7 +180,8 @@ const Adds = (props: any) => {
onChange
({
file
}:
any
)
{
onChange
({
file
}:
any
)
{
file
.
status
===
'uploading'
?
setimgLoad
(
true
)
:
setimgLoad
(
false
);
file
.
status
===
'uploading'
?
setimgLoad
(
true
)
:
setimgLoad
(
false
);
if
(
file
.
status
===
'done'
)
{
if
(
file
.
status
===
'done'
)
{
setLouba
(
BackFormat
(
file
.
name
,
file
.
response
.
data
));
let
data
=
file
.
response
.
data
;
setLouba
(
BackFormat
(
data
.
imageName
,
data
.
url
));
setcodeStrat
(
true
);
setcodeStrat
(
true
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
}
}
...
@@ -192,7 +195,8 @@ const Adds = (props: any) => {
...
@@ -192,7 +195,8 @@ const Adds = (props: any) => {
onChange
({
file
,
fileList
}:
any
)
{
onChange
({
file
,
fileList
}:
any
)
{
file
.
status
===
'uploading'
?
setimgLoad
(
true
)
:
setimgLoad
(
false
);
file
.
status
===
'uploading'
?
setimgLoad
(
true
)
:
setimgLoad
(
false
);
if
(
file
.
status
===
'done'
)
{
if
(
file
.
status
===
'done'
)
{
setGuide
(
BackFormat
(
file
.
name
,
file
.
response
.
data
));
let
data
=
file
.
response
.
data
;
setGuide
(
BackFormat
(
data
.
imageName
,
data
.
url
));
setcodeStrat
(
true
);
setcodeStrat
(
true
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
}
}
...
@@ -206,7 +210,8 @@ const Adds = (props: any) => {
...
@@ -206,7 +210,8 @@ const Adds = (props: any) => {
onChange
({
file
}:
any
)
{
onChange
({
file
}:
any
)
{
file
.
status
===
'uploading'
?
setimgLoad
(
true
)
:
setimgLoad
(
false
);
file
.
status
===
'uploading'
?
setimgLoad
(
true
)
:
setimgLoad
(
false
);
if
(
file
.
status
===
'done'
)
{
if
(
file
.
status
===
'done'
)
{
setPeriod
(
BackFormat
(
file
.
name
,
file
.
response
.
data
));
let
data
=
file
.
response
.
data
;
setPeriod
(
BackFormat
(
data
.
imageName
,
data
.
url
));
setcodeStrat
(
true
);
setcodeStrat
(
true
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
}
}
...
...
src/pages/CommunityManagement/CommunityAnnouncement/Add.tsx
View file @
a9b87c90
...
@@ -64,6 +64,7 @@ const Add = (props: any) => {
...
@@ -64,6 +64,7 @@ const Add = (props: any) => {
// 监听图片状态 ImgSrc
// 监听图片状态 ImgSrc
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
ImgSrc
)
{
if
(
ImgSrc
)
{
console
.
log
(
ImgSrc
);
let
a
=
ImgSrc
.
map
((
item
:
any
)
=>
{
let
a
=
ImgSrc
.
map
((
item
:
any
)
=>
{
let
key
=
Object
.
keys
(
item
)[
0
];
let
key
=
Object
.
keys
(
item
)[
0
];
return
{
return
{
...
...
src/pages/ContractManagement/ContractContent.tsx
View file @
a9b87c90
...
@@ -224,13 +224,14 @@ const ContractContent = (props: any) => {
...
@@ -224,13 +224,14 @@ const ContractContent = (props: any) => {
if
(
file
.
status
===
'done'
)
{
if
(
file
.
status
===
'done'
)
{
message
.
success
(
file
.
name
+
' Upload Successful !'
);
message
.
success
(
file
.
name
+
' Upload Successful !'
);
let
data
=
file
.
response
.
data
;
// 实现在线预览
// 实现在线预览
let
obj
=
{
let
obj
=
{
uid
:
randomString
(
12
),
uid
:
randomString
(
12
),
name
:
file
.
n
ame
,
name
:
data
.
imageN
ame
,
status
:
'done'
,
status
:
'done'
,
type
:
file
.
name
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
type
:
file
.
name
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
file
.
response
.
data
,
url
:
data
.
url
,
};
};
// setFileList([...fileList, obj]);
// setFileList([...fileList, obj]);
...
...
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