From 0677faf2ae8940aaafae3d394a8ea1100e070947 Mon Sep 17 00:00:00 2001
From: liubp <1535785116@qq.com>
Date: 星期一, 22 十二月 2025 19:22:21 +0800
Subject: [PATCH] 1.新增:费用明细-编辑页面,费用明细-添加页面,费用明细-更多页面
---
public/components/frame/privilegeTree/privilegeTree.js | 43 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/public/components/frame/privilegeTree/privilegeTree.js b/public/components/frame/privilegeTree/privilegeTree.js
index 4846aa9..793a511 100644
--- a/public/components/frame/privilegeTree/privilegeTree.js
+++ b/public/components/frame/privilegeTree/privilegeTree.js
@@ -125,6 +125,49 @@
$that.deletePrivilege(_selectPrivileges);
}
});
+ // 鍦ㄦ爲鍔犺浇瀹屾垚鍚庯紝涓虹涓夌骇鑺傜偣娣诲姞"鏉冮檺"鎸夐挳
+ $('#jstree_privilege').on("ready.jstree", function (e, data) {
+ $that._addPermissionButtons();
+ });
+ // 褰撴爲鑺傜偣灞曞紑鏃讹紝涓哄睍寮�鐨勭涓夌骇鑺傜偣娣诲姞鎸夐挳
+ $('#jstree_privilege').on("open_node.jstree", function (e, data) {
+ setTimeout(function () {
+ $that._addPermissionButtons();
+ }, 100);
+ });
+ // 褰撴爲鍒锋柊鏃讹紝閲嶆柊娣诲姞鎸夐挳
+ $('#jstree_privilege').on("refresh.jstree", function (e, data) {
+ setTimeout(function () {
+ $that._addPermissionButtons();
+ }, 100);
+ });
+ },
+ _addPermissionButtons: function () {
+ // 鑾峰彇鎵�鏈夌涓夌骇鑺傜偣锛坕d浠_寮�澶达級
+ $('#jstree_privilege').find('li[id^="p_"]').each(function () {
+ let $node = $(this);
+ let $anchor = $node.find('> a.jstree-anchor');
+ // 妫�鏌ユ槸鍚﹀凡缁忔坊鍔犺繃鎸夐挳
+ if ($anchor.next('.permission-btn').length === 0) {
+ // 鍒涘缓鏉冮檺鎸夐挳
+ let $btn = $('<button class="permission-btn" style="margin-left: 10px; padding: 2px 8px; font-size: 12px; border: 1px solid #ccc; border-radius: 3px; background: #fff; cursor: pointer; color: #333;">鏉冮檺</button>');
+ // 鑾峰彇鏉冮檺ID
+ let nodeId = $node.attr('id');
+ let pId = nodeId.substring(2); // 鍘绘帀"p_"鍓嶇紑
+ // 缁戝畾鐐瑰嚮浜嬩欢
+ $btn.on('click', function (e) {
+ e.stopPropagation(); // 闃绘浜嬩欢鍐掓场锛岄伩鍏嶈Е鍙戞爲鑺傜偣鐨勯�夋嫨
+ // 鑾峰彇褰撳墠椤甸潰鐨勫弬鏁�
+ let pgId = vc.component.privilegeTreeInfo._currentPgId;
+ let communityId = vc.getCurrentCommunity().communityId;
+ // 璺宠浆鍒皉ole-a椤甸潰锛屼紶閫掓墍鏈夊弬鏁�
+ let params = 'pId=' + pId + '&pgId=' + pgId + '&communityId=' + communityId + '&type=all';
+ vc.jumpToPage('/#/pages/frame/role/role-a?' + params);
+ });
+ // 灏嗘寜閽彃鍏ュ埌鑺傜偣鍚庨潰
+ $anchor.after($btn);
+ }
+ });
},
_doJsTreeData: function (_privileges) {
let _mGroupTree = [];
--
Gitblit v1.8.0