From 031dd032c44ada034f5b9e338d623dd736cf0306 Mon Sep 17 00:00:00 2001 From: hxr <1490493387@qq.com> Date: Fri, 6 Oct 2023 00:02:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20aPI=20=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=90=8D=E5=90=88=E7=90=86=E6=80=A7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 95e0f44edc317e1d237cc155afde3e61387dae44 --- src/api/dept/index.ts | 2 +- src/api/role/index.ts | 2 +- src/views/system/dept/index.vue | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/dept/index.ts b/src/api/dept/index.ts index 2d2cff4f..77e3973a 100644 --- a/src/api/dept/index.ts +++ b/src/api/dept/index.ts @@ -18,7 +18,7 @@ export function listDepts(queryParams?: DeptQuery): AxiosPromise { /** * 部门下拉列表 */ -export function listDeptOptions(): AxiosPromise<[]> { +export function getDeptOptions(): AxiosPromise<[]> { return request({ url: "/api/v1/dept/options", method: "get", diff --git a/src/api/role/index.ts b/src/api/role/index.ts index f5f93a52..fdbc65cd 100644 --- a/src/api/role/index.ts +++ b/src/api/role/index.ts @@ -22,7 +22,7 @@ export function getRolePage( * * @param queryParams */ -export function listRoleOptions( +export function getRoleOptions( queryParams?: RoleQuery ): AxiosPromise { return request({ diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 605512f5..ae5b85dd 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -4,7 +4,7 @@ import { deleteDept, updateDept, addDept, - listDeptOptions, + getDeptOptions, listDepts, } from "@/api/dept"; @@ -62,8 +62,8 @@ function handleSelectionChange(selection: any) { } /** 获取部门下拉数据 */ -async function getDeptOptions() { - listDeptOptions().then((response) => { +async function loadDeptOptions() { + getDeptOptions().then((response) => { deptOptions.value = [ { value: 0, @@ -81,7 +81,7 @@ async function getDeptOptions() { * @param deptId 部门ID */ async function openDialog(parentId?: number, deptId?: number) { - await getDeptOptions(); + await loadDeptOptions(); dialog.visible = true; if (deptId) { dialog.title = "修改部门";