shengxuefei 4 年之前
父节点
当前提交
35a246155f

+ 32 - 0
vue-antd-admin/src/mock/common/activityData.js

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

+ 118 - 0
vue-antd-admin/src/mock/common/tableData.js

@@ -0,0 +1,118 @@
+const operation1 = [
+  {
+    key: 'op1',
+    type: '订购关系生效',
+    name: '曲丽丽',
+    status: 'agree',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '-'
+  },
+  {
+    key: 'op2',
+    type: '财务复审',
+    name: '付小小',
+    status: 'reject',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '不通过原因'
+  },
+  {
+    key: 'op3',
+    type: '部门初审',
+    name: '周毛毛',
+    status: 'agree',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '-'
+  },
+  {
+    key: 'op4',
+    type: '提交订单',
+    name: '林东东',
+    status: 'agree',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '很棒'
+  },
+  {
+    key: 'op5',
+    type: '创建订单',
+    name: '汗牙牙',
+    status: 'agree',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '-'
+  }
+]
+
+const operation2 = [
+  {
+    key: 'op2',
+    type: '财务复审',
+    name: '付小小',
+    status: 'reject',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '不通过原因'
+  },
+  {
+    key: 'op3',
+    type: '部门初审',
+    name: '周毛毛',
+    status: 'agree',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '-'
+  },
+  {
+    key: 'op4',
+    type: '提交订单',
+    name: '林东东',
+    status: 'agree',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '很棒'
+  }
+]
+
+const operation3 = [
+  {
+    key: 'op2',
+    type: '财务复审',
+    name: '付小小',
+    status: 'reject',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '不通过原因'
+  },
+  {
+    key: 'op3',
+    type: '部门初审',
+    name: '周毛毛',
+    status: 'agree',
+    updatedAt: '2017-10-03  19:23:12',
+    memo: '-'
+  }
+]
+
+const operationColumns = [
+  {
+    title: '操作类型',
+    dataIndex: 'type',
+    key: 'type'
+  },
+  {
+    title: '操作人',
+    dataIndex: 'name',
+    key: 'name'
+  },
+  {
+    title: '执行结果',
+    dataIndex: 'status',
+    key: 'status'
+  },
+  {
+    title: '操作时间',
+    dataIndex: 'updatedAt',
+    key: 'updatedAt'
+  },
+  {
+    title: '备注',
+    dataIndex: 'memo',
+    key: 'memo'
+  }
+]
+
+export {operation1, operation2, operation3, operationColumns}

+ 11 - 0
vue-antd-admin/src/mock/user/current.js

@@ -0,0 +1,11 @@
+import Mock from 'mockjs'
+import '@/mock/extend'
+
+const welcome = Mock.mock({
+  timeFix: '@TIMEFIX',
+  message: '@WELCOME'
+})
+
+Mock.mock('/user/welcome', 'get', () => {
+  return welcome
+})

+ 12 - 0
vue-antd-admin/src/services/dataSource.js

@@ -0,0 +1,12 @@
+import {GOODS, GOODS_COLUMNS} from './api'
+import {METHOD, request} from '@/utils/request'
+
+export async function goodsList(params) {
+  return request(GOODS, METHOD.GET, params)
+}
+
+export async function goodsColumns() {
+  return request(GOODS_COLUMNS, METHOD.GET)
+}
+
+export default {goodsList, goodsColumns}