refactor: 拆分公司/系统账户权限与模块,系统账户迁至 sys/account 并更新菜单

This commit is contained in:
2026-08-27 22:39:08 +08:00
parent 65c412d533
commit 5f184ef560
14 changed files with 273 additions and 251 deletions
@@ -57,9 +57,9 @@ const statusOptions = [
];
const accountActionCodes = [
'org:account:create',
'org:account:update',
'org:account:delete',
'org:company:account:create',
'org:company:account:update',
'org:company:account:delete',
];
const showActionColumn = useActionColumnVisible(accountActionCodes);
@@ -374,13 +374,13 @@ function handleModalSuccess() {
<!-- 工具栏工具 -->
<template #toolbar-tools>
<Space>
<PermissionGate code="org:account:create">
<PermissionGate code="org:company:account:create">
<Button type="primary" @click="handleAdd">
<PlusIcon />
添加账户
</Button>
</PermissionGate>
<PermissionGate code="org:account:delete">
<PermissionGate code="org:company:account:delete">
<Button v-if="hasSelected" danger @click="handleBatchDelete">
批量删除
</Button>
@@ -405,10 +405,10 @@ function handleModalSuccess() {
<!-- 操作列 -->
<template v-if="showActionColumn" #action="{ row }">
<Space>
<PermissionGate code="org:account:update">
<PermissionGate code="org:company:account:update">
<Button size="small" @click="handleEdit(row)"> 编辑 </Button>
</PermissionGate>
<PermissionGate code="org:account:delete">
<PermissionGate code="org:company:account:delete">
<Popconfirm
title="确定要删除这个账户吗?"
@confirm="handleDelete(row)"
@@ -20,7 +20,7 @@ interface Emits {
(e: 'success'): void;
}
defineOptions({ name: 'SuperAccountFormModal' });
defineOptions({ name: 'SysAccountFormModal' });
const emit = defineEmits<Emits>();
@@ -34,7 +34,7 @@ import {
super_getAccountPageApi,
} from '#/api/sys/account';
import SuperAccountFormModal from './components/SuperAccountFormModal.vue';
import AccountFormModal from './components/AccountFormModal.vue';
import { PermissionGate } from '#/components/permission';
import {
syncVxeGridColumns,
@@ -45,7 +45,7 @@ import {
sidebarListRowClass,
} from '#/utils/sidebar-list-styles';
defineOptions({ name: 'SuperAccountManagement' });
defineOptions({ name: 'SysAccountManagement' });
const PlusIcon = createIconifyIcon('lucide:plus');
const BuildingIcon = createIconifyIcon('lucide:building-2');
@@ -88,9 +88,9 @@ const selectedCompanyLabel = computed(() => {
});
const accountActionCodes = [
'org:account:create',
'org:account:update',
'org:account:delete',
'sys:account:create',
'sys:account:update',
'sys:account:delete',
];
const showActionColumn = useActionColumnVisible(accountActionCodes);
@@ -361,7 +361,7 @@ onMounted(() => {
</script>
<template>
<Page title="超级账户管理" :auto-content-height="true">
<Page title="系统账户管理" :auto-content-height="true">
<template #description>
<div class="text-foreground/80 mt-2">
左侧选择公司筛选右侧账户;首项「全部账户」展示所有账户,可在公司行快捷新增。
@@ -370,7 +370,7 @@ onMounted(() => {
<template #extra>
<Space>
<PermissionGate code="org:account:create">
<PermissionGate code="sys:account:create">
<Button type="primary" @click="handleAdd">
<PlusIcon class="mr-2 h-4 w-4" />
新增账户
@@ -380,7 +380,6 @@ onMounted(() => {
</template>
<Flex gap="middle" class="h-full min-h-0">
<!-- 左:公司 -->
<Card
class="flex h-full w-[420px] shrink-0 flex-col"
:body-style="{
@@ -458,7 +457,7 @@ onMounted(() => {
{{ company.status === 1 ? '启用' : '禁用' }}
</span>
</button>
<PermissionGate code="org:account:create">
<PermissionGate code="sys:account:create">
<Button
type="link"
size="small"
@@ -487,7 +486,6 @@ onMounted(() => {
</Spin>
</Card>
<!-- 右:账户列表 -->
<Card
class="flex h-full min-h-0 min-w-0 flex-1 flex-col"
:body-style="{
@@ -568,10 +566,10 @@ onMounted(() => {
<template v-if="showActionColumn" #action="{ row }">
<Space>
<PermissionGate code="org:account:update">
<PermissionGate code="sys:account:update">
<Button size="small" @click="handleEdit(row)">编辑</Button>
</PermissionGate>
<PermissionGate code="org:account:delete">
<PermissionGate code="sys:account:delete">
<Popconfirm
title="确定要删除这个账户吗?"
@confirm="handleDelete(row)"
@@ -586,9 +584,6 @@ onMounted(() => {
</Card>
</Flex>
<SuperAccountFormModal
ref="accountFormModalRef"
@success="handleModalSuccess"
/>
<AccountFormModal ref="accountFormModalRef" @success="handleModalSuccess" />
</Page>
</template>