mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update apply.html
This commit is contained in:
parent
4bfb7c16c8
commit
2c65a07730
@ -13,13 +13,14 @@
|
|||||||
|
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
window.RoleAction = new function () {
|
require(['jquery.ztree'], function () {
|
||||||
|
new function () {
|
||||||
|
var that = this;
|
||||||
this.data = {}, this.ztree = null, this.setting = {
|
this.data = {}, this.ztree = null, this.setting = {
|
||||||
view: {showLine: false, showIcon: false, dblClickExpand: false},
|
view: {showLine: false, showIcon: false, dblClickExpand: false},
|
||||||
check: {enable: true, nocheck: false, chkboxType: {"Y": "ps", "N": "ps"}},
|
check: {enable: true, nocheck: false, chkboxType: {"Y": "ps", "N": "ps"}}, callback: {
|
||||||
callback: {
|
|
||||||
beforeClick: function (id, node) {
|
beforeClick: function (id, node) {
|
||||||
node.children.length < 1 ? RoleAction.ztree.checkNode(node, !node.checked, null, true) : RoleAction.ztree.expandNode(node);
|
node.children.length < 1 ? that.ztree.checkNode(node, !node.checked, null, true) : that.ztree.expandNode(node);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,7 +33,7 @@
|
|||||||
});
|
});
|
||||||
return childrens;
|
return childrens;
|
||||||
};
|
};
|
||||||
this.getData = function (that) {
|
this.getData = function () {
|
||||||
$.form.load('{:url("apply")}', {id: '{$vo.id}', action: 'get'}, 'post', function (ret) {
|
$.form.load('{:url("apply")}', {id: '{$vo.id}', action: 'get'}, 'post', function (ret) {
|
||||||
return (that.data = that.renderChildren(ret.data, 1)), that.showTree(), false;
|
return (that.data = that.renderChildren(ret.data, 1)), that.showTree(), false;
|
||||||
});
|
});
|
||||||
@ -53,18 +54,17 @@
|
|||||||
$.form.load('{:url("apply")}', {id: '{$vo.id}', action: 'save', nodes: nodes}, 'post');
|
$.form.load('{:url("apply")}', {id: '{$vo.id}', action: 'save', nodes: nodes}, 'post');
|
||||||
};
|
};
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
this.getData(this);
|
this.getData();
|
||||||
// 提交表单
|
// 提交表单
|
||||||
$('[data-submit-role]').on('click', function () {
|
$('[data-submit-role]').on('click', function () {
|
||||||
RoleAction.submit();
|
that.submit();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="style"}
|
{block name="style"}
|
||||||
<link href="__ROOT__/static/plugs/ztree/zTreeStyle/zTreeStyle.css" rel="stylesheet">
|
|
||||||
<script src="__ROOT__/static/plugs/ztree/ztree.all.min.js"></script>
|
|
||||||
<style>
|
<style>
|
||||||
ul.ztree li {
|
ul.ztree li {
|
||||||
white-space: normal !important;
|
white-space: normal !important;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user