From bcd163a09389b3a3309c92501f840953df2b17d4 Mon Sep 17 00:00:00 2001 From: zhangjf Date: Sun, 15 Feb 2026 17:56:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 功能: - dept.js API文件:部门CRUD接口 - dept.vue 页面:树形表格展示部门层级 - 支持添加子部门、编辑、删除 - 上级部门选择(树形下拉) - 表单验证和错误处理 - 路由配置:/system/dept --- fund-admin/src/api/dept.js | 64 +++++++ fund-admin/src/router/index.js | 6 + fund-admin/src/views/system/dept.vue | 257 +++++++++++++++++++++++++++ 3 files changed, 327 insertions(+) create mode 100644 fund-admin/src/api/dept.js create mode 100644 fund-admin/src/views/system/dept.vue diff --git a/fund-admin/src/api/dept.js b/fund-admin/src/api/dept.js new file mode 100644 index 0000000..ce7ca4f --- /dev/null +++ b/fund-admin/src/api/dept.js @@ -0,0 +1,64 @@ +import request from '../utils/request' + +/** + * 获取部门树 + */ +export const getDeptTree = () => { + return request({ + url: '/sys/api/v1/dept/tree', + method: 'get' + }) +} + +/** + * 获取部门列表 + */ +export const getDeptList = (params) => { + return request({ + url: '/sys/api/v1/dept/list', + method: 'get', + params + }) +} + +/** + * 获取部门详情 + */ +export const getDeptById = (id) => { + return request({ + url: `/sys/api/v1/dept/${id}`, + method: 'get' + }) +} + +/** + * 创建部门 + */ +export const createDept = (data) => { + return request({ + url: '/sys/api/v1/dept', + method: 'post', + data + }) +} + +/** + * 更新部门 + */ +export const updateDept = (id, data) => { + return request({ + url: `/sys/api/v1/dept/${id}`, + method: 'put', + data + }) +} + +/** + * 删除部门 + */ +export const deleteDept = (id) => { + return request({ + url: `/sys/api/v1/dept/${id}`, + method: 'delete' + }) +} diff --git a/fund-admin/src/router/index.js b/fund-admin/src/router/index.js index d575d68..c71d81b 100644 --- a/fund-admin/src/router/index.js +++ b/fund-admin/src/router/index.js @@ -31,6 +31,12 @@ const routes = [ component: () => import('../views/system/user.vue'), meta: { title: '用户管理' } }, + { + path: 'dept', + name: 'Dept', + component: () => import('../views/system/dept.vue'), + meta: { title: '部门管理' } + }, { path: 'role', name: 'Role', diff --git a/fund-admin/src/views/system/dept.vue b/fund-admin/src/views/system/dept.vue new file mode 100644 index 0000000..35a96a7 --- /dev/null +++ b/fund-admin/src/views/system/dept.vue @@ -0,0 +1,257 @@ + + + + +