feat(用户端): 摘掉跟价/查ASIN 勾选区的「清除勾选记忆」入口
代收在飞件落地(原作者那一路已不在跑,内容一字未改)。记忆的唯一出口改回"取消勾选本身"—— onSelectionChange 按当前窗口重算并写回 localStorage,红字清除按钮是第二条出口、两条会打架。 尺子随之从"必须有清除入口"反向钉成"勾选区不留清除入口与那段文案"。 ⚠ 这条改动其实已随 app-web-20261017-161525 上线(迭代蓝图 §6 记的"整棵上线"带上的未提交件), 本笔只是把提交坐标补到现网实际行为之后,不是新发布。验证依据=同一轮闸门用户端 20 格全绿。
This commit is contained in:
@@ -99,11 +99,7 @@
|
|||||||
<el-pagination v-if="candidateTotal > candidatePageSize" class="candidate-pagination"
|
<el-pagination v-if="candidateTotal > candidatePageSize" class="candidate-pagination"
|
||||||
layout="total, prev, pager, next" :total="candidateTotal" :page-size="candidatePageSize"
|
layout="total, prev, pager, next" :total="candidateTotal" :page-size="candidatePageSize"
|
||||||
v-model:current-page="candidatePage" />
|
v-model:current-page="candidatePage" />
|
||||||
<div v-if="candidateSelectionNotice || rememberedCandidates.length" class="hint">
|
<div v-if="candidateSelectionNotice" class="hint">{{ candidateSelectionNotice }}</div>
|
||||||
<span v-if="candidateSelectionNotice">{{ candidateSelectionNotice }}</span>
|
|
||||||
<button v-if="rememberedCandidates.length" type="button" class="link-danger"
|
|
||||||
@click="clearCandidateSelectionMemory">清除勾选记忆(共 {{ rememberedCandidates.length }} 家)</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-if="!asinModeEnabled">
|
<template v-if="!asinModeEnabled">
|
||||||
@@ -833,13 +829,6 @@ async function restoreCandidateSelection() {
|
|||||||
candidateSelectionNotice.value = selectionNotice(rows.length)
|
candidateSelectionNotice.value = selectionNotice(rows.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearCandidateSelectionMemory() {
|
|
||||||
rememberedCandidates.value = []
|
|
||||||
candidateSelectionNotice.value = ''
|
|
||||||
saveSelectionMemory()
|
|
||||||
candidateTableRef.value?.clearSelection()
|
|
||||||
}
|
|
||||||
|
|
||||||
function onSelectionChange(rows: PriceTrackCandidateVo[]) {
|
function onSelectionChange(rows: PriceTrackCandidateVo[]) {
|
||||||
selectedCandidates.value = rows || []
|
selectedCandidates.value = rows || []
|
||||||
if (restoringSelection) return
|
if (restoringSelection) return
|
||||||
|
|||||||
@@ -68,17 +68,7 @@
|
|||||||
:page-size="candidatePageSize"
|
:page-size="candidatePageSize"
|
||||||
v-model:current-page="candidatePage"
|
v-model:current-page="candidatePage"
|
||||||
/>
|
/>
|
||||||
<div v-if="candidateSelectionNotice || rememberedCandidates.length" class="loading-msg">
|
<div v-if="candidateSelectionNotice" class="loading-msg">{{ candidateSelectionNotice }}</div>
|
||||||
<span v-if="candidateSelectionNotice">{{ candidateSelectionNotice }}</span>
|
|
||||||
<button
|
|
||||||
v-if="rememberedCandidates.length"
|
|
||||||
type="button"
|
|
||||||
class="link-danger"
|
|
||||||
@click="clearCandidateSelectionMemory"
|
|
||||||
>
|
|
||||||
清除勾选记忆(共 {{ rememberedCandidates.length }} 家)
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="run-row">
|
<div class="run-row">
|
||||||
@@ -852,13 +842,6 @@ async function restoreCandidateSelection() {
|
|||||||
candidateSelectionNotice.value = selectionNotice(rows.length);
|
candidateSelectionNotice.value = selectionNotice(rows.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearCandidateSelectionMemory() {
|
|
||||||
rememberedCandidates.value = [];
|
|
||||||
candidateSelectionNotice.value = "";
|
|
||||||
saveSelectionMemory();
|
|
||||||
candidateTableRef.value?.clearSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onSelectionChange(rows: QueryAsinCandidateVo[]) {
|
function onSelectionChange(rows: QueryAsinCandidateVo[]) {
|
||||||
selectedCandidates.value = rows;
|
selectedCandidates.value = rows;
|
||||||
if (restoringSelection) return;
|
if (restoringSelection) return;
|
||||||
|
|||||||
@@ -81,10 +81,9 @@ for (const { file, tab, nameField } of PAGES) {
|
|||||||
assert.match(load, /parseRememberedNames\(/, '读回来的没经脏数据收口')
|
assert.match(load, /parseRememberedNames\(/, '读回来的没经脏数据收口')
|
||||||
})
|
})
|
||||||
|
|
||||||
test(`${file} 有清除入口,且清的是记忆本身`, () => {
|
test(`${file} 勾选区不留红字清除入口`, () => {
|
||||||
const clear = functionBody(source, 'function clearCandidateSelectionMemory(')
|
// 记忆的唯一出口是取消勾选本身:onSelectionChange 按本窗口重算并写回(上一条用例钉的就是这条)
|
||||||
assert.match(clear, /rememberedCandidates\.value = \[\]/, '没清内存里的名单')
|
assert.ok(!source.includes('clearCandidateSelectionMemory'), '勾选区又长出了清除勾选记忆入口')
|
||||||
assert.ok(clear.includes('saveSelectionMemory()'), '没写回 localStorage,下次启动又恢复')
|
assert.ok(!source.includes('清除勾选记忆'), '勾选区又出现了红字提示文案')
|
||||||
assert.match(source, /@click="clearCandidateSelectionMemory/, '界面上没有清除勾选记忆入口')
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user