wuxw
2019-07-16 e108ff50d948e7b8f85a07a8ec708699df745c82
WebService/src/main/resources/components/staff/staff.js
@@ -5,22 +5,30 @@
            },
            _initMethod:function(){
                vc.component.loadData();
                vc.component.loadData(1,10);
            },
            _initEvent:function(){
                 vc.component.$on('pagination_page_event',function(_currentPage){
                        vc.component.currentPage(_currentPage);
                    });
                 vc.component.$on('addStaff_reload_event',function(){
                     vc.component.loadData();
                     vc.component.loadData(1,10);
                 });
                 vc.component.$on('editStaff_reload_event',function(){
                      vc.component.loadData(1,10);
                  });
                  vc.component.$on('deleteStaff_reload_event',function(){
                     vc.component.loadData(1,10);
                  });
            },
            methods:{
                loadData:function(){
                loadData:function(_page,_rows){
                    var param = {
                        params:{
                            page:1,
                            rows:10
                            page:_page,
                            rows:_rows
                        }
                    };
@@ -32,7 +40,7 @@
                                    var _staffInfo = JSON.parse(json);
                                    vc.component.staffData = _staffInfo.datas;
                                    vc.component.$emit('pagination_info_event',{
                                        total:_staffInfo.total,
                                        total:_staffInfo.records,
                                        currentPage:_staffInfo.page
                                    });
@@ -43,55 +51,15 @@
                },
                currentPage:function(_currentPage){
                    vc.component.loadData(_currentPage,10);
                },
                addStaff:function(){
                    var param = {
                        params:{
                            page:1,
                            rows:10
                        }
                    };
                      //发送get请求
                   vc.http.post('nav',
                                'logout',
                                JSON.stringify(param),
                               {
                                   emulateJSON:true
                                },
                                 function(json,res){
                                   if(res.status == 200){
                                       vc.jumpToPage("/flow/login");
                                       return ;
                                   }
                                 },function(){
                                    console.log('请求失败处理');
                                 }
                               );
                openEditStaff:function(_staffInfo){
                     vc.component.$emit('edit_staff_event',_staffInfo);
                },
                enableStaff:function(){
                    //获取用户名
                    var param = {
                                        msg:'123',
                    };
                    //发送get请求
                   vc.http.get('nav',
                                'getUserInfo',
                                 param,
                                 function(json,res){
                                    if(res.status == 200){
                                        var tmpUserInfo = JSON.parse(json);
                                       vc.component.userName = tmpUserInfo.name;
                                   }
                                 },function(){
                                    console.log('请求失败处理');
                                 }
                               );
                },
                disableStaff:function(){
                openDeleteStaff:function(_staffInfo){
                     vc.component.$emit('delete_staff_event',_staffInfo);
                }
            }