import { request } from '@eciol/request'; import { DemoListGetResultModel, DemoParams } from './model/tableModel'; enum Api { DEMO_LIST = '/table/getDemoList', } function getRandomPics(count = 10): string[] { const arr: string[] = []; for (let i = 0; i < count; i++) { arr.push('@/assets/images/demo.png'); } return arr; } const demoList = (() => { const result: any[] = []; for (let index = 0; index < 200; index++) { result.push({ id: `${index}`, beginTime: new Date().getTime(), endTime: new Date().getTime(), address: '@city()', name: '@cname()', name1: '@cname()', name2: '@cname()', name3: '@cname()', name4: '@cname()', name5: '@cname()', name6: '@cname()', name7: '@cname()', name8: '@cname()', radio1: `选项${index + 1}`, radio2: `选项${index + 1}`, radio3: `选项${index + 1}`, avatar: '@/assets/images/header.jpg', imgArr: getRandomPics(Math.ceil(Math.random() * 3) + 1), imgs: getRandomPics(Math.ceil(Math.random() * 3) + 1), date: `@date('yyyy-MM-dd')`, time: `@time('HH:mm')`, status: ['normal', 'enable', 'disable'], }); } return result; })(); /** * @description: Get sample list value */ export const demoListApi = (params: DemoParams) => ({ results: demoList, total: demoList.length, });