陈帅 6 лет назад
Родитель
Сommit
2f25e590f9
2 измененных файлов с 89 добавлено и 5 удалено
  1. 84 0
      lambda/mock/index.js
  2. 5 5
      scripts/fetch-blocks.js

+ 84 - 0
lambda/mock/index.js

@@ -3996,6 +3996,90 @@
       signature: '海纳百川,有容乃大',
       title: '交互专家',
       group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
+      notices: [{
+        id: '000000001',
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
+        title: '你收到了 14 份新周报',
+        datetime: '2017-08-09',
+        type: 'notification'
+      }, {
+        id: '000000002',
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
+        title: '你推荐的 曲妮妮 已通过第三轮面试',
+        datetime: '2017-08-08',
+        type: 'notification'
+      }, {
+        id: '000000003',
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png',
+        title: '这种模板可以区分多种通知类型',
+        datetime: '2017-08-07',
+        read: true,
+        type: 'notification'
+      }, {
+        id: '000000004',
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png',
+        title: '左侧图标用于区分不同的类型',
+        datetime: '2017-08-07',
+        type: 'notification'
+      }, {
+        id: '000000005',
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
+        title: '内容不要超过两行字,超出时自动截断',
+        datetime: '2017-08-07',
+        type: 'notification'
+      }, {
+        id: '000000006',
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
+        title: '曲丽丽 评论了你',
+        description: '描述信息描述信息描述信息',
+        datetime: '2017-08-07',
+        type: 'message',
+        clickClose: true
+      }, {
+        id: '000000007',
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
+        title: '朱偏右 回复了你',
+        description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
+        datetime: '2017-08-07',
+        type: 'message',
+        clickClose: true
+      }, {
+        id: '000000008',
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
+        title: '标题',
+        description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
+        datetime: '2017-08-07',
+        type: 'message',
+        clickClose: true
+      }, {
+        id: '000000009',
+        title: '任务名称',
+        description: '任务需要在 2017-01-12 20:00 前启动',
+        extra: '未开始',
+        status: 'todo',
+        type: 'event'
+      }, {
+        id: '000000010',
+        title: '第三方紧急代码变更',
+        description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
+        extra: '马上到期',
+        status: 'urgent',
+        type: 'event'
+      }, {
+        id: '000000011',
+        title: '信息安全考试',
+        description: '指派竹尔于 2017-01-09 前完成更新并发布',
+        extra: '已耗时 8 天',
+        status: 'doing',
+        type: 'event'
+      }, {
+        id: '000000012',
+        title: 'ABCD 版本发布',
+        description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
+        extra: '进行中',
+        status: 'processing',
+        type: 'event'
+      }],
       tags: [{
         key: '0',
         label: '很有想法的'

+ 5 - 5
scripts/fetch-blocks.js

@@ -94,7 +94,7 @@ const installBlock = async () => {
       console.log('install ' + chalk.green(item.name) + ' to: ' + chalk.yellow(item.path));
       gitFiles = gitFiles.filter(file => file.path !== gitPath);
       const skipModifyRouter = item.routes ? '--skip-modify-routes' : '';
-      const cmd = `umi block add https://github.com/ant-design/pro-blocks/tree/master/${gitPath}   --path=${
+      const cmd = `umi block add https://github.com/ant-design/pro-blocks/tree/master/${gitPath}  --path=${
         item.path
       } ${skipModifyRouter}`;
       try {
@@ -123,7 +123,7 @@ const installBlock = async () => {
   // 安装 router 中没有的剩余区块.
   installGitFile(0);
 };
-installBlock();
-
-// 插入 pro 需要的演示代码
-insertCode();
+installBlock().then(() => {
+  // 插入 pro 需要的演示代码
+  insertCode();
+});