| | |
| | | data:{ |
| | | addPrivilegeInfo:{ |
| | | _currentPgId:'', |
| | | _pName:'', |
| | | name:'', |
| | | description:'', |
| | | errorInfo:'', |
| | |
| | | } |
| | | }, |
| | | watch: { // 监视双向绑定的数据数组 |
| | | checkData: { |
| | | addPrivilegeInfo: { |
| | | handler(){ // 数据数组有变化将触发此函数 |
| | | if(vc.component.addPrivilegeInfo.selectPrivileges.length == vc.component.addPrivilegeInfo._noAddPrivilege.length){ |
| | | document.querySelector('#quan').checked = true; |
| | |
| | | vc.component.addPrivilegeInfo._noAddPrivilege=[]; |
| | | var param = { |
| | | params:{ |
| | | pgId:vc.component.addPrivilegeInfo._currentPgId |
| | | pgId:vc.component.addPrivilegeInfo._currentPgId, |
| | | pName:vc.component.addPrivilegeInfo._pName |
| | | } |
| | | } |
| | | vc.http.get( |
| | |
| | | var _pId = { |
| | | pId: _selectPrivileges[selectIndex] |
| | | }; |
| | | _pIds.push(_pId)l |
| | | _pIds.push(_pId); |
| | | } |
| | | var _objData = { |
| | | pgId:vc.component.addPrivilegeInfo._currentPgId, |
| | |
| | | vc.http.post( |
| | | 'addPrivilege', |
| | | 'addPrivilegeToPrivilegeGroup', |
| | | JSON.stringify(_privilegeInfo), |
| | | JSON.stringify(_objData), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | vc.component.listNoAddPrivilege(); |
| | | $('#addPrivilegeModel').modal('hide'); |
| | | vc.component.$emit('privilege_loadPrivilege',vc.component.addPrivilegeInfo._currentPgId); |
| | | return ; |
| | | } |