feat: 部门管理添加按钮级权限管理
This commit is contained in:
@@ -9,6 +9,7 @@ import EditPen from "@iconify-icons/ep/edit-pen";
|
|||||||
import Refresh from "@iconify-icons/ep/refresh";
|
import Refresh from "@iconify-icons/ep/refresh";
|
||||||
import AddFill from "@iconify-icons/ri/add-circle-line";
|
import AddFill from "@iconify-icons/ri/add-circle-line";
|
||||||
import { onBeforeRouteUpdate } from "vue-router";
|
import { onBeforeRouteUpdate } from "vue-router";
|
||||||
|
import { hasAuth } from "@/utils/auth";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "SystemDepartment"
|
name: "SystemDepartment"
|
||||||
@@ -82,6 +83,7 @@ onBeforeRouteUpdate((to, from, next) => {
|
|||||||
>
|
>
|
||||||
<template #buttons>
|
<template #buttons>
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="hasAuth('department:btn:add')"
|
||||||
type="primary"
|
type="primary"
|
||||||
:icon="useRenderIcon(AddFill)"
|
:icon="useRenderIcon(AddFill)"
|
||||||
@click="openDialog()"
|
@click="openDialog()"
|
||||||
@@ -117,6 +119,7 @@ onBeforeRouteUpdate((to, from, next) => {
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
:size="size"
|
:size="size"
|
||||||
|
:disabled="!hasAuth('department:btn:update')"
|
||||||
:icon="useRenderIcon(EditPen)"
|
:icon="useRenderIcon(EditPen)"
|
||||||
@click="openDialog('修改', row)"
|
@click="openDialog('修改', row)"
|
||||||
>
|
>
|
||||||
@@ -127,6 +130,7 @@ onBeforeRouteUpdate((to, from, next) => {
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
:size="size"
|
:size="size"
|
||||||
|
:disabled="!hasAuth('department:btn:add')"
|
||||||
:icon="useRenderIcon(AddFill)"
|
:icon="useRenderIcon(AddFill)"
|
||||||
@click="openDialog('新增', { parent_id: row.id } as any)"
|
@click="openDialog('新增', { parent_id: row.id } as any)"
|
||||||
>
|
>
|
||||||
@@ -142,6 +146,7 @@ onBeforeRouteUpdate((to, from, next) => {
|
|||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
:size="size"
|
:size="size"
|
||||||
|
:disabled="!hasAuth('department:btn:delete')"
|
||||||
:icon="useRenderIcon(Delete)"
|
:icon="useRenderIcon(Delete)"
|
||||||
>
|
>
|
||||||
{{ t("buttons:Delete") }}
|
{{ t("buttons:Delete") }}
|
||||||
|
|||||||
Reference in New Issue
Block a user