fix(测试用例): 导出-修复下载文件错误的缺陷
This commit is contained in:
parent
19f5cb2d27
commit
73a011985c
|
@ -1153,9 +1153,9 @@
|
||||||
const taskId = ref('');
|
const taskId = ref('');
|
||||||
|
|
||||||
// 下载文件
|
// 下载文件
|
||||||
async function downloadFile() {
|
async function downloadFile(id: string) {
|
||||||
try {
|
try {
|
||||||
const response = await getCaseDownloadFile(currentProjectId.value, reportId.value);
|
const response = await getCaseDownloadFile(currentProjectId.value, id);
|
||||||
const fileName = response?.headers.get('content-disposition').split('filename=')[1];
|
const fileName = response?.headers.get('content-disposition').split('filename=')[1];
|
||||||
downloadByteFile(response.data, decodeURIComponent(fileName));
|
downloadByteFile(response.data, decodeURIComponent(fileName));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -1164,7 +1164,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 提示:导出成功
|
// 提示:导出成功
|
||||||
function showExportSuccessfulMessage(count: number) {
|
function showExportSuccessfulMessage(id: string, count: number) {
|
||||||
Message.success({
|
Message.success({
|
||||||
content: () =>
|
content: () =>
|
||||||
h('div', { class: 'flex flex-col gap-[8px] items-start' }, [
|
h('div', { class: 'flex flex-col gap-[8px] items-start' }, [
|
||||||
|
@ -1176,7 +1176,7 @@
|
||||||
{
|
{
|
||||||
type: 'text',
|
type: 'text',
|
||||||
onClick() {
|
onClick() {
|
||||||
downloadFile();
|
downloadFile(id);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ default: () => t('common.downloadFile') }
|
{ default: () => t('common.downloadFile') }
|
||||||
|
@ -1237,7 +1237,7 @@
|
||||||
reportId.value = data.fileId;
|
reportId.value = data.fileId;
|
||||||
taskId.value = data.taskId;
|
taskId.value = data.taskId;
|
||||||
if (data.isSuccessful) {
|
if (data.isSuccessful) {
|
||||||
showExportSuccessfulMessage(data.count);
|
showExportSuccessfulMessage(reportId.value, data.count);
|
||||||
} else {
|
} else {
|
||||||
Message.error({
|
Message.error({
|
||||||
content: t('common.exportFailed'),
|
content: t('common.exportFailed'),
|
||||||
|
|
Loading…
Reference in New Issue