更改导出数据
This commit is contained in:
parent
4877550f7b
commit
e9b718ddee
|
|
@ -683,12 +683,26 @@ function exporChartText() {
|
|||
downloadTextFile(respor, '观测值和模拟值的活度浓度比较结果数据');
|
||||
}
|
||||
});
|
||||
// 单变量后验分布结果数据
|
||||
paramForm.value.layer === '3' && exportUnivariateTxt({ taskId: curRow.value.id }).then((respor: any) => {
|
||||
if (respor) {
|
||||
downloadTextFile(respor, '单变量后验分布结果数据');
|
||||
}
|
||||
});
|
||||
|
||||
if (paramForm.value.layer === '3') {
|
||||
exportUnivariateTxt({ taskId: curRow.value.id })
|
||||
.then(resp => {
|
||||
// resp.data 才是二进制文本流
|
||||
downloadTextFile(resp.data, '单变量后验分布结果数据.txt')
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('导出异常', err)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// // 单变量后验分布结果数据
|
||||
// paramForm.value.layer === '3' && exportUnivariateTxt({ taskId: curRow.value.id }).then((respor: any) => {
|
||||
// console.log(respor,222222222)
|
||||
// if (respor) {
|
||||
// downloadTextFile(respor, '单变量后验分布结果数据');
|
||||
// }
|
||||
// });
|
||||
}
|
||||
// 导出图表图片
|
||||
function exporChartImg() {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import { ElMessage } from 'element-plus';
|
|||
import { baseURL, serverIp } from '@/gis/common/config';
|
||||
import request from '@/utils/request';
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
// http://localhost:9999/sys/log/page?logType=2&startDate=2025-09-24&endDate=2025-09-24&pageNum=1&pageSize=10
|
||||
|
||||
/**
|
||||
|
|
@ -473,16 +475,17 @@ export async function getUnivariate(params: {
|
|||
* @param {number} [params.taskId] - id
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
export async function exportUnivariateTxt(params: {
|
||||
taskId: number;
|
||||
}, callback?: (data: any) => void): Promise<any> {
|
||||
const response = await request({
|
||||
url: `${serverIp}${baseURL}/source/exportBayesMonovarPosterior`,
|
||||
method: 'GET',
|
||||
export function exportUnivariateTxt(params: { taskId: string }) {
|
||||
return axios({
|
||||
url: '${serverIp}${baseURL}/source/exportBayesMonovarPosterior',
|
||||
method: 'GET', // POST自行修改
|
||||
params,
|
||||
});
|
||||
// 执行回调(如果存在)
|
||||
callback?.(response);
|
||||
// 关键配置,必须加!
|
||||
responseType: 'blob',
|
||||
headers: {
|
||||
token: localStorage.getItem('token')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user