feat: Add workplace api

This commit is contained in:
陈凯龙
2022-01-24 14:27:05 +08:00
parent 83327ea763
commit cb558f8af9
7 changed files with 354 additions and 133 deletions

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

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