From 6be8bc9bfd0ede185e6578b79faad3fba6f013bd Mon Sep 17 00:00:00 2001 From: lixiaolong <702156524@qq.com> Date: Mon, 17 Aug 2026 16:05:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(flow):=20=E6=B7=BB=E5=8A=A0=E5=8A=A8?= =?UTF-8?q?=E4=BD=9C=E9=98=9F=E5=88=97=E6=AD=A5=E9=AA=A4=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=8A=9F=E8=83=BD=E5=92=8C=E5=AA=92=E4=BD=93?= =?UTF-8?q?=E5=88=86=E6=9E=90=E5=A2=9E=E5=BC=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在动作队列参数组件中添加单独执行按钮,允许独立运行指定步骤 - 实现步骤验证和构建逻辑,支持单步执行的参数处理 - 更新媒体分析参数界面,添加高级设置和参数微调功能 - 增加视频分析的置信度、通过标准等配置选项 - 优化任务执行日志显示,添加分析结果的结构化展示 - 集成分页请求工具,改进日志加载性能和用户体验 - 添加执行步骤索引跟踪,确保执行状态正确管理 - 实现防重复ID机制,保证分页数据完整性 - 新增分析结果解析和可视化展示功能 - 扩展媒体分析类型的处理和结果显示 --- src/utils/pagedRequest.js | 45 ++++ .../flow/components/ActionQueueSingleRun.vue | 41 +++- .../flow/components/TaskExecutionLog.vue | 194 ++++++++++++++++++ .../components/params/ActionQueueParams.vue | 47 ++++- .../components/params/MediaAnalysisParams.vue | 123 ++++++++++- src/views/flow/config.js | 6 +- src/views/flow/index.vue | 24 +++ src/views/inspection/runTask/index.vue | 20 +- .../intelligenceTest/runningTask/index.vue | 20 +- src/views/test/log/index.vue | 18 +- 10 files changed, 511 insertions(+), 27 deletions(-) create mode 100644 src/utils/pagedRequest.js diff --git a/src/utils/pagedRequest.js b/src/utils/pagedRequest.js new file mode 100644 index 0000000..e8a7711 --- /dev/null +++ b/src/utils/pagedRequest.js @@ -0,0 +1,45 @@ +const DEFAULT_PAGE_SIZE = 200 +const DEFAULT_MAX_PAGES = 1000 + +/** + * Loads every page from a standard TableDataInfo endpoint. Endpoints that ignore + * page parameters are also supported because their first response already reaches total. + */ +export async function fetchAllPagedRows(fetchPage, params = {}, options = {}) { + const pageSize = Math.max(1, Number(options.pageSize || DEFAULT_PAGE_SIZE)) + const maxPages = Math.max(1, Number(options.maxPages || DEFAULT_MAX_PAGES)) + const rows = [] + const seenIds = new Set() + let lastResponse = { code: 200, rows: [], total: 0 } + + for (let pageNum = 1; pageNum <= maxPages; pageNum += 1) { + const response = await fetchPage({ ...params, pageNum, pageSize }) + lastResponse = response || lastResponse + const batch = Array.isArray(response?.rows) ? response.rows : [] + let addedCount = 0 + batch.forEach((row) => { + const id = row?.id + if (id !== undefined && id !== null && id !== '') { + const key = String(id) + if (seenIds.has(key)) return + seenIds.add(key) + } + rows.push(row) + addedCount += 1 + }) + + const total = Number(response?.total) + const hasTotal = Number.isFinite(total) && total >= 0 + if (addedCount === 0 && hasTotal && rows.length < total) { + throw new Error('日志分页没有返回新记录,无法保证数据完整') + } + if (batch.length === 0 + || addedCount === 0 + || (hasTotal && rows.length >= total) + || (!hasTotal && batch.length < pageSize)) { + return { ...lastResponse, rows, total: hasTotal ? total : rows.length } + } + } + + throw new Error(`日志记录超过 ${pageSize * maxPages} 条,未能完整加载`) +} diff --git a/src/views/flow/components/ActionQueueSingleRun.vue b/src/views/flow/components/ActionQueueSingleRun.vue index 3a6d054..993e7f6 100644 --- a/src/views/flow/components/ActionQueueSingleRun.vue +++ b/src/views/flow/components/ActionQueueSingleRun.vue @@ -15,6 +15,19 @@
{{ getActionQueueStepName(step, index) }} · {{ actionName(step.type) }}
+ + + @@ -44,7 +57,7 @@ diff --git a/src/views/flow/components/params/ActionQueueParams.vue b/src/views/flow/components/params/ActionQueueParams.vue index ac97d9d..6571a2c 100644 --- a/src/views/flow/components/params/ActionQueueParams.vue +++ b/src/views/flow/components/params/ActionQueueParams.vue @@ -33,6 +33,9 @@ {{ actionLabel(step.type) }}
+ + + @@ -141,7 +144,7 @@