优化代码

This commit is contained in:
java110 2021-11-13 18:21:17 +08:00
parent 245d5b0842
commit 9c194ae17f

View File

@ -22,7 +22,7 @@
$that._listReportCustomTableComponent(); $that._listReportCustomTableComponent();
}) })
vc.on('commonReportTable', 'paginationPlus', 'page_event', function (_currentPage) { vc.on('commonReportTable', 'paginationPlus', 'page_event', function (_currentPage) {
vc.component._listReportCustomTableDatas(_currentPage, DEFAULT_ROWS,$that.commonReportTableInfo.components[0]); vc.component._listReportCustomTableDatas(_currentPage, DEFAULT_ROWS, $that.commonReportTableInfo.components[0]);
}); });
}, },
methods: { methods: {
@ -59,17 +59,12 @@
); );
}, },
_listReportCustomTableConditions: function (_component) { _listReportCustomTableConditions: function (_component) {
let _community = vc.getCurrentCommunity();
let _communityId = '';
if (_community) {
_communityId = _community.communityId
}
let param = { let param = {
params: { params: {
page: 1, page: 1,
row: 50, row: 50,
componentId: _component.componentId, componentId: _component.componentId
communityId: _communityId
} }
}; };
//发送get请求 //发送get请求
@ -86,15 +81,22 @@
}, },
_listReportCustomTableDatas: function (_page, _row, _component, _conditions) { _listReportCustomTableDatas: function (_page, _row, _component, _conditions) {
let _community = vc.getCurrentCommunity();
let _communityId = '';
if (_community) {
_communityId = _community.communityId
}
if (_conditions) { if (_conditions) {
_conditions.page = _page; _conditions.page = _page;
_conditions.row = _row; _conditions.row = _row;
_conditions.componentId = _component.componentId; _conditions.componentId = _component.componentId;
_conditions.communityId = _communityId
} else { } else {
_conditions = { _conditions = {
page: _page, page: _page,
row: _row, row: _row,
componentId: _component.componentId componentId: _component.componentId,
communityId: _communityId
} }
} }
let param = { let param = {