优化代码

This commit is contained in:
wuxw 2021-01-21 20:47:18 +08:00
parent 347b29d9b4
commit 4b44f3c353
3 changed files with 11 additions and 5 deletions

View File

@ -12,7 +12,8 @@
floorId: '',
floorNum: '',
floorName: ''
}
},
currentPage:DEFAULT_PAGE
}
},
_initMethod: function () {
@ -20,9 +21,10 @@
},
_initEvent: function () {
vc.on('listFloor', 'listFloorData', function () {
vc.component._listFloorData(DEFAULT_PAGE, DEFAULT_ROWS);
vc.component._listFloorData($that.listFloorInfo.currentPage, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function (_currentPage) {
$that.listFloorInfo.currentPage = _currentPage;
vc.component._listFloorData(_currentPage, DEFAULT_ROWS);
});
},

View File

@ -24,6 +24,7 @@
roomNum: '',
roomName: ''
},
currentPage:DEFAULT_PAGE,
listColumns: []
}
},
@ -40,9 +41,10 @@
},
_initEvent: function () {
vc.on('listOwner', 'listOwnerData', function () {
vc.component._listOwnerData(DEFAULT_PAGE, DEFAULT_ROWS);
vc.component._listOwnerData($that.listOwnerInfo.currentPage, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function (_currentPage) {
$that.listOwnerInfo.currentPage = _currentPage;
vc.component._listOwnerData(_currentPage, DEFAULT_ROWS);
});

View File

@ -26,6 +26,7 @@
section: '',
roomType:'1010301'
},
currentPage:DEFAULT_PAGE,
listColumns: []
}
@ -45,12 +46,13 @@
});
vc.on('room', 'listRoom', function (_param) {
vc.component.listRoom(DEFAULT_PAGE, DEFAULT_ROW);
vc.component.listRoom($that.roomInfo.currentPage, DEFAULT_ROW);
});
vc.on('room', 'loadData', function (_param) {
vc.component.listRoom(DEFAULT_PAGE, DEFAULT_ROW);
vc.component.listRoom($that.roomInfo.currentPage, DEFAULT_ROW);
});
vc.on('pagination', 'page_event', function (_currentPage) {
$that.roomInfo.currentPage = _currentPage;
vc.component.listRoom(_currentPage, DEFAULT_ROW);
});
},