{"size": 3276, "ext": "js", "max_stars_repo_path": "WebService/src/main/resources/components/noticePackage/notice-manage/noticeManage.js", "max_stars_repo_name": "luckymaosh/MicroCommunity", "max_stars_repo_stars_event_min_datetime": "2021-03-08T08:23:05.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-06T02:57:16.000Z", "max_issues_repo_path": "WebService/src/main/resources/components/noticePackage/notice-manage/noticeManage.js", "max_issues_repo_name": "luckymaosh/MicroCommunity", "max_issues_repo_issues_event_min_datetime": "2020-02-16T09:21:22.000Z", "max_issues_repo_issues_event_max_datetime": "2020-02-16T09:21:22.000Z", "max_forks_repo_path": "WebService/src/main/resources/components/noticePackage/notice-manage/noticeManage.js", "max_forks_repo_name": "luckymaosh/MicroCommunity", "max_forks_repo_forks_event_min_datetime": "2020-04-15T07:23:47.000Z", "max_forks_repo_forks_event_max_datetime": "2020-04-15T07:23:47.000Z"}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 38.5411764706, "max_line_length": 108, "alphanum_fraction": 0.4880952381}
/**
    入驻小区
**/
(function(vc){
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data:{
            noticeManageInfo:{
                notices:[],
                total:0,
                records:1,
                componentShow:'noticeList',
                conditions:{
                    title:'',
                    noticeTypeCd:'',
                    noticeId:''
                }
            }
        },
        _initMethod:function(){
            vc.component._listNotices(DEFAULT_PAGE, DEFAULT_ROWS);
        },
        _initEvent:function(){
            vc.on('noticeManage','listNotice',function(_param){
                  vc.component.noticeManageInfo.componentShow = 'noticeList';

                  vc.component._listNotices(DEFAULT_PAGE, DEFAULT_ROWS);
            });
             vc.on('pagination','page_event',function(_currentPage){
                vc.component._listNotices(_currentPage,DEFAULT_ROWS);
            });
        },
        methods:{
            _listNotices:function(_page, _rows){
                vc.component.noticeManageInfo.conditions.page = _page;
                vc.component.noticeManageInfo.conditions.row = _rows;
                vc.component.noticeManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
                var param = {
                    params:vc.component.noticeManageInfo.conditions
               };

               //发送get请求
               vc.http.get('noticeManage',
                            'list',
                             param,
                             function(json,res){
                                var _noticeManageInfo=JSON.parse(json);
                                vc.component.noticeManageInfo.total = _noticeManageInfo.total;
                                vc.component.noticeManageInfo.records = _noticeManageInfo.records;
                                vc.component.noticeManageInfo.notices = _noticeManageInfo.notices;
                                vc.emit('pagination','init',{
                                     total:vc.component.noticeManageInfo.records,
                                     currentPage:_page
                                 });
                             },function(errInfo,error){
                                console.log('请求失败处理');
                             }
                           );
            },
            _openAddNoticeModal:function(){
                vc.component.noticeManageInfo.componentShow = 'addNoticeView';
                vc.emit('addNoticeView','openAddNoticeView',{});

            },
            _openEditNoticeModel:function(_notice){

                vc.emit('editNoticeViewInfo','noticeEditNoticeInfo',_notice);
                vc.component.noticeManageInfo.componentShow = 'editNoticeView';
            },
            _openDeleteNoticeModel:function(_notice){
                vc.emit('deleteNotice','openDeleteNoticeModal',_notice);
            },
            _openNoticeDetail:function(_notice){
                vc.jumpToPage("/flow/noticeDetailFlow?noticeId="+_notice.noticeId);

            },
            _queryNoticeMethod:function(){
                vc.component._listNotices(DEFAULT_PAGE, DEFAULT_ROWS);

            }
        }
    });
})(window.vc);
