修改导出数据

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

View File

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