feat: 添加系统级管理专属页面权限

This commit is contained in:
皓月归尘 2025-02-26 23:02:40 +08:00
parent 52b9e8f3c8
commit 6e6bab05ac
6 changed files with 53 additions and 5 deletions

View File

@ -1,6 +1,7 @@
title: HTS Code Query System title: HTS Code Query System
buttons:AccountSettings: Account buttons:AccountSettings: Account
buttons:LoginOut: LoginOut buttons:LoginOut: LoginOut
buttons:Cancell: Cancell Account
buttons:Login: Login buttons:Login: Login
buttons:OpenSystemSet: Open System Configs buttons:OpenSystemSet: Open System Configs
buttons:Reload: Reload buttons:Reload: Reload
@ -177,6 +178,10 @@ logout:message: Whether to exit the system?
logout:success: Logout Success logout:success: Logout Success
logout:fail: Logout Fail logout:fail: Logout Fail
logout:cancel: Logout Cancel logout:cancel: Logout Cancel
logout:cancellMessage: Would you like to deactivate your account?
logout:cancellSuccess: Deletion successful
logout:cancellFail: Failed to cancell
logout:cancellCancel: cancell Cancel
user:buttons:addRole: Add User Role user:buttons:addRole: Add User Role
user:buttons:deleteRole: Delete User Role user:buttons:deleteRole: Delete User Role
user:buttons:updateRole: Update User Role user:buttons:updateRole: Update User Role

View File

@ -1,6 +1,7 @@
title: 清关编码查询系统 title: 清关编码查询系统
buttons:AccountSettings: 账户设置 buttons:AccountSettings: 账户设置
buttons:LoginOut: 退出系统 buttons:LoginOut: 退出系统
buttons:Cancell: 注销账号
buttons:Login: 登录 buttons:Login: 登录
buttons:OpenSystemSet: 打开系统配置 buttons:OpenSystemSet: 打开系统配置
buttons:Reload: 重新加载 buttons:Reload: 重新加载
@ -177,6 +178,10 @@ logout:message: 是否退出当前系统?
logout:success: 退出成功 logout:success: 退出成功
logout:fail: 退出失败 logout:fail: 退出失败
logout:cancel: 退出取消 logout:cancel: 退出取消
logout:cancellMessage: 是否注销账号?
logout:cancellSuccess: 注销成功
logout:cancellFail: 注销失败
logout:cancellCancel: 注销取消
user:buttons:addRole: 添加用户角色 user:buttons:addRole: 添加用户角色
user:buttons:deleteRole: 删除用户角色 user:buttons:deleteRole: 删除用户角色
user:buttons:updateRole: 更新用户角色 user:buttons:updateRole: 更新用户角色

View File

@ -139,6 +139,8 @@ type GetPermissionListParams = {
fixedTag?: boolean; fixedTag?: boolean;
/** 隐藏标签页 */ /** 隐藏标签页 */
hiddenTag?: boolean; hiddenTag?: boolean;
/** 是否为管理员专属页面 */
isAdmin?: boolean;
}; };
/**获取权限列表 */ /**获取权限列表 */
@ -196,6 +198,8 @@ type AddPermissionParams = {
parent_id: string; parent_id: string;
/** 菜单类型 */ /** 菜单类型 */
menu_type: number; menu_type: number;
/**是否为管理员专属页面 */
is_admin: boolean;
}; };
/** /**
* *

View File

@ -91,6 +91,19 @@ const showParentOptions: Array<OptionsType> = [
} }
]; ];
const isAdminOptions: Array<OptionsType> = [
{
label: "是",
tip: "只有系统管理员才能查看",
value: true
},
{
label: "否",
tip: "系统内所有成员可见",
value: false
}
];
const frameLoadingOptions: Array<OptionsType> = [ const frameLoadingOptions: Array<OptionsType> = [
{ {
label: "开启", label: "开启",
@ -128,6 +141,7 @@ interface FormItemProps {
fixed_tag: boolean; fixed_tag: boolean;
show_link: boolean; show_link: boolean;
show_parent: boolean; show_parent: boolean;
is_admin: boolean;
} }
interface FormProps { interface FormProps {
formInline: FormItemProps; formInline: FormItemProps;
@ -169,7 +183,8 @@ const props = withDefaults(defineProps<FormProps>(), {
hidden_tag: false, hidden_tag: false,
fixed_tag: false, fixed_tag: false,
show_link: true, show_link: true,
show_parent: false show_parent: false,
is_admin: false
}) })
}); });
@ -418,6 +433,19 @@ defineExpose({ getRef });
/> />
</el-form-item> </el-form-item>
</re-col> </re-col>
<re-col v-if="newFormInline.menu_type < 3" :value="12" :xs="24" :sm="24">
<el-form-item label="管理专属">
<Segmented
:modelValue="newFormInline.is_admin ? 0 : 1"
:options="isAdminOptions"
@change="
({ option: { value } }) => {
newFormInline.is_admin = value;
}
"
/>
</el-form-item>
</re-col>
<re-col <re-col
v-show="newFormInline.menu_type !== 3" v-show="newFormInline.menu_type !== 3"

View File

@ -180,7 +180,8 @@ export const usePermission = () => {
hidden_tag: row?.hidden_tag ?? false, hidden_tag: row?.hidden_tag ?? false,
fixed_tag: row?.fixed_tag ?? false, fixed_tag: row?.fixed_tag ?? false,
show_link: row?.show_link ?? true, show_link: row?.show_link ?? true,
show_parent: row?.show_parent ?? false show_parent: row?.show_parent ?? false,
is_admin: row?.is_admin ?? false
} }
}, },
width: "45%", width: "45%",
@ -214,7 +215,8 @@ export const usePermission = () => {
hidden_tag: row?.hidden_tag ?? false, hidden_tag: row?.hidden_tag ?? false,
fixed_tag: row?.fixed_tag ?? false, fixed_tag: row?.fixed_tag ?? false,
show_link: row?.show_link ?? true, show_link: row?.show_link ?? true,
show_parent: row?.show_parent ?? false show_parent: row?.show_parent ?? false,
is_admin: row?.is_admin ?? false
} }
}), }),
beforeSure: (done, { options }) => { beforeSure: (done, { options }) => {
@ -257,7 +259,8 @@ export const usePermission = () => {
hidden_tag: false, hidden_tag: false,
fixed_tag: false, fixed_tag: false,
show_link: true, show_link: true,
show_parent: false show_parent: false,
is_admin: false
}; };
for (let key in addForm) { for (let key in addForm) {
// 检查第二个字典是否包含相同的键 // 检查第二个字典是否包含相同的键
@ -295,7 +298,8 @@ export const usePermission = () => {
hidden_tag: false, hidden_tag: false,
fixed_tag: false, fixed_tag: false,
show_link: true, show_link: true,
show_parent: false show_parent: false,
is_admin: false
}; };
for (let key in updateForm) { for (let key in updateForm) {
// 检查第二个字典是否包含相同的键 // 检查第二个字典是否包含相同的键

2
types/system.d.ts vendored
View File

@ -118,6 +118,8 @@ export type PermissionInfo = {
show_link: boolean; show_link: boolean;
/** 是否显示父菜单 */ /** 是否显示父菜单 */
show_parent: boolean; show_parent: boolean;
/**是否为管理员专属页面 */
is_admin: boolean;
}; };
/**角色信息类型 */ /**角色信息类型 */