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 @@ + + + + + + 部门管理 + 新增部门 + + + + + + + + + + + + + + {{ scope.row.status === 1 ? '启用' : '禁用' }} + + + + + + 添加子部门 + 编辑 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确定 + + + + + + + +