更改导出数据

This commit is contained in:
renxiangke 2026-07-27 18:04:46 +08:00
parent 4877550f7b
commit e9b718ddee
2 changed files with 32 additions and 15 deletions

View File

@ -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() {

View File

@ -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')
}
})
}
/**