mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-29 08:14:33 +08:00
v2.0
This commit is contained in:
40
web/mock/table/list.ts
Normal file
40
web/mock/table/list.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Random } from 'mockjs';
|
||||
import { doCustomTimes, resultSuccess } from '../_util';
|
||||
|
||||
const tableList = (pageSize) => {
|
||||
const result: any[] = [];
|
||||
doCustomTimes(pageSize, () => {
|
||||
result.push({
|
||||
id: '@integer(10,999999)',
|
||||
beginTime: '@datetime',
|
||||
endTime: '@datetime',
|
||||
address: '@city()',
|
||||
name: '@cname()',
|
||||
avatar: Random.image('400x400', Random.color(), Random.color(), Random.first()),
|
||||
date: `@date('yyyy-MM-dd')`,
|
||||
time: `@time('HH:mm')`,
|
||||
'no|100000-10000000': 100000,
|
||||
'status|1': [true, false],
|
||||
});
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
export default [
|
||||
//表格数据列表
|
||||
{
|
||||
url: '/admin/table/list',
|
||||
timeout: 1000,
|
||||
method: 'get',
|
||||
response: ({ query }) => {
|
||||
const { page = 1, pageSize = 10 } = query;
|
||||
const list = tableList(Number(pageSize));
|
||||
return resultSuccess({
|
||||
page: Number(page),
|
||||
pageSize: Number(pageSize),
|
||||
pageCount: 60,
|
||||
list,
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
Reference in New Issue
Block a user