feat: 部门管理添加按钮级权限管理

This commit is contained in:
2025-02-22 04:21:35 +08:00
parent 3a6cb4897b
commit dc5c22e48a

View File

@@ -9,6 +9,7 @@ import EditPen from "@iconify-icons/ep/edit-pen";
import Refresh from "@iconify-icons/ep/refresh";
import AddFill from "@iconify-icons/ri/add-circle-line";
import { onBeforeRouteUpdate } from "vue-router";
import { hasAuth } from "@/utils/auth";
defineOptions({
name: "SystemDepartment"
@@ -82,6 +83,7 @@ onBeforeRouteUpdate((to, from, next) => {
>
<template #buttons>
<el-button
v-if="hasAuth('department:btn:add')"
type="primary"
:icon="useRenderIcon(AddFill)"
@click="openDialog()"
@@ -117,6 +119,7 @@ onBeforeRouteUpdate((to, from, next) => {
link
type="primary"
:size="size"
:disabled="!hasAuth('department:btn:update')"
:icon="useRenderIcon(EditPen)"
@click="openDialog('修改', row)"
>
@@ -127,6 +130,7 @@ onBeforeRouteUpdate((to, from, next) => {
link
type="primary"
:size="size"
:disabled="!hasAuth('department:btn:add')"
:icon="useRenderIcon(AddFill)"
@click="openDialog('新增', { parent_id: row.id } as any)"
>
@@ -142,6 +146,7 @@ onBeforeRouteUpdate((to, from, next) => {
link
type="danger"
:size="size"
:disabled="!hasAuth('department:btn:delete')"
:icon="useRenderIcon(Delete)"
>
{{ t("buttons:Delete") }}