safesite/safesite/templates/rights.html

40 lines
1.4 KiB
HTML

<div class="easyui-layout" style="width:100%;height:100%;">
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="rightssubmit()"
id="submitb">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
</div>
<div id="rightstree" data-options="region:'center'" style="height:100%;padding:15px 15px;">
</div>
</div>
<script>
$(function () {
$('#rightstree').tree({
url: "api/rights?a=detail&groupid=" + {{ groupid }},
animate: true,
checkbox: true,
lines: true,
loadFilter: function (rows) {
return convertmenu(rows);
},
onClick: function (node) {
},
onCheck:function(node){
console.log($('#rightstree').tree('getChecked', ['checked','indeterminate']))
},
onBeforeLoad: function (node, param) {
},
onLoadSuccess: function () {
}
});
});
function rightssubmit(){
var nodes = $('#rightstree').tree('getChecked', ['checked','indeterminate']);
$.post("api/rights?a=edit&groupid=" + {{ groupid }},{data:JSON.stringify(nodes)},function(result){
closeForm();
});
}
</script>