11import { Result } from '@/request/Result'
22import type { Ref } from 'vue'
33import { get , post , del } from '@/request/index'
4- import type { WorkspaceItem , CreateWorkspaceMemberParamsItem , WorkspaceMemberItem } from '@/api/type/workspace'
4+ import type {
5+ WorkspaceItem ,
6+ CreateWorkspaceMemberParamsItem ,
7+ WorkspaceMemberItem ,
8+ } from '@/api/type/workspace'
59import type { pageRequest , PageList } from '@/api/type/common'
610
711const prefix = '/workspace'
812
913/**
1014 * 获取首页的工作空间下拉列表
1115 */
12- const getWorkspaceListByUser : ( loading ?: Ref < boolean > ) => Promise < Result < WorkspaceItem [ ] > > = ( loading ) => {
16+ const getWorkspaceListByUser : ( loading ?: Ref < boolean > ) => Promise < Result < WorkspaceItem [ ] > > = (
17+ loading ,
18+ ) => {
1319 return get ( '/workspace/by_user' , undefined , loading )
1420}
1521
1622/**
1723 * 获取添加成员时的工作空间下拉列表
1824 */
19- const getWorkspaceList : ( loading ?: Ref < boolean > ) => Promise < Result < Record < string , any > [ ] > > = ( loading ) => {
25+ const getWorkspaceList : ( loading ?: Ref < boolean > ) => Promise < Result < Record < string , any > [ ] > > = (
26+ loading ,
27+ ) => {
2028 return get ( '/workspace/current_user' , undefined , loading )
2129}
2230
2331/**
2432 * 获取工作空间列表
2533 */
26- const getSystemWorkspaceList : ( loading ?: Ref < boolean > ) => Promise < Result < WorkspaceItem [ ] > > = ( loading ) => {
34+ const getSystemWorkspaceList : ( loading ?: Ref < boolean > ) => Promise < Result < WorkspaceItem [ ] > > = (
35+ loading ,
36+ ) => {
2737 return get ( `${ prefix } ` , undefined , loading )
2838}
2939
30-
3140/**
3241 * 获取工作空间成员列表
3342 */
@@ -47,14 +56,11 @@ const getWorkspaceMemberList: (
4756/**
4857 * 获取工作空间全部成员列表
4958 */
50- const getAllMemberList : (
51- workspace_id : string ,
52- loading ?: Ref < boolean > ,
53- ) => Promise < Result < any [ ] > > = ( workspace_id , loading ) => {
54- return get (
55- `${ prefix } /${ workspace_id } /user_list` ,
56- loading ,
57- )
59+ const getAllMemberList : ( workspace_id : string , loading ?: Ref < boolean > ) => Promise < Result < any [ ] > > = (
60+ workspace_id ,
61+ loading ,
62+ ) => {
63+ return get ( `${ prefix } /${ workspace_id } /user_list` , undefined , loading )
5864}
5965
6066/**
@@ -71,18 +77,20 @@ const CreateWorkspaceMember: (
7177/**
7278 * 删除工作空间成员
7379 */
74- const deleteWorkspaceMember : ( workspace_id : string , user_relation_id : string , loading ?: Ref < boolean > ) => Promise < Result < any > > = (
75- workspace_id ,
76- user_relation_id ,
77- loading ,
78- ) => {
80+ const deleteWorkspaceMember : (
81+ workspace_id : string ,
82+ user_relation_id : string ,
83+ loading ?: Ref < boolean > ,
84+ ) => Promise < Result < any > > = ( workspace_id , user_relation_id , loading ) => {
7985 return post ( `${ prefix } /${ workspace_id } /remove_member/${ user_relation_id } ` , undefined , { } , loading )
8086}
8187
8288/**
8389 * 获取添加成员时的角色下拉列表
8490 */
85- const getWorkspaceRoleList : ( loading ?: Ref < boolean > ) => Promise < Result < Record < string , any > [ ] > > = ( loading ) => {
91+ const getWorkspaceRoleList : ( loading ?: Ref < boolean > ) => Promise < Result < Record < string , any > [ ] > > = (
92+ loading ,
93+ ) => {
8694 return get ( '/role_list/current_user' , undefined , loading )
8795}
8896
0 commit comments