Commit 3b6edc69 authored by cellee's avatar cellee

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi.git into final

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