Sanakey
6 天以前 cb165187ddcf5d9cfd8aad97a2868d0343b14bd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import { MockMethod } from 'vite-plugin-mock';
import { Random } from 'mockjs';
import { resultPageSuccess } from '../_util';
 
function getRandomPics(count = 10): string[] {
  const arr: string[] = [];
  for (let i = 0; i < count; i++) {
    arr.push(Random.image('800x600', Random.color(), Random.color(), Random.title()));
  }
  return arr;
}
 
const demoList = (() => {
  const result: any[] = [];
  for (let index = 0; index < 200; index++) {
    result.push({
      id: `${index}`,
      color: Random.color(),
      cluesName: '@ctitle()',
      formId: `@integer(100000, 999999)`,
      archiveTime: '@datetime',
      statusId: '@integer()',
      status: '@ctitle()',
      followUpTime: '@datetime',
      failType: '@integer()',
      failStatus: '@integer()',
      failStatusName: '@ctitle()',
      failReason: '@ctitle()',
      privateTime: '@datetime',
      publicTime: '@datetime',
      isPublic: '@boolean()',
      star: '@integer(1-5)',
      nextFollowUpTime: '@datetime',
      duplicateFlag: '@boolean()',
      tagList: [{name:'@cname()',color:Random.color()}, {name:'@cname()',color:Random.color()}],
      homepage: '@url()',
      originList: `$range(10)`,
      shortName: '@cname()',
      country: '@region()',
      province: '@province()',
      city: '@city()',
      corporate: '@ctitle()',
      bizType: '@ctitle()',
      telAreaCode: '@integer(100, 999)',
      tel: '@integer(100000, 199999)',
      intentionLevel: '@ctitle()',
      annualProcurement: '@float()',
      timezone: '@ctitle()',
      address: '@county()',
      adKeyword: '@ctitle()',
      imageList: getRandomPics(Math.ceil(Math.random() * 3) + 1),
      hdmeno: '@cname()',
      scaleId: '@character()',
      seller: '@cname()',
      inquiryOrigin: '@ctitle()',
      categoryIds: `@Integer(100, 999)`,
      inquiryCountry: '@city()',
      pinFlag: '@boolean()',
 
      email: '@email()',
      ip: '@ip()',
      beginTime: '@datetime',
      endTime: '@datetime',
      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: Random.image('400x400', Random.color(), Random.color(), Random.first()),
      imgArr: getRandomPics(Math.ceil(Math.random() * 3) + 1),
      date: `@date('yyyy-MM-dd')`,
      time: `@time('HH:mm')`,
      'no|100000-10000000': 100000,
      'status|1': ['normal', 'enable', 'disable'],
    });
  }
  return result;
})();
 
export default [
  {
    // url: '/basic-api/table/getDemoList',
    url: '/basic-api/crm/clues/list',
    timeout: 100,
    method: 'get',
    response: ({ query }) => {
      const { page = 1, pageSize = 20 } = query;
      return resultPageSuccess(page, pageSize, demoList);
    },
  },
] as MockMethod[];