| import Mock from 'mockjs' |
| import { param2Obj } from '@/utils' |
| |
| const recordList = Mock.mock({ |
| 'list|4': [{ |
| 'id': '@increment', |
| 'hjmc|1': ['后勤处', '财务处', '学生处'], |
| 'hjid': '@word(5)', |
| 'dsh|1-1000': 100, |
| 'shtg|1-1000': 100, |
| 'shbtg|1-1000': 100 |
| }] |
| }).list |
| |
| export default{ |
| getList: config => { |
| const { pcmc, xh, xm, sfzylx, yx, zy, bj, xslb, pageIndex = 1, pageSize = 20 } = param2Obj(config.url) |
| const mockList = recordList.filter(item => { |
| if (pcmc && item.pcmc + '' !== pcmc + '') return false |
| if (xh && item.xh !== xh) return false |
| if (xm && item.xm !== xm) return false |
| if (sfzylx && item.sfzylx !== sfzylx) return false |
| if (yx && item.yx !== yx) return false |
| if (zy && item.zy !== zy) return false |
| if (bj && item.bj !== bj) return false |
| if (xslb && item.xslb !== xslb) 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 |
| } |
| }, |
| getLeaveAuditResult: config => { |
| return { |
| data: { |
| zylx: 100, |
| bzylx: 200 |
| }, |
| code: 200 |
| } |
| } |
| } |