diff --git a/ljwx-admin/src/views/manage/role/index.vue b/ljwx-admin/src/views/manage/role/index.vue
index 0854619..27057d3 100644
--- a/ljwx-admin/src/views/manage/role/index.vue
+++ b/ljwx-admin/src/views/manage/role/index.vue
@@ -10,6 +10,7 @@ import { transDeleteParams } from '@/utils/common';
import { useAuth } from '@/hooks/business/auth';
import { useDict } from '@/hooks/business/dict';
import { useAuthStore } from '@/store/modules/auth';
+import SvgIcon from '@/components/custom/svg-icon.vue';
import RoleOperateDrawer from './modules/role-operate-drawer.vue';
import RoleSearch from './modules/role-search.vue';
import MenuAuthModal from './modules/menu-auth-modal.vue';
@@ -115,14 +116,28 @@ const { columns, columnChecks, data, loading, getData, getDataByPage, mobilePagi
align: 'center',
width: 300,
render: row => (
-
+
{hasAuth('sys:role:menu:add') && (
- handleMenuAuth(row.id)}>
+
)}
{hasAuth('sys:role:permission:add') && (
- handleButtonAuth(row.id)}>
+ handleButtonAuth(row.id)}
+ renderIcon={() => }
+ >
{$t('page.manage.role.buttonAuth')}
)}
@@ -226,4 +241,40 @@ function handleButtonAuth(id: string) {
-
+
diff --git a/ljwx-admin/src/views/manage/role/modules/button-auth-modal.vue b/ljwx-admin/src/views/manage/role/modules/button-auth-modal.vue
index a997ba5..b8ab470 100644
--- a/ljwx-admin/src/views/manage/role/modules/button-auth-modal.vue
+++ b/ljwx-admin/src/views/manage/role/modules/button-auth-modal.vue
@@ -65,6 +65,14 @@ async function handleSubmit() {
}
}
+function selectAll() {
+ checks.value = permissionData.value.flatMap(item => item.buttons.map(button => button.id));
+}
+
+function clearAll() {
+ checks.value = [];
+}
+
watch(visible, () => {
if (visible.value) {
Object.assign(model, createDefaultModel());
@@ -74,20 +82,54 @@ watch(visible, () => {
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ 已选择 {{ checks.length }} 项权限
+
+
+ 全选
+
+
+ 清空
+
+
+
+
+
+
+
+
-
+
-
+
\ No newline at end of file
diff --git a/ljwx-admin/src/views/manage/role/modules/menu-auth-modal.vue b/ljwx-admin/src/views/manage/role/modules/menu-auth-modal.vue
index 281e1bb..8bab271 100644
--- a/ljwx-admin/src/views/manage/role/modules/menu-auth-modal.vue
+++ b/ljwx-admin/src/views/manage/role/modules/menu-auth-modal.vue
@@ -86,6 +86,20 @@ function init() {
getMenuId();
}
+function getAllKeys(node: TreeOption): string[] {
+ const keys = [node.key as string];
+ if (node.children) {
+ node.children.forEach(child => {
+ keys.push(...getAllKeys(child));
+ });
+ }
+ return keys;
+}
+
+function selectAll() {
+ checks.value = tree.value.map(node => getAllKeys(node)).flat();
+}
+
watch(visible, val => {
if (val) {
init();
@@ -94,8 +108,44 @@ watch(visible, val => {
-
-
+
-
+
+
\ No newline at end of file
diff --git a/ljwx-admin/src/views/manage/user/modules/user-page-table.vue b/ljwx-admin/src/views/manage/user/modules/user-page-table.vue
index d5e4269..4142619 100644
--- a/ljwx-admin/src/views/manage/user/modules/user-page-table.vue
+++ b/ljwx-admin/src/views/manage/user/modules/user-page-table.vue
@@ -1,5 +1,6 @@