riku
2024-10-14 89292199af8b4db3a6333b9941ef277f26490f6d
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
import { $fysp } from '../index';
 
export default {
  /**
   * 获取顶层任务
   */
  getTopTask() {
    return $fysp.get('task/alltask/0').then((res) => res.data);
  },
 
  /**
   * 获取总任务的监管场景版本信息
   */
  fetchMonitorObjectVersion(taskId) {
    return $fysp.get(`monitorobjectversion/task/${taskId}`).then((res) => res.data);
  },
 
  /**
   * 添加监管对象
   */
  addMonitorObject(objList) {
    return $fysp.put(`monitorobjectversion/addlist`, objList).then((res) => res.data);
  },
 
  /**
   * 更新监管对象
   */
  updateMonitorObject(objList) {
    return $fysp.post(`monitorobjectversion/uplist`, objList).then((res) => res.data);
  },
 
  /**
   * 删除监管对象
   */
  deleteMonitorObject(objList) {
    return $fysp({
      method: 'delete',
      url: 'monitorobjectversion/deleteList',
      data: objList
    }).then((res) => res.data);
  },
 
  /**
   * 查询总任务
   * @param {Object} param
   * @returns
   */
  fetchTopTasks(param) {
    return $fysp.post('task/find', param).then((res) => res.data);
  },
 
  /**
   * 获取每日任务统计信息
   * @param {String} topTaskId 总任务主键id
   * @param {String} userId 用户id,当用户类型userType为1(监管用户)时,会根据用户id获取其权限内的统计信息
   * @param {String} userType 用户类型,0:管理员;1:监管用户;2:政府部门;3:企业
   */
  fetchDayTasks(topTaskId, userId = '', userType = '0') {
    return $fysp
      .get(`task/dayTask/${topTaskId}?userId=${userId}&userType=${userType}`)
      .then((res) => res.data);
  },
 
  /**
   * 获取子任务统计信息
   */
  getSubtaskSummary({ topTaskId = undefined, sceneTypeId = undefined }) {
    return $fysp
      .get('subtask/summary', {
        params: {
          topTaskId: topTaskId,
          sceneTypeId: sceneTypeId
        }
      })
      .then((res) => res.data);
  },
 
  /**
   * 获取具体子任务信息
   * @param {String} dayTaskId 日任务主键id
   * @param {String} userId 用户id,当用户类型userType为1(监管用户)时,会根据用户id获取其权限内的统计信息
   * @param {String} userType 用户类型,0:管理员;1:监管用户;2:政府部门;3:企业
   */
  fetchSubtaskByDayTask(dayTaskId, userId = '', userType = '0') {
    const params = `?dayTaskId=${dayTaskId}&userId=${userId}&userType=${userType}`;
    return $fysp.get(`subtask/byDayTaskId${params}`).then((res) => res.data);
  },
 
  /**
   * 获取子任务问题详情
   */
  getProBySubtask(id) {
    return $fysp
      .get('problemlist/subtask', {
        params: {
          stGuid: id
        }
      })
      .then((res) => res.data);
  }
};