From cbc3477cb4e29839f3ca09fb8ba4d054aa30f491 Mon Sep 17 00:00:00 2001 From: Karson Date: Tue, 13 Jan 2026 11:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=92=E8=89=B2=E7=BB=84?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=A7=84=E5=88=99=E6=A0=91=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/css/backend.css | 16 ++++----- public/assets/js/backend/auth/group.js | 6 ++++ public/assets/less/backend.less | 47 ++++++++++++++------------ 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/public/assets/css/backend.css b/public/assets/css/backend.css index a7a9012d..4dc43881 100644 --- a/public/assets/css/backend.css +++ b/public/assets/css/backend.css @@ -926,30 +926,26 @@ form.form-horizontal .control-label { display: block; clear: both; } -#treeview .jstree-leaf:not(:first-child) { +#treeview [data-vertical="true"] .jstree-leaf:not(:first-child) { float: left; background: none; margin-left: 0; min-width: 80px; clear: none; } -#treeview .jstree-leaf { +#treeview [data-vertical="true"] .jstree-leaf { float: left; + background: none; margin-left: 0; padding-left: 24px; min-width: 80px; clear: none; - color: #777; + color: #999; } -#treeview .jstree-leaf > .jstree-icon, -#treeview .jstree-leaf .jstree-themeicon { +#treeview [data-vertical="true"] .jstree-leaf > .jstree-icon, +#treeview [data-vertical="true"] .jstree-leaf .jstree-themeicon { display: none; } -#treeview .jstree-last { - background-image: url("../img/32px.png"); - background-position: -292px -4px; - background-repeat: repeat-y; -} #treeview .jstree-children:before, #treeview .jstree-children:after { content: " "; diff --git a/public/assets/js/backend/auth/group.js b/public/assets/js/backend/auth/group.js index 34cfc237..0696e3f4 100755 --- a/public/assets/js/backend/auth/group.js +++ b/public/assets/js/backend/auth/group.js @@ -119,6 +119,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function ( .on('redraw.jstree', function (e) { $(".layer-footer").attr("domrefresh", Math.random()); }) + .on('before_open.jstree.jstree', function (e, node) { + if (node.node.children.length > 0 && node.node.children.length === node.node.children_d.length) { + node.node.li_attr['data-vertical'] = true; + $("#" + node.node.id).attr("data-vertical", true); + } + }) .jstree({ "themes": {"stripes": true}, "checkbox": { diff --git a/public/assets/less/backend.less b/public/assets/less/backend.less index edde2197..076b4552 100755 --- a/public/assets/less/backend.less +++ b/public/assets/less/backend.less @@ -842,31 +842,34 @@ form.form-horizontal .control-label { clear: both; } - .jstree-leaf:not(:first-child) { - float: left; - background: none; - margin-left: 0; - min-width: 80px; - clear: none; - } + [data-vertical="true"] { - .jstree-leaf { - float: left; - margin-left: 0; - padding-left: 24px; - min-width: 80px; - clear: none; - color: #777; - } + .jstree-leaf:not(:first-child) { + float: left; + background: none; + margin-left: 0; + min-width: 80px; + clear: none; + } - .jstree-leaf > .jstree-icon, .jstree-leaf .jstree-themeicon { - display: none; - } + .jstree-leaf { + float: left; + background: none; + margin-left: 0; + padding-left: 24px; + min-width: 80px; + clear: none; + color: #999; + } + + .jstree-leaf > .jstree-icon, .jstree-leaf .jstree-themeicon { + display: none; + } + + .jstree-last { + + } - .jstree-last { - background-image: url("../img/32px.png"); - background-position: -292px -4px; - background-repeat: repeat-y; } .jstree-children {