😎 优化角色管理页面相关代码

This commit is contained in:
zuohuaijun 2025-08-11 13:59:30 +08:00
parent 75a9182a19
commit 03978cccce
7 changed files with 26 additions and 22 deletions

View File

@ -2,7 +2,7 @@
"name": "admin.net.pro",
"type": "module",
"version": "2.4.33",
"lastBuildTime": "2025.08.10",
"lastBuildTime": "2025.08.11",
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
"author": "zuohuaijun",
"license": "MIT",
@ -18,8 +18,8 @@
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.2",
"@logicflow/core": "^2.1.0",
"@logicflow/extension": "^2.1.1",
"@logicflow/core": "^2.1.1",
"@logicflow/extension": "^2.1.2",
"@microsoft/signalr": "^9.0.6",
"@vue-office/docx": "^1.6.3",
"@vue-office/excel": "^1.7.14",

View File

@ -230,7 +230,9 @@ export default {
apiRoute: 'API Route',
authRoleDataScope: 'Authorize Role Data Scope',
orgList: 'Organization List',
noAuthForCoreMenu: 'Non-admin roles are not allowed to authorize system core module table resources',
noAuthForMenu: 'Non-admin roles are not allowed to authorize system core module menu resources',
noAuthForTable: 'Non-admin roles are not allowed to authorize system core module table resources',
noAuthForApi: 'Non-admin roles are not allowed to authorize system core module api resources',
grantRoleMenu: 'Set Role Field Blacklist [{name}]',
setApiBlacklist: 'Set Role API Blacklist [{name}]',
authRoleDataScopeWithName: 'Authorize Role Data Scope [{name}]',

View File

@ -230,7 +230,9 @@ export default {
apiRoute: 'API路由',
authRoleDataScope: '授权角色数据范围',
orgList: '机构列表',
noAuthForCoreMenu: '非超管角色禁止授权系统核心模块表格资源',
noAuthForMenu: '非超管角色禁止授权系统核心模块菜单资源',
noAuthForTable: '非超管角色禁止授权系统核心模块字段资源',
noAuthForApi: '非超管角色禁止授权系统核心模块接口资源',
grantRoleMenu: '设置角色字段黑名单【{name}】',
setApiBlacklist: '设置角色接口黑名单【{name}】',
authRoleDataScopeWithName: '授权角色数据范围【{name}】',
@ -374,8 +376,8 @@ export default {
submit: '确 定',
expand: '全部展开',
fold: '全部折叠',
pleaseChoose: '请选择 ',
pleaseInput: '请输入 ',
pleaseChoose: '请选择 ',
pleaseInput: '请输入 ',
pleaseInputTitle: '请选择至少一种 ',
error: '发生错误了!',
length: '长度应该是 ',

View File

@ -32,7 +32,7 @@
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
<template #toolbar_buttons>
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysPos/add'"> {{ $t('message.list.add') }} </el-button>
<el-button-group type="primary" style="padding-left: 12px">
<el-button-group style="padding-left: 12px">
<el-button plain icon="ele-Upload" @click="importData" v-auth="'sysPos/import'"> {{ $t('message.list.import') }} </el-button>
<el-button plain icon="ele-Download" @click="exportData" v-auth="'sysPos/export'"> {{ $t('message.list.export') }} </el-button>
<el-button plain icon="ele-FolderOpened" @click="downloadTemplate"> {{ $t('message.list.downloadTemplate') }} </el-button>

View File

@ -1,22 +1,26 @@
<template>
<div class="sys-grantApi-container">
<el-drawer v-model="state.isVisible" size="30%">
<el-drawer v-model="state.isVisible" size="40%">
<template #header>
<div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Link /> </el-icon>
<span>{{ state.drawerTitle }}</span>
</div>
</template>
<div>
<NoticeBar leftIcon="iconfont icon-tongzhi2" :text="$t('message.list.noAuthForApi')" :scrollable="true" />
</div>
<el-card class="tree-card" shadow="hover" style="height: calc(100vh - 110px)" body-style="height:100%; overflow:auto">
<template #header>
<div class="card-header">
<div class="tree-h-flex">
<div class="tree-h-left">
<el-input :prefix-icon="Search" v-model="filterText" :placeholder="$t('message.list.apiRoute')" />
<el-input prefix-icon="ele-Search" v-model="filterText" :placeholder="$t('message.list.apiRoute')" />
</div>
</div>
</div>
</template>
<el-form-item v-loading="state.loading" style="margin-bottom: 45px">
<el-row :gutter="24">
<el-col :span="24" class="mb8">
@ -61,14 +65,13 @@
<script lang="ts" setup>
import { reactive, onMounted, ref, watch } from 'vue';
import type { ElTree } from 'element-plus';
import { Search } from '@element-plus/icons-vue';
import NoticeBar from '/@/components/noticeBar/index.vue';
import { useI18n } from 'vue-i18n';
import { getAPI } from '/@/utils/axios-utils';
import { SysCommonApi, SysRoleApi } from '/@/api-services/api';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const filterText = ref('');
const treeRef = ref<InstanceType<typeof ElTree>>();
const state = reactive({

View File

@ -8,9 +8,9 @@
</div>
</template>
<div>
<NoticeBar leftIcon="iconfont icon-tongzhi2" :text="$t('message.list.noAuthForCoreMenu')" :scrollable="true" style="margin: 5px" />
<NoticeBar leftIcon="iconfont icon-tongzhi2" :text="$t('message.list.noAuthForMenu')" :scrollable="true" />
</div>
<div v-loading="state.loading">
<div v-loading="state.loading" style="padding: 10px">
<el-tree
ref="treeRef"
:data="state.menuData"
@ -20,7 +20,6 @@
icon="ele-Menu"
highlight-current
default-expand-all
style="margin: 10px"
/>
</div>
<template #footer>
@ -37,14 +36,13 @@
import { reactive, onMounted, ref } from 'vue';
import type { ElTree } from 'element-plus';
import NoticeBar from '/@/components/noticeBar/index.vue';
import { useI18n } from 'vue-i18n';
import { getAPI } from '/@/utils/axios-utils';
import { SysMenuApi, SysRoleApi } from '/@/api-services/api';
import { SysMenu } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const treeRef = ref<InstanceType<typeof ElTree>>();
const state = reactive({
loading: false,

View File

@ -8,19 +8,18 @@
</div>
</template>
<div>
<NoticeBar leftIcon="iconfont icon-tongzhi2" :text="$t('message.list.noAuthForCoreMenu')" :scrollable="true" style="margin: 5px" />
<NoticeBar leftIcon="iconfont icon-tongzhi2" :text="$t('message.list.noAuthForTable')" :scrollable="true" />
</div>
<div v-loading="state.loading">
<div v-loading="state.loading" style="margin: 10px">
<el-tree
ref="treeRef"
:data="state.roleTableData"
node-key="id"
show-checkbox
:props="{ children: 'columns', label: 'label', class: 'penultimate-node' }"
icon="ele-Grid"
icon="ele-Menu"
highlight-current
default-expand-all
style="margin: 10px"
/>
</div>
<template #footer>