58 lines
2.1 KiB
JavaScript
58 lines
2.1 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
machineDetailLiftLogInfo: {
|
|
logs: [],
|
|
machineId:'',
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('machineDetailLiftLog', 'switch', function (_data) {
|
|
$that.machineDetailLiftLogInfo.machineId = _data.machineId;
|
|
$that._loadMachineDetailLiftLogData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('machineDetailLiftLog', 'paginationPlus', 'page_event', function (_currentPage) {
|
|
$that._loadMachineDetailLiftLogData(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
_loadMachineDetailLiftLogData: function (_page, _row) {
|
|
let param = {
|
|
params: {
|
|
communityId: vc.getCurrentCommunity().communityId,
|
|
machineId:$that.machineDetailLiftLogInfo.machineId,
|
|
page:_page,
|
|
row:_row
|
|
}
|
|
};
|
|
|
|
//发送get请求
|
|
vc.http.apiGet('/liftMachineLog.listLiftMachineLog',
|
|
param,
|
|
function (json) {
|
|
let _machineInfo = JSON.parse(json);
|
|
$that.machineDetailLiftLogInfo.logs = _machineInfo.data;
|
|
vc.emit('machineDetailLiftLog', 'paginationPlus', 'init', {
|
|
total: _machineInfo.records,
|
|
dataCount: _machineInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function () {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
_openViewLiftMachineLogModel: function (_log) {
|
|
vc.emit('showLiftMachineLog', 'openShowLiftMachineLogModal', _log);
|
|
}
|
|
}
|
|
});
|
|
})(window.vc); |