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;
|
});
|
},
|
|
};
|