fix(qc): 修改记录批量查询避免路由误匹配并空列表返回

/qc-tasks/result-change-logs 须先于 /qc-tasks/{task_id} 注册;
无留痕时返回 [],不再因路径被当成任务 ID 报「任务不存在」。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-11-20 11:53:13 +08:00
1 parent e396b1a6eb
commit 38bad4232a
2 files changed
+29 -31

No files matched your search

@@ -67,7 +67,6 @@
import { Close } from '@element-plus/icons-vue'
import DialogFormBody from '@/components/business/dialog-form-body/index.vue'
import {
fetchQcTaskResultChangeLogs,
fetchQcTaskResultChangeLogsBatch,
type QcTaskResultChangeLog
} from '@/api/qc-task-result'
@@ -114,14 +113,12 @@
loading.value = true
entries.value = []
try {
const list =
ids.length > 1
? await fetchQcTaskResultChangeLogsBatch(ids)
: ids.length === 1
? await fetchQcTaskResultChangeLogs(ids[0])
: []
// 多任务统一走批量接口,避免路径被 /qc-tasks/{id} 误匹配
const list = ids.length
? await fetchQcTaskResultChangeLogsBatch(ids)
: []
if (seq !== loadSeq) return
entries.value = list || []
entries.value = Array.isArray(list) ? list : []
} catch {
if (seq !== loadSeq) return
entries.value = []