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
ac1c7cb5
Commit
ac1c7cb5
authored
Dec 29, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除小区
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
58c7aac0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
init.ts
src/models/init.ts
+8
-1
Details.tsx
src/pages/CommunityManagement/CellList/Details.tsx
+12
-6
No files found.
src/models/init.ts
View file @
ac1c7cb5
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-12-
14 18:28:21
* @LastEditTime: 2020-12-
29 09:52:26
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\init.ts
* @FilePath: \tostumi\src\models\init.ts
...
@@ -40,5 +40,12 @@ export default {
...
@@ -40,5 +40,12 @@ export default {
localStorage
.
setItem
(
'CommunityList'
,
JSON
.
stringify
(
CommunityList
));
localStorage
.
setItem
(
'CommunityList'
,
JSON
.
stringify
(
CommunityList
));
yield
put
({
type
:
'returnCommunityList'
,
CommunityList
});
yield
put
({
type
:
'returnCommunityList'
,
CommunityList
});
},
},
// 删除
*
delCommunityget
({
playload
},
{
call
,
put
,
select
})
{
const
CommunityList
=
playload
?
playload
.
Result
:
[];
localStorage
.
setItem
(
'CommunityList'
,
JSON
.
stringify
(
CommunityList
));
yield
put
({
type
:
'returnCommunityList'
,
CommunityList
});
},
},
},
};
};
src/pages/CommunityManagement/CellList/Details.tsx
View file @
ac1c7cb5
...
@@ -18,7 +18,7 @@ import fileDownload from 'js-file-download';
...
@@ -18,7 +18,7 @@ import fileDownload from 'js-file-download';
const
Detail
=
(
props
:
any
)
=>
{
const
Detail
=
(
props
:
any
)
=>
{
const
module
=
'CellList'
;
const
module
=
'CellList'
;
const
{
detailData
,
DataSave
,
dispatch
,
loading
,
overCom
,
user
}
=
props
;
const
{
detailData
,
DataSave
,
dispatch
,
loading
,
overCom
,
user
,
CommunityList
}
=
props
;
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
DataSave
)
{
if
(
DataSave
)
{
...
@@ -32,11 +32,16 @@ const Detail = (props: any) => {
...
@@ -32,11 +32,16 @@ const Detail = (props: any) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
overCom
!=
null
)
{
if
(
overCom
!=
null
)
{
message
.
success
(
`Community Deleted Successfully`
);
message
.
success
(
`Community Deleted Successfully`
);
history
.
push
(
'/CommunityManagement/CellList'
);
// 然后在清空删除成功数据
// 然后在清空删除成功数据
dispatch
({
dispatch
({
type
:
module
+
'/comRemove'
});
type
:
module
+
'/comRemove'
,
});
// 在删除搜索小区
let
a
=
detailData
.
rows
.
residentialName
;
// 当前删除小区
let
c
=
CommunityList
.
filter
((
item
:
any
)
=>
item
!=
a
);
// 过滤掉
dispatch
({
type
:
'Init/delCommunityget'
,
playload
:
{
Result
:
c
}
});
// 跳转
history
.
push
(
'/CommunityManagement/CellList'
);
}
}
},
[
overCom
]);
},
[
overCom
]);
...
@@ -301,8 +306,9 @@ const Detail = (props: any) => {
...
@@ -301,8 +306,9 @@ const Detail = (props: any) => {
// export default Adds;
// export default Adds;
function
map
(
state
:
any
)
{
function
map
(
state
:
any
)
{
const
{
DataSave
,
detailData
,
imgUrl
,
overCom
}
=
state
.
CellList
;
// 上层传递来的值
const
{
DataSave
,
detailData
,
imgUrl
,
overCom
}
=
state
.
CellList
;
// 上层传递来的值
const
{
CommunityList
}
=
state
.
Init
;
// 小区列表
const
loading
=
state
.
loading
.
models
.
CellList
;
const
loading
=
state
.
loading
.
models
.
CellList
;
const
user
=
state
.
user
;
const
user
=
state
.
user
;
return
{
DataSave
,
detailData
,
loading
,
imgUrl
,
overCom
,
user
};
return
{
DataSave
,
detailData
,
loading
,
imgUrl
,
overCom
,
user
,
CommunityList
};
}
}
export
default
connect
(
map
)(
Detail
);
export
default
connect
(
map
)(
Detail
);
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