From f1ad01c807061f50e8afaaf68054b884dc578563 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 21 Mar 2026 11:42:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=89=B9=E9=87=8F=E4=BF=9D=E5=AD=98=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/dept.ts | 11 ++++++- src/types/api/system/dept.ts | 8 +++++ src/views/system/dept/index.vue | 55 +++++++++++++++++++++++++++++++-- 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 17d4807..eddb9ff 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -1,5 +1,5 @@ import request from '@/utils/request' -import type { DeptQueryParams, SysDept, AjaxResult } from '@/types' +import type { DeptQueryParams, SysDept, DeptSortParams, AjaxResult } from '@/types' // 查询部门列表 export function listDept(query?: DeptQueryParams): Promise> { @@ -44,6 +44,15 @@ export function updateDept(data: SysDept): Promise { }) } +// 保存部门排序 +export function updateDeptSort(data: DeptSortParams): Promise { + return request({ + url: '/system/dept/updateSort', + method: 'put', + data: data + }) +} + // 删除部门 export function delDept(deptId: number): Promise { return request({ diff --git a/src/types/api/system/dept.ts b/src/types/api/system/dept.ts index ff29ba5..af6eb1a 100644 --- a/src/types/api/system/dept.ts +++ b/src/types/api/system/dept.ts @@ -8,6 +8,12 @@ export interface DeptQueryParams { status?: string; } +/** 保存部门排序参数 */ +export interface DeptSortParams { + deptIds: string + orderNums: string +} + /** 部门信息 */ export interface SysDept extends BaseEntity { /** 部门编号 */ @@ -28,4 +34,6 @@ export interface SysDept extends BaseEntity { email?: string; /** 状态(0正常 1停用) */ status?: '0' | '1'; + /** 子部门 */ + children?: SysDept[]; } diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 36578b6..63aa50e 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -36,6 +36,15 @@ v-hasPermi="['system:dept:add']" >新增 + + 保存排序 + - + + +