修改导出数据

This commit is contained in:
renxiangke 2026-07-28 11:05:58 +08:00
parent d484c8a6a8
commit 73be6f0dc3
2 changed files with 21 additions and 40 deletions

View File

@ -684,25 +684,12 @@ function exporChartText() {
}
});
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, '');
// }
// });
//
paramForm.value.layer === '3' && exportUnivariateTxt({ taskId: curRow.value.id }).then((respor: any) => {
if (respor) {
downloadTextFile(respor, '单变量后验分布结果数据');
}
});
}
//
function exporChartImg() {

View File

@ -440,16 +440,14 @@ export async function getAcTimeSeries(params: {
* @param {number} [params.taskId] - id
* @returns {Promise<any>}
*/
export async function exportAcTimeSeriesTxt(params: {
taskId: number;
}, callback?: (data: any) => void): Promise<any> {
const response = await request({
export function exportAcTimeSeriesTxt(params: { taskId: string }) {
return request({
url: `${serverIp}${baseURL}/source/exportBayesAcTimeSeriesTxt`,
method: 'GET',
method: 'GET', // POST自行修改
params,
});
// 执行回调(如果存在)
callback?.(response);
// 关键配置,必须加!
responseType: 'blob',
})
}
/**
@ -476,15 +474,12 @@ export async function getUnivariate(params: {
* @returns {Promise<any>}
*/
export function exportUnivariateTxt(params: { taskId: string }) {
return axios({
url: '${serverIp}${baseURL}/source/exportBayesMonovarPosterior',
return request({
url: `${serverIp}${baseURL}/source/exportBayesMonovarPosterior`,
method: 'GET', // POST自行修改
params,
// 关键配置,必须加!
responseType: 'blob',
headers: {
token: localStorage.getItem('token')
}
})
}
@ -511,17 +506,16 @@ export async function getBivariate(params: {
* @param {number} [params.taskId] - id
* @returns {Promise<any>}
*/
export async function exportBivariateTxt(params: {
taskId: number;
}, callback?: (data: any) => void): Promise<any> {
const response = await request({
export function exportBivariateTxt(params: { taskId: string }) {
return request({
url: `${serverIp}${baseURL}/source/exportBayesBivarPosterior`,
method: 'GET',
method: 'GET', // POST自行修改
params,
});
// 执行回调(如果存在)
callback?.(response);
// 关键配置,必须加!
responseType: 'blob',
})
}
/**
* @method
* @returns {Promise<any>}