From 337baf198fe85bcb140adf55f6358e53c3fb498d Mon Sep 17 00:00:00 2001 From: "WANGFAN\\wangf" <15871339963@163.com> Date: Sun, 30 Mar 2025 23:33:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/system/index.ts | 8 + src/mock/_data/system_data.ts | 4 +- src/mock/system/system.ts | 10 +- src/views/system/dictionary/dictionary.vue | 11 +- src/views/system/division/division.vue | 264 ++++++++++++++------- 5 files changed, 206 insertions(+), 91 deletions(-) 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 @@