权限相关调整

This commit is contained in:
fuenmao
2026-09-10 16:43:23 +08:00
parent 0db1848b10
commit 4371eca6c4
11 changed files with 347 additions and 36 deletions
+60 -9
View File
@@ -12,7 +12,7 @@
:search-col="5"
>
<template #tableHeader>
<el-button type="primary" icon="Plus" @click="openCompanyCreate">
<el-button v-auth="'onboardingSetupAdd'" type="primary" icon="Plus" @click="openCompanyCreate">
新增入职公司
</el-button>
</template>
@@ -33,11 +33,27 @@
</template>
<template #operation="scope">
<el-button link type="primary" icon="Edit" @click="openCompanyEdit(scope.row)">
<el-button
v-auth="'onboardingSetupEdit'"
link
type="primary"
icon="Edit"
:disabled="!canManage(scope.row)"
:title="disabledReason(scope.row)"
@click="openCompanyEdit(scope.row)"
>
编辑
</el-button>
<el-button link type="danger" icon="Delete" @click="removeCompany(scope.row)">
<el-button
v-auth="'onboardingSetupDelete'"
link
type="danger"
icon="Delete"
:disabled="!canManage(scope.row)"
:title="disabledReason(scope.row)"
@click="removeCompany(scope.row)"
>
删除
</el-button>
</template>
@@ -56,7 +72,7 @@
:search-col="5"
>
<template #tableHeader>
<el-button type="primary" icon="Plus" @click="openDepartmentCreate">
<el-button v-auth="'onboardingSetupAdd'" type="primary" icon="Plus" @click="openDepartmentCreate">
新增入职部门
</el-button>
</template>
@@ -74,11 +90,27 @@
</template>
<template #operation="scope">
<el-button link type="primary" icon="Edit" @click="openDepartmentEdit(scope.row)">
<el-button
v-auth="'onboardingSetupEdit'"
link
type="primary"
icon="Edit"
:disabled="!canManage(scope.row)"
:title="disabledReason(scope.row)"
@click="openDepartmentEdit(scope.row)"
>
编辑
</el-button>
<el-button link type="danger" icon="Delete" @click="removeDepartment(scope.row)">
<el-button
v-auth="'onboardingSetupDelete'"
link
type="danger"
icon="Delete"
:disabled="!canManage(scope.row)"
:title="disabledReason(scope.row)"
@click="removeDepartment(scope.row)"
>
删除
</el-button>
</template>
@@ -97,7 +129,7 @@
:search-col="5"
>
<template #tableHeader>
<el-button type="primary" icon="Plus" @click="openPositionCreate">
<el-button v-auth="'onboardingSetupAdd'" type="primary" icon="Plus" @click="openPositionCreate">
新增入职岗位
</el-button>
</template>
@@ -122,11 +154,27 @@
</template>
<template #operation="scope">
<el-button link type="primary" icon="Edit" @click="openPositionEdit(scope.row)">
<el-button
v-auth="'onboardingSetupEdit'"
link
type="primary"
icon="Edit"
:disabled="!canManage(scope.row)"
:title="disabledReason(scope.row)"
@click="openPositionEdit(scope.row)"
>
编辑
</el-button>
<el-button link type="danger" icon="Delete" @click="removePosition(scope.row)">
<el-button
v-auth="'onboardingSetupDelete'"
link
type="danger"
icon="Delete"
:disabled="!canManage(scope.row)"
:title="disabledReason(scope.row)"
@click="removePosition(scope.row)"
>
删除
</el-button>
</template>
@@ -377,6 +425,9 @@ import {
} from "@/api/modules/biz/onboarding";
import type { ColumnProps, ProTableInstance, EnumProps } from "@/components/ProTable/interface";
import { isMessageBoxConfirmed } from "@/utils/messageBox";
import { useOnboardingPermission } from "@/utils/onboardingPermission";
const { canManage, disabledReason } = useOnboardingPermission("onboardingSetupManageAll");
const activeTab = ref("company");