commobileList.js
1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* @Date: 2019-05-20T16:45:00+08:00
* @Last modified time: 2019-06-26T18:40:44+08:00
*/
import { connect } from 'umi';
import CommobileListComponent from '../../../mobile/common/CommobileList';
import * as commonUtils from '../../../utils/utils';
function commobileList({
dispatch, app, content, location, sModelsId, sModelsType,
}) {
/* 只有state与sModelsId同时为空时 返回空白页,设备是固定模块id */
if (location && location.state === null && commonUtils.isEmptyObject(sModelsId)) {
return (<div />);
}
let param = {};
if (location && location.pathname !== '/indexMobile') {
if (location.state.sParam) {
param = commonUtils.convertStrToObj(location.state.sParam);
} else {
param = commonUtils.convertStrToObj(location.state);
}
}
const commonListProps = {
app,
content,
sModelsId: commonUtils.isNotEmptyObject(sModelsId) && location.pathname === '/indexMobile' ? sModelsId : param.sModelsId,
sModelsType: commonUtils.isNotEmptyObject(sModelsType) ? sModelsType : param.sModelsType,
formRoute: '/commobileList',
dispatch,
};
if (commonUtils.isNotEmptyArr(param.returnFilterCondition)) { /* 未清到单据 单据回刷到列表所带条件 */
commonListProps.returnFilterCondition = param.returnFilterCondition;
commonListProps.returnFilterName = param.copyTo.listFilterName;
}
return (
<CommobileListComponent {...commonListProps} style={{ height: '100%' }} />
);
}
export default connect(({ routing, app, content }) =>
({ routing, app, content }))(commobileList);