fix(layout): add OptStore
This commit is contained in:
32
components/label/api/user/index.ts
Normal file
32
components/label/api/user/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import httpFetch from "@/api/fetch"
|
||||
import { BASE_LABEL_API } from "../const"
|
||||
import { Organization } from "./typing"
|
||||
|
||||
// 获取用户组织树
|
||||
export const getUserGroupTree = () => {
|
||||
return httpFetch<Organization.Response[]>({
|
||||
url: "/api/v1/label_server/user/group/tree",
|
||||
method: "GET",
|
||||
})
|
||||
}
|
||||
|
||||
/* ****************************** Options ****************************** */
|
||||
interface Option {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
// 获取所有用户组
|
||||
export const getUserGroupAll = () => {
|
||||
return httpFetch<Array<Option>>({
|
||||
url: BASE_LABEL_API + `/api/v1/label_server/user/group/all`,
|
||||
method: "GET",
|
||||
})
|
||||
}
|
||||
|
||||
// 获取所有用户
|
||||
export const getUserAll = () => {
|
||||
return httpFetch<Array<Option>>({
|
||||
url: BASE_LABEL_API + "/api/v1/label_server/user/all",
|
||||
method: "GET",
|
||||
})
|
||||
}
|
||||
21
components/label/api/user/typing.ts
Normal file
21
components/label/api/user/typing.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export namespace Organization {
|
||||
interface Member {
|
||||
base_city: string
|
||||
id: number
|
||||
name: string
|
||||
work_status: number
|
||||
}
|
||||
|
||||
export interface Response {
|
||||
children?: Response[]
|
||||
create_at?: string
|
||||
create_user?: string
|
||||
group_uuid: string
|
||||
leader_uid?: number
|
||||
leader_name?: string
|
||||
members?: Member[]
|
||||
name: string
|
||||
parent_group_uuid: string
|
||||
[key: string]: boolean | string | number | Response[] | Member[] | undefined
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user