wuxw
2019-04-02 b8f24f50a6bb6715b06100c77d6b18294b037f57
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
(function(vc){
   vc.extends({
            data:{
                staffData:[],
 
            },
            _initMethod:function(){
                vc.component.loadData();
            },
            _initEvent:function(){
                 vc.component.$on('pagination_page_event',function(_currentPage){
                        vc.component.currentPage(_currentPage);
                    });
                 vc.component.$on('addStaff_reload_event',function(){
                     vc.component.loadData();
                 });
            },
            methods:{
                loadData:function(){
                    var param = {
                        msg:'123',
                    };
 
                    //发送get请求
                   vc.http.get('staff',
                                'loadData',
                                 param,
                                 function(json){
                                    var _staffInfo = JSON.parse(json);
                                    vc.component.staffData = _staffInfo.data;
                                    vc.component.$emit('pagination_info_event',{
                                        total:_staffInfo.total,
                                        currentPage:_staffInfo.page
                                    });
 
                                 },function(){
                                    console.log('请求失败处理');
                                 }
                               );
 
                },
                currentPage:function(_currentPage){
 
                },
                addStaff:function(){
                    var param = {
                        msg:123
                    };
                      //发送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('请求失败处理');
                                 }
                               );
                },
                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(){
 
                }
            }
 
 
        });
 
})(window.vc);