mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 05:49:20 +08:00
refactor: 拆分公司/系统账户权限与模块,系统账户迁至 sys/account 并更新菜单
This commit is contained in:
@@ -4,40 +4,25 @@ import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { SuperAccountDTO, SuperAccountVO } from './types';
|
||||
|
||||
/**
|
||||
* 超管账户管理API
|
||||
* 平台系统账户管理 API(/api/sys/account)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 创建账户(超管)
|
||||
*/
|
||||
export async function super_createAccountApi(data: SuperAccountDTO.SuperCreateAccountDTO) {
|
||||
return requestClient.post<SuperAccountVO.AccountInfoVO>('/super/account/create', data);
|
||||
return requestClient.post<SuperAccountVO.AccountInfoVO>('/sys/account/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询账户(超管)
|
||||
*/
|
||||
export async function super_getAccountPageApi(params: PageQueryDTO<SuperAccountDTO.AccountFilterDTO>) {
|
||||
return requestClient.post<PageResultVO<SuperAccountVO.AccountInfoVO>>('/super/account/list', params);
|
||||
return requestClient.post<PageResultVO<SuperAccountVO.AccountInfoVO>>('/sys/account/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新账户信息(超管)
|
||||
*/
|
||||
export async function super_updateAccountApi(accountId: number, data: SuperAccountDTO.SuperUpdateAccountDTO) {
|
||||
return requestClient.put<SuperAccountVO.AccountInfoVO>(`/super/account/update/${accountId}`, data);
|
||||
return requestClient.put<SuperAccountVO.AccountInfoVO>(`/sys/account/update/${accountId}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除账户(超管)
|
||||
*/
|
||||
export async function super_deleteAccountApi(accountId: number) {
|
||||
return requestClient.delete<void>(`/super/account/delete/${accountId}`);
|
||||
return requestClient.delete<void>(`/sys/account/delete/${accountId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账户详情(超管)
|
||||
*/
|
||||
export async function super_getAccountDetailApi(accountId: number) {
|
||||
return requestClient.get<SuperAccountVO.AccountInfoVO>(`/super/account/detail/${accountId}`);
|
||||
return requestClient.get<SuperAccountVO.AccountInfoVO>(`/sys/account/detail/${accountId}`);
|
||||
}
|
||||
|
||||
@@ -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)"
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ interface Emits {
|
||||
(e: 'success'): void;
|
||||
}
|
||||
|
||||
defineOptions({ name: 'SuperAccountFormModal' });
|
||||
defineOptions({ name: 'SysAccountFormModal' });
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
+11
-16
@@ -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>
|
||||
Reference in New Issue
Block a user