| import Mock from 'mockjs' |
| import { param2Obj } from '@/utils' |
| |
| const clsList = Mock.mock({ |
| 'list|26': [{ |
| 'id': '@increment', |
| 'hjmc|1': ['后勤处', '财务处', '学生处'], |
| 'xh': '@word(8)', |
| 'xm': '@cword(2, 3)', |
| 'yx|1': ['教育学院', '经管学院', '人文学院', '数学学院', '计算机学院', '电子学院', '电气学院', '生命科学院'], |
| 'yxid|1': ['1', '2', '3', '4', '5', '6', '7', '8'], |
| 'zy': '@cword(6, 7)', |
| 'bj': '@cword(6, 7)', |
| 'shzt|1': ['待审核', '审核通过', '审核不通过'], |
| 'shyj': '@cword(6, 10)', |
| 'shztcode|1': ['1', '2', '3'] |
| }] |
| }).list |
| |
| export default{ |
| getList: config => { |
| const { xh, xm, pcmc, xslb, bynf, byyf, yx, zy, sex, shhj, shzt, pageIndex = 1, pageSize = 20 } = param2Obj(config.url) |
| const mockList = clsList.filter(item => { |
| if (pcmc && item.pcmc && item.pcmc + '' !== pcmc + '') return false |
| if (xslb && item.xslb && item.xslb !== xslb) return false |
| if (bynf && item.bynf && item.bynf !== bynf) return false |
| if (byyf && item.byyf && item.byyf !== byyf) return false |
| if (yx && item.yxid && item.yxid !== yx) return false |
| if (zy && item.zy && item.zy !== zy) return false |
| if (sex && item.sex && item.sex !== sex) return false |
| if (shhj && item.shhj && item.shhj !== shhj) return false |
| if (shzt && item.shztcode && item.shztcode !== shzt) return false |
| if (xh && item.xh && item.xh !== xh) return false |
| if (xm && item.xm && item.xm !== xm) return false |
| return true |
| }) |
| |
| const pageList = mockList.filter((item, index) => index < pageSize * pageIndex && index >= pageSize * (pageIndex - 1)) |
| return { |
| items: pageList, |
| recordCount: mockList.length, |
| code: 200 |
| } |
| } |
| } |