Files
crawler-plugin/admin-frontend-vue/src/pages/tasks/DuplicateCheckPage.vue
T
huangzd1997 10dec12ec0 refactor(前端): 前后台界面小字全面精简——删技术ID括号/页头操作提示条/机制解释句(2026-11-28 客户口径「这些小字都不需要多余,还有shopId啥的…除了必须要的比如任务ID密钥,其他精简一些」)
用户端 frontend-vue:
- jd-publish-shop.ts:shopLabel 只出店名(缺名兜底「店铺 N」),跨店/多店琥珀文案压成一两句,判据逻辑零改动
- JdPublishTab:删工具头/分类解释/品牌句后半,默认店铺/选品/collect-hint/中断回执/加价规则各压一句
- JdCollectTab:删工具头 desc、分类机制句、断点游标行,「页面筛选未生效兜底翻页中」从任务卡撤下
- jd-on-shelf 空态一句、JdConsolePage hero-sub 整段删(含过时的「正在建设中」)
- 品牌 10 个 tab:输入/筛选/加载长句压一句或删,任务卡删「结果ID/店铺ID/平台」技术行(店名已显形)
- 保留:错误出口、额度「当前在架X/Y」、GROUPS_EMPTY 空态动作句、检测按钮与店铺显形

后管 admin-frontend-vue:
- 每页顶部「当前页面操作提示」条整条下线(删 OperationGuide.vue+operation-guides.ts)
- 撞款/任务中心/关键词用量/密钥用量/客户端包/教程/软件版本/数字人/菜单/店铺密钥/登录页逐页删说明小字(保留:踢线警示、「留空=永不过期」、「不要带v前缀」、「仅支持.zip」、草稿需手动发布、已授权人数、安全提示)
- 编辑/建号弹窗 label 括号收短;代理弹窗/设备日志(删 pywebview/kk-browser 进程名)/密钥 pill title/授权弹窗 dim/品牌门控空态收短

测试同步(16 支改反钉或同步断言,全部当场绿):
- align-operation-guide 整份重写为反钉(组件与文案表不得回流)
- source-pin 台账 task-center-board 条目手工点名 7/3/5→24/14/28:旧值是切分器把正则字面量内裸引号当字符串开关吞掉 18 支用例的误量(stripNonCode 不识别 regex literal),本次改写恰好移除该文件最后两处带引号正则后测出真值;真实用例数反而 25→24(删 1 支 guide 用例),非真实增长

门禁:后管 node --test 1965/1965+vitest 253/253+vue-tsc rc=0;用户端 node 1150/mount 149/vue-tsc rc=0;ops 快检 --fast overall=pass(后端9.5/后管8.8/客户端9.8/用户端9.6)。本窗不发版;app_client/jar/后端零改动。
2026-11-28 01:14:51 +08:00

1011 lines
53 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
/**
* 店铺数据重复检查 · 撞款控制台 —— 观感与交互像素级复刻 reference/asin-store-console(index.template.html),
* 数据源保持自家后端:/duplicate-check-console(指标/店铺/撞款全集/分组统计) + /duplicate-check-ledger(台账分页) + /duplicate-check-export(Excel)。
* 分组归属来自「店铺管理」真实店铺分组,本页只读展示,仅用于分组撞款范围切换。
*/
import { computed, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
import { useAdminSessionStore } from '@/stores/admin-session'
import { useCompanyTabStore } from '@/stores/company-tab'
import type { DuplicateItem, DuplicateOccurrence, DuplicateMetrics, DuplicateShop } from './duplicate-model.ts'
import { fetchDuplicateConsole, fetchDuplicateLedger, requestDuplicateExportBlob, type LedgerSortKey } from './duplicate-console-api.ts'
import {
aggregateDrawerRows,
drawerSummaryOf,
indexShopGroups,
itemBrandOf,
type DrawerAggRow,
type DrawerSummary,
type ShopGroups,
} from './duplicate-console-logic.ts'
import { useDuplicateMatrix } from './duplicate-matrix-window.ts'
import type { DuplicateConsole, LedgerRow } from './duplicate-console-model.ts'
import { ASIN_COUNTRY_CODES, asinCountryLabel } from '../asin/asin-country.ts'
import { orderedPair } from '@/utils/datetime'
type Tab = 'dup' | 'ledger'
type Scope = 'global' | 'group'
const consoleData = ref<DuplicateConsole | null>(null)
const loading = ref(false)
const loadError = ref('')
const reanalyzing = ref(false)
const filter = reactive({ asin: '', shop: '', group: '', country: '', dateFrom: '', dateTo: '' })
/** min/max 挡不住手输,落值后把倒挂的起止交换回来。 */
function clampDatePair(): void {
const [s, e] = orderedPair(filter.dateFrom, filter.dateTo)
filter.dateFrom = s
filter.dateTo = e
}
/** 角色范围:超管可看全部分组店铺并可跨分组筛选;管理员数据已由后端裁剪到自己分组,无需分组筛选。 */
const session = useAdminSessionStore()
const companyTab = useCompanyTabStore()
const isSuper = computed(() => session.isSuperAdmin)
const activeTab = ref<Tab>('dup')
const scope = ref<Scope>('global')
const selectedGroup = ref('')
const shopGroups = ref<ShopGroups>({ members: {}, shopGroupNames: {} })
/** 台账每页条数(全站统一:10/20/50/100 可选,默认 10)。 */
const ledgerPageSize = ref(10)
const ledgerItems = ref<LedgerRow[]>([])
const ledgerTotal = ref(0)
const ledgerPage = ref(1)
const ledgerLoading = ref(false)
const sortState = reactive<{ key: LedgerSortKey | ''; dir: 'asc' | 'desc' }>({ key: 'earliest', dir: 'asc' })
import OldPagination from '@/components/OldPagination.vue'
const drawerVisible = ref(false)
const drawerTitle = ref('')
const drawerBrand = ref('')
const drawerDup = ref(false)
const drawerOccurrences = ref<DuplicateOccurrence[]>([])
const drawerAggRows = computed<DrawerAggRow[]>(() => aggregateDrawerRows(drawerOccurrences.value))
const drawerSummary = computed<DrawerSummary>(() => drawerSummaryOf(drawerOccurrences.value))
const groupInfoVisible = ref(false)
let toastTimer: number | undefined
function toast(msg: string) {
const t = document.getElementById('dup-toast')
if (!t) return
t.textContent = msg
t.classList.add('show')
window.clearTimeout(toastTimer)
toastTimer = window.setTimeout(() => t.classList.remove('show'), 2400)
}
const overview = computed(() => consoleData.value?.overview ?? null)
const summary = computed<DuplicateMetrics | null>(() => overview.value?.summary ?? null)
const shops = computed(() => overview.value?.shops ?? [])
/** 当前撞款行窗口:服务端按 page/page_size(+dup_group) 切好的一窗(B60),页面不再自切全集。 */
const dupItems = computed<DuplicateItem[]>(() => consoleData.value?.dup ?? [])
const groupStats = computed(() => consoleData.value?.groups ?? [])
const countryOptions = computed<string[]>(() => {
const codes = new Set<string>(ASIN_COUNTRY_CODES as readonly string[])
for (const shop of shops.value) for (const code of shop.countryCodes || []) codes.add(code.toUpperCase())
for (const item of dupItems.value) for (const occ of item.occurrences) if (occ.country) codes.add(occ.country.toUpperCase())
return [...codes]
})
/** 店铺展示顺序(reference:按上架记录量降序),店铺分布/矩阵列/筛选下拉共用。 */
const orderedShops = computed<DuplicateShop[]>(() =>
[...shops.value].sort((a, b) => b.recordCount - a.recordCount || a.shopName.localeCompare(b.shopName)),
)
const kpis = computed(() => {
const s = summary.value
const totalDup = consoleData.value?.totalDup ?? dupItems.value.length
const groupDupTotal = groupStats.value.reduce((sum, group) => sum + group.dupCount, 0)
const groupSub = groupStats.value.map((group) => group.name).join(' / ')
const siteSub = [...countryOptions.value].map((code) => asinCountryLabel(code)).join(' / ')
return [
{ label: '唯一ASIN', value: (s?.asinTotal ?? 0).toLocaleString(), sub: '去重后', tone: '' },
{ label: '上架记录', value: (s?.recordTotal ?? 0).toLocaleString(), sub: '含重复扫描', tone: '' },
{ label: '在售店铺', value: (s?.shopCount ?? orderedShops.value.length).toLocaleString(), sub: '本批数据', tone: 'primary' },
{ label: '分组', value: groupStats.value.length.toLocaleString(), sub: groupSub || '未配置', tone: '' },
{ label: '全店撞款', value: totalDup.toLocaleString(), sub: '≥2店在售', tone: 'danger' },
{ label: '组内撞款', value: groupDupTotal.toLocaleString(), sub: '分组内≥2店', tone: groupDupTotal > 0 ? 'danger' : '' },
{ label: '覆盖站点', value: (s?.siteCount ?? 0).toLocaleString(), sub: siteSub, tone: '' },
]
})
const storeDistribution = computed(() => {
const list = orderedShops.value.map((shop) => ({ name: shop.shopName, group: shop.groupName, records: shop.recordCount, asins: shop.asinCount }))
const max = Math.max(1, ...list.map((item) => item.records))
return { max, list }
})
function selectedGroupMembers(): string[] {
if (!selectedGroup.value) return []
return shopGroups.value.members[selectedGroup.value] || []
}
const groupChips = computed(() => groupStats.value.filter((group) => group.shopCount >= 2))
const activeGroupStat = computed(() => groupStats.value.find((group) => group.name === selectedGroup.value) || null)
/** 撞款行总数:服务端在本页 + 本范围(全局或所选分组)内未分页的计数,翻页控件与 KPI 共用。 */
const totalDupCount = computed(() => consoleData.value?.totalDup ?? 0)
/** 撞款矩阵的行窗 + 列窗 + 格子视图(B60):状态与算法在 `duplicate-matrix-window.ts`,翻页动作交回这里。 */
const {
matrixPage,
matrixPageSize,
columnPage,
columnWindowTotal,
matrixAllColumns,
matrixShops,
matrixView,
matrixHint,
goMatrixPage,
changeMatrixSize,
goColumnPage,
resetMatrixWindows,
} = useDuplicateMatrix({
rows: dupItems,
groupMembers: computed(() => selectedGroupMembers()),
groupScoped: computed(() => scope.value === 'group'),
selectedGroup,
reload: () => void loadConsole(),
dataVersion: consoleData,
})
// ---- 撞款视图分页(分布/矩阵/撞款详情/抽屉明细;10/20/50/100 可选) ----
const distCount = computed(() => storeDistribution.value.list.length)
const distPage = ref(1)
const distPageSize = ref(10)
const pagedDistBars = computed(() =>
storeDistribution.value.list.slice((distPage.value - 1) * distPageSize.value, distPage.value * distPageSize.value),
)
const drawerPage = ref(1)
const drawerPageSize = ref(10)
const drawerRows = computed(() =>
drawerAggRows.value.slice((drawerPage.value - 1) * drawerPageSize.value, drawerPage.value * drawerPageSize.value),
)
/** 分组说明抽屉:分组统计表客户端分页(10/20/50/100 可选)。 */
const groupStatsPage = ref(1)
const groupStatsPageSize = ref(10)
const pagedGroupStats = computed(() =>
groupStats.value.slice((groupStatsPage.value - 1) * groupStatsPageSize.value, groupStatsPage.value * groupStatsPageSize.value),
)
watch([drawerOccurrences, groupStats], () => {
drawerPage.value = 1
groupStatsPage.value = Math.min(groupStatsPage.value, Math.max(1, Math.ceil(groupStats.value.length / groupStatsPageSize.value)))
})
/* ----- 矩阵单元格辅助 ----- */
function shopKey(name: string): string {
return (name || '').trim().toLowerCase()
}
function activeFilterParams() {
return { asin: filter.asin.trim(), shopName: filter.shop.trim(), group: filter.group.trim(), country: filter.country, site: '', dateFrom: filter.dateFrom, dateTo: filter.dateTo }
}
async function loadConsole() {
loading.value = true
loadError.value = ''
try {
consoleData.value = await fetchDuplicateConsole(
{ view: '', ...activeFilterParams() },
companyTab.requestCompanyId,
matrixPage.value,
matrixPageSize.value,
scope.value === 'group' ? selectedGroup.value : '',
)
shopGroups.value = indexShopGroups(orderedShops.value)
if (groupStats.value.length && !groupStats.value.some((group) => group.name === selectedGroup.value)) {
selectedGroup.value = groupChips.value[0] ? groupChips.value[0].name : ''
}
} catch (error) {
loadError.value = error instanceof Error ? error.message : '撞款数据加载失败'
toast(loadError.value)
} finally {
loading.value = false
}
}
async function loadLedger(page: number, resetSort = false) {
ledgerLoading.value = true
try {
if (resetSort) {
sortState.key = 'earliest'
sortState.dir = 'asc'
}
const result = await fetchDuplicateLedger(
{ view: '', ...activeFilterParams() },
page,
ledgerPageSize.value,
sortState.key,
sortState.dir,
companyTab.requestCompanyId,
)
ledgerItems.value = result.items
ledgerTotal.value = result.total
ledgerPage.value = result.page
} catch (error) {
toast(error instanceof Error ? error.message : '台账加载失败')
} finally {
ledgerLoading.value = false
}
}
function applyQuery() {
loadConsole()
if (activeTab.value === 'ledger') loadLedger(1)
}
function resetQuery() {
filter.asin = ''
filter.shop = ''
filter.group = ''
filter.country = ''
filter.dateFrom = ''
filter.dateTo = ''
scope.value = 'global'
selectedGroup.value = ''
activeTab.value = 'dup'
resetMatrixWindows()
applyQuery()
toast('筛选已重置')
}
function switchTab(tab: Tab) {
activeTab.value = tab
if (tab === 'ledger') loadLedger(1, true)
}
function switchScope(next: Scope) {
if (scope.value === next) return
scope.value = next
if (next === 'group' && !selectedGroup.value && groupChips.value.length) selectedGroup.value = groupChips.value[0].name
// 行范围换了(全局 ↔ 组内),服务端裁出来的那一窗也就换了 ⇒ 重新请一窗。
resetMatrixWindows()
void loadConsole()
}
/** 分组 chip:选中即换行范围,与 switchScope 同一条出口(不再在客户端重裁一遍全集)。 */
function selectGroup(name: string) {
if (selectedGroup.value === name && scope.value === 'group') return
scope.value = 'group'
selectedGroup.value = name
resetMatrixWindows()
void loadConsole()
}
async function reAnalyze() {
reanalyzing.value = true
try {
await loadConsole()
toast('重新分析完成,已同步最新扫描结果')
} catch (error) {
toast(error instanceof Error ? error.message : '重新分析失败')
} finally {
reanalyzing.value = false
}
}
interface ShopSiteBlock {
shopName: string
groupName: string
sites: { country: string; times: string[] }[]
count: number
}
/** occurrence 按 店铺 → 站点 → 时间 汇总成撞款卡结构。 */
function shopBlocks(item: DuplicateItem, restrictShops: string[] = []): ShopSiteBlock[] {
const restrict = new Set(restrictShops.map(shopKey))
const order: string[] = []
const blocks = new Map<string, ShopSiteBlock>()
for (const occ of item.occurrences || []) {
const shop = occ.shopName || ''
if (restrict.size && !restrict.has(shopKey(shop))) continue
let block = blocks.get(shop)
if (!block) {
block = { shopName: shop, groupName: occ.groupName || '', sites: [], count: 0 }
blocks.set(shop, block)
order.push(shop)
}
const country = occ.country || ''
let site = block.sites.find((entry) => entry.country === country)
if (!site) {
site = { country, times: [] }
block.sites.push(site)
}
if (occ.date) site.times.push(occ.date)
block.count++
}
return order.map((shop) => blocks.get(shop) as ShopSiteBlock)
}
function openDrawer(asin: string, brand: string, dupFlag: boolean, occurrences: DuplicateOccurrence[]) {
drawerTitle.value = asin
drawerBrand.value = brand
drawerDup.value = dupFlag
drawerOccurrences.value = [...occurrences]
drawerVisible.value = true
}
function openDupDrawer(item: DuplicateItem) {
openDrawer(item.asin, itemBrandOf(item), item.shopCount >= 2, item.occurrences)
}
function openLedgerDrawer(row: LedgerRow) {
openDrawer(row.asin, row.brand, row.storeCount >= 2, row.occurrences)
}
/* ----- 台账排序/分页(服务器端 sort_key/page_size) ----- */
const ledgerCols: { label: string; key: LedgerSortKey | '' }[] = [
{ label: 'ASIN', key: 'asin' },
{ label: '品牌', key: 'brand' },
{ label: '上架店铺', key: 'store_count' },
{ label: '涉及店铺', key: '' },
{ label: '分组', key: '' },
{ label: '站点', key: '' },
{ label: '上架次数', key: 'record_count' },
{ label: '最早上架', key: 'earliest' },
{ label: '最近上架', key: 'latest' },
{ label: '操作', key: '' },
]
function onSort(key: LedgerSortKey) {
if (sortState.key === key) sortState.dir = sortState.dir === 'asc' ? 'desc' : 'asc'
else {
sortState.key = key
sortState.dir = 'asc'
}
loadLedger(1)
}
const totalPages = computed(() => Math.max(1, Math.ceil(ledgerTotal.value / ledgerPageSize.value)))
function goPage(page: number) {
if (page < 1 || page > totalPages.value) return
loadLedger(page)
}
function changeLedgerSize(size: number) {
ledgerPageSize.value = size
loadLedger(1)
}
async function exportXlsx() {
let view = 'monitor'
const params = activeFilterParams()
if (activeTab.value === 'ledger') {
view = 'all'
} else if (scope.value === 'group' && selectedGroup.value) {
params.shopName = selectedGroup.value
}
try {
const blob = await requestDuplicateExportBlob({ view, ...params }, view, companyTab.requestCompanyId)
saveBlob(blob, `店铺数据_${activeTab.value === 'ledger' ? '台账' : '撞款'}_${new Date().toISOString().slice(0, 10)}.xlsx`)
toast('已导出 Excel')
} catch (error) {
toast(error instanceof Error ? error.message : '导出失败')
}
}
function saveBlob(blob: Blob, filename: string) {
const url = URL.createObjectURL(blob)
const anchor = document.createElement('a')
anchor.href = url
anchor.download = filename
anchor.click()
URL.revokeObjectURL(url)
}
function siteColor(code: string): string {
const map: Record<string, string> = { UK: '#2E5BE6', DE: '#D9912B', FR: '#7C5CD6', ES: '#1F9D62', IT: '#D63A4A' }
return map[code.toUpperCase()] || '#98A1B1'
}
// 切公司 = 重新取数。店铺/分组两个筛选项的候选字典本身就按公司收窄(/duplicate-check-console 的 shops/groups),
// 留着上一家选中的值会把新一家首屏筛成空页;分组范围(scope)一并回全店,否则切到没有分组的公司在
// loadConsole 的重挑分支(groupStats 为空时不触发)里留着一个不属于本公司的 selectedGroup。
watch(() => companyTab.activeId, () => { filter.shop = ''; filter.group = ''; selectedGroup.value = ''; scope.value = 'global'; void loadConsole(); void loadLedger(1) })
// 卸载时收掉 toast 的 2.4s 收尾定时器:否则离开本页后它还会去摸一个已经不存在的节点。
onUnmounted(() => {
window.clearTimeout(toastTimer)
})
onMounted(() => {
loadConsole()
// 台账 Tab 计数打开即显示:挂载时预取第一页拿 total(对齐 reference 渲染即见台账条数)。
void loadLedger(1)
})
</script>
<template>
<div class="dup-ref">
<div class="dup-head">
<div>
<h2>店铺数据撞款监控</h2>
</div>
</div>
<div v-if="loadError" class="load-banner">
<span>{{ loadError }}</span>
<button class="btn btn-ghost btn-sm" type="button" @click="loadConsole">重试</button>
<button class="btn btn-ghost btn-sm" type="button" @click="loadError = ''">知道了</button>
</div>
<!-- 筛选条件(撞款/台账专用) -->
<section class="card filter">
<div class="filter-title">筛选条件</div>
<div class="filter-row">
<div class="f-group">
<label>ASIN</label>
<input type="text" v-model="filter.asin" placeholder="模糊搜索ASIN" @keyup.enter="applyQuery" />
</div>
<div class="f-group">
<label>店铺</label>
<!-- 2026-11-17 用户口径「和亚马逊不统一」:原生 select 弹层是直角原生物,换 el-select。
「全部 XX」空值行保留,候选值原样透传。 -->
<el-select v-model="filter.shop" class="admin-filter" filterable style="width: 150px" aria-label="筛选店铺">
<el-option value="" label="全部店铺" />
<el-option v-for="shop in orderedShops" :key="shop.shopName" :value="shop.shopName" :label="shop.shopName" />
</el-select>
</div>
<div v-if="isSuper" class="f-group">
<label>分组</label>
<el-select v-model="filter.group" class="admin-filter" filterable style="width: 150px" aria-label="筛选分组">
<el-option value="" label="全部分组" />
<el-option v-for="group in groupStats" :key="group.name" :value="group.name" :label="group.name" />
</el-select>
</div>
<div class="f-group">
<label>国家 / 站点</label>
<el-select v-model="filter.country" class="admin-filter" style="width: 150px" aria-label="筛选国家">
<el-option value="" label="全部国家" />
<el-option v-for="code in countryOptions" :key="code" :value="code" :label="asinCountryLabel(code)" />
</el-select>
</div>
<div class="f-group">
<label>上架时间开始</label>
<input type="date" v-model="filter.dateFrom" :max="filter.dateTo" @change="clampDatePair" />
</div>
<div class="f-group">
<label>上架时间结束</label>
<input type="date" v-model="filter.dateTo" :min="filter.dateFrom" @change="clampDatePair" />
</div>
<div class="f-group">
<label>&nbsp;</label>
<button class="btn btn-primary" type="button" @click="applyQuery">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><circle cx="11" cy="11" r="7" /><path d="M21 21l-4.3-4.3" /></svg>
查询
</button>
</div>
<div class="f-group">
<label>&nbsp;</label>
<button class="btn btn-ghost" type="button" @click="resetQuery">重置</button>
</div>
</div>
</section>
<div v-loading="loading" class="dup-body-wrap">
<!-- KPI 统计 -->
<section v-if="consoleData" class="kpis">
<div v-for="kpi in kpis" :key="kpi.label" class="kpi" :class="kpi.tone">
<div class="k-label"><span class="k-dot"></span>{{ kpi.label }}</div>
<div class="k-value">{{ kpi.value }}</div>
<div class="k-sub">{{ kpi.sub }}</div>
</div>
</section>
<!-- 店铺上架分布 -->
<section v-if="consoleData" class="card store-strip">
<div class="strip-head">
<span class="strip-title">店铺上架分布</span>
</div>
<div class="strip-bars">
<div v-for="bar in pagedDistBars" :key="bar.name" class="s-bar">
<div class="s-name">
<span>{{ bar.name }}<span v-if="bar.group" class="s-grp"> · {{ bar.group }}</span></span>
<b>{{ bar.records.toLocaleString() }}</b>
</div>
<div class="s-track"><div class="s-fill" :style="{ width: Math.round((bar.records / storeDistribution.max) * 100) + '%' }"></div></div>
<div class="s-meta">{{ bar.asins.toLocaleString() }} 个 ASIN</div>
</div>
</div>
<OldPagination :total="distCount" :page="distPage" :page-size="distPageSize" @change="distPage = $event" @size-change="(s: number) => { distPageSize = s; distPage = 1 }" />
</section>
<!-- 主区 Tabs + 操作 -->
<div class="content-head">
<div class="tabs">
<button class="tab" :class="{ active: activeTab === 'dup' }" type="button" @click="switchTab('dup')">撞款监控 <span class="t-count">{{ totalDupCount }}</span></button>
<button class="tab" :class="{ active: activeTab === 'ledger' }" type="button" @click="switchTab('ledger')">全部ASIN台账 <span class="t-count">{{ ledgerTotal }}</span></button>
</div>
<div class="actions">
<span v-if="overview" class="updated">数据更新时间 {{ overview.scannedAt || '—' }}</span>
<button v-if="isSuper" class="btn btn-ghost btn-sm" type="button" @click="groupInfoVisible = true">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" /><circle cx="9" cy="7" r="4" /><path d="M23 21v-2a4 4 0 0 0-3-3.87" /><path d="M16 3.13a4 4 0 0 1 0 7.75" /></svg>
分组说明
</button>
<button class="btn btn-ghost btn-sm" type="button" :disabled="reanalyzing" @click="reAnalyze">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-2.6-6.4" /><path d="M21 3v6h-6" /></svg>
{{ reanalyzing ? '重新分析中…' : '重新分析' }}
</button>
<button class="btn btn-ghost btn-sm" type="button" @click="exportXlsx">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v12" /><path d="M7 10l5 5 5-5" /><path d="M4 21h16" /></svg>
导出
</button>
</div>
</div>
<!-- ============ 撞款监控 ============ -->
<template v-if="consoleData && activeTab === 'dup'">
<div v-if="isSuper" class="scope-bar">
<div class="seg">
<button class="seg-btn" :class="{ active: scope === 'global' }" type="button" @click="switchScope('global')">全店撞款</button>
<button class="seg-btn" :class="{ active: scope === 'group' }" type="button" @click="switchScope('group')">分组撞款</button>
</div>
<div v-if="scope === 'group'" class="group-chips">
<template v-if="groupChips.length">
<button v-for="group in groupChips" :key="group.name" type="button" class="g-chip" :class="{ active: selectedGroup === group.name, dup: group.dupCount > 0 }" @click="selectGroup(group.name)">
{{ group.name }} <span class="g-count">{{ group.shopCount }}店 · {{ group.dupCount }}撞款</span>
</button>
</template>
<span v-else class="chip-empty">暂无 ≥2 家店铺的分组,无法做分组撞款分析</span>
</div>
</div>
<div v-if="scope === 'group' && activeGroupStat" class="group-summary card">
<div class="gs-item"><div class="gs-v">{{ activeGroupStat.shopCount }}</div><div class="gs-l">组员店铺</div></div>
<div class="gs-item"><div class="gs-v">{{ activeGroupStat.asinUnique.toLocaleString() }}</div><div class="gs-l">组内唯一ASIN</div></div>
<div class="gs-item"><div class="gs-v">{{ activeGroupStat.recordCount.toLocaleString() }}</div><div class="gs-l">组内上架记录</div></div>
<div class="gs-item" :class="{ warn: activeGroupStat.dupCount > 0 }"><div class="gs-v">{{ activeGroupStat.dupCount }}</div><div class="gs-l">组内撞款ASIN</div></div>
</div>
<div class="section-title">
撞款覆盖矩阵 <span class="hint">{{ matrixHint }}</span>
<span v-if="columnWindowTotal > 1" class="col-window">
<button type="button" class="link-btn" :disabled="columnPage <= 1" @click="goColumnPage(-1)">‹ 上一窗列</button>
列 {{ columnPage }}/{{ columnWindowTotal }}(共 {{ matrixAllColumns.length }} 列)
<button type="button" class="link-btn" :disabled="columnPage >= columnWindowTotal" @click="goColumnPage(1)">下一窗列 ›</button>
</span>
</div>
<div class="matrix-wrap">
<table v-if="dupItems.length" class="matrix">
<thead>
<tr>
<th>ASIN</th>
<th>品牌</th>
<th v-for="shop in matrixShops" :key="shop" style="text-align:center">{{ shop }}</th>
</tr>
</thead>
<tbody>
<tr v-for="row in matrixView" :key="row.asin" @click="openDupDrawer(row.item)">
<td><span class="asin-code">{{ row.asin }}</span></td>
<td><span class="m-brand">{{ row.brand }}</span></td>
<td v-for="(cell, index) in row.cells" :key="matrixShops[index]" style="text-align:center">
<div class="m-cell" :class="{ empty: cell.count === 0 }" :title="cell.title">
{{ cell.count || '' }}
<span class="dots"><span v-for="code in cell.dots" :key="code" class="m-dot" :style="{ background: siteColor(code) }"></span></span>
</div>
</td>
</tr>
</tbody>
</table>
<div v-else class="empty-state">
<div class="e-title">当前范围下没有撞款ASIN</div>
调整筛选条件或切换到其他分组查看
</div>
</div>
<OldPagination :total="totalDupCount" :page="matrixPage" :page-size="matrixPageSize" @change="goMatrixPage" @size-change="changeMatrixSize" />
<div class="section-title" style="margin-top:24px">撞款详情</div>
<div v-if="dupItems.length" class="dup-grid">
<div v-for="item in dupItems" :key="item.asin" class="dup-card">
<div class="dup-head">
<span class="asin-code">{{ item.asin }}</span>
<span class="badge dup">{{ item.shopCount }}店在售</span>
<span class="d-brand">{{ itemBrandOf(item) || '未知品牌' }}</span>
<button class="link-btn" type="button" @click="openDupDrawer(item)">查看明细</button>
</div>
<div class="dup-body">
<div v-for="block in shopBlocks(item)" :key="block.shopName" class="store-col">
<div class="st-name">{{ block.shopName }}<span class="st-count">{{ block.count }} 条</span></div>
<div v-if="isSuper && block.groupName" class="st-grp">分组:{{ block.groupName }}</div>
<template v-for="site in block.sites" :key="site.country">
<div class="c-site"><span class="m-dot" :style="{ background: siteColor(site.country) }"></span>{{ asinCountryLabel(site.country) }} · {{ site.times.length }} 次</div>
<div class="c-times"><span v-for="(time, index) in site.times" :key="index" class="c-time">{{ time }}</span></div>
</template>
</div>
</div>
</div>
</div>
<div v-else class="dup-empty">当前范围下没有撞款ASIN</div>
<OldPagination :total="totalDupCount" :page="matrixPage" :page-size="matrixPageSize" @change="goMatrixPage" @size-change="changeMatrixSize" />
<div class="dup-total">共 <b>{{ dupItems.length }}</b> 条{{ scope === 'group' && selectedGroup ? `分组「${selectedGroup}」组内撞款ASIN` : '全店撞款ASIN' }}</div>
</template>
<!-- ============ 全部ASIN台账 ============ -->
<template v-else-if="consoleData">
<div class="table-wrap" v-loading="ledgerLoading">
<table v-if="ledgerItems.length" class="ledger">
<thead>
<tr>
<th v-for="col in ledgerCols" :key="col.label" :class="{ sortable: !!col.key }" @click="col.key && onSort(col.key)">
{{ col.label }}<span v-if="sortState.key === col.key" class="arr">{{ sortState.dir === 'asc' ? '▲' : '▼' }}</span>
</th>
</tr>
</thead>
<tbody>
<tr v-for="row in ledgerItems" :key="row.asin">
<td><span class="link" @click="openLedgerDrawer(row)">{{ row.asin }}</span></td>
<td class="brand-cell">{{ row.brand || '—' }}</td>
<td><span class="badge" :class="row.storeCount >= 2 ? 'dup' : 'single'">{{ row.storeCount }} 店</span></td>
<td class="chips-cell"><span v-for="store in row.stores" :key="store" class="badge store">{{ store }}</span></td>
<td class="chips-cell">
<template v-if="row.groups.length"><span v-for="group in row.groups" :key="group" class="badge country">{{ group }}</span></template>
<span v-else class="dim-cell">—</span>
</td>
<td><span v-for="code in row.countries" :key="code" class="site-chip" :style="{ background: siteColor(code) + '1F', color: siteColor(code) }">{{ asinCountryLabel(code) }}</span></td>
<td class="num-cell">{{ row.recordCount }}</td>
<td class="mono dt-cell">{{ row.earliest || '—' }}</td>
<td class="mono dt-cell">{{ row.latest || '—' }}</td>
<td><button class="btn btn-ghost btn-sm" type="button" @click="openLedgerDrawer(row)">明细</button></td>
</tr>
</tbody>
</table>
<div v-else class="empty-state">
<div class="e-title">暂无台账记录</div>
调整筛选条件或触发重新分析后再查看
</div>
</div>
<OldPagination v-if="ledgerTotal" :total="ledgerTotal" :page="ledgerPage" :page-size="ledgerPageSize" @change="goPage" @size-change="changeLedgerSize" />
</template>
<div v-if="!consoleData && !loadError" class="card empty-state">
<div class="e-title">暂无扫描结果</div>
请点击右上角「重新分析」触发撞款扫描
</div>
</div>
<!-- 明细抽屉 -->
<div class="mask" :class="{ show: drawerVisible }" v-show="drawerVisible" @click="drawerVisible = false"></div>
<aside class="drawer" :class="{ show: drawerVisible }" v-show="drawerVisible">
<div class="drawer-head">
<span class="d-title">{{ drawerTitle }}</span>
<span v-if="drawerDup" class="badge dup">撞款</span>
<button class="drawer-close" type="button" @click="drawerVisible = false">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18" /></svg>
</button>
</div>
<div class="drawer-body">
<div class="d-brand">品牌:{{ drawerBrand || '未知' }}</div>
<div class="d-summary">
<span class="badge store">{{ drawerSummary.shopCount }} 家店铺</span>
<template v-for="code in drawerSummary.countries" :key="code"><span class="site-chip" :style="{ background: siteColor(code) + '1F', color: siteColor(code) }">{{ asinCountryLabel(code) }}</span></template>
<span class="badge single">{{ drawerSummary.totalRecords }} 次上架</span>
<span class="badge time">最早上架 {{ drawerSummary.earliest || '—' }}</span>
</div>
<table v-if="drawerAggRows.length" class="d-table">
<thead>
<tr><th>店铺</th><th v-if="isSuper">分组</th><th>站点</th><th>上架时间(按时间升序)</th><th>次数</th></tr>
</thead>
<tbody>
<tr v-for="row in drawerRows" :key="row.shopName + '|' + row.country">
<td class="cell-strong">{{ row.shopName }}</td>
<td v-if="isSuper"><span class="d-stgrp">{{ row.groupName || '—' }}</span></td>
<td><span class="site-chip" :style="{ background: siteColor(row.country) + '1F', color: siteColor(row.country) }">{{ asinCountryLabel(row.country || '') }}</span></td>
<td><template v-for="(time, index) in row.times" :key="index"><span class="d-time">{{ time }}</span></template></td>
<td class="num-cell">{{ row.count }}</td>
</tr>
</tbody>
</table>
<div v-else class="dup-empty">暂无上架时间明细</div>
<OldPagination v-if="drawerAggRows.length > drawerPageSize" :total="drawerAggRows.length" :page="drawerPage" :page-size="drawerPageSize" @change="drawerPage = $event" @size-change="(s: number) => { drawerPageSize = s; drawerPage = 1 }" />
</div>
</aside>
<!-- 分组说明(只读,来自店铺管理) -->
<div class="mask" :class="{ show: groupInfoVisible }" v-show="groupInfoVisible" @click="groupInfoVisible = false"></div>
<aside class="drawer" :class="{ show: groupInfoVisible }" v-show="groupInfoVisible" style="width:560px">
<div class="drawer-head">
<span class="m-title">分组撞款说明</span>
<button class="drawer-close" type="button" @click="groupInfoVisible = false">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18" /></svg>
</button>
</div>
<div class="drawer-body">
<table class="d-table">
<thead><tr><th>分组</th><th>店铺数</th><th>成员店铺</th><th>组内撞款</th></tr></thead>
<tbody>
<tr v-for="group in pagedGroupStats" :key="group.name">
<td class="cell-strong">{{ group.name }}</td>
<td class="num-cell">{{ group.shopCount }}</td>
<td><template v-for="shop in (shopGroups.members[group.name] || [])" :key="shop"><span class="badge store">{{ shop }}</span></template></td>
<td class="num-cell">{{ group.dupCount }}</td>
</tr>
<tr v-if="!groupStats.length"><td colspan="4" class="empty-cell">暂无分组</td></tr>
</tbody>
</table>
<OldPagination v-if="groupStats.length > groupStatsPageSize" :total="groupStats.length" :page="groupStatsPage" :page-size="groupStatsPageSize" @change="groupStatsPage = $event" @size-change="(s: number) => { groupStatsPageSize = s; groupStatsPage = 1 }" />
</div>
</aside>
<div id="dup-toast"></div>
</div>
</template>
<style>
/* ============================================================
像素级复刻 reference asin-store-console(index.template.html):
页面内独立令牌 + 组件观感。所有选择器前缀 .dup-ref 防外泄。
============================================================ */
.dup-ref {
/* reference 设计令牌 */
--bg: #F2F4F8;
--surface: #FFFFFF;
--border: #E5E9F0;
--border-strong: #D5DBE6;
--text: #1C2230;
--text2: #5A6474;
--text3: #98A1B1;
--primary: #2E5BE6;
--primary-hover: #1E4BD8;
--primary-weak: #EAF0FF;
--danger: #D63A4A;
--danger-weak: #FDEBED;
--green: #1F9D62;
--green-weak: #E7F7EF;
--amber: #D9912B;
--amber-weak: #FCF2E3;
--mono: "Cascadia Mono", "SF Mono", Consolas, "Courier New", monospace;
--shadow: 0 1px 2px rgba(20, 30, 60, 0.05), 0 4px 18px rgba(20, 30, 60, 0.06);
--radius: 10px;
max-width: 1560px;
margin: 0 auto;
color: var(--text);
font-size: 13px;
line-height: 1.55;
-webkit-font-smoothing: antialiased;
}
.dup-ref .mono { font-family: var(--mono); }
.dup-ref button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.dup-ref button:disabled { opacity: 0.55; cursor: not-allowed; }
/* 原生 select 已换 el-select(2026-11-17)⇒ 选择器里不再列 select。 */
.dup-ref input { font-family: inherit; font-size: 13px; color: var(--text); }
.dup-ref a { color: var(--primary); text-decoration: none; }
.dup-ref .dim-cell { color: var(--text3); }
.dup-ref .num-cell { font-variant-numeric: tabular-nums; }
.dup-ref .cell-strong { font-weight: 600; }
.dup-ref .empty-cell { text-align: center; color: var(--text3); padding: 18px 10px !important; }
/* ---------- 页面标题(本页在 admin 壳内的控制台头部) ---------- */
.dup-ref .dup-head { margin: 0 0 18px; }
.dup-ref .dup-head h2 { margin: 0; font-size: 20px; color: var(--text); }
.dup-ref .dup-head p { margin: 7px 0 0; color: var(--text2); font-size: 13px; }
.dup-ref .load-banner {
display: flex; align-items: center; justify-content: space-between; gap: 12px;
background: var(--danger-weak); color: var(--danger);
border: 1px solid #F3C6CC; border-radius: var(--radius);
padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
/* ---------- 卡片 ---------- */
.dup-ref .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
/* ---------- 筛选条件 ---------- */
.dup-ref .filter { padding: 16px 18px; margin-bottom: 16px; }
.dup-ref .filter-title { font-size: 12px; color: var(--text3); margin-bottom: 12px; letter-spacing: 0.5px; }
.dup-ref .filter-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.dup-ref .f-group { display: flex; flex-direction: column; gap: 6px; }
.dup-ref .f-group label { font-size: 12px; color: var(--text2); }
/* 下拉已换 el-select(2026-11-17)⇒ 皮肤走全局 .admin-filter。
本页 style 块不是 scoped,`.f-group input` 会连带命中 el-select 内层的
`input.el-select__input`(EP 自己的边框/背景会被这套规则压掉,控件变成框里套框)
⇒ 必须显式排除。 */
.dup-ref .f-group input:not(.el-select__input) {
width: 170px;
height: 34px; border: 1px solid var(--border-strong); border-radius: 7px; padding: 0 10px; background: #FBFCFE; outline: none;
transition: border-color 0.15s, box-shadow 0.15s;
}
.dup-ref .f-group input:not(.el-select__input):focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 91, 230, 0.12); background: #fff; }
.dup-ref .f-group input[type="date"] { width: 150px; }
/* 本页筛选行是 34px 紧凑档(输入框与 `.btn` 同为 34px、7px 圆角、蓝色 focus)。
新换的 el-select 若照全局 admin-filter(42px/9px/蓝灰 ring)会与同行输入框错位
⇒ 在本页把壳压回本地档位;本页 style 不 scoped,EP 内部结构可直接选中。 */
.dup-ref .f-group .el-select__wrapper {
min-height: 34px; padding: 0 10px; border-radius: 7px;
background: #FBFCFE; box-shadow: 0 0 0 1px var(--border-strong) inset; font-size: 13px;
}
.dup-ref .f-group .el-select__wrapper.is-focused {
background: #fff; box-shadow: 0 0 0 1px var(--primary) inset, 0 0 0 3px rgba(46, 91, 230, 0.12);
}
.dup-ref .btn {
height: 34px; border-radius: 7px; padding: 0 16px; font-size: 13px; font-weight: 600;
display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dup-ref .btn-primary { background: #4f78a5; color: #fff; }
.dup-ref .btn-primary:hover { background: #5d83ac; }
.dup-ref .btn-ghost { background: #fff; color: var(--text2); border: 1px solid var(--border-strong); }
.dup-ref .btn-ghost:hover { border-color: #4f78a5; color: #4f78a5; }
.dup-ref .btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
/* ---------- KPI 统计 ---------- */
.dup-ref .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.dup-ref .kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.dup-ref .kpi .k-label { font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dup-ref .kpi .k-value { font-size: 26px; font-weight: 700; letter-spacing: 0.3px; font-variant-numeric: tabular-nums; }
.dup-ref .kpi .k-sub { font-size: 11px; color: var(--text3); margin-top: 3px; }
.dup-ref .kpi.danger .k-value { color: var(--danger); }
.dup-ref .kpi.primary .k-value { color: var(--primary); }
.dup-ref .k-dot { width: 8px; height: 8px; border-radius: 50%; background: #B8C0CE; }
.dup-ref .kpi.danger .k-dot { background: var(--danger); }
.dup-ref .kpi.primary .k-dot { background: var(--primary); }
/* ---------- 店铺分布条 ---------- */
.dup-ref .store-strip { padding: 14px 18px; margin-bottom: 16px; }
.dup-ref .strip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dup-ref .strip-title { font-size: 13px; font-weight: 600; }
.dup-ref .strip-note { font-size: 11px; color: var(--text3); }
.dup-ref .strip-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px 20px; }
.dup-ref .s-bar .s-name { font-size: 12px; color: var(--text2); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; }
.dup-ref .s-bar .s-name b { color: var(--text); font-weight: 600; }
.dup-ref .s-grp { color: var(--text3); font-weight: 400; font-size: 11px; }
.dup-ref .s-track { height: 8px; background: #EEF1F6; border-radius: 5px; overflow: hidden; }
.dup-ref .s-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2E5BE6, #6C8BEF); }
.dup-ref .s-bar .s-meta { font-size: 11px; color: var(--text3); margin-top: 5px; }
/* ---------- 内容区头部(Tabs + 操作) ---------- */
.dup-ref .content-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; flex-wrap: wrap; gap: 10px; }
.dup-ref .tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 4px; }
.dup-ref .tab {
padding: 7px 18px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text2);
display: inline-flex; align-items: center; gap: 7px; transition: all 0.15s;
}
.dup-ref .tab:hover { color: var(--primary); }
.dup-ref .tab.active { background: var(--primary); color: #fff; }
.dup-ref .tab .t-count { background: rgba(0, 0, 0, 0.12); border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.dup-ref .tab.active .t-count { background: rgba(255, 255, 255, 0.25); }
.dup-ref .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dup-ref .actions .updated { font-size: 11px; color: var(--text3); margin-right: 4px; }
/* ---------- 撞款检测范围(分段控件) ---------- */
.dup-ref .scope-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.dup-ref .seg { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 4px; box-shadow: var(--shadow); }
.dup-ref .seg-btn { padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text2); transition: all 0.15s; }
.dup-ref .seg-btn:hover { color: var(--primary); }
.dup-ref .seg-btn.active { background: var(--primary); color: #fff; }
.dup-ref .group-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dup-ref .g-chip {
display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
background: var(--surface); border: 1px solid var(--border-strong); color: var(--text2); transition: all 0.15s; box-shadow: var(--shadow);
}
.dup-ref .g-chip:hover { border-color: var(--primary); color: var(--primary); }
.dup-ref .g-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.dup-ref .g-chip.dup:not(.active) { border-color: #F3C6CC; background: var(--danger-weak); color: var(--danger); }
.dup-ref .g-chip .g-count { font-size: 11px; font-weight: 500; opacity: 0.85; }
.dup-ref .chip-empty { font-size: 12px; color: var(--text3); }
/* ---------- 分组概览 ---------- */
.dup-ref .group-summary { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; margin-bottom: 16px; }
.dup-ref .gs-item { padding: 16px 20px; border-right: 1px solid var(--border); }
.dup-ref .gs-item:last-child { border-right: none; }
.dup-ref .gs-item.warn { background: var(--danger-weak); }
.dup-ref .gs-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dup-ref .gs-item.warn .gs-v { color: var(--danger); }
.dup-ref .gs-l { font-size: 12px; color: var(--text2); margin-top: 4px; }
/* ---------- 撞款覆盖矩阵 ---------- */
.dup-ref .section-title { font-size: 14px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.dup-ref .section-title .hint { font-size: 11px; font-weight: 400; color: var(--text3); }
.dup-ref .matrix-wrap { overflow-x: auto; overflow-y: auto; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); max-height: 480px; }
/* 列窗口控件:与 section-title 同行,只在看得到第二窗列时出现。 */
.dup-ref .col-window { margin-left: 12px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); }
.dup-ref .col-window .link-btn:disabled { color: var(--text3); cursor: not-allowed; }
.dup-ref table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--surface); }
.dup-ref table.matrix th {
background: #F7F9FC; color: var(--text2); font-size: 12px; font-weight: 600; padding: 10px 12px;
border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap;
position: sticky; top: 0; z-index: 1;
}
.dup-ref table.matrix td { padding: 9px 12px; border-bottom: 1px solid #EFF2F7; vertical-align: middle; font-size: 12.5px; white-space: nowrap; }
.dup-ref table.matrix tbody tr { cursor: pointer; }
.dup-ref table.matrix tbody tr:hover td { background: #F7FAFF; }
.dup-ref .m-brand { color: var(--text2); }
.dup-ref .m-cell {
width: 34px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
font-weight: 700; font-size: 12.5px; color: var(--primary); background: var(--primary-weak); position: relative;
}
.dup-ref .m-cell.empty { background: #F1F3F8; color: #C4CBD8; font-weight: 400; }
.dup-ref .m-cell .dots { position: absolute; bottom: 2px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.dup-ref .m-dot { width: 4px; height: 4px; border-radius: 50%; display: inline-block; }
.dup-ref .asin-code { font-family: var(--mono); font-weight: 700; font-size: 12.5px; letter-spacing: 0.4px; color: var(--primary); }
/* ---------- 撞款详情卡片 ---------- */
.dup-ref .badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 2px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.dup-ref .badge.dup { background: var(--danger-weak); color: var(--danger); }
.dup-ref .badge.single { background: var(--green-weak); color: var(--green); }
.dup-ref .badge.store { background: var(--primary-weak); color: var(--primary); }
.dup-ref .badge.country { background: #EFF2F8; color: var(--text2); font-weight: 500; }
.dup-ref .badge.time { background: #F1F3F8; color: var(--text2); }
.dup-ref .dup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(368px, 1fr)); gap: 16px; }
.dup-ref .dup-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.dup-ref .dup-head {
padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
background: linear-gradient(180deg, #FBFCFE, #F6F8FC);
}
.dup-ref .dup-head .d-brand { font-size: 12px; color: var(--text2); font-weight: 500; margin-left: 2px; }
.dup-ref .dup-head .link-btn { margin-left: auto; font-size: 12px; color: var(--primary); font-weight: 600; }
.dup-ref .dup-head .link-btn:hover { text-decoration: underline; }
.dup-ref .dup-body { padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; flex: 1; align-content: start; }
.dup-ref .store-col .st-name { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.dup-ref .store-col .st-name .st-count { font-size: 11px; color: var(--text3); font-weight: 400; }
.dup-ref .store-col .st-grp { font-size: 10.5px; color: var(--text3); font-weight: 400; margin-bottom: 4px; }
.dup-ref .c-site { font-size: 11px; color: var(--text2); margin-top: 8px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.dup-ref .c-site .m-dot { width: 6px; height: 6px; }
.dup-ref .c-times { margin-top: 3px; }
.dup-ref .c-time { font-family: var(--mono); font-size: 11.5px; color: var(--text2); line-height: 1.7; display: block; }
.dup-ref .dup-empty { padding: 40px; text-align: center; color: var(--text3); font-size: 13px; }
.dup-ref .dup-total { margin-top: 12px; color: var(--text2); font-size: 12.5px; }
.dup-ref .dup-total b { color: var(--text); }
/* ---------- 全部ASIN台账表 ---------- */
.dup-ref .table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.dup-ref table.ledger { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--surface); }
.dup-ref table.ledger th {
background: #F7F9FC; color: var(--text2); font-size: 12px; font-weight: 600; padding: 11px 12px;
border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; user-select: none; position: sticky; top: 0; z-index: 1;
}
.dup-ref table.ledger th.sortable { cursor: pointer; }
.dup-ref table.ledger th.sortable:hover { color: var(--primary); }
.dup-ref table.ledger th .arr { font-size: 10px; margin-left: 4px; color: var(--text3); }
.dup-ref table.ledger td { padding: 10px 12px; border-bottom: 1px solid #EFF2F7; font-size: 12.5px; white-space: nowrap; }
.dup-ref table.ledger tbody tr:hover td { background: #F7FAFF; }
.dup-ref table.ledger .link { color: var(--primary); font-weight: 600; cursor: pointer; }
.dup-ref table.ledger .link:hover { text-decoration: underline; }
.dup-ref .brand-cell { color: var(--text2); }
.dup-ref .chips-cell { max-width: 230px; }
.dup-ref .chips-cell .badge { margin-right: 4px; margin-bottom: 2px; }
.dup-ref .dt-cell { font-size: 11.5px; color: var(--text2); }
.dup-ref .site-chip { border-radius: 5px; padding: 1px 7px; font-size: 11.5px; margin-right: 4px; margin-bottom: 2px; font-weight: 600; display: inline-block; white-space: nowrap; }
/* ---------- 分页:台账/分布/矩阵/详情/抽屉统一共享 OldPagination(自带条数选择),无自绘 pager ---------- */
/* ---------- 空态 / 加载 ---------- */
.dup-ref .empty-state { padding: 48px 20px; text-align: center; color: var(--text3); font-size: 13px; }
.dup-ref .empty-state .e-title { font-size: 14px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.dup-ref .dup-body-wrap { min-height: 120px; }
/* ---------- 抽屉(明细) ---------- */
.dup-ref .mask { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.42); z-index: 100; }
.dup-ref .drawer {
position: fixed; top: 0; right: 0; bottom: 0; width: 540px; max-width: 92vw; background: var(--surface); z-index: 101;
box-shadow: -8px 0 30px rgba(20, 30, 60, 0.18); display: flex; flex-direction: column;
}
.dup-ref .drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dup-ref .drawer-head .d-title { font-size: 15px; font-weight: 700; font-family: var(--mono); color: var(--primary); }
.dup-ref .drawer-head .m-title { font-size: 15px; font-weight: 700; }
.dup-ref .drawer-close { margin-left: auto; width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: var(--text3); }
.dup-ref .drawer-close:hover { background: #F1F3F8; color: var(--text); }
.dup-ref .drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.dup-ref .d-brand { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.dup-ref .d-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; align-items: center; }
.dup-ref .d-table { width: 100%; border-collapse: collapse; }
.dup-ref .d-table th { background: #F7F9FC; font-size: 12px; color: var(--text2); text-align: left; padding: 8px 10px; border: 1px solid var(--border); }
.dup-ref .d-table td { padding: 8px 10px; border: 1px solid var(--border); font-size: 12.5px; vertical-align: top; }
.dup-ref .d-table .d-time { font-family: var(--mono); font-size: 11.5px; display: block; line-height: 1.8; color: var(--text2); }
.dup-ref .d-stgrp { font-size: 11px; color: var(--text3); }
.dup-ref .note { font-size: 12px; color: var(--text2); line-height: 1.7; margin: 0 0 14px; }
/* ---------- Toast ---------- */
.dup-ref #dup-toast {
position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px); z-index: 200;
background: #1C2230; color: #fff; padding: 10px 18px; border-radius: 9px; font-size: 13px;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); opacity: 0; pointer-events: none; transition: all 0.25s;
max-width: 70vw; text-align: center;
}
.dup-ref #dup-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
</style>