|
1 |
| -(function (vc) { |
| 1 | +(function(vc) { |
2 | 2 | var DEFAULT_ROWS = 10;
|
3 | 3 | vc.extends({
|
4 | 4 | propTypes: {
|
|
10 | 10 | total: 0,
|
11 | 11 | records: 1,
|
12 | 12 | units: [],
|
13 |
| - staffName: '', |
| 13 | + unitNum: '', |
14 | 14 | dpId: '',
|
15 | 15 | orgName: '',
|
16 | 16 | selectUnits: []
|
|
28 | 28 | deep: true // 深度监视
|
29 | 29 | }
|
30 | 30 | },
|
31 |
| - _initMethod: function () { |
32 |
| - }, |
33 |
| - _initEvent: function () { |
34 |
| - |
35 |
| - vc.on('addDataPrivilegeUnit', 'openAddDataPrivilegeUnitModal', function (_param) { |
| 31 | + _initMethod: function() {}, |
| 32 | + _initEvent: function() { |
| 33 | + |
| 34 | + vc.on('addDataPrivilegeUnit', 'openAddDataPrivilegeUnitModal', function(_param) { |
36 | 35 | vc.component._refreshChooseUnitInfo();
|
37 | 36 | $('#addDataPrivilegeUnitModel').modal('show');
|
38 | 37 | vc.copyObject(_param, vc.component.addDataPrivilegeUnitInfo);
|
39 | 38 | vc.component._loadAllUnitsInfo(1, 10, '');
|
40 | 39 | });
|
41 |
| - vc.on('addDataPrivilegeUnit', 'paginationPlus', 'page_event', function (_currentPage) { |
| 40 | + vc.on('addDataPrivilegeUnit', 'paginationPlus', 'page_event', function(_currentPage) { |
42 | 41 | vc.component._loadAllUnitsInfo(_currentPage, DEFAULT_ROWS);
|
43 | 42 | });
|
44 | 43 | },
|
45 | 44 | methods: {
|
46 |
| - _loadAllUnitsInfo: function (_page, _row, _name) { |
| 45 | + _loadAllUnitsInfo: function(_page, _row, _name) { |
47 | 46 | let param = {
|
48 | 47 | params: {
|
49 | 48 | page: _page,
|
50 | 49 | row: _row,
|
51 |
| - unitNum: _name, |
| 50 | + unitNum: $that.addDataPrivilegeUnitInfo.unitNum, |
52 | 51 | dpId: vc.component.addDataPrivilegeUnitInfo.dpId,
|
53 |
| - communityId:vc.getCurrentCommunity().communityId |
| 52 | + communityId: vc.getCurrentCommunity().communityId |
54 | 53 | }
|
55 | 54 | };
|
56 | 55 | //发送get请求
|
57 | 56 | vc.http.apiGet('/dataPrivilegeUnit.listUnitsNotInDataPrivilege',
|
58 | 57 | param,
|
59 |
| - function (json) { |
| 58 | + function(json) { |
60 | 59 | var _staffInfo = JSON.parse(json);
|
61 | 60 | vc.component.addDataPrivilegeUnitInfo.total = _staffInfo.total;
|
62 | 61 | vc.component.addDataPrivilegeUnitInfo.records = _staffInfo.records;
|
|
67 | 66 | currentPage: _page
|
68 | 67 | });
|
69 | 68 | },
|
70 |
| - function () { |
| 69 | + function() { |
71 | 70 | console.log('请求失败处理');
|
72 | 71 | }
|
73 | 72 | );
|
74 | 73 | },
|
75 |
| - addDataPrivilegeUnit: function (_org) { |
| 74 | + addDataPrivilegeUnit: function(_org) { |
76 | 75 | var _selectUnits = vc.component.addDataPrivilegeUnitInfo.selectUnits;
|
77 | 76 | var _tmpUnits = vc.component.addDataPrivilegeUnitInfo.units;
|
78 | 77 | if (_selectUnits.length < 1) {
|
|
101 | 100 | JSON.stringify(_objData), {
|
102 | 101 | emulateJSON: true
|
103 | 102 | },
|
104 |
| - function (json, res) { |
| 103 | + function(json, res) { |
105 | 104 | $('#addDataPrivilegeUnitModel').modal('hide');
|
106 | 105 | let _json = JSON.parse(json)
|
107 | 106 | if (_json.code == 0) {
|
|
112 | 111 | vc.toast(_json.msg);
|
113 | 112 | }
|
114 | 113 | },
|
115 |
| - function () { |
| 114 | + function() { |
116 | 115 | console.log('请求失败处理');
|
117 | 116 | }
|
118 | 117 | );
|
119 | 118 | $('#addDataPrivilegeUnitModel').modal('hide');
|
120 | 119 | },
|
121 |
| - queryUnits: function () { |
122 |
| - vc.component._loadAllStaffInfo(1, 10, vc.component.addDataPrivilegeUnitInfo.staffName); |
| 120 | + queryUnits: function() { |
| 121 | + vc.component._loadAllUnitsInfo(1, 10, vc.component.addDataPrivilegeUnitInfo.unitNum); |
123 | 122 | },
|
124 |
| - _refreshChooseUnitInfo: function () { |
| 123 | + _refreshChooseUnitInfo: function() { |
125 | 124 | vc.component.addDataPrivilegeUnitInfo = {
|
126 | 125 | units: [],
|
127 | 126 | staffName: '',
|
|
130 | 129 | selectUnits: []
|
131 | 130 | };
|
132 | 131 | },
|
133 |
| - checkAll: function (e) { |
| 132 | + checkAll: function(e) { |
134 | 133 | var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项
|
135 | 134 | if (e.target.checked) { // 判定全选checkbox的勾选状态
|
136 | 135 | for (var i = 0; i < checkObj.length; i++) {
|
|
0 commit comments