mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 22:29:19 +08:00
refactor: 岗位改名为职位
- 数据库 sys_menu:岗位管理 → 职位管理,岗位菜单分配 → 职位菜单分配,岗位权限分配 → 职位权限分配 - 路由:所有 position-related route titles 更新 - 前端页面:职位列表、职位菜单分配、职位权限分配 - 表单:职位名称、职位ID 等 label 更新 - API 注释同步更新
This commit is contained in:
+9
-9
@@ -63,7 +63,7 @@ const formData = ref<FormData>({
|
||||
// 开关组件不需要选项数组
|
||||
|
||||
// 模态框标题
|
||||
const modalTitle = computed(() => (isEdit.value ? '编辑岗位' : '添加岗位'));
|
||||
const modalTitle = computed(() => (isEdit.value ? '编辑职位' : '添加职位'));
|
||||
|
||||
// 重置表单
|
||||
function resetForm() {
|
||||
@@ -105,8 +105,8 @@ async function handleSubmit() {
|
||||
emit('success');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error('保存岗位失败:', error);
|
||||
message.error('保存岗位失败');
|
||||
console.error('保存职位失败:', error);
|
||||
message.error('保存职位失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
@@ -150,15 +150,15 @@ defineExpose({
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item
|
||||
label="岗位名称"
|
||||
label="职位名称"
|
||||
name="name"
|
||||
:rules="[{ required: true, message: '请输入岗位名称' }]"
|
||||
:rules="[{ required: true, message: '请输入职位名称' }]"
|
||||
>
|
||||
<Input v-model:value="formData.name" placeholder="请输入岗位名称" />
|
||||
<Input v-model:value="formData.name" placeholder="请输入职位名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="岗位编码" name="code">
|
||||
<Input v-model:value="formData.code" placeholder="请输入岗位编码" />
|
||||
<Form.Item label="职位编码" name="code">
|
||||
<Input v-model:value="formData.code" placeholder="请输入职位编码" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="所属部门" name="departmentId">
|
||||
@@ -173,7 +173,7 @@ defineExpose({
|
||||
<Form.Item label="描述" name="remark">
|
||||
<Input.TextArea
|
||||
v-model:value="formData.remark"
|
||||
placeholder="请输入岗位描述"
|
||||
placeholder="请输入职位描述"
|
||||
:rows="3"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
@@ -57,13 +57,13 @@ const gridOptions: VxeGridProps<any> = {
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '岗位名称',
|
||||
title: '职位名称',
|
||||
minWidth: 150,
|
||||
showOverflow: 'tooltip' as const,
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
title: '岗位编码',
|
||||
title: '职位编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
@@ -149,8 +149,8 @@ const gridOptions: VxeGridProps<any> = {
|
||||
total: data.total,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('获取岗位列表失败:', error);
|
||||
message.error('获取岗位列表失败');
|
||||
console.error('获取职位列表失败:', error);
|
||||
message.error('获取职位列表失败');
|
||||
return {
|
||||
items: [],
|
||||
total: 0,
|
||||
@@ -169,10 +169,10 @@ const formOptions = computed(() => ({
|
||||
{
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入岗位名称',
|
||||
placeholder: '请输入职位名称',
|
||||
},
|
||||
fieldName: 'name',
|
||||
label: '岗位名称',
|
||||
label: '职位名称',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
@@ -197,25 +197,25 @@ function refreshTable() {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理添加岗位
|
||||
// 处理添加职位
|
||||
function handleAdd() {
|
||||
positionModalRef.value?.open(false);
|
||||
}
|
||||
|
||||
// 处理编辑岗位
|
||||
// 处理编辑职位
|
||||
function handleEdit(record: PositionVO.PositionInfoVO) {
|
||||
positionModalRef.value?.open(true, record);
|
||||
}
|
||||
|
||||
// 处理删除岗位
|
||||
// 处理删除职位
|
||||
async function handleDelete(record: PositionVO.PositionInfoVO) {
|
||||
try {
|
||||
await deletePositionApi(record.id);
|
||||
message.success('删除成功');
|
||||
refreshTable();
|
||||
} catch (error) {
|
||||
console.error('删除岗位失败:', error);
|
||||
message.error('删除岗位失败');
|
||||
console.error('删除职位失败:', error);
|
||||
message.error('删除职位失败');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,15 +229,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
gridOptions,
|
||||
formOptions: formOptions.value,
|
||||
showSearchForm: true,
|
||||
tableTitle: '岗位管理',
|
||||
tableTitle: '职位管理',
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page title="岗位管理" auto-content-height>
|
||||
<Page title="职位管理" auto-content-height>
|
||||
<template #description>
|
||||
<div class="text-foreground/80 mt-2">
|
||||
管理岗位信息,包括岗位名称、编码、所属部门和描述
|
||||
管理职位信息,包括职位名称、编码、所属部门和描述
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -248,7 +248,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<Space>
|
||||
<Button type="primary" @click="handleAdd">
|
||||
<PlusIcon />
|
||||
添加岗位
|
||||
添加职位
|
||||
</Button>
|
||||
</Space>
|
||||
</template>
|
||||
@@ -276,7 +276,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<Space>
|
||||
<Button size="small" @click="handleEdit(row)"> 编辑 </Button>
|
||||
<Popconfirm
|
||||
title="确定要删除这个岗位吗?"
|
||||
title="确定要删除这个职位吗?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<Button size="small" danger> 删除 </Button>
|
||||
@@ -285,7 +285,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
</template>
|
||||
</Grid>
|
||||
|
||||
<!-- 岗位模态框组件 -->
|
||||
<!-- 职位模态框组件 -->
|
||||
<PositionModal
|
||||
ref="positionModalRef"
|
||||
:department-options="departmentOptions"
|
||||
|
||||
Reference in New Issue
Block a user