frontend-vue 退役:删新版/旧版选项控件与删除品牌/巡店删除入口,用例族随实况收敛

- 删 ZiniaoVersionSetting.vue / ziniao-version.ts;9 个 Tab 摘 ziniao_version 载荷
- 删 BrandDeleteBrandTab.vue / BrandPatrolDeleteTab.vue 与 delete-brand 类型模块;
  路由、工具目录(20→18)、端点表、progress-light 模块(12→10)、withdraw.ts 巡店段、
  java-modules re-export 同步摘除
- 测试面:node --test 17 处红按实况收敛(端点冻结快照摘两组、适配器 16→14、窄集合台账
  摘两页、六页→五页、reexport/快照随实况),modules-delete-brand.test.ts 整文件删
- vue-tsc+vite build 通过;node --test 837/837 绿
This commit is contained in:
2026-10-15 22:30:06 +08:00
parent 785dbb7c2d
commit fdaae3c560
34 changed files with 42 additions and 4212 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -118,7 +118,6 @@
<div v-if="countryPrefSaving" class="country-pref-status">保存中…</div>
</template>
<ZiniaoVersionSetting v-model="ziniaoVersion" />
<!-- 状态指示 -->
<div v-if="statusModeEnabled" class="mode-status-bar">
@@ -225,7 +224,6 @@ import { ElMessage } from 'element-plus'
import type { TableInstance } from 'element-plus'
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue';
import ModuleTemplateDownload from '@/shared/components/ModuleTemplateDownload.vue'
import ZiniaoVersionSetting from '@/shared/components/ZiniaoVersionSetting.vue'
import FileUploadZone from '@/shared/components/FileUploadZone.vue'
import TaskCenterPanel from '@/shared/components/tasks/TaskCenterPanel.vue'
import type { TaskItemView, TaskStatCard } from '@/shared/components/tasks/types'
@@ -243,7 +241,6 @@ import {
shouldDeferQueuePush,
} from '@/shared/dispatch-guard'
import { passGuard } from '@/shared/dispatch-guard-ui'
import { useZiniaoVersion } from '@/shared/utils/ziniao-version'
import {
addPriceTrackCandidate,
completePriceTrackLoopChild,
@@ -293,7 +290,6 @@ import {
selectionNotice,
} from '@/shared/utils/candidate-selection-memory'
const ziniaoVersion = useZiniaoVersion()
// ========== 类型定义 ==========
const COUNTRY_OPTIONS = [
@@ -1037,7 +1033,6 @@ async function buildQueuePayload(taskVo: PriceTrackCreateTaskVo, row: PriceTrack
ts: Date.now(),
data: {
task_id: taskVo.taskId,
ziniao_version: ziniaoVersion.value,
shop_name: shopName,
country_codes: resolveCountryCodesForRequest(),
mode: priceTrackModeForAppClient(),
@@ -67,7 +67,6 @@
</el-select>
</div>
<ZiniaoVersionSetting v-model="ziniaoVersion" />
<div class="run-row">
<button type="button" class="btn-run" :disabled="matching" @click="runMatch">
@@ -185,8 +184,6 @@ import { saveUrlWithProgress } from '@/shared/utils/download-progress'
import { isTerminalTaskStatus, waitForTaskTerminal as waitForTaskTerminalShared } from '@/shared/utils/task-terminal'
import { checkQueuePayload, guardBlocked } from '@/shared/dispatch-guard'
import { passGuard } from '@/shared/dispatch-guard-ui'
import ZiniaoVersionSetting from '@/shared/components/ZiniaoVersionSetting.vue'
import { useZiniaoVersion } from '@/shared/utils/ziniao-version'
import { formatDateTime } from '@/shared/utils/datetime'
import { taskStatusClass, taskStatusText } from '@/shared/utils/task-status-text'
import { runBatchDelete } from '@/shared/utils/batch-delete'
@@ -222,13 +219,9 @@ const queueWorkerRunning = ref(false)
const autoQueueEnabled = ref(false)
const queuePushResult = ref('')
const queuePayloadText = ref('')
const ziniaoVersion = useZiniaoVersion()
const PRODUCT_RISK_LISTING_FILTER_OPTIONS = [
...LISTING_FILTER_OPTIONS,
{ value: 'AccountStatus', label: '账户状态处理' },
] as const
type ProductRiskListingFilterValue = ListingFilterValue | 'AccountStatus'
const PRODUCT_RISK_LISTING_FILTER_OPTIONS = LISTING_FILTER_OPTIONS
type ProductRiskListingFilterValue = ListingFilterValue
/** 与后端 ProductRiskCountryCode / 默认顺序 DE→UK→FR→IT→ES 一致 */
const COUNTRY_OPTIONS = [
@@ -1146,7 +1139,6 @@ async function processMatchedBatchQueue(toPush: ProductRiskShopQueueItem[]) {
ts: Date.now(),
data: {
taskId,
ziniao_version: ziniaoVersion.value,
items: toPush,
country_codes: [...orderedCountryCodes.value],
risk_listing_filter: productRiskListingFilter.value,
@@ -1242,7 +1234,6 @@ async function processMatchedQueue() {
ts: Date.now(),
data: {
taskId,
ziniao_version: ziniaoVersion.value,
items: [item],
country_codes: [...orderedCountryCodes.value],
risk_listing_filter: productRiskListingFilter.value,
@@ -58,7 +58,6 @@
<p class="country-hint">发布国家会从同步国家中自动排除。</p>
</div>
<ZiniaoVersionSetting v-model="ziniaoVersion" />
<div class="run-row">
<button
@@ -182,7 +181,6 @@ import FileUploadZone from '@/shared/components/FileUploadZone.vue'
import ModuleTemplateDownload from '@/shared/components/ModuleTemplateDownload.vue'
import TaskCenterPanel from '@/shared/components/tasks/TaskCenterPanel.vue'
import type { TaskItemView, TaskStatCard } from '@/shared/components/tasks/types'
import ZiniaoVersionSetting from '@/shared/components/ZiniaoVersionSetting.vue'
import {
activatePublishFile,
activatePublishTask,
@@ -211,7 +209,6 @@ import {
guardBlocked,
} from '@/shared/dispatch-guard'
import { passGuard } from '@/shared/dispatch-guard-ui'
import { useZiniaoVersion, type ZiniaoVersion } from '@/shared/utils/ziniao-version'
import { runBatchDelete } from '@/shared/utils/batch-delete'
const COUNTRY_OPTIONS = [
@@ -225,7 +222,6 @@ const COUNTRY_OPTIONS = [
interface PublishDispatchOptions {
publishCountry: string
syncCountries: string[]
ziniaoVersion: ZiniaoVersion
}
interface PublishQueueBatch {
@@ -263,7 +259,6 @@ const queueWorkerRunning = ref(false)
const queueMessage = ref('')
const publishCountry = ref<string>('DE')
const syncCountries = ref<string[]>(['UK', 'FR', 'IT', 'ES'])
const ziniaoVersion = useZiniaoVersion()
const currentTaskId = ref<number | null>(null)
const currentFiles = ref<PublishFileItem[]>([])
const pendingFileIds = ref<number[]>([])
@@ -541,7 +536,6 @@ async function submitRun() {
const options: PublishDispatchOptions = {
publishCountry: publishCountry.value,
syncCountries: syncCountries.value.filter((country) => country !== publishCountry.value),
ziniaoVersion: ziniaoVersion.value,
}
const files = parsed.files || []
applyTaskSnapshot(parsed.taskId, {
@@ -634,7 +628,6 @@ function setActiveBatch(batch: PublishQueueBatch, restoreForm = false) {
if (restoreForm) {
publishCountry.value = batch.options.publishCountry
syncCountries.value = [...batch.options.syncCountries]
ziniaoVersion.value = batch.options.ziniaoVersion
}
}
@@ -737,7 +730,6 @@ function buildQueuePayload(taskId: number, file: PublishFileItem) {
matched: isMatchedFile(file),
matchStatus: file.matchStatus || '',
matchMessage: file.matchMessage || '',
ziniao_version: options.ziniaoVersion,
publish_country: options.publishCountry,
sync_countries: options.syncCountries,
paginationUrl,
@@ -80,7 +80,6 @@
</button>
</div>
<ZiniaoVersionSetting v-model="ziniaoVersion" />
<div class="run-row">
<button
@@ -242,8 +241,6 @@ import { createCategorizedTimers } from "@/shared/utils/categorized-timers";
import { saveUrlWithProgress } from "@/shared/utils/download-progress";
import { checkQueuePayload } from "@/shared/dispatch-guard";
import { passGuard } from "@/shared/dispatch-guard-ui";
import ZiniaoVersionSetting from "@/shared/components/ZiniaoVersionSetting.vue";
import { useZiniaoVersion } from "@/shared/utils/ziniao-version";
import { formatDateTime } from '@/shared/utils/datetime'
import { RUNNING_UNTIL_DONE_STATUS_OPTIONS, taskStatusClass, taskStatusText } from '@/shared/utils/task-status-text'
import { useHistoryPolling } from '@/shared/composables/useHistoryPolling'
@@ -265,7 +262,6 @@ import {
} from '@/shared/utils/candidate-selection-memory';
const MAX_TRANSIENT_ERRORS = 30;
const ziniaoVersion = useZiniaoVersion();
const shopInput = ref("");
const candidates = ref<QueryAsinCandidateVo[]>([]);
@@ -972,7 +968,6 @@ function buildQueuePayload(taskId: number, item: QueryAsinHistoryItem) {
ts: Date.now(),
data: {
taskId,
ziniao_version: ziniaoVersion.value,
user_id: Number(uidForStorage()) || 0,
source: "frontend-vue-query-asin",
submissionId,
@@ -54,7 +54,6 @@
</div>
<div v-if="countryPrefSaving" class="country-pref-status">保存中...</div>
<ZiniaoVersionSetting v-model="ziniaoVersion" />
<div class="run-row">
<button type="button" class="btn-run" :disabled="matching" @click="runMatch">
@@ -135,8 +134,6 @@ import { ElMessage } from 'element-plus'
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue';
import TaskCenterPanel from '@/shared/components/tasks/TaskCenterPanel.vue'
import type { TaskItemView, TaskStatCard } from '@/shared/components/tasks/types'
import ZiniaoVersionSetting from '@/shared/components/ZiniaoVersionSetting.vue'
import { useZiniaoVersion } from '@/shared/utils/ziniao-version'
import { getPywebviewApi } from '@/shared/bridges/pywebview'
import { getTaskPollIntervalMs } from '@/shared/task-progress-config'
import { createCategorizedTimers } from '@/shared/utils/categorized-timers'
@@ -182,7 +179,6 @@ const COUNTRY_OPTIONS = [
] as const
const timers = createCategorizedTimers('shop-data-crawl')
const ziniaoVersion = useZiniaoVersion()
const shopInput = ref('')
const candidates = ref<ShopDataCrawlCandidateVo[]>([])
const selectedCandidates = ref<ShopDataCrawlCandidateVo[]>([])
@@ -217,7 +213,6 @@ const activeTaskId = ref<number | null>(null)
const activeQueueItem = ref<ShopDataCrawlShopItem | null>(null)
const activeDispatched = ref(false)
const activeCountryCodes = ref<string[]>([])
const activeZiniaoVersion = ref<'new' | 'old'>('new')
const pollingTaskIds = ref<number[]>([])
/** 任务快照(审查 C3):整份含行明细、体积大,shallowRef 只跟踪整份替换,写入后统一 triggerRef */
const taskSnapshots = shallowRef<Record<number, ShopDataCrawlTaskDetailVo>>({})
@@ -297,13 +292,12 @@ function setStorage(name: string, value: unknown) {
function loadLocalState() {
try { matchedItems.value = JSON.parse(window.localStorage.getItem(storageKey('matched')) || '[]') } catch { matchedItems.value = [] }
try {
const state = JSON.parse(window.localStorage.getItem(storageKey('queue')) || '{}') as { pendingQueue?: ShopDataCrawlShopItem[]; activeTaskId?: number | null; activeQueueItem?: ShopDataCrawlShopItem | null; activeDispatched?: boolean; activeCountryCodes?: string[]; activeZiniaoVersion?: 'new' | 'old'; autoQueueEnabled?: boolean }
const state = JSON.parse(window.localStorage.getItem(storageKey('queue')) || '{}') as { pendingQueue?: ShopDataCrawlShopItem[]; activeTaskId?: number | null; activeQueueItem?: ShopDataCrawlShopItem | null; activeDispatched?: boolean; activeCountryCodes?: string[]; autoQueueEnabled?: boolean }
pendingQueue.value = state.pendingQueue || []
activeTaskId.value = state.activeTaskId || null
activeQueueItem.value = state.activeQueueItem || null
activeDispatched.value = state.activeDispatched || false
activeCountryCodes.value = state.activeCountryCodes || []
activeZiniaoVersion.value = state.activeZiniaoVersion || 'new'
autoQueueEnabled.value = state.autoQueueEnabled || false
} catch { pendingQueue.value = []; activeTaskId.value = null; activeQueueItem.value = null }
try { pollingTaskIds.value = JSON.parse(window.localStorage.getItem(storageKey('polling-task-ids')) || '[]') } catch { pollingTaskIds.value = [] }
@@ -312,7 +306,7 @@ function loadLocalState() {
}
function saveQueueState() {
setStorage('queue', { pendingQueue: pendingQueue.value, activeTaskId: activeTaskId.value, activeQueueItem: activeQueueItem.value, activeDispatched: activeDispatched.value, activeCountryCodes: activeCountryCodes.value, activeZiniaoVersion: activeZiniaoVersion.value, autoQueueEnabled: autoQueueEnabled.value })
setStorage('queue', { pendingQueue: pendingQueue.value, activeTaskId: activeTaskId.value, activeQueueItem: activeQueueItem.value, activeDispatched: activeDispatched.value, activeCountryCodes: activeCountryCodes.value, autoQueueEnabled: autoQueueEnabled.value })
setStorage('polling-task-ids', pollingTaskIds.value)
setStorage('task-snapshots', taskSnapshots.value)
}
@@ -476,7 +470,7 @@ async function waitForTerminal(taskId: number) {
function clearActiveTask() {
const taskId = activeTaskId.value
activeTaskId.value = null; activeQueueItem.value = null; activeDispatched.value = false
activeCountryCodes.value = []; activeZiniaoVersion.value = 'new'
activeCountryCodes.value = []
if (taskId) pollingTaskIds.value = pollingTaskIds.value.filter((id) => id !== taskId)
saveQueueState()
}
@@ -490,7 +484,6 @@ async function dispatchActiveTask(api: NonNullable<ReturnType<typeof getPywebvie
ts: Date.now(),
data: {
taskId: activeTaskId.value,
ziniao_version: activeZiniaoVersion.value,
items: [buildTaskItem(activeQueueItem.value)],
country_codes: [...activeCountryCodes.value],
},
@@ -557,7 +550,6 @@ async function processQueue() {
activeQueueItem.value = next
activeDispatched.value = false
activeCountryCodes.value = countries
activeZiniaoVersion.value = ziniaoVersion.value
pollingTaskIds.value = [...new Set([...pollingTaskIds.value, created.taskId])]
const createdItems = (created.items || []).map((item) => ({ ...item, taskId: item.taskId || created.taskId }))
taskSnapshots.value = { ...taskSnapshots.value, [created.taskId]: { task: { id: created.taskId, status: createdItems[0]?.taskStatus }, items: createdItems } }
@@ -58,7 +58,6 @@
<button type="button" class="schedule-add" :disabled="pushing" @click="addScheduleValue">添加时间点</button>
<p class="hint schedule-hint">启用后可按 `MM-DD HH:mm` 添加多个执行时间点。</p>
</div>
<ZiniaoVersionSetting v-model="ziniaoVersion" />
<div class="run-row">
<button type="button" class="btn-run" :disabled="matching" @click="runMatch">{{ matching ? '匹配中...' : '匹配店铺' }}</button>
@@ -125,7 +124,6 @@ import { ElMessage } from 'element-plus'
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue';
import TaskCenterPanel from '@/shared/components/tasks/TaskCenterPanel.vue'
import type { TaskItemView, TaskStatCard } from '@/shared/components/tasks/types'
import ZiniaoVersionSetting from '@/shared/components/ZiniaoVersionSetting.vue'
import { LISTING_FILTER_OPTIONS, type ListingFilterValue } from '@/pages/brand/components/listingFilters'
import { activateShopMatchTask, addShopMatchCandidate, createShopMatchTask, deleteShopMatchCandidate, deleteShopMatchHistory, deleteShopMatchTask, getShopMatchCountryPreference, getShopMatchDashboard, getShopMatchHistory, getShopMatchResultDownloadUrl, getShopMatchTaskProgressBatch, listShopMatchCandidates, matchShopMatchShops, putShopMatchCountryPreference, type ShopMatchCandidateVo, type ShopMatchCreateTaskItem, type ShopMatchDashboardVo, type ShopMatchHistoryItem, type ShopMatchShopQueueItem, type ShopMatchTaskDetailVo } from '@/shared/api/java-modules'
import { getPollingProgressBatch } from '@/shared/api/task-progress-polling.ts'
@@ -136,7 +134,6 @@ import { createCategorizedTimers } from '@/shared/utils/categorized-timers'
import { createRowId } from '@/shared/utils/row-id'
import { saveUrlWithProgress } from '@/shared/utils/download-progress'
import { taskStatusClass, taskStatusText } from '@/shared/utils/task-status-text'
import { useZiniaoVersion } from '@/shared/utils/ziniao-version'
import { runBatchDelete } from '@/shared/utils/batch-delete'
import { useTablePaging } from '@/shared/composables/useTablePaging.ts'
import { confirmTaskDeletion } from '@/shared/task-delete-confirm'
@@ -170,7 +167,6 @@ const queueWorkerRunning = ref(false)
const autoQueueEnabled = ref(false)
const queuePushResult = ref('')
const queuePayloadText = ref('')
const ziniaoVersion = useZiniaoVersion()
const orderedCountryCodes = ref<string[]>(['DE', 'UK', 'FR', 'IT', 'ES'])
const dragCountryIndex = ref<number | null>(null)
const countryPrefSaving = ref(false)
@@ -418,7 +414,6 @@ function buildQueuePayload(taskId: number, item: Pick<ShopMatchHistoryItem, 'sho
ts: Date.now(),
data: {
taskId,
ziniao_version: ziniaoVersion.value,
user_id: currentUserId(),
items: [{
shopName: item.shopName,
@@ -50,11 +50,9 @@ type ActiveNavKey =
| 'dedupe'
| 'convert'
| 'split'
| 'delete-brand'
| 'product-risk'
| 'shop-match'
| 'pricing'
| 'patrol-delete'
| 'query-asin'
| 'shop-data-crawl'
| 'withdraw'
@@ -114,11 +112,9 @@ const navGroups: ReadonlyArray<NavGroup> = [
label: '运营工具',
items: [
{ key: 'publish', label: '上架', href: '/publish' },
{ key: 'delete-brand', label: '删除ASIN', href: '/delete-brand' },
{ key: 'product-risk', label: '商品风险解决', href: '/product-risk' },
{ key: 'shop-match', label: '定时匹配', href: '/shop-match' },
{ key: 'pricing', label: '跟价', href: '/price-track', aliases: ['price-track'] },
{ key: 'patrol-delete', label: '巡店删除', href: '/patrol-delete' },
{ key: 'query-asin', label: '查询ASIN', href: '/query-asin' },
{ key: 'shop-data-crawl', label: '店铺数据抓取', href: '/shop-data-crawl', columnKey: 'shop_data_crawl', aliases: ['shop-data-crawl'] },
{ key: 'withdraw', label: '取款', href: '/withdraw' },
@@ -79,7 +79,6 @@
v-model:current-page="candidatePage"
/>
<ZiniaoVersionSetting v-model="ziniaoVersion" />
<div class="run-row">
<button
@@ -269,8 +268,6 @@ import { createCategorizedTimers } from "@/shared/utils/categorized-timers";
import { saveUrlWithProgress } from "@/shared/utils/download-progress";
import { checkQueuePayload } from "@/shared/dispatch-guard";
import { passGuard } from "@/shared/dispatch-guard-ui";
import ZiniaoVersionSetting from "@/shared/components/ZiniaoVersionSetting.vue";
import { useZiniaoVersion } from "@/shared/utils/ziniao-version";
import { formatDateTime } from '@/shared/utils/datetime'
import { RUNNING_UNTIL_DONE_STATUS_OPTIONS, taskStatusClass, taskStatusText } from '@/shared/utils/task-status-text'
import { useHistoryPolling } from '@/shared/composables/useHistoryPolling'
@@ -284,7 +281,6 @@ import { confirmTaskDeletion } from '@/shared/task-delete-confirm'
import { waitForTaskTerminal as waitForTaskTerminalShared } from '@/shared/utils/task-terminal'
const MAX_TRANSIENT_ERRORS = 30;
const ziniaoVersion = useZiniaoVersion();
type WithdrawTaskBatchQueueItem = {
batchId: string;
@@ -1002,7 +998,6 @@ function buildQueuePayload(taskId: number, batch: WithdrawTaskBatchQueueItem) {
ts: Date.now(),
data: {
task_id: taskId,
ziniao_version: ziniaoVersion.value,
user_id: Number(uidForStorage()) || 0,
source: "frontend-vue-withdraw",
reserved_amount: batch.reservedAmount,