diff --git a/src/apis/system/dept.ts b/src/apis/system/dept.ts new file mode 100644 index 0000000..873babf --- /dev/null +++ b/src/apis/system/dept.ts @@ -0,0 +1,29 @@ +import http from '@/utils/http' +import type * as System from './type' + +const BASE_URL = '/system/dept' + +/** @desc 查询部门列表 */ +export function listDept(query: System.DeptQuery) { + return http.get(`${BASE_URL}/tree`, query) +} + +/** @desc 查询部门详情 */ +export function getDept(id: string) { + return http.get(`${BASE_URL}/${id}`) +} + +/** @desc 新增部门 */ +export function addDept(data: any) { + return http.post(`${BASE_URL}`, data) +} + +/** @desc 修改部门 */ +export function updateDept(data: any, id: string) { + return http.put(`${BASE_URL}/${id}`, data) +} + +/** @desc 删除部门 */ +export function deleteDept(id: string) { + return http.del(`${BASE_URL}/${id}`) +} diff --git a/src/apis/system/index.ts b/src/apis/system/index.ts index 1f9f80b..5a39b44 100644 --- a/src/apis/system/index.ts +++ b/src/apis/system/index.ts @@ -1 +1,2 @@ +export * from './dept' export * from './log' diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 536c2f8..46ed7aa 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -1,3 +1,24 @@ +/** 系统部门类型 */ +export interface DeptResp { + id: string + name: string + sort: number + status: 1 | 2 + isSystem: boolean + description: string + createUserString: string + createTime: string + updateUserString: string + updateTime: string + parentId: string + children: DeptResp[] +} +export interface DeptQuery { + description?: string + status?: number + sort?: Array +} + /** 系统日志类型 */ export interface LogResp { id: string diff --git a/src/types/components.d.ts b/src/types/components.d.ts index 12f41e2..a006fce 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -37,5 +37,6 @@ declare module 'vue' { ParentView: typeof import('./../components/ParentView/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + TextCopy: typeof import('./../components/TextCopy/index.vue')['default'] } } diff --git a/src/views/system/dept/AddDeptModal.vue b/src/views/system/dept/AddDeptModal.vue new file mode 100644 index 0000000..72d4f2b --- /dev/null +++ b/src/views/system/dept/AddDeptModal.vue @@ -0,0 +1,151 @@ + + + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue new file mode 100644 index 0000000..aebe163 --- /dev/null +++ b/src/views/system/dept/index.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/src/views/system/dept/type.ts b/src/views/system/dept/type.ts new file mode 100644 index 0000000..50cb7c2 --- /dev/null +++ b/src/views/system/dept/type.ts @@ -0,0 +1,7 @@ +export interface DeptReq { + parentId: string + name: string + sort: number + description: string + status: 1 | 2 +}