fix(layout): add OptStore

This commit is contained in:
zhangheng
2026-02-24 16:23:48 +08:00
parent 52b1a627e1
commit ee635b3ee4
6 changed files with 175 additions and 2 deletions

View 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",
})
}

View 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
}
}