diff --git a/src/api/modules/system/index.ts b/src/api/modules/system/index.ts index e3677ac..d150472 100644 --- a/src/api/modules/system/index.ts +++ b/src/api/modules/system/index.ts @@ -15,3 +15,11 @@ export const getDictAPI = () => { method: "get" }); }; + +// 获取部门数据 +export const getDivisionAPI = () => { + return axios({ + url: "/mock/system/getDivision", + method: "get" + }); +}; diff --git a/src/mock/_data/system_data.ts b/src/mock/_data/system_data.ts index c0c214d..b07cb6e 100644 --- a/src/mock/_data/system_data.ts +++ b/src/mock/_data/system_data.ts @@ -18,13 +18,13 @@ export const divisionData = [ { id: "10001", parentId: "100", - name: "研发部门", + name: "华中总部", leader: "小唐", phone: "", email: "", sort: 1, status: 1, - description: "这里是研发部门", + description: "这里是华中总部", createBy: "admin", createTime: "2024-03-19 11:21:01", updateBy: "admin", diff --git a/src/mock/system/system.ts b/src/mock/system/system.ts index 468d00b..570e2d9 100644 --- a/src/mock/system/system.ts +++ b/src/mock/system/system.ts @@ -1,6 +1,6 @@ import type { MockMethod } from "vite-plugin-mock"; import { resultSuccess } from "../_utils"; -import { dictData } from "../_data/system_data"; +import { dictData, divisionData } from "../_data/system_data"; // post请求body,get请求query export default [ @@ -11,5 +11,13 @@ export default [ response: () => { return resultSuccess(dictData); } + }, + { + url: "/mock/system/getDivision", + method: "get", + timeout: 300, + response: () => { + return resultSuccess(divisionData); + } } ] as MockMethod[]; diff --git a/src/views/system/dictionary/dictionary.vue b/src/views/system/dictionary/dictionary.vue index 85cf590..2dcbdef 100644 --- a/src/views/system/dictionary/dictionary.vue +++ b/src/views/system/dictionary/dictionary.vue @@ -83,7 +83,7 @@
- + @@ -167,7 +167,7 @@
- + @@ -188,6 +188,7 @@