vue-element-plus-admin/mock/workplace/index.mock.ts

170 lines
3.8 KiB
TypeScript
Raw Normal View History

import { SUCCESS_CODE } from '@/constants'
2023-12-10 10:11:14 +08:00
const timeout = 1000
2022-01-24 14:27:05 +08:00
export default [
// 获取统计
{
2023-11-29 15:34:17 +08:00
url: '/mock/workplace/total',
2023-12-10 10:11:14 +08:00
method: 'get',
timeout,
response: () => {
2022-01-24 14:27:05 +08:00
return {
code: SUCCESS_CODE,
2022-01-24 14:27:05 +08:00
data: {
project: 40,
access: 2340,
todo: 10
2022-01-24 14:27:05 +08:00
}
}
}
},
// 获取项目
{
2023-11-29 15:34:17 +08:00
url: '/mock/workplace/project',
2023-12-10 10:11:14 +08:00
method: 'get',
timeout,
response: () => {
2022-01-24 14:27:05 +08:00
return {
code: SUCCESS_CODE,
data: [
{
name: 'Github',
icon: 'akar-icons:github-fill',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Vue',
icon: 'logos:vue',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Angular',
icon: 'logos:angular-icon',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'React',
icon: 'logos:react',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Webpack',
icon: 'logos:webpack',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Vite',
icon: 'vscode-icons:file-type-vite',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
}
]
2022-01-24 14:27:05 +08:00
}
}
},
// 获取动态
{
2023-11-29 15:34:17 +08:00
url: '/mock/workplace/dynamic',
2023-12-10 10:11:14 +08:00
method: 'get',
timeout,
response: () => {
2022-01-24 14:27:05 +08:00
return {
code: SUCCESS_CODE,
data: [
{
keys: ['workplace.push', 'Github'],
time: new Date()
},
{
keys: ['workplace.push', 'Github'],
time: new Date()
},
{
keys: ['workplace.push', 'Github'],
time: new Date()
},
{
keys: ['workplace.push', 'Github'],
time: new Date()
},
{
keys: ['workplace.push', 'Github'],
time: new Date()
},
{
keys: ['workplace.push', 'Github'],
time: new Date()
}
]
2022-01-24 14:27:05 +08:00
}
}
},
// 获取团队信息
{
2023-11-29 15:34:17 +08:00
url: '/mock/workplace/team',
2023-12-10 10:11:14 +08:00
method: 'get',
timeout,
response: () => {
2022-01-24 14:27:05 +08:00
return {
code: SUCCESS_CODE,
data: [
{
name: 'Github',
icon: 'akar-icons:github-fill'
},
{
name: 'Vue',
icon: 'logos:vue'
},
{
name: 'Angular',
icon: 'logos:angular-icon'
},
{
name: 'React',
icon: 'logos:react'
},
{
name: 'Webpack',
icon: 'logos:webpack'
},
{
name: 'Vite',
icon: 'vscode-icons:file-type-vite'
}
]
2022-01-24 14:27:05 +08:00
}
}
},
// 获取指数
{
2023-11-29 15:34:17 +08:00
url: '/mock/workplace/radar',
2023-12-10 10:11:14 +08:00
method: 'get',
timeout,
response: () => {
2022-01-24 14:27:05 +08:00
return {
code: SUCCESS_CODE,
data: [
{ name: 'workplace.quote', max: 65, personal: 42, team: 50 },
{ name: 'workplace.contribution', max: 160, personal: 30, team: 140 },
{ name: 'workplace.hot', max: 300, personal: 20, team: 28 },
{ name: 'workplace.yield', max: 130, personal: 35, team: 35 },
{ name: 'workplace.follow', max: 100, personal: 80, team: 90 }
]
2022-01-24 14:27:05 +08:00
}
}
}
2023-11-29 15:34:17 +08:00
]