mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-26 08:16:47 +08:00
70 lines
2.6 KiB
JavaScript
70 lines
2.6 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
aStaffDetailCommunitysInfo: {
|
|
communitys: [],
|
|
staffId: '',
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('aStaffDetailCommunitys', 'switch', function (_data) {
|
|
$that.aStaffDetailCommunitysInfo.staffId = _data.staffId;
|
|
$that._loadAStaffDetailCommunitysData(DEFAULT_PAGE, DEFAULT_ROWS)
|
|
});
|
|
vc.on('aStaffDetailCommunitys', 'paginationPlus', 'page_event',
|
|
function (_currentPage) {
|
|
vc.component._loadAStaffDetailCommunitysData(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
vc.on('aStaffDetailCommunitys', 'notify', function (_data) {
|
|
$that._loadAStaffDetailCommunitysData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
})
|
|
},
|
|
methods: {
|
|
_loadAStaffDetailCommunitysData: function (_page, _row) {
|
|
let param = {
|
|
params: {
|
|
staffId: $that.aStaffDetailCommunitysInfo.staffId,
|
|
page: _page,
|
|
row: _row
|
|
}
|
|
};
|
|
//发送get请求
|
|
vc.http.apiGet('/role.listAStaffCommunity',
|
|
param,
|
|
function (json) {
|
|
let _json = JSON.parse(json);
|
|
$that.aStaffDetailCommunitysInfo.communitys = _json.data;
|
|
vc.emit('aStaffDetailCommunitys', 'paginationPlus', 'init', {
|
|
total: _json.records,
|
|
dataCount: _json.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function () {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
//查询
|
|
_qureyAStaffDetailCommunitys: function () {
|
|
$that._loadAStaffDetailCommunitysData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_openAddStaffCommunityModal:function(){
|
|
vc.emit('addAStaffCommunity', 'openAddAStaffCommunityModal',{
|
|
staffId:$that.aStaffDetailCommunitysInfo.staffId,
|
|
})
|
|
},
|
|
_openDeleteRoleCommunityModel:function(staffCommunity){
|
|
vc.emit( 'deleteAStaffCommunity','openDeleteAStaffCommunityModal',staffCommunity)
|
|
},
|
|
|
|
}
|
|
});
|
|
})(window.vc); |