mrzcc
2020-02-17 e64197421cf28099935f71f193989a3394d47fe0
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
95
96
97
98
99
100
/**
 入驻小区
 **/
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    var ALL_ROWS = 100;
    vc.extends({
        data: {
            orgCommunityManageInfo: {
                orgCommunitys: [],
                total: 0,
                records: 1,
                moreCondition: false,
                orgId:'',
                orgName:''
 
            }
        },
        _initMethod: function () {
 
        },
        _initEvent: function () {
            vc.on('orgCommunityManageInfo', 'openOrgCommunity', function (_param) {
                vc.copyObject(_param, vc.component.orgCommunityManageInfo);
                vc.component._listOrgCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('orgCommunityManageInfo', 'listOrgCommunity', function (_param) {
                //vc.copyObject(_param, vc.component.orgCommunityManageInfo.conditions);
                vc.component._listOrgCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('pagination', 'page_event', function (_currentPage) {
                vc.component._listOrgCommunitys(_currentPage, DEFAULT_ROWS);
            });
 
        },
        methods: {
            _listOrgCommunitys: function (_page, _rows) {
 
                var param = {
                    params: {
                        page:_page,
                        row:_rows,
                        orgId:vc.component.orgCommunityManageInfo.orgId
                    }
                };
 
                //发送get请求
                vc.http.get('orgCommunityManage',
                    'list',
                    param,
                    function (json, res) {
                        var _orgCommunityManageInfo = JSON.parse(json);
                        vc.component.orgCommunityManageInfo.total = _orgCommunityManageInfo.total;
                        vc.component.orgCommunityManageInfo.records = _orgCommunityManageInfo.records;
                        vc.component.orgCommunityManageInfo.orgCommunitys = _orgCommunityManageInfo.orgCommunitys;
                        vc.emit('pagination', 'init', {
                            total: vc.component.orgCommunityManageInfo.records,
                            currentPage: _page
                        });
                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _openAddOrgCommunityModal: function () {
                vc.emit('addOrgCommunity', 'openAddOrgCommunityModal', {
                    orgId: vc.component.orgCommunityManageInfo.orgId,
                    orgName: vc.component.orgCommunityManageInfo.orgName
                });
            },
            _openEditOrgCommunityModel: function (_orgCommunity) {
                vc.emit('editOrgCommunity', 'openEditOrgCommunityModal', _orgCommunity);
            },
            _openDeleteOrgCommunityModel: function (_orgCommunity) {
                vc.emit('deleteOrgCommunity', 'openDeleteOrgCommunityModal', _orgCommunity);
            },
            _openBeyondCommunity:function(_orgCommunity){
            },
            _queryOrgCommunityMethod: function () {
                vc.component._listOrgCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
 
            },
            _moreCondition: function () {
                if (vc.component.orgCommunityManageInfo.moreCondition) {
                    vc.component.orgCommunityManageInfo.moreCondition = false;
                } else {
                    vc.component.orgCommunityManageInfo.moreCondition = true;
                }
            },
            _goBack:function(){
                vc.emit('orgManage','onBack',{});
            }
 
 
 
 
        }
    });
})(window.vc);