huibing.xie | 1f1606f | 2018-08-20 15:46:55 +0800 | [diff] [blame] | 1 | // import Mock from 'mockjs' |
| 2 | import { param2Obj } from '@/utils' |
| 3 | |
| 4 | const deptList = [{ |
| 5 | 'id': '1', |
| 6 | 'type': 'lbm', |
| 7 | 'name': '院系' |
| 8 | }, |
| 9 | { |
| 10 | 'id': '2', |
| 11 | 'type': 'lbm', |
| 12 | 'name': '部门' |
| 13 | }, |
| 14 | { |
| 15 | 'id': '3', |
| 16 | 'type': 'gjzybz', |
| 17 | 'name': '文学' |
| 18 | }, |
| 19 | { |
| 20 | 'id': '4', |
| 21 | 'type': 'gjzybz', |
| 22 | 'name': '物理' |
| 23 | }, |
| 24 | { |
| 25 | 'id': '5', |
| 26 | 'type': 'gjzybz', |
| 27 | 'name': '数学' |
| 28 | }, |
| 29 | { |
| 30 | 'id': '6', |
| 31 | 'type': 'nj', |
| 32 | 'name': '2017' |
| 33 | }, |
| 34 | { |
| 35 | 'id': '7', |
| 36 | 'type': 'nj', |
| 37 | 'name': '2018' |
| 38 | }, |
| 39 | { |
| 40 | 'id': '8', |
| 41 | 'type': 'nj', |
| 42 | 'name': '2019' |
| 43 | }, |
| 44 | { |
| 45 | 'id': '9', |
| 46 | 'type': 'zzmm', |
| 47 | 'name': '党员' |
| 48 | }, |
| 49 | { |
| 50 | 'id': '10', |
| 51 | 'type': 'zzmm', |
| 52 | 'name': '群众' |
| 53 | }, |
| 54 | { |
| 55 | 'id': '11', |
| 56 | 'type': 'xb', |
| 57 | 'name': '男' |
| 58 | }, |
| 59 | { |
| 60 | 'id': '12', |
| 61 | 'type': 'xb', |
| 62 | 'name': '女' |
| 63 | }, |
| 64 | { |
| 65 | 'id': '13', |
| 66 | 'type': 'xswz', |
| 67 | 'name': '置顶' |
| 68 | }, |
| 69 | { |
| 70 | 'id': '14', |
| 71 | 'type': 'xswz', |
| 72 | 'name': '其他' |
| 73 | }, |
| 74 | { |
| 75 | 'id': '15', |
| 76 | 'type': 'gglx', |
| 77 | 'name': '离校公告' |
| 78 | }, |
| 79 | { |
| 80 | 'id': '16', |
| 81 | 'type': 'jszlx', |
| 82 | 'name': '所有人' |
| 83 | }, |
| 84 | { |
| 85 | 'id': '17', |
| 86 | 'type': 'jszlx', |
| 87 | 'name': '所有学生' |
| 88 | }, |
| 89 | { |
| 90 | 'id': '18', |
| 91 | 'type': 'jszlx', |
| 92 | 'name': '所有教职工' |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 93 | }, |
| 94 | { |
| 95 | 'id': '19', |
| 96 | 'type': 'xslb', |
| 97 | 'name': '本专科生' |
| 98 | }, |
| 99 | { |
| 100 | 'id': '20', |
| 101 | 'type': 'xslb', |
| 102 | 'name': '研究生' |
Horace | cc75859 | 2018-08-23 17:40:39 +0800 | [diff] [blame] | 103 | }, |
| 104 | { |
| 105 | 'id': '21', |
| 106 | 'type': 'scope', |
| 107 | 'name': '辅导员范围' |
| 108 | }, |
| 109 | { |
| 110 | 'id': '22', |
| 111 | 'type': 'defaultAuditStatus', |
| 112 | 'name': '待审核' |
| 113 | }, |
| 114 | { |
| 115 | 'id': '23', |
| 116 | 'type': 'defaultAuditStatus', |
| 117 | 'name': '审核通过' |
| 118 | }, |
| 119 | { |
| 120 | 'id': '24', |
| 121 | 'type': 'defaultAuditStatus', |
| 122 | 'name': '审核不通过' |
| 123 | }, |
| 124 | { |
| 125 | 'id': '25', |
| 126 | 'type': 'auditType', |
| 127 | 'name': '手动' |
| 128 | }, |
| 129 | { |
| 130 | 'id': '26', |
| 131 | 'type': 'auditType', |
| 132 | 'name': '自动' |
| 133 | }, |
| 134 | { |
| 135 | 'id': '27', |
| 136 | 'type': 'scope', |
| 137 | 'name': '全校范围' |
| 138 | }, |
| 139 | { |
| 140 | 'id': '28', |
| 141 | 'type': 'scope', |
| 142 | 'name': '院系范围' |
huibing.xie | 1f1606f | 2018-08-20 15:46:55 +0800 | [diff] [blame] | 143 | }] |
| 144 | |
| 145 | export default{ |
| 146 | getDicList: config => { |
| 147 | const { type } = param2Obj(config.url) |
| 148 | const mockList = deptList.filter(item => { |
| 149 | if (type && item.type !== type) return false |
| 150 | return true |
| 151 | }) |
| 152 | |
| 153 | return { |
| 154 | items: mockList, |
| 155 | code: 200 |
| 156 | } |
| 157 | } |
| 158 | } |