更改导出数据
This commit is contained in:
parent
4877550f7b
commit
e9b718ddee
|
|
@ -683,12 +683,26 @@ function exporChartText() {
|
||||||
downloadTextFile(respor, '观测值和模拟值的活度浓度比较结果数据');
|
downloadTextFile(respor, '观测值和模拟值的活度浓度比较结果数据');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 单变量后验分布结果数据
|
|
||||||
paramForm.value.layer === '3' && exportUnivariateTxt({ taskId: curRow.value.id }).then((respor: any) => {
|
if (paramForm.value.layer === '3') {
|
||||||
if (respor) {
|
exportUnivariateTxt({ taskId: curRow.value.id })
|
||||||
downloadTextFile(respor, '单变量后验分布结果数据');
|
.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() {
|
function exporChartImg() {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ import { ElMessage } from 'element-plus';
|
||||||
import { baseURL, serverIp } from '@/gis/common/config';
|
import { baseURL, serverIp } from '@/gis/common/config';
|
||||||
import request from '@/utils/request';
|
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
|
// 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
|
* @param {number} [params.taskId] - id
|
||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
export async function exportUnivariateTxt(params: {
|
export function exportUnivariateTxt(params: { taskId: string }) {
|
||||||
taskId: number;
|
return axios({
|
||||||
}, callback?: (data: any) => void): Promise<any> {
|
url: '${serverIp}${baseURL}/source/exportBayesMonovarPosterior',
|
||||||
const response = await request({
|
method: 'GET', // POST自行修改
|
||||||
url: `${serverIp}${baseURL}/source/exportBayesMonovarPosterior`,
|
|
||||||
method: 'GET',
|
|
||||||
params,
|
params,
|
||||||
});
|
// 关键配置,必须加!
|
||||||
// 执行回调(如果存在)
|
responseType: 'blob',
|
||||||
callback?.(response);
|
headers: {
|
||||||
|
token: localStorage.getItem('token')
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user