Commit a58884e8 authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试bug修复

parent af67086e
......@@ -77,7 +77,7 @@ export default {
var CurDataDetail = {
community: tmp.communityName,
address: tmp.addressAndpostalCode,
home: tmp.buildingNumber + '#' + tmp.floorNumber + '-' + tmp.roomNumber,
home: tmp.buildingNumber + ' #' + tmp.floorNumber + '-' + tmp.roomNumber,
name: tmp.owerName,
phone: tmp.owerPhone,
email: tmp.owerEmail,
......
......@@ -23,6 +23,8 @@ export default {
memberResult: null,
DataServices: null,
Data4Error: null,
},
reducers: {
......@@ -62,6 +64,9 @@ export default {
returnDataServices(state, { DataServices }) {
return { ...state, DataServices };
},
returnData4Error(state, { Data4Error }) {
return { ...state, Data4Error };
},
},
effects: {
......@@ -93,6 +98,7 @@ export default {
if (resp.code == 500 || resp.error_code != '0000') {
// message.error("Server Error,try again,error code:500",3)
// window.location.href = '/500';
console.log();
}
if (resp.error_code != '0000') {
......@@ -100,6 +106,7 @@ export default {
console.log(playload);
var Data3Error = null;
var Result = null;
let Data4Error = null;
switch (playload.index) {
case 11:
{
......@@ -120,6 +127,12 @@ export default {
yield put({ type: 'returnResult', Result });
}
break;
case 14:
{
Data4Error = { msg: 'The community or unit is already registered!' };
}
yield put({ type: 'returnData4Error', Data4Error });
break;
}
} else {
switch (playload.index) {
......@@ -216,5 +229,10 @@ export default {
let memberResult = null;
yield put({ type: 'returnMemberResult', memberResult });
},
*Data4ErrorClear({}, { put }) {
let Data4Error = null;
yield put({ type: 'returnData4Error', Data4Error });
},
},
};
......@@ -42,6 +42,8 @@ const CardAdd = (props: any) => {
}
values.communityName = communityName;
console.log(values);
values.buildNumber = 'BLK ' + values.buildNumber;
setLoading(true);
RA(35, values, module, dispatch);
};
......
......@@ -70,12 +70,7 @@ const CardDetail = (props: any) => {
<Col span={3}>{DataSave.community_name}</Col>
<Col>Unit:</Col>
<Col>
{'BLK ' +
DataSave.build_number +
'#' +
DataSave.floor_number +
'-' +
DataSave.room_number}
{DataSave.build_number + ' #' + DataSave.floor_number + '-' + DataSave.room_number}
</Col>
</Row>
......
......@@ -71,6 +71,7 @@ const Detail = (props: any) => {
fromRef.current.setFieldsValue(tmp);
}
setLoading(false);
console.log(CurDataDetail);
}
}, [CurDataDetail]);
......
......@@ -72,7 +72,7 @@ const RenovationDetail = (props: any) => {
<Col span={3}>{DataSave.communityName}</Col>
<Col>Unit:</Col>
<Col>
{DataSave.communityBuildDecorate}#{DataSave.communityFloorDecorate}-
{DataSave.communityBuildDecorate} #{DataSave.communityFloorDecorate}-
{DataSave.communityRoomDecoate}
</Col>
</Row>
......
......@@ -7,18 +7,28 @@ 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 } from '../../../utils/method';
import { checkParam, RA, Data4ErrorClear } from '../../../utils/method';
import { validateMessages } from '@/utils/params';
const module = 'User';
const UsersAdd = (props: any) => {
const { dispatch, communityInfo } = props;
const { dispatch, communityInfo, Data4Error } = props;
const [postman, setPostman] = useState({ extend: null });
const formRef = useRef(null as any);
const [loading, setLoading] = useState(false);
useEffect(() => {
if (Data4Error) {
if (Data4Error.msg) {
setLoading(false);
message.error(Data4Error.msg, 3);
Data4ErrorClear(module, dispatch);
}
}
}, [Data4Error]);
const onFinish = (values: any) => {
if (postman.extend != null) {
values.communityName = postman.extend;
......@@ -36,12 +46,14 @@ const UsersAdd = (props: any) => {
message.error('Error,Please finish it,not empty!', 3);
}
};
const extendName = (values: any) => {
var tmp = postman;
tmp.extend = values;
RA(32, { communityName: values }, module, dispatch);
setPostman(tmp);
};
useEffect(() => {
if (communityInfo != null) {
if (postman.extend != null) {
......@@ -156,11 +168,12 @@ const UsersAdd = (props: any) => {
};
function mapStateToProps(state: any) {
const { DataSave, communityInfo } = state.User;
const { DataSave, communityInfo, Data4Error } = state.User;
return {
DataSave,
communityInfo,
Data4Error,
};
}
export default connect(mapStateToProps)(UsersAdd);
......@@ -85,6 +85,9 @@ export const DataSaveDetailClear = (module: any, dispatch: any) => {
export const DataSaveClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/DataSaveClear' });
};
export const Data4ErrorClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/Data4ErrorClear' });
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
export const Fromate = (values: any, reg: any) => {
......
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