/** 入驻小区 **/ (function (vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 10; var ALL_ROWS = 100; vc.extends({ data: { roleCommunityInfo: { roleCommunitys: [], total: 0, records: 1, moreCondition: false, pgId: '' } }, _initMethod: function () { }, _initEvent: function () { vc.on('roleCommunityInfo', 'openRoleCommunity', function (_param) { vc.copyObject(_param, $that.roleCommunityInfo); $that._listRoleCommunitys(DEFAULT_PAGE, DEFAULT_ROWS); }); vc.on('roleCommunityInfo', 'listRoleCommunity', function (_param) { //vc.copyObject(_param, $that.roleCommunityInfo.conditions); $that._listRoleCommunitys(DEFAULT_PAGE, DEFAULT_ROWS); }); vc.on('roleCommunityInfo', 'paginationPlus', 'page_event', function (_currentPage) { $that._listRoleCommunitys(_currentPage, DEFAULT_ROWS); }); }, methods: { _listRoleCommunitys: function (_page, _rows) { let param = { params: { page: _page, row: _rows, roleId: $that.roleCommunityInfo.pgId } }; //发送get请求 vc.http.apiGet('/roleCommunity.listRoleCommunity', param, function (json, res) { var _roleCommunityInfo = JSON.parse(json); $that.roleCommunityInfo.total = _roleCommunityInfo.total; $that.roleCommunityInfo.records = _roleCommunityInfo.records; $that.roleCommunityInfo.roleCommunitys = _roleCommunityInfo.data; vc.emit('roleCommunityInfo', 'paginationPlus', 'init', { total: $that.roleCommunityInfo.records, dataCount: $that.roleCommunityInfo.total, currentPage: _page }); }, function (errInfo, error) { console.log('请求失败处理'); } ); }, _openAddRoleCommunityModal: function () { vc.emit('addRoleCommunity', 'openAddRoleCommunityModal', { roleId: $that.roleCommunityInfo.pgId, orgName: $that.roleCommunityInfo.orgName }); }, _openDeleteRoleCommunityModel: function (_roleCommunity) { vc.emit('deleteRoleCommunity', 'openDeleteRoleCommunityModal', _roleCommunity); }, _openBeyondRoleCommunity: function (_roleCommunity) { }, _queryRoleCommunityMethod: function () { $that._listRoleCommunitys(DEFAULT_PAGE, DEFAULT_ROWS); }, _moreCondition: function () { if ($that.roleCommunityInfo.moreCondition) { $that.roleCommunityInfo.moreCondition = false; } else { $that.roleCommunityInfo.moreCondition = true; } }, _goBack: function () { vc.emit('orgManage', 'onBack', {}); } } }); })(window.vc);