mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 20:29:19 +08:00
refactor: 重构超管相关
This commit is contained in:
+6
-6
@@ -19,8 +19,8 @@ export namespace SuperAccountDTO {
|
||||
departmentId?: number;
|
||||
/** 岗位ID */
|
||||
positionId?: number;
|
||||
/** 角色 */
|
||||
role: string;
|
||||
/** 是否超级管理员(0-否 1-是) */
|
||||
isSuper: number;
|
||||
/** 头像图片ID */
|
||||
avatarImageId?: number;
|
||||
/** 备注 */
|
||||
@@ -41,8 +41,8 @@ export namespace SuperAccountDTO {
|
||||
departmentId?: number;
|
||||
/** 岗位ID */
|
||||
positionId?: number;
|
||||
/** 角色 */
|
||||
role?: string;
|
||||
/** 是否超级管理员(0-否 1-是) */
|
||||
isSuper?: number;
|
||||
/** 头像图片ID */
|
||||
avatarImageId?: number;
|
||||
/** 状态(0-正常 1-删除 2-停用 3-冻结) */
|
||||
@@ -65,8 +65,8 @@ export namespace SuperAccountDTO {
|
||||
departmentId?: number;
|
||||
/** 岗位ID */
|
||||
positionId?: number;
|
||||
/** 角色 */
|
||||
role?: string;
|
||||
/** 是否超级管理员(0-否 1-是) */
|
||||
isSuper?: number;
|
||||
/** 状态(0-正常 1-删除 2-停用 3-冻结) */
|
||||
status?: number;
|
||||
}
|
||||
|
||||
+4
-4
@@ -29,10 +29,10 @@ export namespace SuperAccountVO {
|
||||
avatar?: string;
|
||||
/** 头像图片ID */
|
||||
avatarImageId?: number;
|
||||
/** 角色 */
|
||||
role?: string;
|
||||
/** 角色名称 */
|
||||
roleName?: string;
|
||||
/** 是否超级管理员(0-否 1-是) */
|
||||
isSuper?: number;
|
||||
/** 是否超级管理员名称 */
|
||||
isSuperName?: string;
|
||||
/** 密码安全级别 */
|
||||
pwdSecurityLevel?: number;
|
||||
/** 密码最后更新时间 */
|
||||
|
||||
@@ -26,8 +26,8 @@ export namespace UserVO {
|
||||
realName: string;
|
||||
/** 头像路径 */
|
||||
avatar?: string;
|
||||
/** 关联角色(user-普通账户 company-公司账户 super-超管账户) */
|
||||
role: string;
|
||||
/** 是否超级管理员(0-否 1-是) */
|
||||
isSuper?: number;
|
||||
/** 密码安全级别(0-初始 1-很弱 2-弱 3-安全 4-很安全) */
|
||||
pwdSecurityLevel?: number;
|
||||
/** 密码最后更新时间 */
|
||||
|
||||
@@ -120,7 +120,7 @@ const menus = computed(() => {
|
||||
}
|
||||
|
||||
// 只有超级管理员才显示切换账户功能
|
||||
if (accessStore.userRole === 'super') {
|
||||
if (accessStore.isSuper) {
|
||||
menuItems.push({
|
||||
handler: () => {
|
||||
switchAccountModalRef.value?.open();
|
||||
|
||||
+10
-11
@@ -51,7 +51,7 @@ const formData = ref<
|
||||
companyId: 0,
|
||||
departmentId: undefined,
|
||||
positionId: undefined,
|
||||
role: '',
|
||||
isSuper: 0,
|
||||
avatarImageId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
@@ -73,7 +73,7 @@ function resetForm() {
|
||||
companyId: presetCompany.value?.id ?? 0,
|
||||
departmentId: undefined,
|
||||
positionId: undefined,
|
||||
role: '',
|
||||
isSuper: 0,
|
||||
avatarImageId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
@@ -104,7 +104,7 @@ function open(
|
||||
companyId: accountData.companyId || presetCompany.value?.id || 0,
|
||||
departmentId: accountData.departmentId,
|
||||
positionId: accountData.positionId,
|
||||
role: accountData.role || '',
|
||||
isSuper: accountData.isSuper ?? 0,
|
||||
avatarImageId: accountData.avatarImageId,
|
||||
remark: accountData.remark || '',
|
||||
status: accountData.status ?? 1,
|
||||
@@ -253,17 +253,16 @@ defineExpose({
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="角色"
|
||||
name="role"
|
||||
:rules="[{ required: true, message: '请输入角色' }]"
|
||||
label="是否超管"
|
||||
name="isSuper"
|
||||
:rules="[{ required: true, message: '请选择是否超管' }]"
|
||||
>
|
||||
<Select
|
||||
v-model:value="formData.role"
|
||||
placeholder="请选择角色"
|
||||
v-model:value="formData.isSuper"
|
||||
placeholder="请选择是否超管"
|
||||
:options="[
|
||||
{ label: '超级管理员', value: 'super' },
|
||||
{ label: '拥有者', value: 'admin' },
|
||||
{ label: '普通用户', value: 'user' },
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '是', value: 1 },
|
||||
]"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
@@ -122,8 +122,8 @@ const gridOptions: VxeGridProps<SuperAccountVO.AccountInfoVO> = {
|
||||
showOverflow: 'tooltip' as const,
|
||||
},
|
||||
{
|
||||
field: 'role',
|
||||
title: '角色',
|
||||
field: 'isSuperName',
|
||||
title: '超管',
|
||||
minWidth: 100,
|
||||
showOverflow: 'tooltip' as const,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user