From 9e1e058b057fc6ef0a9baf636f230c21f1282797 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 07 七月 2025 15:26:23 +0800
Subject: [PATCH] ss
---
admin/src/components/system/role/MenuConfigWindow.vue | 44 +++++++++++++++++++++++++++-----------------
1 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/admin/src/components/system/role/MenuConfigWindow.vue b/admin/src/components/system/role/MenuConfigWindow.vue
index 21229fe..29811f7 100644
--- a/admin/src/components/system/role/MenuConfigWindow.vue
+++ b/admin/src/components/system/role/MenuConfigWindow.vue
@@ -9,7 +9,7 @@
>
<p class="tip" v-if="role != null">涓鸿鑹� <em>{{role.name}}</em> 閰嶇疆鍙闂殑鑿滃崟</p>
<el-tree
- ref="menuTree"
+ ref="tree"
:data="menus"
show-checkbox
node-key="id"
@@ -43,7 +43,9 @@
},
methods: {
/**
- * @role 瑙掕壊瀵硅薄
+ * 鎵撳紑绐楀彛
+ *
+ * @param role 鐩爣瑙掕壊
*/
open (role) {
fetchMenuList({})
@@ -51,7 +53,7 @@
this.role = role
this.menus = records
// 濡傛灉涓哄浐瀹氳鑹诧紝鍒欏浐瀹氳彍鍗曚笉鍙洿鏀�
- this.__resetDisabled(this.menus, this.role)
+ this.__handleFixedMenus(this.menus, this.role)
// 鎵惧嚭鍙惰妭鐐�
role.menus = role.menus.filter(menu => role.menus.findIndex(m => m.parentId === menu.id) === -1)
// 鍒濆鍖栭�変腑
@@ -62,9 +64,11 @@
this.$tip.apiFailed(e)
})
},
- // 纭閫夋嫨鑿滃崟
+ /**
+ * 纭閫夋嫨鑿滃崟
+ */
confirm () {
- const selectedMenus = this.$refs.menuTree.getCheckedNodes(false, true)
+ const selectedMenus = this.$refs.tree.getCheckedNodes(false, true)
this.isWorking = true
createRoleMenu({
roleId: this.role.id,
@@ -82,8 +86,14 @@
this.isWorking = false
})
},
- // 閲嶇疆disabled
- __resetDisabled (menus, role) {
+ /**
+ * 澶勭悊鍥哄畾鑿滃崟
+ *
+ * @param menus 鑿滃崟鍒楄〃
+ * @param role 瑙掕壊
+ * @private
+ */
+ __handleFixedMenus (menus, role) {
if (menus == null || menus.length === 0) {
return
}
@@ -92,7 +102,7 @@
if (role.fixed && menu.fixed) {
menu.disabled = true
}
- this.__resetDisabled(menu.children, role)
+ this.__handleFixedMenus(menu.children, role)
}
}
}
@@ -100,15 +110,15 @@
</script>
<style scoped lang="scss">
- @import "@/assets/style/variables.scss";
- .global-window {
- .tip {
- margin-bottom: 12px;
- em {
- font-style: normal;
- color: $primary-color;
- font-weight: bold;
- }
+@import "@/assets/style/variables.scss";
+.global-window {
+ .tip {
+ margin-bottom: 12px;
+ em {
+ font-style: normal;
+ color: $primary-color;
+ font-weight: bold;
}
}
+}
</style>
--
Gitblit v1.9.3