|
@@ -3,6 +3,7 @@
|
|
|
vc.extends({
|
|
vc.extends({
|
|
|
data:{
|
|
data:{
|
|
|
addPrivilegeInfo:{
|
|
addPrivilegeInfo:{
|
|
|
|
|
+ _currentPgId:'',
|
|
|
name:'',
|
|
name:'',
|
|
|
description:'',
|
|
description:'',
|
|
|
errorInfo:'',
|
|
errorInfo:'',
|
|
@@ -15,6 +16,7 @@
|
|
|
_initEvent:function(){
|
|
_initEvent:function(){
|
|
|
vc.component.$on('addPrivilege_openPrivilegeModel',function(_params){
|
|
vc.component.$on('addPrivilege_openPrivilegeModel',function(_params){
|
|
|
$('#addPrivilegeModel').modal('show');
|
|
$('#addPrivilegeModel').modal('show');
|
|
|
|
|
+ vc.component.addPrivilegeInfo._currentPgId = _params.pgId;
|
|
|
//查询没有添加的权限
|
|
//查询没有添加的权限
|
|
|
vc.component.listNoAddPrivilege();
|
|
vc.component.listNoAddPrivilege();
|
|
|
});
|
|
});
|
|
@@ -23,12 +25,14 @@
|
|
|
listNoAddPrivilege:function(){
|
|
listNoAddPrivilege:function(){
|
|
|
vc.component.addPrivilegeInfo._noAddPrivilege=[];
|
|
vc.component.addPrivilegeInfo._noAddPrivilege=[];
|
|
|
var param = {
|
|
var param = {
|
|
|
- _id:'123'
|
|
|
|
|
|
|
+ params:{
|
|
|
|
|
+ pgId:vc.component.addPrivilegeInfo._currentPgId
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
vc.http.get(
|
|
vc.http.get(
|
|
|
'addPrivilege',
|
|
'addPrivilege',
|
|
|
'listNoAddPrivilege',
|
|
'listNoAddPrivilege',
|
|
|
- JSON.stringify(param),
|
|
|
|
|
|
|
+ param,
|
|
|
function(json,res){
|
|
function(json,res){
|
|
|
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
|
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
@@ -43,16 +47,14 @@
|
|
|
vc.component.addPrivilegeInfo.errorInfo = errInfo;
|
|
vc.component.addPrivilegeInfo.errorInfo = errInfo;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- saveAddPrivilegeGroup:function(){
|
|
|
|
|
- if(!vc.component.addPrivilegeGroupValidate()){
|
|
|
|
|
- vc.component.addPrivilegeGroupInfo.errorInfo = vc.validate.errInfo;
|
|
|
|
|
- return ;
|
|
|
|
|
- }
|
|
|
|
|
- vc.component.addPrivilegeGroupInfo.errorInfo = "";
|
|
|
|
|
|
|
+ addPrivilegeToPrivilegeGroup:function(_privilegeInfo){
|
|
|
|
|
+
|
|
|
|
|
+ vc.component.addPrivilegeInfo.errorInfo = "";
|
|
|
|
|
+ _privilegeInfo.pgId = vc.component.addPrivilegeInfo._currentPgId;
|
|
|
vc.http.post(
|
|
vc.http.post(
|
|
|
- 'addPrivilegeGroup',
|
|
|
|
|
- 'savePrivilegeGroupInfo',
|
|
|
|
|
- JSON.stringify(vc.component.addPrivilegeGroupInfo),
|
|
|
|
|
|
|
+ 'addPrivilege',
|
|
|
|
|
+ 'addPrivilegeToPrivilegeGroup',
|
|
|
|
|
+ JSON.stringify(_privilegeInfo),
|
|
|
{
|
|
{
|
|
|
emulateJSON:true
|
|
emulateJSON:true
|
|
|
},
|
|
},
|
|
@@ -60,25 +62,16 @@
|
|
|
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
|
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
|
//关闭model
|
|
//关闭model
|
|
|
- $('#addPrivilegeGroupModel').modal('hide');
|
|
|
|
|
- vc.component.clearAddPrivilegeGroupInfo();
|
|
|
|
|
- vc.component.$emit('privilegeGroup_loadPrivilegeGroup',{});
|
|
|
|
|
|
|
+ vc.component.listNoAddPrivilege();
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|
|
|
- vc.component.addPrivilegeGroupInfo.errorInfo = json;
|
|
|
|
|
|
|
+ vc.component.addPrivilegeInfo.errorInfo = json;
|
|
|
},
|
|
},
|
|
|
function(errInfo,error){
|
|
function(errInfo,error){
|
|
|
console.log('请求失败处理');
|
|
console.log('请求失败处理');
|
|
|
|
|
|
|
|
- vc.component.addPrivilegeGroupInfo.errorInfo = errInfo;
|
|
|
|
|
|
|
+ vc.component.addPrivilegeInfo.errorInfo = errInfo;
|
|
|
});
|
|
});
|
|
|
- },
|
|
|
|
|
- clearAddPrivilegeGroupInfo:function(){
|
|
|
|
|
- vc.component.addPrivilegeGroupInfo = {
|
|
|
|
|
- name:'',
|
|
|
|
|
- description:'',
|
|
|
|
|
- errorInfo:''
|
|
|
|
|
- };
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|