File tree 2 files changed +58
-3
lines changed
src/api/system/organization
2 files changed +58
-3
lines changed Original file line number Diff line number Diff line change 1
1
import httpClient from '@/utils/axios'
2
2
import type { ApiResult } from '@/api/types'
3
- import type { SysOrganizationVO } from '@/api/system/organization/types'
3
+ import type { SysOrganizationDTO , SysOrganizationVO } from '@/api/system/organization/types'
4
4
5
- /** 查询组织机构列表 */
5
+ /**
6
+ * 查询组织机构列表
7
+ */
6
8
export function listOrganizations ( ) {
7
9
return httpClient . get < ApiResult < SysOrganizationVO [ ] > > ( '/system/organization/list' )
8
10
}
11
+
12
+ /**
13
+ * 新建组织
14
+ * @param data
15
+ */
16
+ export function createOrganization ( data : SysOrganizationDTO ) {
17
+ return httpClient . post < ApiResult < void > > ( '/system/organization' , data )
18
+ }
19
+
20
+ /**
21
+ * 修改组织
22
+ * @param data
23
+ */
24
+ export function updateOrganization ( data : SysOrganizationDTO ) {
25
+ return httpClient . put < ApiResult < void > > ( '/system/organization' , data )
26
+ }
27
+
28
+ /**
29
+ * 删除组织
30
+ * @param id 组织id
31
+ */
32
+ export function removeOrganization ( id : number ) {
33
+ return httpClient . delete < ApiResult < void > > ( `/system/organization/${ id } ` )
34
+ }
35
+
36
+ /**
37
+ * 修正组织机构层级
38
+ */
39
+ export function revisedOrganization ( ) {
40
+ return httpClient . patch < ApiResult < void > > ( '/system/organization/revised' )
41
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * 组织架构视图对象
3
+ */
1
4
export interface SysOrganizationVO {
2
5
id : number
3
6
// 组织名称
@@ -22,8 +25,27 @@ export interface SysOrganizationVO {
22
25
updateTime : string
23
26
}
24
27
28
+ /**
29
+ * 组织架构树
30
+ */
25
31
export interface SysOrganizationTree extends SysOrganizationVO {
26
- key : number
32
+ key ? : number
27
33
// 下级组织
28
34
children ?: SysOrganizationVO [ ]
29
35
}
36
+
37
+ /**
38
+ * 组织架构传输对象
39
+ */
40
+ export interface SysOrganizationDTO {
41
+ // 组织ID
42
+ id ?: number
43
+ // 组织名称
44
+ name : string
45
+ // 父级ID
46
+ parentId : number
47
+ // 备注
48
+ remarks : string
49
+ // 排序字段,由小到大
50
+ sort : number
51
+ }
You can’t perform that action at this time.
0 commit comments