refactor: 统一权限标识前缀为module_格式

feat(tenant): 新增租户管理模块相关文件

style: 优化代码导入和类型提示

fix: 修复前端权限标识校验逻辑

docs: 更新注释中的权限标识示例

test: 更新测试用例中的权限标识

chore: 清理无用导入和类型定义
This commit is contained in:
zhangtao
2025-11-11 01:06:40 +08:00
parent 379df71baa
commit 5d0d0cd26a
54 changed files with 2109 additions and 445 deletions
+14 -14
View File
@@ -29,8 +29,8 @@
</el-form-item>
<!-- 查询、重置、展开/收起按钮 -->
<el-form-item class="search-buttons">
<el-button v-hasPerm="['system:role:query']" type="primary" icon="search" native-type="submit">查询</el-button>
<el-button v-hasPerm="['system:role:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
<el-button v-hasPerm="['module_system:role:query']" type="primary" icon="search" native-type="submit">查询</el-button>
<el-button v-hasPerm="['module_system:role:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
<!-- 展开/收起 -->
<template v-if="isExpandable">
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
@@ -67,18 +67,18 @@
<div class="data-table__toolbar--left">
<el-row :gutter="10">
<el-col :span="1.5">
<el-button v-hasPerm="['system:role:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
<el-button v-hasPerm="['module_system:role:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPerm="['system:role:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
<el-button v-hasPerm="['module_system:role:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
</el-col>
<el-col :span="1.5">
<el-dropdown v-hasPerm="['system:role:patch']" trigger="click">
<el-dropdown v-hasPerm="['module_system:role:patch']" trigger="click">
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">
更多
</el-button>
<template #dropdown>
<el-dropdown-menu v-hasPerm="['system:role:filter']">
<el-dropdown-menu v-hasPerm="['module_system:role:filter']">
<el-dropdown-item icon="Check" @click="handleMoreClick(true)">批量启用</el-dropdown-item>
<el-dropdown-item icon="CircleClose" @click="handleMoreClick(false)">批量停用</el-dropdown-item>
</el-dropdown-menu>
@@ -91,12 +91,12 @@
<el-row :gutter="10">
<el-col :span="1.5">
<el-tooltip content="导出">
<el-button v-hasPerm="['system:role:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
<el-button v-hasPerm="['module_system:role:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
</el-tooltip>
</el-col>
<el-col :span="1.5">
<el-tooltip content="刷新">
<el-button v-hasPerm="['system:role:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
<el-button v-hasPerm="['module_system:role:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
</el-tooltip>
</el-col>
<el-col :span="1.5">
@@ -156,7 +156,7 @@
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="280">
<template #default="scope">
<el-button
v-hasPerm="['system:role:permission']"
v-hasPerm="['module_system:role:permission']"
type="warning"
size="small"
link
@@ -165,7 +165,7 @@
@click="scope.row.id === 1 ? ElMessage.warning('系统默认角色,不可操作') : handleOpenAssignPermDialog(scope.row.id, scope.row.name)"
>分配权限</el-button>
<el-button
v-hasPerm="['system:role:detail']"
v-hasPerm="['module_system:role:detail']"
type="info"
size="small"
link
@@ -173,7 +173,7 @@
@click="handleOpenDialog('detail', scope.row.id)"
>详情</el-button>
<el-button
v-hasPerm="['system:role:update']"
v-hasPerm="['module_system:role:update']"
type="primary"
size="small"
link
@@ -182,7 +182,7 @@
@click="scope.row.id === 1 ? ElMessage.warning('系统默认角色,不可操作') : handleOpenDialog('update', scope.row.id)"
>编辑</el-button>
<el-button
v-hasPerm="['system:role:delete']"
v-hasPerm="['module_system:role:delete']"
type="danger"
size="small"
link
@@ -260,7 +260,7 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="handleCloseDialog">取 消</el-button>
<el-button v-hasPerm="['system:role:submit']" type="primary" @click="handleSubmit">确 定</el-button>
<el-button v-hasPerm="['module_system:role:submit']" type="primary" @click="handleSubmit">确 定</el-button>
</div>
</template>
</el-dialog>
@@ -578,7 +578,7 @@ const exportColumns = [
// 导入/导出配置
const curdContentConfig = {
permPrefix: 'system:role',
permPrefix: 'module_system:role',
cols: exportColumns as any,
exportsAction: async (params: any) => {
const query: any = { ...params };