优化代码

This commit is contained in:
java110 2021-10-16 01:53:01 +08:00
parent 96c7646c60
commit 2bdd4e3691
2 changed files with 39 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<th class="text-center">车辆状态</th>
<th class="text-center">车牌号</th>
<th class="text-center">进场时间</th>
<th class="text-center">在场时间(小时)</th>
<th class="text-center">在场时间</th>
</tr>
</thead>

View File

@ -2,10 +2,13 @@
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
parkingAreaControlInCarInfo: {
carIns: []
carIns: [],
paId: ''
}
},
@ -13,10 +16,42 @@
},
_initEvent: function () {
vc.on('parkingAreaControlInCar', 'switch', function (_data) {
$that.parkingAreaControlInCarInfo.paId = _data.paId;
$that._loadParkingAreaControlInCarData(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('parkingAreaControlInCar', 'paginationPlus', 'page_event',
function (_currentPage) {
vc.component._loadParkingAreaControlInCarData(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_loadParkingAreaControlInCarData: function (_page, _row) {
let param = {
params: {
page: _page,
row: _row,
communityId: vc.getCurrentCommunity().communityId,
paId: $that.parkingAreaControlInCarInfo.paId,
}
};
//发送get请求
vc.http.apiGet('/carInout.listCarInParkingAreaCmd',
param,
function (json) {
let _feeConfigInfo = JSON.parse(json);
vc.component.parkingAreaControlInCarInfo.total = _feeConfigInfo.total;
vc.component.parkingAreaControlInCarInfo.records = _feeConfigInfo.records;
vc.component.parkingAreaControlInCarInfo.carIns = _feeConfigInfo.data;
vc.emit('parkingAreaControlInCar', 'paginationPlus', 'init', {
total: _feeConfigInfo.records,
currentPage: _page
});
}, function () {
console.log('请求失败处理');
}
);
}
}
});
})(window.vc);