feat: Add workplace api
This commit is contained in:
24
src/api/dashboard/workplace/index.ts
Normal file
24
src/api/dashboard/workplace/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useAxios } from '@/hooks/web/useAxios'
|
||||
import type { WorkplaceTotal, Project, Dynamic, Team, RadarData } from './types'
|
||||
|
||||
const { request } = useAxios()
|
||||
|
||||
export const getCountApi = () => {
|
||||
return request<WorkplaceTotal>({ url: '/workplace/total', method: 'get' })
|
||||
}
|
||||
|
||||
export const getProjectApi = () => {
|
||||
return request<Project[]>({ url: '/workplace/project', method: 'get' })
|
||||
}
|
||||
|
||||
export const getDynamicApi = () => {
|
||||
return request<Dynamic[]>({ url: '/workplace/dynamic', method: 'get' })
|
||||
}
|
||||
|
||||
export const getTeamApi = () => {
|
||||
return request<Team[]>({ url: '/workplace/team', method: 'get' })
|
||||
}
|
||||
|
||||
export const getRadarApi = () => {
|
||||
return request<RadarData[]>({ url: '/workplace/radar', method: 'get' })
|
||||
}
|
||||
30
src/api/dashboard/workplace/types.ts
Normal file
30
src/api/dashboard/workplace/types.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
export type WorkplaceTotal = {
|
||||
project: number
|
||||
access: number
|
||||
todo: number
|
||||
}
|
||||
|
||||
export type Project = {
|
||||
name: string
|
||||
icon: string
|
||||
message: string
|
||||
personal: string
|
||||
time: Date | number | string
|
||||
}
|
||||
|
||||
export type Dynamic = {
|
||||
keys: string[]
|
||||
time: Date | number | string
|
||||
}
|
||||
|
||||
export type Team = {
|
||||
name: string
|
||||
icon: string
|
||||
}
|
||||
|
||||
export type RadarData = {
|
||||
personal: number
|
||||
team: number
|
||||
max: number
|
||||
name: string
|
||||
}
|
||||
Reference in New Issue
Block a user