外观专利: 摘掉「分组数异常」确认框、页面提示改成逐行检测口径
10-15 把 worker 抓取改成逐行(maixiang_run_task f871f55)后,解析阶段的分组只剩 "回传攒片"一个作用,不再决定检测覆盖 —— 这个框的前提随之消失: - 它写"同组只会检测 1 次,结论复制到组内其它行",那是 10-10 撤折叠之前的语义,已过期 - 判据是 rows>=20 且 groups*3<rows,用户正常填变体 id(12_1…12_98)就会误报 (11.xlsx 2298 行/626 组实测弹框,把用户推向"返回改表"这条错路) - 左侧提示"同一 ID 有多行时只保留第一行"同样与代码不符,改成"每一行都会各自抓取商品页、 各自送检,同一 ID 有多行也不会少检" 检测覆盖的真正护栏落在代码出口+可实跑的测试:maixiang_run_task/test/maixiang_ops/ test_proxy_cost_leaks.py 两支新用例(4 行各抓 4 次且 url 逐行不同;55 行那片单独收口), 变异 M1(退回 items[0])/M2(摘掉行数档) 各判 1 红。 摘除的框零测试钉(全仓 grep abortOnCollapsedGroups 只有定义+1 处调用)。
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<aside class="left-panel left-panel--with-template">
|
||||
<div class="section-title">上传文件</div>
|
||||
<FileUploadZone
|
||||
hint="选择 Excel 后点击解析,系统会识别表格里的 ID、ASIN、国家信息;同一 ID 有多行时只保留第一行。"
|
||||
hint="选择 Excel 后点击解析,系统会识别表格里的 ID、ASIN、国家信息;每一行都会各自抓取商品页、各自送检,同一 ID 有多行也不会少检。"
|
||||
:names="selectedFileNames"
|
||||
@select-files="selectFiles"
|
||||
@select-folder="selectFolder"
|
||||
@@ -70,7 +70,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||
import { userNotice } from '@/shared/utils/user-notice'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue';
|
||||
import FileUploadZone from '@/shared/components/FileUploadZone.vue'
|
||||
import ModuleTemplateDownload from '@/shared/components/ModuleTemplateDownload.vue'
|
||||
@@ -374,28 +374,12 @@ function toTaskSummary(result: AppearancePatentParseVo): TaskSummary {
|
||||
}
|
||||
|
||||
/**
|
||||
* 本模块按 id 列分组,同组只检测 1 次并把结论复制给组内其它行。
|
||||
* 生产事故(任务 28805):源表 id 列 904 行全填 "1",整表塌成 1 组,105 秒就"完成"了。
|
||||
* 这里在解析后按组/行比例提醒用户确认,返回 true 表示用户选择回去改表。
|
||||
* 本模块自 2026-10-15 起逐行抓取、逐行送检:解析阶段仍按 id 前缀分组,但分组只是
|
||||
* 回传攒片的单位,不再决定检测覆盖,所以原先这里有一个「分组数异常」确认框
|
||||
* (组数 < 行数/3 就拦一道,源自任务 28805 的 id 塌陷事故)—— 它的前提已经不存在,
|
||||
* 且会在用户正常填变体 id(12_1…12_98)时误报,故摘除。检测覆盖由 ap_worker 的
|
||||
* 逐行抓取用例钉住:maixiang_run_task/test/maixiang_ops/test_proxy_cost_leaks.py。
|
||||
*/
|
||||
async function abortOnCollapsedGroups(res: { acceptedRows?: number; groupCount?: number }): Promise<boolean> {
|
||||
const rows = res.acceptedRows || 0
|
||||
const groups = res.groupCount || 0
|
||||
if (rows < 20 || groups * 3 >= rows) {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`本次共 ${rows} 行,只识别出 ${groups} 个检测分组(平均每组 ${(rows / Math.max(groups, 1)).toFixed(1)} 行)。`
|
||||
+ '同组只会检测 1 次,结论复制到组内其它行。若 id 列是整表同一个值,请改为每个商品一个 id 后重新上传。',
|
||||
'分组数异常',
|
||||
{ confirmButtonText: '按当前分组继续', cancelButtonText: '返回改表', type: 'warning', distinguishCancelAndClose: true },
|
||||
)
|
||||
return false
|
||||
} catch {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
async function parseFiles() {
|
||||
if (!uploadedFiles.value.length) {
|
||||
@@ -424,12 +408,6 @@ async function parseFiles() {
|
||||
queuedTaskSummary.value = null
|
||||
return
|
||||
}
|
||||
if (await abortOnCollapsedGroups(res)) {
|
||||
parseResult.value = null
|
||||
queuedTaskSummary.value = null
|
||||
ElMessage.info('已取消,修正 id 列后重新解析')
|
||||
return
|
||||
}
|
||||
parseResult.value = res
|
||||
queuedTaskSummary.value = null
|
||||
ElMessage.success(`解析完成,共 ${res.groupCount || 0} 组 / ${res.acceptedRows} 条`)
|
||||
|
||||
Reference in New Issue
Block a user