riku
2023-02-24 5d8e52e398bff7bc8f83e8f5b8a387175b958c98
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
const Multipart = require('../utils/Multipart.min')
const $f = require('./baserequest')
const util = require('../utils/util')
 
const baseUrl = "https://fyami.com.cn:447"
// const baseUrl = "http://47.100.191.150:9005"
const imgUrl = baseUrl + '/images/'
 
module.exports = {
  imgUrl,
 
  //获取飞羽监管所有顶层任务
  getTopTask: function (fun) {
    let cb = {
      url: `/task/alltask/0`,
    }
    Object.assign(cb, fun)
    $f.get(cb, baseUrl)
  },
 
  //获取子任务统计
  getSubTaskSummary: function (topTaskId, sceneTypeId, fun) {
    let cb = {
      url: `/subtask/summary`,
      params: {
        topTaskId: topTaskId,
        sceneTypeId: sceneTypeId,
      }
    }
    Object.assign(cb, fun)
    $f.get(cb, baseUrl)
  },
 
  //获取子任务详情
  getSubtask: function (stGuid, fun) {
    let cb = {
      url: `/subtask/${stGuid}`,
    }
    Object.assign(cb, fun)
    $f.get(cb, baseUrl)
  },
 
  //获取子任务问题
  getProblem: function (stGuid, fun) {
    let cb = {
      url: `/problemlist/subtask`,
      params: {
        stGuid: stGuid,
      }
    }
    Object.assign(cb, fun)
    $f.get(cb, baseUrl)
  },
 
  //上传整改图片
  uploadChangePic: function (pId, paths, fun) {
    const fields = [{
      name: 'problemId',
      value: pId
    }]
    const files = []
    paths.forEach(p => {
      files.push({
        name: 'images',
        filePath: p
      })
    });
    console.log(files);
    let p = new Multipart({
      fields,
      files
    }).submit(baseUrl + `/problemlist/changeProblem`)
    p.then(res => {
      fun.success(res)
    })
  },
}