Skip to content

Commit d369017

Browse files
928255095gitee-org
authored andcommitted
优化数据权限
Signed-off-by: java110 <[email protected]>
1 parent 3199fb6 commit d369017

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

public/components/property/addDataPrivilegeUnit/addDataPrivilegeUnit.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function (vc) {
1+
(function(vc) {
22
var DEFAULT_ROWS = 10;
33
vc.extends({
44
propTypes: {
@@ -10,7 +10,7 @@
1010
total: 0,
1111
records: 1,
1212
units: [],
13-
staffName: '',
13+
unitNum: '',
1414
dpId: '',
1515
orgName: '',
1616
selectUnits: []
@@ -28,35 +28,34 @@
2828
deep: true // 深度监视
2929
}
3030
},
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) {
3635
vc.component._refreshChooseUnitInfo();
3736
$('#addDataPrivilegeUnitModel').modal('show');
3837
vc.copyObject(_param, vc.component.addDataPrivilegeUnitInfo);
3938
vc.component._loadAllUnitsInfo(1, 10, '');
4039
});
41-
vc.on('addDataPrivilegeUnit', 'paginationPlus', 'page_event', function (_currentPage) {
40+
vc.on('addDataPrivilegeUnit', 'paginationPlus', 'page_event', function(_currentPage) {
4241
vc.component._loadAllUnitsInfo(_currentPage, DEFAULT_ROWS);
4342
});
4443
},
4544
methods: {
46-
_loadAllUnitsInfo: function (_page, _row, _name) {
45+
_loadAllUnitsInfo: function(_page, _row, _name) {
4746
let param = {
4847
params: {
4948
page: _page,
5049
row: _row,
51-
unitNum: _name,
50+
unitNum: $that.addDataPrivilegeUnitInfo.unitNum,
5251
dpId: vc.component.addDataPrivilegeUnitInfo.dpId,
53-
communityId:vc.getCurrentCommunity().communityId
52+
communityId: vc.getCurrentCommunity().communityId
5453
}
5554
};
5655
//发送get请求
5756
vc.http.apiGet('/dataPrivilegeUnit.listUnitsNotInDataPrivilege',
5857
param,
59-
function (json) {
58+
function(json) {
6059
var _staffInfo = JSON.parse(json);
6160
vc.component.addDataPrivilegeUnitInfo.total = _staffInfo.total;
6261
vc.component.addDataPrivilegeUnitInfo.records = _staffInfo.records;
@@ -67,12 +66,12 @@
6766
currentPage: _page
6867
});
6968
},
70-
function () {
69+
function() {
7170
console.log('请求失败处理');
7271
}
7372
);
7473
},
75-
addDataPrivilegeUnit: function (_org) {
74+
addDataPrivilegeUnit: function(_org) {
7675
var _selectUnits = vc.component.addDataPrivilegeUnitInfo.selectUnits;
7776
var _tmpUnits = vc.component.addDataPrivilegeUnitInfo.units;
7877
if (_selectUnits.length < 1) {
@@ -101,7 +100,7 @@
101100
JSON.stringify(_objData), {
102101
emulateJSON: true
103102
},
104-
function (json, res) {
103+
function(json, res) {
105104
$('#addDataPrivilegeUnitModel').modal('hide');
106105
let _json = JSON.parse(json)
107106
if (_json.code == 0) {
@@ -112,16 +111,16 @@
112111
vc.toast(_json.msg);
113112
}
114113
},
115-
function () {
114+
function() {
116115
console.log('请求失败处理');
117116
}
118117
);
119118
$('#addDataPrivilegeUnitModel').modal('hide');
120119
},
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);
123122
},
124-
_refreshChooseUnitInfo: function () {
123+
_refreshChooseUnitInfo: function() {
125124
vc.component.addDataPrivilegeUnitInfo = {
126125
units: [],
127126
staffName: '',
@@ -130,7 +129,7 @@
130129
selectUnits: []
131130
};
132131
},
133-
checkAll: function (e) {
132+
checkAll: function(e) {
134133
var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项
135134
if (e.target.checked) { // 判定全选checkbox的勾选状态
136135
for (var i = 0; i < checkObj.length; i++) {

0 commit comments

Comments
 (0)