优化代码

This commit is contained in:
java110 2021-11-14 14:10:59 +08:00
parent c996939a3a
commit ec336dd97c
4 changed files with 60 additions and 3 deletions

View File

@ -42,7 +42,7 @@
</tr>
</thead>
<tbody>
<tr v-for="(itemData,indexData) in item.data" >
<tr v-for="(itemData,indexData) in item.data">
<td class="text-center" v-for="(tmpItemTh,key) in item.th">
{{itemData[tmpItemTh]}}</td>
</tr>
@ -55,8 +55,17 @@
</tr>
</tfoot>
</table>
<div class="row padding-left" v-if="item.footer">
<span class="col-md-2" v-for="(tmpItemTh,key) of item.footer">
<div class="row">{{key}}: {{tmpItemTh}}</div>
</span>
</div>
<!-- 分页 -->
<vc:create path="frame/paginationPlus" namespace="commonReportTable"></vc:create>
<div class="row">
<div class="col-md-12 text-center">
<vc:create path="frame/paginationPlus" namespace="commonReportTable"></vc:create>
</div>
</div>
</div>
</div>
</div>

View File

@ -33,6 +33,7 @@
})
$that._listReportCustomTableDatas(1, 15, item, _condition);
$that._listReportCustomTableFooter(1, 15, item, _condition);
},
_listReportCustomTableComponent: function () {
var param = {
@ -52,6 +53,7 @@
$that.commonReportTableInfo.components.forEach(item => {
$that._listReportCustomTableConditions(item);
$that._listReportCustomTableDatas(1, 15, item);
$that._listReportCustomTableFooter(1, 15, item);
});
}, function (errInfo, error) {
console.log('请求失败处理');
@ -75,7 +77,7 @@
_component.conditions = _componentConditionManageInfo.data;
$that.$forceUpdate();
//处理日期类型
}, function (errInfo, error) {
console.log('请求失败处理');
}
@ -126,6 +128,45 @@
console.log('请求失败处理');
}
);
},
_listReportCustomTableFooter: function (_page, _row, _component, _conditions) {
let _community = vc.getCurrentCommunity();
let _communityId = '';
if (_community) {
_communityId = _community.communityId
}
if (_conditions) {
_conditions.page = _page;
_conditions.row = _row;
_conditions.componentId = _component.componentId;
_conditions.communityId = _communityId
} else {
_conditions = {
page: _page,
row: _row,
componentId: _component.componentId,
communityId: _communityId
}
}
let param = {
params: _conditions
};
//发送get请求
vc.http.apiGet('/reportCustomComponent.listReportCustomComponentDataFooter',
param,
function (json, res) {
let _componentDataManageInfo = JSON.parse(json);
if (_componentDataManageInfo.code != 0) {
return;
}
let _data = _componentDataManageInfo.data;
_component.footer = _data;
$that.$forceUpdate();
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
}
}
});

View File

@ -5,6 +5,10 @@
<div class="ibox-title">
<h5>{{reportCustomComponentFooterManageInfo.componentName}}统计</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-white btn-sm"
v-on:click="_goBack()">
返回
</button>
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_openAddReportCustomComponentFooterModal()">
<i class="glyphicon glyphicon-plus"></i>

View File

@ -74,6 +74,9 @@
_queryReportCustomComponentFooterMethod: function () {
vc.component._listReportCustomComponentFooters(DEFAULT_PAGE, DEFAULT_ROWS);
},
_goBack:function(){
vc.goBack();
},
_moreCondition: function () {
if (vc.component.reportCustomComponentFooterManageInfo.moreCondition) {
vc.component.reportCustomComponentFooterManageInfo.moreCondition = false;