菜单&数据权限新增(展开/折叠 全选/全不选 父子联动)
This commit is contained in:
@@ -42,9 +42,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">菜单权限</label>
|
||||
<label class="col-sm-3 control-label">菜单权限:</label>
|
||||
<div class="col-sm-8">
|
||||
<div id="menuTrees" class="ztree"></div>
|
||||
<label class="check-box">
|
||||
<input type="checkbox" value="1">展开/折叠</label>
|
||||
<label class="check-box">
|
||||
<input type="checkbox" value="2">全选/全不选</label>
|
||||
<label class="check-box">
|
||||
<input type="checkbox" value="3" checked>父子联动</label>
|
||||
<div id="menuTrees" class="ztree ztree-border"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -111,6 +117,30 @@
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
$('input').on('ifChanged', function(obj){
|
||||
var type = $(this).val();
|
||||
var checked = obj.currentTarget.checked;
|
||||
if (type == 1) {
|
||||
if (checked) {
|
||||
$._tree.expandAll(true);
|
||||
} else {
|
||||
$._tree.expandAll(false);
|
||||
}
|
||||
} else if (type == "2") {
|
||||
if (checked) {
|
||||
$._tree.checkAllNodes(true);
|
||||
} else {
|
||||
$._tree.checkAllNodes(false);
|
||||
}
|
||||
} else if (type == "3") {
|
||||
if (checked) {
|
||||
$._tree.setting.check.chkboxType = { "Y": "ps", "N": "ps" };
|
||||
} else {
|
||||
$._tree.setting.check.chkboxType = { "Y": "", "N": "" };
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
add();
|
||||
|
Reference in New Issue
Block a user