_mock.ts 6.98 KB
Newer Older
afc163's avatar
afc163 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
const titles = [
  'Alipay',
  'Angular',
  'Ant Design',
  'Ant Design Pro',
  'Bootstrap',
  'React',
  'Vue',
  'Webpack',
];
const avatars = [
  'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', // Alipay
  'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', // Angular
  'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', // Ant Design
  'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', // Ant Design Pro
  'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png', // Bootstrap
  'https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png', // React
  'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png', // Vue
  'https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png', // Webpack
];
afc163's avatar
afc163 committed
21 22

const avatars2 = [
afc163's avatar
afc163 committed
23 24 25 26 27 28 29 30 31 32
  'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
  'https://gw.alipayobjects.com/zos/rmsportal/cnrhVkzwxjPwAaCfPbdc.png',
  'https://gw.alipayobjects.com/zos/rmsportal/gaOngJwsRYRaVAuXXcmB.png',
  'https://gw.alipayobjects.com/zos/rmsportal/ubnKSIfAJTxIgXOKlciN.png',
  'https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png',
  'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
  'https://gw.alipayobjects.com/zos/rmsportal/psOgztMplJMGpVEqfcgF.png',
  'https://gw.alipayobjects.com/zos/rmsportal/ZpBqSxLxVEXfcUNoPKrz.png',
  'https://gw.alipayobjects.com/zos/rmsportal/laiEnJdGHVOhJrUShBaJ.png',
  'https://gw.alipayobjects.com/zos/rmsportal/UrQsqscbKEpNuJcvBZBu.png',
afc163's avatar
afc163 committed
33 34
];

愚道's avatar
愚道 committed
35
const getNotice = [
36 37
  {
    id: 'xxx1',
afc163's avatar
afc163 committed
38 39
    title: titles[0],
    logo: avatars[0],
afc163's avatar
afc163 committed
40
    description: '那是一种内在的东西,他们到达不了,也无法触及的',
41
    updatedAt: new Date(),
niko's avatar
niko committed
42
    member: '科学搬砖组',
ddcat1115's avatar
ddcat1115 committed
43 44
    href: '',
    memberLink: '',
45 46 47
  },
  {
    id: 'xxx2',
afc163's avatar
afc163 committed
48 49
    title: titles[1],
    logo: avatars[1],
niko's avatar
niko committed
50
    description: '希望是一个好东西,也许是最好的,好东西是不会消亡的',
afc163's avatar
afc163 committed
51
    updatedAt: new Date('2017-07-24'),
niko's avatar
niko committed
52
    member: '全组都是吴彦祖',
ddcat1115's avatar
ddcat1115 committed
53 54
    href: '',
    memberLink: '',
55 56 57
  },
  {
    id: 'xxx3',
afc163's avatar
afc163 committed
58 59
    title: titles[2],
    logo: avatars[2],
niko's avatar
niko committed
60
    description: '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆',
61
    updatedAt: new Date(),
niko's avatar
niko committed
62
    member: '中二少女团',
ddcat1115's avatar
ddcat1115 committed
63 64
    href: '',
    memberLink: '',
65 66 67
  },
  {
    id: 'xxx4',
afc163's avatar
afc163 committed
68 69
    title: titles[3],
    logo: avatars[3],
niko's avatar
niko committed
70
    description: '那时候我只会想自己想要什么,从不想自己拥有什么',
afc163's avatar
afc163 committed
71
    updatedAt: new Date('2017-07-23'),
niko's avatar
niko committed
72
    member: '程序员日常',
ddcat1115's avatar
ddcat1115 committed
73 74
    href: '',
    memberLink: '',
75 76 77
  },
  {
    id: 'xxx5',
afc163's avatar
afc163 committed
78 79
    title: titles[4],
    logo: avatars[4],
niko's avatar
niko committed
80
    description: '凛冬将至',
afc163's avatar
afc163 committed
81
    updatedAt: new Date('2017-07-23'),
niko's avatar
niko committed
82
    member: '高逼格设计天团',
ddcat1115's avatar
ddcat1115 committed
83 84
    href: '',
    memberLink: '',
85 86 87
  },
  {
    id: 'xxx6',
afc163's avatar
afc163 committed
88 89
    title: titles[5],
    logo: avatars[5],
niko's avatar
niko committed
90
    description: '生命就像一盒巧克力,结果往往出人意料',
afc163's avatar
afc163 committed
91
    updatedAt: new Date('2017-07-23'),
niko's avatar
niko committed
92
    member: '骗你来学计算机',
ddcat1115's avatar
ddcat1115 committed
93 94
    href: '',
    memberLink: '',
95 96 97
  },
];

愚道's avatar
愚道 committed
98
const getActivities = [
99 100 101 102
  {
    id: 'trend-1',
    updatedAt: new Date(),
    user: {
afc163's avatar
afc163 committed
103
      name: '曲丽丽',
afc163's avatar
afc163 committed
104
      avatar: avatars2[0],
105
    },
afc163's avatar
afc163 committed
106 107 108 109 110 111 112 113 114
    group: {
      name: '高逼格设计天团',
      link: 'http://github.com/',
    },
    project: {
      name: '六月迭代',
      link: 'http://github.com/',
    },
    template: '在 @{group} 新建项目 @{project}',
115 116 117 118 119
  },
  {
    id: 'trend-2',
    updatedAt: new Date(),
    user: {
niko's avatar
niko committed
120
      name: '付小小',
afc163's avatar
afc163 committed
121
      avatar: avatars2[1],
122
    },
afc163's avatar
afc163 committed
123 124 125 126 127 128 129 130 131
    group: {
      name: '高逼格设计天团',
      link: 'http://github.com/',
    },
    project: {
      name: '六月迭代',
      link: 'http://github.com/',
    },
    template: '在 @{group} 新建项目 @{project}',
132 133 134 135 136
  },
  {
    id: 'trend-3',
    updatedAt: new Date(),
    user: {
afc163's avatar
afc163 committed
137
      name: '林东东',
afc163's avatar
afc163 committed
138
      avatar: avatars2[2],
139
    },
afc163's avatar
afc163 committed
140 141 142 143 144 145 146 147 148
    group: {
      name: '中二少女团',
      link: 'http://github.com/',
    },
    project: {
      name: '六月迭代',
      link: 'http://github.com/',
    },
    template: '在 @{group} 新建项目 @{project}',
149 150 151 152 153
  },
  {
    id: 'trend-4',
    updatedAt: new Date(),
    user: {
niko's avatar
niko committed
154
      name: '周星星',
afc163's avatar
afc163 committed
155
      avatar: avatars2[4],
156
    },
afc163's avatar
afc163 committed
157 158 159 160 161
    project: {
      name: '5 月日常迭代',
      link: 'http://github.com/',
    },
    template: '将 @{project} 更新至已发布状态',
162 163 164 165 166
  },
  {
    id: 'trend-5',
    updatedAt: new Date(),
    user: {
niko's avatar
niko committed
167
      name: '朱偏右',
afc163's avatar
afc163 committed
168
      avatar: avatars2[3],
169
    },
afc163's avatar
afc163 committed
170 171 172 173 174 175 176 177 178
    project: {
      name: '工程效能',
      link: 'http://github.com/',
    },
    comment: {
      name: '留言',
      link: 'http://github.com/',
    },
    template: '在 @{project} 发布了 @{comment}',
179 180 181 182 183
  },
  {
    id: 'trend-6',
    updatedAt: new Date(),
    user: {
niko's avatar
niko committed
184
      name: '乐哥',
afc163's avatar
afc163 committed
185
      avatar: avatars2[5],
186
    },
afc163's avatar
afc163 committed
187 188 189 190 191 192 193 194 195
    group: {
      name: '程序员日常',
      link: 'http://github.com/',
    },
    project: {
      name: '品牌迭代',
      link: 'http://github.com/',
    },
    template: '在 @{group} 新建项目 @{project}',
196 197 198
  },
];

199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
const radarOriginData = [
  {
    name: '个人',
    ref: 10,
    koubei: 8,
    output: 4,
    contribute: 5,
    hot: 7,
  },
  {
    name: '团队',
    ref: 3,
    koubei: 9,
    output: 6,
    contribute: 3,
    hot: 1,
  },
  {
    name: '部门',
    ref: 4,
    koubei: 1,
    output: 6,
    contribute: 5,
    hot: 7,
  },
];

const radarData = [];
const radarTitleMap = {
  ref: '引用',
  koubei: '口碑',
  output: '产量',
  contribute: '贡献',
  hot: '热度',
};
radarOriginData.forEach(item => {
  Object.keys(item).forEach(key => {
    if (key !== 'name') {
      radarData.push({
        name: item.name,
        label: radarTitleMap[key],
        value: item[key],
      });
    }
  });
});
245

246
export default {
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
  'GET /api/BLOCK_NAME/project/notice': getNotice,
  'GET /api/BLOCK_NAME/activities': getActivities,
  'GET /api/BLOCK_NAME/fake_chart_data': {
    radarData,
  },

  'GET /api/BLOCK_NAME/currentUser': {
    name: 'Serati Ma',
    avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
    userid: '00000001',
    email: 'antdesign@alipay.com',
    signature: '海纳百川,有容乃大',
    title: '交互专家',
    group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
    tags: [
      {
        key: '0',
        label: '很有想法的',
      },
      {
        key: '1',
        label: '专注设计',
      },
      {
        key: '2',
        label: '辣~',
      },
      {
        key: '3',
        label: '大长腿',
      },
      {
        key: '4',
        label: '川妹子',
      },
      {
        key: '5',
        label: '海纳百川',
      },
    ],
    notifyCount: 12,
    unreadCount: 11,
    country: 'China',
    geographic: {
      province: {
        label: '浙江省',
        key: '330000',
      },
      city: {
        label: '杭州市',
        key: '330100',
      },
    },
    address: '西湖区工专路 77 号',
    phone: '0752-268888888',
愚道's avatar
愚道 committed
302
  },
303
};