duhuizhe
2023-10-16 3aa55dd3f62cee2c1c4c0aa74e1570acf83f8927
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import Mock from 'mockjs';
 
/*临期预警设置*/
export default ({mock}) => {
  if (!mock) return;
  //新增
  Mock.mock(new RegExp("/pc/p/temp/expiration/notify/add"), 'post', () => {
    return Mock.mock({
      code: 1,
      data: 1
 
    });
  });
  //删除
  Mock.mock(new RegExp("/pc/p/temp/expiration/notify/del"), 'delete', () => {
    return Mock.mock({
      code: 1,
      data: 1
 
    });
  });
  //编辑
  Mock.mock(new RegExp("/pc/p/temp/expiration/notify/upd"), 'post', () => {
    return Mock.mock({
      code: 1,
      data: 1
 
    });
  });
  //修改状态
  Mock.mock(new RegExp("/pc/p/temp/expiration/notify/updStatus"), 'post', () => {
    return Mock.mock({
      code: 1,
      data: 1
 
    });
  });
  //详情
  Mock.mock(new RegExp("/pc/p/temp/expiration/notify/detail"), 'get', () => {
    const phonePrefix = ['132', '135', '189']
    const index = Math.floor(Math.random() * phonePrefix.length)
    var phone = []
    for (let i = 0; i < 15; i++) {
      phone.push(phonePrefix[index] + Mock.mock(/\d{8}/))
    }
    return Mock.mock({
      code: 1,
      data: {
        id: '@id',
        tempExpirationNotifyName: '@ctitle(3,5)',
        tempExpirationNotifyCode: '@id',
        createOrgName: '@city()',
        'expireBefore1|5-10': 6,
        'beforeManagerNotify1|0-1': 0,
        'beforeManagerNotifyUser1|3-6': [
          {
            id: '@id',
            userName: '@cname',
          }
        ],
        'expireBefore2|5-10': 6,
        'beforeManagerNotify2|0-1': 0,
        'beforeManagerNotifyUser2|3-6': [
          {
            id: '@id',
            userName: '@cname',
          }
        ],
        'expireBefore3|5-10': 6,
        'beforeManagerNotify3|0-1': 0,
        'beforeManagerNotifyUser3|3-6': [
          {
            id: '@id',
            userName: '@cname',
          }
        ],
        'expireAfter1|5-10': 6,
        'afterManagerNotify1|0-1': 0,
        'afterManagerNotifyUser1|3-6': [
          {
            id: '@id',
            userName: '@cname',
          }
        ],
        'expireAfter2|5-10': 6,
        'afterManagerNotify2|0-1': 0,
        'afterManagerNotifyUser2|3-6': [
          {
            id: '@id',
            userName: '@cname',
          }
        ],
        'expireAfter3|5-10': 6,
        'afterManagerNotify3|0-1': 0,
        'afterManagerNotifyUser3|3-6': [
          {
            id: '@id',
            userName: '@cname',
          }
        ],
        "notifyWx|0-1": 0,
        "notifyMobMsg|0-1": 0,
        "notifyMobMsgWay|0-1": 0,
        "status|0-1": 0,
        notifyMob: phone.join(','),
        'notifyTime|0-23': 9
      },
    });
  });
  //查询列表
  Mock.mock(new RegExp("/pc/p/temp/expiration/notify/list"), 'get', () => {
    return Mock.mock({
      code: 1,
      'data|10': [
        {
          id: '@id',
          tempExpirationNotifyName: '@ctitle(3,5)',
          tempExpirationNotifyCode: '@id',
          createOrgName: '@city()',
          "notifyWx|0-1": 0,
          "notifyMobMsg|0-1": 0,
          "notifyMobMsgWay|0-1": 0,
          "status|0-1": 0,
        },
      ]
    });
  })
}