mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 05:49:20 +08:00
refactor: 岗位改名为职位
- 数据库 sys_menu:岗位管理 → 职位管理,岗位菜单分配 → 职位菜单分配,岗位权限分配 → 职位权限分配 - 路由:所有 position-related route titles 更新 - 前端页面:职位列表、职位菜单分配、职位权限分配 - 表单:职位名称、职位ID 等 label 更新 - API 注释同步更新
This commit is contained in:
+17
-17
@@ -35,7 +35,7 @@ const searchForm = ref({
|
||||
status: undefined as number | undefined,
|
||||
});
|
||||
|
||||
// 岗位列表
|
||||
// 职位列表
|
||||
const positionList = ref<PositionVO.PositionInfoVO[]>([]);
|
||||
const positionLoading = ref(false);
|
||||
const positionPagination = ref({
|
||||
@@ -44,14 +44,14 @@ const positionPagination = ref({
|
||||
total: 0,
|
||||
});
|
||||
|
||||
// 当前选中的岗位
|
||||
// 当前选中的职位
|
||||
const currentPosition = ref<null | PositionVO.PositionInfoVO>(null);
|
||||
|
||||
// 公司菜单树数据
|
||||
const companyMenuTree = ref<CompanyMenuVO.CompanyMenuInfo[]>([]);
|
||||
const menuTreeLoading = ref(false);
|
||||
|
||||
// 岗位权限菜单ID列表
|
||||
// 职位权限菜单ID列表
|
||||
const positionMenuIds = ref<number[]>([]);
|
||||
const permissionLoading = ref(false);
|
||||
|
||||
@@ -61,7 +61,7 @@ const expandedKeys = ref<number[]>([]);
|
||||
|
||||
// 不区分超管与普通菜单
|
||||
|
||||
// 搜索岗位列表
|
||||
// 搜索职位列表
|
||||
async function searchPositions() {
|
||||
positionLoading.value = true;
|
||||
try {
|
||||
@@ -78,7 +78,7 @@ async function searchPositions() {
|
||||
positionList.value = result.records;
|
||||
positionPagination.value.total = result.total;
|
||||
} catch (error: any) {
|
||||
message.error(error?.message || '获取岗位列表失败');
|
||||
message.error(error?.message || '获取职位列表失败');
|
||||
} finally {
|
||||
positionLoading.value = false;
|
||||
}
|
||||
@@ -130,13 +130,13 @@ function convertToTreeData(menus: CompanyMenuVO.CompanyMenuInfo[]): any[] {
|
||||
}));
|
||||
}
|
||||
|
||||
// 选择岗位
|
||||
// 选择职位
|
||||
async function selectPosition(position: PositionVO.PositionInfoVO) {
|
||||
currentPosition.value = position;
|
||||
await loadPositionPermissions();
|
||||
}
|
||||
|
||||
// 加载岗位权限
|
||||
// 加载职位权限
|
||||
async function loadPositionPermissions() {
|
||||
if (!currentPosition.value?.id) return;
|
||||
|
||||
@@ -149,7 +149,7 @@ async function loadPositionPermissions() {
|
||||
const leafMenuIds = cleanRootNodes(result);
|
||||
checkedKeys.value = leafMenuIds;
|
||||
} catch (error: any) {
|
||||
message.error(error?.message || '获取岗位菜单失败');
|
||||
message.error(error?.message || '获取职位菜单失败');
|
||||
} finally {
|
||||
permissionLoading.value = false;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ function ensureParentMenuIds(menuIds: number[]): number[] {
|
||||
return [...result];
|
||||
}
|
||||
|
||||
// 保存岗位权限
|
||||
// 保存职位权限
|
||||
async function savePositionPermissions() {
|
||||
if (!currentPosition.value?.id) return;
|
||||
|
||||
@@ -332,9 +332,9 @@ onMounted(() => {
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<Flex gap="middle" class="h-full">
|
||||
<!-- 左栏:岗位列表 -->
|
||||
<!-- 左栏:职位列表 -->
|
||||
<Card
|
||||
title="岗位列表"
|
||||
title="职位列表"
|
||||
class="flex h-full max-w-[400px] flex-col"
|
||||
:body-style="{
|
||||
height: '100%',
|
||||
@@ -347,7 +347,7 @@ onMounted(() => {
|
||||
<Flex class="flex-wrap gap-2">
|
||||
<Input
|
||||
v-model:value="searchForm.name"
|
||||
placeholder="请输入岗位名称"
|
||||
placeholder="请输入职位名称"
|
||||
allow-clear
|
||||
style="width: 200px; margin-right: 8px"
|
||||
/>
|
||||
@@ -364,9 +364,9 @@ onMounted(() => {
|
||||
<Button @click="resetSearch"> 重置 </Button>
|
||||
</Flex>
|
||||
|
||||
<!-- 岗位列表区域 -->
|
||||
<!-- 职位列表区域 -->
|
||||
<Flex vertical class="flex-1">
|
||||
<!-- 岗位列表 -->
|
||||
<!-- 职位列表 -->
|
||||
<Flex vertical class="flex-1">
|
||||
<Spin :spinning="positionLoading">
|
||||
<Card
|
||||
@@ -431,12 +431,12 @@ onMounted(() => {
|
||||
|
||||
<!-- 右栏:权限管理 -->
|
||||
<Card
|
||||
title="岗位菜单分配"
|
||||
title="职位菜单分配"
|
||||
class="flex h-full flex-1 flex-col"
|
||||
:body-style="{ height: '100%' }"
|
||||
>
|
||||
<template v-if="currentPosition">
|
||||
<!-- 岗位信息 + 统计与操作 -->
|
||||
<!-- 职位信息 + 统计与操作 -->
|
||||
<div class="mb-4 rounded bg-gray-50 p-4 dark:bg-neutral-800">
|
||||
<div class="mb-3 flex items-center justify-between gap-2">
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -512,7 +512,7 @@ onMounted(() => {
|
||||
<div v-else class="flex h-full flex-1 items-center justify-center">
|
||||
<div class="text-center text-gray-500">
|
||||
<div class="mb-4 text-5xl">👈</div>
|
||||
<div class="text-base">请先选择一个岗位</div>
|
||||
<div class="text-base">请先选择一个职位</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user