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': '所有教职工' | ||||
93 | }] | ||||
94 | |||||
95 | export default{ | ||||
96 | getDicList: config => { | ||||
97 | const { type } = param2Obj(config.url) | ||||
98 | const mockList = deptList.filter(item => { | ||||
99 | if (type && item.type !== type) return false | ||||
100 | return true | ||||
101 | }) | ||||
102 | |||||
103 | return { | ||||
104 | items: mockList, | ||||
105 | code: 200 | ||||
106 | } | ||||
107 | } | ||||
108 | } |