From 77fd339366940a81247a22dda344caca9acff17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A8=9C?= Date: Wed, 21 May 2025 14:48:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 6 +++++- src/store/modules/app.ts | 7 +++++++ src/utils/downloadFun.ts | 22 ++++++++++++++++------ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 27c6250..bcef1ab 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,7 @@ @@ -10,10 +11,13 @@ import { useI18n } from 'vue-i18n'; import { computed, ref } from 'vue'; import '@/styles/app.scss'; import router from './router'; +import CustomLoading from '@/components/CustomLoading/index.vue'; + -const appStore = useAppStore(); const { locale } = useI18n(); const locales = computed(() => appStore.locale); +const appStore = useAppStore(); +const {downLoading} = storeToRefs(appStore); const { changeParentToken } = appStore; // 新增路由状态标记 const isManualNavigation = ref(false); diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index 1150e16..f81a06d 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -6,6 +6,11 @@ import en from 'element-plus/es/locale/lang/en'; import { store } from '@/store'; export const useAppStore = defineStore('app', () => { + const downLoading = ref(false); + + const changeDownLoading = (value: boolean) => { + downLoading.value = value; + }; const parentToken = ref(''); function changeParentToken(value: string) { @@ -39,6 +44,8 @@ export const useAppStore = defineStore('app', () => { changeLanguage, parentToken, changeParentToken, + downLoading, + changeDownLoading, }; }); diff --git a/src/utils/downloadFun.ts b/src/utils/downloadFun.ts index 65560c4..e1fea10 100644 --- a/src/utils/downloadFun.ts +++ b/src/utils/downloadFun.ts @@ -1,20 +1,27 @@ -import { useAppStore } from '@/store'; +import { useAppStore, useAppStoreHook } from '@/store'; +import { storeToRefs } from 'pinia'; export function downloadFun(url: string) { const appStore = useAppStore(); const { parentToken } = storeToRefs(appStore); + const token = parentToken.value || localStorage.getItem('ECSESSION'); + if (!token) { + console.error('Token is not available yet'); + return; + } + useAppStoreHook().changeDownLoading(true); fetch(url, { headers: { - Authorization: parentToken.value - ? `Bearer ${parentToken.value}` - : `Bearer 99db1ba8eb0c9bb67e3e45dccfac8e60`, // 添加 Authorization 头 + Authorization: `Bearer ${token}`, }, }) .then((response) => { + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } // 提取 Content-Disposition 头部 const contentDisposition = response.headers.get('Content-Disposition'); let fileName = 'default-filename'; - // 解析文件名(处理编码及格式) if (contentDisposition) { const fileNameMatch = contentDisposition.match(/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i); @@ -32,5 +39,8 @@ export function downloadFun(url: string) { a.click(); URL.revokeObjectURL(a.href); }) - .catch((error) => console.error('下载失败:', error)); + .catch((error) => console.error('下载失败:', error)) + .finally(() => { + useAppStoreHook().changeDownLoading(false); + }); } -- Gitee From 950a0a5499bc414336ccb6e699f3e47e402ea9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A8=9C?= Date: Wed, 21 May 2025 14:52:12 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=B8=8B=E8=BD=BD=E9=80=BB=E8=BE=91=EF=BC=9B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=A8=E6=A0=BC=E6=9C=80=E5=B0=8F=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/evaluate/index.vue | 2 +- src/views/evaluate/testCase.vue | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/evaluate/index.vue b/src/views/evaluate/index.vue index 89e8246..ad9245a 100644 --- a/src/views/evaluate/index.vue +++ b/src/views/evaluate/index.vue @@ -426,7 +426,7 @@ const handleDownload = (row: any) => { const handleBatchDownload = () => { let flag = true; selectedRow.value.forEach((item: any) => { - if (item.runStatus !== 'idle') { + if (item?.testingTask?.taskStatus !== 'success') { flag = false; } }) diff --git a/src/views/evaluate/testCase.vue b/src/views/evaluate/testCase.vue index 116bdb7..c2b917a 100644 --- a/src/views/evaluate/testCase.vue +++ b/src/views/evaluate/testCase.vue @@ -521,7 +521,11 @@ const handleDownloadReport = () => { .table-container { margin-top: 16px; + overflow-x: auto; // 添加横向滚动支持 + .el-table { + min-width: 1200px; // 设置表格的最小宽度,确保中间列在小屏幕上不会被隐藏 + } .el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell { border-right: unset !important; -- Gitee From 399926a8d2e548774103980fb51382bc57935b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A8=9C?= Date: Wed, 21 May 2025 16:18:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=84=E5=88=86=E6=8E=92=E5=BA=8F=EF=BC=9B=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8F=82=E6=95=B0=E5=A4=84=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dataSet/index.vue | 23 +++++------------------ src/views/evaluate/index.vue | 36 ++++++++++++++---------------------- 2 files changed, 19 insertions(+), 40 deletions(-) diff --git a/src/views/dataSet/index.vue b/src/views/dataSet/index.vue index 8b7f8db..e4edd89 100644 --- a/src/views/dataSet/index.vue +++ b/src/views/dataSet/index.vue @@ -168,7 +168,6 @@ cell-calss-name="tableCell" :row-key="(row) => row.datasetId" @selection-change="handleSelectionChange" - @sort-change="handleSortChange" ref="multipleTable" :border="false"> { }) const { handleKnowledgeTab } = store; -const {knowledgeTabActive,curTeamInfo} = storeToRefs(store); +const {knowledgeTabActive} = storeToRefs(store); watch(()=>knowledgeTabActive.value,()=>{ if(knowledgeTabActive.value === 'dataset'){ @@ -641,7 +640,9 @@ const handleInputSearch = debounce((value: string) => { const handleSearchPayload = (): Record => { return Object.entries(searchPayload.value).reduce((acc, [key, value]) => { - if (value === undefined || value === null || value === 'all') return acc; + if (value === undefined || value === null || value === '' || (Array.isArray(value) && value.length === 0)) { + return acc; // 移除空值或空数组的字段 + } // 处理特殊字段类型转换 acc[key] = typeof value === 'string' ? value.trim() @@ -650,24 +651,12 @@ const handleSearchPayload = (): Record => { }, {} as Record); }; -const handleSortChange = (data: { column: any; prop: string; order: any }) => { - let sortKey = data.prop === 'score' ? 'scoreOrder' : null; - let sortValue = data.order ? (data.order === 'ascending' ? 'asc' : 'desc') : null; - searchPayload.value = sortValue - ? { - [sortKey || data.prop]: sortValue, - } - : {}; - handleSearchOpsData(true, true); -}; - const handlePollFileDataSet = () => { dataSetAPI.queryDataSetList({ page: currentPage.value, pageSize: currentPageSize.value, kbId: route.query.kb_id as string, ...handleSearchPayload(), - ...searchPayload.value, }) .then((res: any) => { if (res.page === currentPage.value && fileTableList.data?.length) { @@ -708,7 +697,6 @@ const handleSearchOpsData = (loadingStatus: boolean, startPollTimer: boolean) => pageSize: currentPageSize.value, kbId: route.query.kb_id as string, ...handleSearchPayload(), - ...searchPayload.value, }, loadingStatus, startPollTimer @@ -757,7 +745,6 @@ const handleSearchData = () => { pageSize: currentPageSize.value ?? 20, kbId: route.query.kb_id as string, ...handleSearchPayload(), - ...searchPayload.value, }, true, true @@ -841,7 +828,7 @@ const handleJumpFileSection = (row: any) => { }; const handelStatusFilterProper = (filterList: any) => { - searchPayload.value.generateStatus = filterList.length ? filterList : null; + searchPayload.value.generateStatus = filterList; handleSearchData(); }; diff --git a/src/views/evaluate/index.vue b/src/views/evaluate/index.vue index ad9245a..ba84d0e 100644 --- a/src/views/evaluate/index.vue +++ b/src/views/evaluate/index.vue @@ -49,7 +49,7 @@