餐饮油烟智能监测与监管一体化平台
riku
2026-03-03 015f3aa4e2818f8e0c16acd0515d9c8eb4026de8
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
import { Base64 } from 'js-base64';
import { $fysp } from '../index';
 
export default {
  /**
   * 下载数据产品
   */
  downloadProduct(area, type, forceUpdate) {
    return $fysp
      .post(`dataProduct/download?`, area, {
        responseType: 'blob',
        params: { type, forceUpdate }
      })
      .then((res) => {
        // 文档未生成,已启动文档生成后台任务
        if (res.data.type == 'application/json') {
          return false;
        }
        // 文档已存在,返回文件数据流
        else {
          return res;
          // const name = Base64.decode(res.headers.get('filename'));
          // const url = window.URL.createObjectURL(res.data);
          // const link = document.createElement('a');
          // link.href = url;
          // link.setAttribute('download', name);
          // document.body.appendChild(link);
          // link.click();
          // document.body.removeChild(link);
          // window.URL.revokeObjectURL(url);
        }
      });
  },
 
  /**
   * 获取问题整改清单
   */
  fetchProbChangeList(option) {
    return $fysp.post(`dataProduct/problemChange?`, option).then((res) => {
      return res.data;
    });
  },
 
  /**
   * 获取问题复发清单
   */
  fetchProbRecurrence(option) {
    return $fysp.post(`dataProduct/problemRecurrence?`, option).then((res) => {
      return res.data;
    });
  },
 
  /**
   * 获取数据产品
   */
  fetchProduct(option, page = 1, perPage = 30) {
    return $fysp
      .post(`dataProduct/query?`, option, {
        params: {
          page: page,
          perPage: perPage
        }
      })
      .then((res) => {
        return res.data;
      });
  },
 
  /**
   * 生成数据产品
   */
  generateProduct(option) {
    return $fysp.post(`dataProduct/generate?`, option).then((res) => {
      return res.data;
    });
  },
 
  /**
   * 获取数据产品类型
   */
  fetchProductType() {
    return $fysp.get(`dataProduct/type?`).then((res) => {
      return res.data;
    });
  }
};