feat: add Mock Data for Workplace page
This commit is contained in:
32
src/mock/common/activityData.js
Normal file
32
src/mock/common/activityData.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import {users, groups} from './index'
|
||||
|
||||
const events = [
|
||||
{
|
||||
type: 0,
|
||||
event: '八月迭代'
|
||||
},
|
||||
{
|
||||
type: 1,
|
||||
event: '留言'
|
||||
},
|
||||
{
|
||||
type: 2,
|
||||
event: '项目进展'
|
||||
}
|
||||
]
|
||||
|
||||
const activities = users.map((user, index) => {
|
||||
return {
|
||||
user: Object.assign({}, user, {group: groups[user.groupId]}),
|
||||
activity: events[index % events.length],
|
||||
template: ''
|
||||
}
|
||||
})
|
||||
|
||||
const templates = [
|
||||
(user, activity) => { return `${user.name} 在 <a >${user.group}</a> 新建项目 <a>${activity.event}</a>` },
|
||||
(user, activity) => { return `${user.name} 在 <a >${user.group}</a> 发布了 <a>${activity.event}</a>` },
|
||||
(user, activity) => { return `${user.name} 将 <a >${activity.event}</a> 更新至已发布状态` }
|
||||
]
|
||||
|
||||
export {activities, templates}
|
||||
@@ -31,4 +31,46 @@ const logos = [
|
||||
|
||||
const admins = ['ICZER', 'JACK', 'LUIS', 'DAVID']
|
||||
|
||||
export {logos, sayings, positions, avatars, admins}
|
||||
const groups = ['高逼格设计天团', '中二少女团', '科学搬砖组', '骗你学计算机', '程序员日常']
|
||||
|
||||
const users = [
|
||||
{
|
||||
name: '曲丽丽',
|
||||
avatar: avatars[0],
|
||||
groupId: 0
|
||||
},
|
||||
{
|
||||
name: '付晓晓',
|
||||
avatar: avatars[1],
|
||||
groupId: 0
|
||||
},
|
||||
{
|
||||
name: '林东东',
|
||||
avatar: avatars[2],
|
||||
groupId: 1
|
||||
},
|
||||
{
|
||||
name: '周星星',
|
||||
avatar: avatars[3],
|
||||
groupId: 2
|
||||
},
|
||||
{
|
||||
name: '朱偏右',
|
||||
avatar: avatars[4],
|
||||
groupId: 3
|
||||
},
|
||||
{
|
||||
name: '勒个',
|
||||
avatar: avatars[5],
|
||||
groupId: 4
|
||||
}
|
||||
]
|
||||
|
||||
const teams = groups.map((item, index) => {
|
||||
return {
|
||||
name: item,
|
||||
avatar: avatars[index]
|
||||
}
|
||||
})
|
||||
|
||||
export {logos, sayings, positions, avatars, admins, groups, users, teams}
|
||||
|
||||
Reference in New Issue
Block a user