From 3e797ab159e5b7febce7a95b0ed99b680d02b52c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E8=87=AA=E8=BE=BE?= <980324341@qq.com>
Date: Sun, 18 Oct 2026 09:52:54 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E7=94=A8=E6=88=B7=E7=AB=AF):=20=E6=91=98?=
=?UTF-8?q?=E6=8E=89=E8=B7=9F=E4=BB=B7/=E6=9F=A5ASIN=20=E5=8B=BE=E9=80=89?=
=?UTF-8?q?=E5=8C=BA=E7=9A=84=E3=80=8C=E6=B8=85=E9=99=A4=E5=8B=BE=E9=80=89?=
=?UTF-8?q?=E8=AE=B0=E5=BF=86=E3=80=8D=E5=85=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
代收在飞件落地(原作者那一路已不在跑,内容一字未改)。记忆的唯一出口改回"取消勾选本身"——
onSelectionChange 按当前窗口重算并写回 localStorage,红字清除按钮是第二条出口、两条会打架。
尺子随之从"必须有清除入口"反向钉成"勾选区不留清除入口与那段文案"。
⚠ 这条改动其实已随 app-web-20261017-161525 上线(迭代蓝图 §6 记的"整棵上线"带上的未提交件),
本笔只是把提交坐标补到现网实际行为之后,不是新发布。验证依据=同一轮闸门用户端 20 格全绿。
---
.../brand/components/BrandPriceTrackTab.vue | 13 +------------
.../brand/components/BrandQueryAsinTab.vue | 19 +------------------
.../candidate-selection-memory-wiring.test.ts | 9 ++++-----
3 files changed, 6 insertions(+), 35 deletions(-)
diff --git a/frontend-vue/src/pages/brand/components/BrandPriceTrackTab.vue b/frontend-vue/src/pages/brand/components/BrandPriceTrackTab.vue
index 25f229946..ba0d71184 100644
--- a/frontend-vue/src/pages/brand/components/BrandPriceTrackTab.vue
+++ b/frontend-vue/src/pages/brand/components/BrandPriceTrackTab.vue
@@ -99,11 +99,7 @@
-
- {{ candidateSelectionNotice }}
-
-
+ {{ candidateSelectionNotice }}
@@ -833,13 +829,6 @@ async function restoreCandidateSelection() {
candidateSelectionNotice.value = selectionNotice(rows.length)
}
-function clearCandidateSelectionMemory() {
- rememberedCandidates.value = []
- candidateSelectionNotice.value = ''
- saveSelectionMemory()
- candidateTableRef.value?.clearSelection()
-}
-
function onSelectionChange(rows: PriceTrackCandidateVo[]) {
selectedCandidates.value = rows || []
if (restoringSelection) return
diff --git a/frontend-vue/src/pages/brand/components/BrandQueryAsinTab.vue b/frontend-vue/src/pages/brand/components/BrandQueryAsinTab.vue
index 5865e0707..7dcd2ed69 100644
--- a/frontend-vue/src/pages/brand/components/BrandQueryAsinTab.vue
+++ b/frontend-vue/src/pages/brand/components/BrandQueryAsinTab.vue
@@ -68,17 +68,7 @@
:page-size="candidatePageSize"
v-model:current-page="candidatePage"
/>
-
- {{ candidateSelectionNotice }}
-
-
+ {{ candidateSelectionNotice }}
@@ -852,13 +842,6 @@ async function restoreCandidateSelection() {
candidateSelectionNotice.value = selectionNotice(rows.length);
}
-function clearCandidateSelectionMemory() {
- rememberedCandidates.value = [];
- candidateSelectionNotice.value = "";
- saveSelectionMemory();
- candidateTableRef.value?.clearSelection();
-}
-
function onSelectionChange(rows: QueryAsinCandidateVo[]) {
selectedCandidates.value = rows;
if (restoringSelection) return;
diff --git a/frontend-vue/tests/candidate-selection-memory-wiring.test.ts b/frontend-vue/tests/candidate-selection-memory-wiring.test.ts
index 87a05ad91..c01856340 100644
--- a/frontend-vue/tests/candidate-selection-memory-wiring.test.ts
+++ b/frontend-vue/tests/candidate-selection-memory-wiring.test.ts
@@ -81,10 +81,9 @@ for (const { file, tab, nameField } of PAGES) {
assert.match(load, /parseRememberedNames\(/, '读回来的没经脏数据收口')
})
- test(`${file} 有清除入口,且清的是记忆本身`, () => {
- const clear = functionBody(source, 'function clearCandidateSelectionMemory(')
- assert.match(clear, /rememberedCandidates\.value = \[\]/, '没清内存里的名单')
- assert.ok(clear.includes('saveSelectionMemory()'), '没写回 localStorage,下次启动又恢复')
- assert.match(source, /@click="clearCandidateSelectionMemory/, '界面上没有清除勾选记忆入口')
+ test(`${file} 勾选区不留红字清除入口`, () => {
+ // 记忆的唯一出口是取消勾选本身:onSelectionChange 按本窗口重算并写回(上一条用例钉的就是这条)
+ assert.ok(!source.includes('clearCandidateSelectionMemory'), '勾选区又长出了清除勾选记忆入口')
+ assert.ok(!source.includes('清除勾选记忆'), '勾选区又出现了红字提示文案')
})
}