80 lines
2.2 KiB
HTML
80 lines
2.2 KiB
HTML
|
<html login="false">
|
||
|
<head>
|
||
|
<title>权限分配</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div widget="toolbar" style="padding:10px;border:0;">
|
||
|
<input widget="edit" name="cname" label="人员" allowInput="false"/>
|
||
|
<input widget="hidden" name="cguid" />
|
||
|
<a widget="button" iconCls="icon-save" onclick="save" linkToState="editold,editnew">保存</a>
|
||
|
<a widget="button" iconCls="icon-save" id="savebtn" onclick="quanxuan" linkToState="editold,editnew">全选</a>
|
||
|
<a widget="button" iconCls="icon-save" id="savebtn" onclick="buxuan" linkToState="editold,editnew">不选</a>
|
||
|
<a widget="button" iconCls="icon-exit" onclick="CloseWindow()">退出</a>
|
||
|
</div>
|
||
|
<div widget="autosize">
|
||
|
<div name="tree" widget="tree" expandOnLoad="0" showTreeIcon="true" valueField="id"
|
||
|
textField="text" url="company/auth/getuserTreeData"
|
||
|
transformtotreeformat="true" showCheckBox="true"
|
||
|
referWidgets="selectStrategy;currentOrgnId;orgntype;root" style="width: 100%; height: 100%;"></div>
|
||
|
</div>
|
||
|
</body>
|
||
|
<script type="text/javascript">
|
||
|
|
||
|
var grid = aos.get('tree');
|
||
|
grid.load(); /*checkedField="id" */
|
||
|
function init(param){
|
||
|
|
||
|
var cname=param['cname'];
|
||
|
var cguid=param['cguid'];
|
||
|
aos.get('cname').setValue(cname);
|
||
|
aos.get('cguid').setValue(cguid);
|
||
|
aos.post({
|
||
|
url:"company/auth/getauthbyid",
|
||
|
data:param,
|
||
|
success:function(rtnData){
|
||
|
grid.setValue(rtnData.id);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function quanxuan(){
|
||
|
|
||
|
aos.post({
|
||
|
url:"company/auth/quanxuan",
|
||
|
|
||
|
success:function(rtnData){
|
||
|
|
||
|
grid.setValue(rtnData.id);
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
}
|
||
|
function buxuan(){
|
||
|
grid.setValue();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
function save(){
|
||
|
var param={};
|
||
|
param['id']=grid.getValue();
|
||
|
param['cguid']=aos.get('cguid').value;
|
||
|
if(param['id']!=""){
|
||
|
aos.post({
|
||
|
url:"company/auth/adduser",
|
||
|
data:param,
|
||
|
success:function(rtnData){
|
||
|
aos.tip('修改成功');
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
else{
|
||
|
aos.tip('请分配权限');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
</script>
|
||
|
</html>
|