Commit 456aff51 authored by cellee's avatar cellee

删除设施

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 57d20fdc
...@@ -35,6 +35,7 @@ export default { ...@@ -35,6 +35,7 @@ export default {
Remaining: null, Remaining: null,
FacilityDelete:null,
}, },
...@@ -90,6 +91,11 @@ export default { ...@@ -90,6 +91,11 @@ export default {
return { ...state, Remaining }; return { ...state, Remaining };
}, },
//删除设施结果
FacilityDelete(state, { FacilityDelete }) {
return { ...state, FacilityDelete };
},
}, },
effects: { effects: {
...@@ -118,7 +124,7 @@ export default { ...@@ -118,7 +124,7 @@ export default {
} }
else { else {
// console.log('===========================') // console.log('===========================')
// console.log(playload) // console.log(playload.index)
switch (playload.index) { switch (playload.index) {
case 1: case 1:
{ {
...@@ -202,6 +208,14 @@ export default { ...@@ -202,6 +208,14 @@ export default {
let Remaining = resp.data; let Remaining = resp.data;
yield put({ type: 'Remaining', Remaining }); yield put({ type: 'Remaining', Remaining });
}
break;
// 设施删除
case 61: {
let FacilityDelete = {data:'ok'};
yield put({ type: 'FacilityDelete', FacilityDelete });
} }
break; break;
} }
...@@ -243,6 +257,10 @@ export default { ...@@ -243,6 +257,10 @@ export default {
yield put({type: 'Remaining', Remaining}) yield put({type: 'Remaining', Remaining})
}, },
*FacilityDel(state, { put }) {
let FacilityDelete = null;
yield put({type: 'FacilityDelete', FacilityDelete})
},
}, },
}; };
...@@ -35,7 +35,7 @@ const FacilityTow = (props: any) => { ...@@ -35,7 +35,7 @@ const FacilityTow = (props: any) => {
dispatch, dispatch,
location, location,
DataSaveDetail, DataSaveDetail,
sourceData, FacilityDelete,
DataSave, DataSave,
Result, Result,
load, load,
...@@ -144,6 +144,16 @@ const FacilityTow = (props: any) => { ...@@ -144,6 +144,16 @@ const FacilityTow = (props: any) => {
} }
}, [DataSaveDetail]); }, [DataSaveDetail]);
// 设施删除结果
useEffect(() => {
if (FacilityDelete) {
message.success('Closed Successfully!');
setIsModalVisible(false);
history.push('/CommunityManagement/FacilityBookings');
dispatch({ type: 'FacilityBookings/FacilityDel' });
}
}, [FacilityDelete]);
// tab 切换 // tab 切换
const onTabClicks = (id: String) => { const onTabClicks = (id: String) => {
// 清空设施图片 // 清空设施图片
...@@ -270,7 +280,8 @@ const FacilityTow = (props: any) => { ...@@ -270,7 +280,8 @@ const FacilityTow = (props: any) => {
// 确认删除 // 确认删除
const handleOk = () => { const handleOk = () => {
// setIsModalVisible(false); // setIsModalVisible(false);
message.info('In function development'); // message.info('In function development');
RA(61, { id: DataSaveDetail.facilities.id });
}; };
// 关闭关闭框 // 关闭关闭框
...@@ -529,7 +540,14 @@ const FacilityTow = (props: any) => { ...@@ -529,7 +540,14 @@ const FacilityTow = (props: any) => {
}; };
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { sourceData, DataSave, DataSaveDetail, Result, FacilitysList } = state.FacilityBookings; const {
sourceData,
DataSave,
DataSaveDetail,
Result,
FacilitysList,
FacilityDelete,
} = state.FacilityBookings;
const { token } = state.login; const { token } = state.login;
const load = state.loading.models.FacilityBookings || false; const load = state.loading.models.FacilityBookings || false;
return { return {
...@@ -540,6 +558,7 @@ function mapStateToProps(state: any) { ...@@ -540,6 +558,7 @@ function mapStateToProps(state: any) {
Result, Result,
load, load,
FacilitysList, FacilitysList,
FacilityDelete, // 设施删除结果
}; };
} }
export default connect(mapStateToProps)(FacilityTow); export default connect(mapStateToProps)(FacilityTow);
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-11-19 20:34:18 * @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-01-15 18:52:31 * @LastEditTime: 2021-01-20 17:30:05
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts * @FilePath: \tostumi\src\utils\params.ts
...@@ -93,4 +93,5 @@ export const requestList = [ ...@@ -93,4 +93,5 @@ export const requestList = [
['/tos/community/categories/subscribe/reservationInfo', '58 获取小区设施可预约次数', {}], ['/tos/community/categories/subscribe/reservationInfo', '58 获取小区设施可预约次数', {}],
['/tos/bug/feedback/list', '59 获取用户反馈列表', {}], ['/tos/bug/feedback/list', '59 获取用户反馈列表', {}],
['/tos/community/facilities/get/detail', '60 获取小区设施详情', {}], ['/tos/community/facilities/get/detail', '60 获取小区设施详情', {}],
['/tos/bookingService/delete', '61 设施删除', {}],
]; ];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment