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 {
Remaining: null,
FacilityDelete:null,
},
......@@ -90,6 +91,11 @@ export default {
return { ...state, Remaining };
},
//删除设施结果
FacilityDelete(state, { FacilityDelete }) {
return { ...state, FacilityDelete };
},
},
effects: {
......@@ -118,7 +124,7 @@ export default {
}
else {
// console.log('===========================')
// console.log(playload)
// console.log(playload.index)
switch (playload.index) {
case 1:
{
......@@ -202,6 +208,14 @@ export default {
let Remaining = resp.data;
yield put({ type: 'Remaining', Remaining });
}
break;
// 设施删除
case 61: {
let FacilityDelete = {data:'ok'};
yield put({ type: 'FacilityDelete', FacilityDelete });
}
break;
}
......@@ -243,6 +257,10 @@ export default {
yield put({type: 'Remaining', Remaining})
},
*FacilityDel(state, { put }) {
let FacilityDelete = null;
yield put({type: 'FacilityDelete', FacilityDelete})
},
},
};
......@@ -35,7 +35,7 @@ const FacilityTow = (props: any) => {
dispatch,
location,
DataSaveDetail,
sourceData,
FacilityDelete,
DataSave,
Result,
load,
......@@ -144,6 +144,16 @@ const FacilityTow = (props: any) => {
}
}, [DataSaveDetail]);
// 设施删除结果
useEffect(() => {
if (FacilityDelete) {
message.success('Closed Successfully!');
setIsModalVisible(false);
history.push('/CommunityManagement/FacilityBookings');
dispatch({ type: 'FacilityBookings/FacilityDel' });
}
}, [FacilityDelete]);
// tab 切换
const onTabClicks = (id: String) => {
// 清空设施图片
......@@ -270,7 +280,8 @@ const FacilityTow = (props: any) => {
// 确认删除
const handleOk = () => {
// 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) => {
};
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 load = state.loading.models.FacilityBookings || false;
return {
......@@ -540,6 +558,7 @@ function mapStateToProps(state: any) {
Result,
load,
FacilitysList,
FacilityDelete, // 设施删除结果
};
}
export default connect(mapStateToProps)(FacilityTow);
/*
* @Author: your name
* @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
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts
......@@ -93,4 +93,5 @@ export const requestList = [
['/tos/community/categories/subscribe/reservationInfo', '58 获取小区设施可预约次数', {}],
['/tos/bug/feedback/list', '59 获取用户反馈列表', {}],
['/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