Commit 3d6640d2 authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试bug修复

parent 9342b445
......@@ -189,5 +189,10 @@ export default {
let DataSave = null;
yield put({ type: 'returnDataSave', DataSave });
},
*Data7Clear({}, { put }: any) {
let Data7 = null;
yield put({ type: 'returnPage7', Data7 });
},
},
};
......@@ -10,7 +10,7 @@ import Login from '../user/login/components/Login';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import { RA, SA, urlEncode, filterObj, filterObjbyTg, Clear } from '@/utils/method';
let readyData: any = {
communityName: '',
......@@ -92,6 +92,16 @@ const Card = (props: any) => {
module,
dispatch,
);
return () => {
readyData = {
communityName: '',
ownerName: '',
handleStatus: '',
pageNum: 1,
};
Clear(module + '/Data7Clear', dispatch);
};
}, [location]);
// 监听数据返回
......
......@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react';
import { Spin, Row, Col, Button, Form, Radio, message } from 'antd';
import { connect, history } from 'umi';
import { RA, getCookie, DataSaveDetailClear } from '@/utils/method';
import { RA, getCookie, Clear } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
......@@ -37,7 +37,7 @@ const CardDetail = (props: any) => {
}
return () => {
DataSaveDetailClear(module, dispatch);
Clear(module + '/DataSaveDetailClear', dispatch);
};
}, []);
......
......@@ -26,9 +26,9 @@ const goToName = ['Reply', 'Detail'];
const module = 'CommunityService';
interface DataType {
handleStatus: string;
ownerName: string;
communityName: string;
handleStatus?: string | Array<string>;
ownerName?: string;
communityName?: string;
}
// 页码
......@@ -110,14 +110,7 @@ const PropertyServices = (props: any) => {
}, [Data]);
useEffect(() => {
console.log('清空默认数据');
// 清空默认数据里面的内容
readyData = {
handleStatus: '',
ownerName: '',
communityName: '',
};
console.log(readyData);
if (location != null) {
//细分类:页面指令
var serviceType = '';
......@@ -135,8 +128,15 @@ const PropertyServices = (props: any) => {
}
//前置数据
var tmp: any = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
tmp.handleStatus = handle_Status[parseInt(tmp.handleStatus)]; //特殊处理
var tmp: DataType = filterObjbyTg(location.query, [
'handleStatus',
'ownerName',
'communityName',
]);
console.log(tmp);
tmp.ownerName = tmp.ownerName || '';
tmp.communityName = tmp.communityName || '';
tmp.handleStatus = handle_Status[parseInt(tmp.handleStatus as string)] as Array<string>; //特殊处理
console.log(tmp);
// setReadyData(tmp);
readyData = {
......@@ -157,6 +157,15 @@ const PropertyServices = (props: any) => {
dispatch,
);
}
return () => {
readyData = {
...readyData,
handleStatus: '',
ownerName: '',
communityName: '',
};
};
}, [location]);
const PageChange = (values: any) => {
......
......@@ -9,7 +9,7 @@ const decoration_status = [
[2, 'Rejected'],
];
import { RA, getCookie, DataSaveDetailClear } from '@/utils/method';
import { RA, getCookie, Clear } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
......@@ -33,7 +33,7 @@ const RenovationDetail = (props: any) => {
}
return () => {
DataSaveDetailClear(module, dispatch);
Clear(module + '/DataSaveDetailClear', dispatch);
};
}, []);
......
......@@ -7,7 +7,7 @@ import styles from './UsersAdd.less';
import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam, RA, Data4ErrorClear } from '../../../utils/method';
import { checkParam, RA, Clear } from '../../../utils/method';
import { validateMessages } from '@/utils/params';
const module = 'User';
......@@ -24,7 +24,7 @@ const UsersAdd = (props: any) => {
if (Data4Error.msg) {
setLoading(false);
message.error(Data4Error.msg, 3);
Data4ErrorClear(module, dispatch);
Clear(module + '/Data4ErrorClear', dispatch);
}
}
}, [Data4Error]);
......
......@@ -5,7 +5,7 @@ import { connect } from 'umi';
import Line from '../../../components/Line/Line';
import TagSelect from '../../../components/TagSelect/index';
import { RA, ClearResult } from '@/utils/method';
import { RA, Clear } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
const module = 'User';
......@@ -73,7 +73,7 @@ const Services = (props: any) => {
} else {
message.success('Operate Success!!!');
}
ClearResult('User', dispatch);
Clear(module + '/ClearResult', dispatch);
RA(43, {}, module, dispatch);
}
}, [Result]);
......
......@@ -79,17 +79,20 @@ export const DataClear = (module: string, dispatch: any) => {
export const ResultClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/ResultClear' });
};
export const DataSaveDetailClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/DataSaveDetailClear' });
};
export const DataSaveClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/DataSaveClear' });
};
export const Data4ErrorClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/Data4ErrorClear' });
};
export const ClearResult = (module: string, dispatch: any) => {
dispatch({ type: module + '/ClearResult' });
// export const DataSaveDetailClear = (module: string, dispatch: any) => {
// dispatch({ type: module + '/DataSaveDetailClear' });
// };
// export const DataSaveClear = (module: string, dispatch: any) => {
// dispatch({ type: module + '/DataSaveClear' });
// };
// export const Data4ErrorClear = (module: string, dispatch: any) => {
// dispatch({ type: module + '/Data4ErrorClear' });
// };
// export const ClearResult = (module: string, dispatch: any) => {
// dispatch({ type: module + '/ClearResult' });
// };
export const Clear = (module: string, dispatch: any) => {
dispatch({ type: module });
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
......
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