From 84adda022e8cd24767c9e1217814dba454ea2b77 Mon Sep 17 00:00:00 2001 From: zhangjf Date: Mon, 16 Feb 2026 09:40:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B2=97=E4=BD=8D=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=89=8D=E7=AB=AF=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端实现: - post.js: API接口封装(86行,8个接口) - getPostList(): 分页查询 - getPostListByDept(): 按部门查询 - getPostListEnabled(): 获取启用的岗位 - getPostById(): 查询详情 - createPost(): 创建岗位 - updatePost(): 更新岗位 - deletePost(): 删除岗位 - updatePostStatus(): 更新状态 - post.vue: 岗位管理页面(416行) - 搜索功能:岗位编码、名称、所属部门(树选择)、状态 - 表格展示:编码、名称、部门、职责、排序、状态、时间 - 状态开关:el-switch直接切换状态 - 新增/编辑对话框: * 岗位编码、名称(必填) * 所属部门(树选择器) * 岗位职责、岗位要求(多行文本) * 排序号、状态、备注 技术特点: - 部门树选择器(el-tree-select) - 状态开关(el-switch) - 表单验证(必填项) - 删除确认 模块状态:✅ 完整(前端+后端) --- fund-admin/src/api/post.js | 85 ++++++ fund-admin/src/views/system/post.vue | 415 +++++++++++++++++++++++++++ 2 files changed, 500 insertions(+) create mode 100644 fund-admin/src/api/post.js create mode 100644 fund-admin/src/views/system/post.vue diff --git a/fund-admin/src/api/post.js b/fund-admin/src/api/post.js new file mode 100644 index 0000000..262f354 --- /dev/null +++ b/fund-admin/src/api/post.js @@ -0,0 +1,85 @@ +import request from '../utils/request' + +/** + * 获取岗位列表(分页) + */ +export const getPostList = (params) => { + return request({ + url: '/sys/api/v1/post/list', + method: 'get', + params + }) +} + +/** + * 根据部门ID获取岗位列表 + */ +export const getPostListByDept = (deptId) => { + return request({ + url: `/sys/api/v1/post/list/dept/${deptId}`, + method: 'get' + }) +} + +/** + * 获取所有启用的岗位列表 + */ +export const getPostListEnabled = () => { + return request({ + url: '/sys/api/v1/post/list/enabled', + method: 'get' + }) +} + +/** + * 获取岗位详情 + */ +export const getPostById = (postId) => { + return request({ + url: `/sys/api/v1/post/${postId}`, + method: 'get' + }) +} + +/** + * 创建岗位 + */ +export const createPost = (data) => { + return request({ + url: '/sys/api/v1/post', + method: 'post', + data + }) +} + +/** + * 更新岗位 + */ +export const updatePost = (postId, data) => { + return request({ + url: `/sys/api/v1/post/${postId}`, + method: 'put', + data + }) +} + +/** + * 删除岗位 + */ +export const deletePost = (postId) => { + return request({ + url: `/sys/api/v1/post/${postId}`, + method: 'delete' + }) +} + +/** + * 更新岗位状态 + */ +export const updatePostStatus = (postId, status) => { + return request({ + url: `/sys/api/v1/post/${postId}/status`, + method: 'put', + params: { status } + }) +} diff --git a/fund-admin/src/views/system/post.vue b/fund-admin/src/views/system/post.vue new file mode 100644 index 0000000..5954e80 --- /dev/null +++ b/fund-admin/src/views/system/post.vue @@ -0,0 +1,415 @@ + + + + +