| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- (function(vc){
- vc.extends({
- data:{
- addPrivilegeInfo:{
- _currentPgId:'',
- name:'',
- description:'',
- errorInfo:'',
- _noAddPrivilege:[]
- }
- },
- _initMethod:function(){
- },
- _initEvent:function(){
- vc.component.$on('addPrivilege_openPrivilegeModel',function(_params){
- $('#addPrivilegeModel').modal('show');
- vc.component.addPrivilegeInfo._currentPgId = _params.pgId;
- //查询没有添加的权限
- vc.component.listNoAddPrivilege();
- });
- },
- methods:{
- listNoAddPrivilege:function(){
- vc.component.addPrivilegeInfo._noAddPrivilege=[];
- var param = {
- params:{
- pgId:vc.component.addPrivilegeInfo._currentPgId
- }
- }
- vc.http.get(
- 'addPrivilege',
- 'listNoAddPrivilege',
- param,
- function(json,res){
- //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
- if(res.status == 200){
- vc.component.addPrivilegeInfo._noAddPrivilege = JSON.parse(json);
- return ;
- }
- vc.component.addPrivilegeInfo.errorInfo = json;
- },
- function(errInfo,error){
- console.log('请求失败处理');
- vc.component.addPrivilegeInfo.errorInfo = errInfo;
- });
- },
- addPrivilegeToPrivilegeGroup:function(_privilegeInfo){
- vc.component.addPrivilegeInfo.errorInfo = "";
- _privilegeInfo.pgId = vc.component.addPrivilegeInfo._currentPgId;
- vc.http.post(
- 'addPrivilege',
- 'addPrivilegeToPrivilegeGroup',
- JSON.stringify(_privilegeInfo),
- {
- emulateJSON:true
- },
- function(json,res){
- //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
- if(res.status == 200){
- //关闭model
- vc.component.listNoAddPrivilege();
- return ;
- }
- vc.component.addPrivilegeInfo.errorInfo = json;
- },
- function(errInfo,error){
- console.log('请求失败处理');
- vc.component.addPrivilegeInfo.errorInfo = errInfo;
- });
- }
- }
- });
- })(window.vc);
|