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/后端零改动。
This commit is contained in:
2026-11-28 01:14:51 +08:00
parent 35e4645358
commit 10dec12ec0
67 changed files with 159 additions and 698 deletions
@@ -18,7 +18,6 @@ import {
import GlobalErrorContainer from '@/layout/GlobalErrorContainer.vue' import GlobalErrorContainer from '@/layout/GlobalErrorContainer.vue'
import NotificationBell from '@/components/NotificationBell.vue' import NotificationBell from '@/components/NotificationBell.vue'
import ExpiryNotice from '@/components/ExpiryNotice.vue' import ExpiryNotice from '@/components/ExpiryNotice.vue'
import OperationGuide from '@/layout/OperationGuide.vue'
import CompanyTabs from '@/layout/CompanyTabs.vue' import CompanyTabs from '@/layout/CompanyTabs.vue'
import { crumbsForActiveRoute, resolveDocumentTitle, updateDocumentTitle } from '@/layout/title-breadcrumb' import { crumbsForActiveRoute, resolveDocumentTitle, updateDocumentTitle } from '@/layout/title-breadcrumb'
import { showAdminFeedback } from '@/components/admin-feedback-ui' import { showAdminFeedback } from '@/components/admin-feedback-ui'
@@ -205,7 +204,6 @@ async function signOut() {
<el-breadcrumb-item v-for="crumb in breadcrumbs" :key="crumb.key">{{ crumb.name }}</el-breadcrumb-item> <el-breadcrumb-item v-for="crumb in breadcrumbs" :key="crumb.key">{{ crumb.name }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
<CompanyTabs /> <CompanyTabs />
<OperationGuide />
<GlobalErrorContainer /> <GlobalErrorContainer />
<el-alert v-if="session.error" :title="session.error" type="error" show-icon :closable="false" /> <el-alert v-if="session.error" :title="session.error" type="error" show-icon :closable="false" />
<el-empty <el-empty
@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
/** 页面上方的公司 tab(spec §4、§9.3):只有超管看得到,而且只画在**注册表里真的按公司取数的那些页**上—— /** 页面上方的公司 tab(spec §4、§9.3):只有超管看得到,而且只画在**注册表里真的按公司取数的那些页**上——
* 选中哪家由哪一枚 tab 带 is-active 表达,这里不再挂第二处"这家是谁"的文案(§12 第 5 条把页头提示条算未批的界面暴露), * 选中哪家由哪一枚 tab 带 is-active 表达,这里不再挂第二处"这家是谁"的文案(§12 第 5 条把页头提示条算未批的界面暴露)。 */
* 提示条只讲这一页怎么办,不讲 tab(2026-10-14 公司观感那句已从引导文案撤掉,见 operation-guides 文件头)。 */
import { computed, watch } from 'vue' import { computed, watch } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { COMPANY_STATUS_ACTIVE } from '@/api/companies-dto' import { COMPANY_STATUS_ACTIVE } from '@/api/companies-dto'
@@ -1,85 +0,0 @@
<script setup lang="ts">
/** 当前页面操作提示条:对齐旧版 admin-interactions.js 的 adminOperationGuide。每页文案逐条登记在
* OPERATION_GUIDES 里,条数**不在这里数**(写死一个页数就会过期:公司 tab 那批把 group-manage 从
* 通用 fallback 改成自带文案时,上一版注释里的数字就已经是错的了)——分母由 align-operation-guide
* 那组用例按路由注册表钉着。
* 挂在 AdminLayout 内容区顶部,随 route.meta.menuKey 切换文案;折叠态存 localStorage。 */
import { computed, ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { OPERATION_GUIDE_STORAGE_KEY, operationGuideFor } from '@/layout/operation-guides'
const route = useRoute()
const guide = computed(() => operationGuideFor(route.meta.menuKey))
function readCollapsed(): boolean {
try {
return localStorage.getItem(OPERATION_GUIDE_STORAGE_KEY) === '1'
} catch {
return false
}
}
function persistCollapsed(value: boolean) {
try {
localStorage.setItem(OPERATION_GUIDE_STORAGE_KEY, value ? '1' : '0')
} catch {
// 忽略隐私模式写入失败
}
}
const collapsed = ref(readCollapsed())
function toggle() {
collapsed.value = !collapsed.value
persistCollapsed(collapsed.value)
}
watch(collapsed, (v) => persistCollapsed(v))
</script>
<template>
<aside v-if="guide" class="operation-guide" :class="{ 'is-collapsed': collapsed }" aria-label="当前页面操作提示">
<div class="og-head">
<span class="og-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><path d="M12 11v5"></path><path d="M12 8h.01"></path></svg>
当前页面操作提示
</span>
<button type="button" class="og-toggle" :aria-expanded="!collapsed" @click="toggle">
{{ collapsed ? '展开提示' : '收起提示' }}
</button>
</div>
<div v-show="!collapsed" class="og-body">
<p class="og-text">{{ guide.text }}</p>
<ol v-if="guide.steps.length" class="og-steps">
<li v-for="step in guide.steps" :key="step">{{ step }}</li>
</ol>
</div>
</aside>
</template>
<style scoped>
.operation-guide {
display: flex; flex-direction: column;
margin: 0 0 18px; padding: 12px 16px;
border: 1px solid #cddbe6; border-radius: 12px;
background: linear-gradient(180deg, #fbfdfe, #f4f8fc);
box-shadow: 0 10px 26px -24px rgba(39, 67, 94, 0.3);
color: var(--admin-text);
}
.operation-guide.is-collapsed { padding: 8px 16px; }
.og-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.og-title {
display: inline-flex; align-items: center; gap: 7px;
font-size: 13px; font-weight: 650; color: var(--admin-primary-strong);
}
.og-title svg { width: 15px; height: 15px; }
.og-toggle {
padding: 0; border: 0; background: none; cursor: pointer;
font: inherit; font-size: 12px; color: #6b8096;
}
.og-toggle:hover { color: var(--admin-primary-strong); }
.og-body { margin-top: 8px; padding-left: 22px; }
.og-text { margin: 0; color: #40586e; font-size: 13px; line-height: 1.7; }
.og-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.og-steps li {
padding: 2px 10px; border-radius: 999px;
background: #e9f1f8; border: 1px solid #d3e0ea;
color: #2f4a63; font-size: 12px; line-height: 1.7;
}
</style>
@@ -1,139 +0,0 @@
/**
* 每菜单页的操作提示(guides)文案,对齐旧版 backend/static/admin-interactions.js 的 guides 表原文
* (duplicate-check 为例外页不展示)。key = 路由 meta.menuKey。
* 2026-10-14 控制方定案:提示条按 menuKey 取、不分支角色,谁能进这一页谁就看得到,
* 于是"超级管理员可用上方公司 tab 切换公司""本页全平台共享,不按公司区分"这类只描述超管观感的句子
* 会摊到普通账号脸上 —— 整批撤掉,文案回到旧版原文。tab 本身与它的接线没动。
* 反向守门:tests/align-operation-guide.test.ts 钉这几句不得回流。
*/
export interface OperationGuideData {
text: string
steps: string[]
}
export const OPERATION_GUIDE_FALLBACK: OperationGuideData = {
text: '先使用筛选定位记录,再进行新增、编辑、导出等操作。涉及删除的数据会要求二次确认。',
steps: ['选择筛选条件', '处理记录', '核对反馈'],
}
/** 折叠状态 localStorage key(沿用旧版 shufuAdminGuideCollapsed 语义)。 */
export const OPERATION_GUIDE_STORAGE_KEY = 'shufuAdminGuideCollapsed'
export const OPERATION_GUIDES: Record<string, OperationGuideData> = {
admin_users: {
text: '先用筛选定位账号,再编辑角色和菜单权限;删除账号会要求二次确认。',
steps: ['筛选账号', '编辑权限', '确认保存'],
},
admin_columns: {
text: '菜单会影响后台和软件端的可见范围。先填写名称并选择对应页面,再设置上级菜单;顺序直接拖动列表左侧手柄调整。',
steps: ['新增或调整菜单', '设置层级', '拖动排序'],
},
admin_group_manage: {
text: '数据权限分组决定"哪些账号能看到哪些店铺",分组按负责人和归属账号聚拢。',
steps: ['选择分组', '维护负责人与归属账号', '核对店铺可见范围'],
},
admin_user_secrets: {
text: '用户密钥按账号绑定,列表只展示脱敏值。可对单条立即检测连通性;清空后该用户需要重新配置密钥。',
steps: ['筛选用户或状态', '立即检测连通性', '必要时清空'],
},
admin_companies: {
text: '公司决定账号归属:新建普通账号/管理员自动落在操作者自己所在的公司,页面上不出现公司选项——要给别的公司建号,请用那个公司自己的管理员登录。唯一例外是「公司超级管理员」:由站点超管开设、需在建号弹窗中显式选择所属公司。公司只做启用/停用,不提供删除。',
steps: ['查看公司列表', '新建公司', '改名或启停'],
},
admin_dedupe_total_data: {
text: '支持按关键词、用户、分组和国家筛选;导入前先确认所选分组,导出会按日期范围生成文件。',
steps: ['选择分组', '筛选或导入', '核对并导出'],
},
admin_invalid_asin_data: {
text: '维护不符合规则的 ASIN 或品牌。添加后可使用上方筛选快速回查。',
steps: ['填写 ASIN/品牌', '选择分组', '保存并回查'],
},
admin_query_asin: {
text: '查询 ASIN 以店铺为单位维护。列表里点击 ASIN 即可复制,点右侧「配置」可一次维护该店铺所有站点的 ASIN。',
steps: ['筛选店铺', '打开配置抽屉', '保存或导出'],
},
admin_product_categories: {
text: '类目树支持展开查看层级。搜索、编辑和删除都在同一列表中完成。',
steps: ['搜索类目', '展开层级', '新增或编辑'],
},
admin_skip_price_asin: {
text: '最低价 ASIN 以店铺为单位维护。列表里点击 ASIN 即可复制,点右侧「配置」可一次维护该店铺所有站点的 ASIN 与最低价。',
steps: ['筛选店铺', '打开配置抽屉', '保存或批量导入'],
},
admin_shop_keys: {
text: '紫鸟令牌属于敏感配置。白名单状态可悬停查看检测详情,编辑前请先核对账号名称。',
steps: ['新增或筛选密钥', '查看白名单状态', '编辑或删除'],
},
admin_shop_manage: {
text: '店铺信息按分组管理。长商城名会自动缩略,悬停即可查看完整内容。',
steps: ['选择分组', '维护店铺信息', '筛选核对结果'],
},
admin_shop_data_crawl_tasks: {
text: '店铺数据任务按状态和时间筛选。批量操作前请核对已选任务。',
steps: ['筛选任务', '检查状态', '执行批量操作'],
},
admin_brand_gating: {
text: '维护不符合规则的品牌(品牌Gating / 类目Gating)。新增后可用下方筛选快速回查;云端 Gating 库与前端排查软件同步同一份数据,命中后会自动拦截。',
steps: ['新增或批量导入', '筛选回查', '按需解除或删除'],
},
admin_keyword_usage: {
text: '本页记录所有关键词操作,只读、不可删除、永久留痕可追溯;与桌面端互通:桌面复制、添加、删除关键词会自动写入本页,两端同源。',
steps: ['选择公司与筛选条件', '切换使用/删除记录', '核对操作人与时间'],
},
// admin_shop_data_duplicate_check(店铺撞款监控)为例外页:不展示全局提示条,不参与对齐。
admin_image_video_tasks: {
text: '可先使用筛选缩小任务范围,再查看任务状态、结果和权限范围。',
steps: ['设置筛选', '查看任务结果', '按需处理任务'],
},
admin_history: {
text: '生成记录可按用户和时间范围回溯,用于核对结果文件和执行时间。',
steps: ['设置时间范围', '筛选记录', '查看结果预览'],
},
admin_version: {
text: '上传版本后请核对版本号和下载链接,再通知用户更新。',
steps: ['上传压缩包', '检查版本记录', '维护历史版本'],
},
admin_tutorial: {
text: '上传新的教程压缩包后即刻生效:工具台首页「立即下载教程」以下载最新上传的包为准。确认旧包不再需要后再删除。',
steps: ['上传教程压缩包', '到工具台核对下载', '清理历史包'],
},
admin_workbench_client_package: {
text: '上传新的工作台客户端 ZIP 包后即刻生效;服务端会复算 sha256 供客户端校验。确认旧包不再需要后再删除。',
steps: ['填写版本号并上传 ZIP', '核对版本与 sha256', '清理历史包'],
},
digital_human_version: {
text: '数字人版本需先上传草稿,再发布并标记最新版本。',
steps: ['上传草稿', '确认更新日志', '发布或设为最新'],
},
admin_device_logs: {
text: '桌面客户端与麦象采集机上报的日志按来源、日期和关键字筛选;可查看日志尾部、下载完整文件或删除云端记录,云端日志按保留期自动清理。',
steps: ['选择来源与日期', '查看或下载日志', '必要时删除'],
},
admin_user_secret_usage: {
text: '按日期范围统计各用户的密钥调用次数(货源查询与外观专利按 LLM 请求次数、代理按提取次数),用于评估用户资源损耗。',
steps: ['选择日期范围', '筛选用户或分组', '核对各模块次数'],
},
admin_task_center: {
text: '按账号、业务、状态、店铺和创建时间筛出客户端任务,点任务查看明细与分组结果;顶部汇总卡给当前在跑与疑似卡住的总量。',
steps: ['按条件筛任务', '查看任务明细', '核对汇总卡'],
},
admin_appearance_patent_clean_items: {
text: '本页只读:出表成功后「结论=无侵权」的明细自动同步到这里,按分公司隔离分页展示;支持任务号/ASIN/国家/同步日期筛选,下载原表请到任务中心取结果文件。',
steps: ['筛选记录', '核对结论明细', '到任务中心下载原表'],
},
admin_jd_database: {
// 2026-11-17 分类管理子菜单并入本页(用户口径「京东分类管理并到京东数据库分类编辑里」,
// 原 admin_jd_category_manage 条目随之摘除):分类建/改名/删在工具栏「分类管理」。
text: '本页只读:客户端采集的京东店铺商品自动同步到这里(同店铺同商品只保留最新一次),按分公司隔离分页展示;点行查看全部属性与图片;分类的新建/改名/删除在工具栏「分类管理」,给商品归类先勾选再「批量编辑分类」。',
steps: ['筛选商品记录', '查看属性与图片明细', '用「分类管理」维护分类并批量归类'],
},
}
/** 全部有独立/兜底提示的后台业务菜单 key。 */
export const OPERATION_GUIDE_MENU_KEYS = Object.keys(OPERATION_GUIDES)
/** 返回指定菜单 key 的提示数据;menuKey 不在已知集合时返回 null(登录/404 等页面不展示)。 */
export function operationGuideFor(menuKey: unknown): OperationGuideData | null {
if (typeof menuKey !== 'string' || !menuKey) return null
return OPERATION_GUIDES[menuKey] ?? null
}
@@ -166,7 +166,7 @@ async function create(): Promise<void> {
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="expiryEditable" label="到期时间(留空 = 永不过期;到期后该账号及其名下账号将停用)"> <el-form-item v-if="expiryEditable" label="到期时间(留空 = 永不过期)">
<el-date-picker <el-date-picker
v-model="form.expiresAt" v-model="form.expiresAt"
type="datetime" type="datetime"
@@ -176,7 +176,7 @@ async function create(): Promise<void> {
style="width: 240px" style="width: 240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="菜单权限(勾选上级菜单会继承全部子菜单)"> <el-form-item label="菜单权限">
<div class="auth-tree-box"> <div class="auth-tree-box">
<!-- 授权树按账号平台收(2026-11-17 用户口径):京东 tab 只给京东侧菜单。 <!-- 授权树按账号平台收(2026-11-17 用户口径):京东 tab 只给京东侧菜单。
平台不再手选(跟随当前 tab),树收窄的判定出口不变。 --> 平台不再手选(跟随当前 tab),树收窄的判定出口不变。 -->
@@ -137,7 +137,7 @@ async function save(): Promise<void> {
<el-form-item label="用户名"> <el-form-item label="用户名">
<el-input :model-value="form.username" readonly /> <el-input :model-value="form.username" readonly />
</el-form-item> </el-form-item>
<el-form-item label="新密码(不修改可留空)" :error="errors.password"> <el-form-item label="新密码" :error="errors.password">
<el-input <el-input
v-model="form.password" v-model="form.password"
type="password" type="password"
@@ -156,7 +156,7 @@ async function save(): Promise<void> {
<el-form-item v-if="targetIsCompanySuperAdmin" label="角色"> <el-form-item v-if="targetIsCompanySuperAdmin" label="角色">
<el-input model-value="公司超级管理员" readonly /> <el-input model-value="公司超级管理员" readonly />
</el-form-item> </el-form-item>
<el-form-item v-if="expiryEditable" label="到期时间(清空 = 永不过期;到期后该账号及其名下账号将停用)"> <el-form-item v-if="expiryEditable" label="到期时间(清空 = 永不过期)">
<el-date-picker <el-date-picker
v-model="form.expiresAt" v-model="form.expiresAt"
type="datetime" type="datetime"
@@ -178,7 +178,7 @@ async function save(): Promise<void> {
<el-form-item v-if="props.user && props.user.creatorUsername" label="所属管理员"> <el-form-item v-if="props.user && props.user.creatorUsername" label="所属管理员">
<el-input :model-value="props.user.creatorUsername" readonly /> <el-input :model-value="props.user.creatorUsername" readonly />
</el-form-item> </el-form-item>
<el-form-item label="菜单权限(勾选上级菜单会继承全部子菜单)"> <el-form-item label="菜单权限">
<div class="auth-tree-box"> <div class="auth-tree-box">
<!-- 授权树按账号平台收(2026-11-17 用户口径):京东档账号不再整树混发亚马逊菜单。 <!-- 授权树按账号平台收(2026-11-17 用户口径):京东档账号不再整树混发亚马逊菜单。
平台不再手选(跟随当前平台 tab,编辑取行值),树收窄的判定出口不变。 --> 平台不再手选(跟随当前平台 tab,编辑取行值),树收窄的判定出口不变。 -->
@@ -264,7 +264,6 @@ onMounted(loadMenus)
<h3>菜单列表</h3> <h3>菜单列表</h3>
<button class="btn" type="button" @click="openCreate">新增菜单</button> <button class="btn" type="button" @click="openCreate">新增菜单</button>
</div> </div>
<p class="columns-drag-tip">拖动每行左侧的手柄可调整同级菜单的显示顺序,松开后自动保存。</p>
<div class="form-row menus-filter-row"> <div class="form-row menus-filter-row">
<div class="form-group" style="min-width: 200px"> <div class="form-group" style="min-width: 200px">
@@ -423,11 +422,6 @@ h3 {
justify-content: space-between; justify-content: space-between;
gap: 12px; gap: 12px;
} }
.columns-drag-tip {
margin: 10px 0 16px;
font-size: 13px;
color: #5b6f83;
}
.menus-filter-row { .menus-filter-row {
margin: 0 0 16px; margin: 0 0 16px;
} }
@@ -79,10 +79,7 @@ async function save() {
<div v-if="modelValue" class="modal-mask" @click.self="close"> <div v-if="modelValue" class="modal-mask" @click.self="close">
<div class="modal" role="dialog" aria-modal="true" aria-labelledby="proxy-entry-title"> <div class="modal" role="dialog" aria-modal="true" aria-labelledby="proxy-entry-title">
<h3 id="proxy-entry-title">{{ locked ? '改代理' : '代填代理' }}</h3> <h3 id="proxy-entry-title">{{ locked ? '改代理' : '代填代理' }}</h3>
<p class="modal-note"> <p class="modal-note">为「{{ username || '该用户' }}」写入代理;出于凭据保护每次需重新填写,保存后只显示脱敏地址。</p>
为「{{ username || '该用户' }}」写入代理。出于凭据保护,后台不再下发已存的提取链接原文,
这里每次都重新填写;保存后界面只显示脱敏后的地址(不含 key/pwd)。
</p>
<div class="form-group"> <div class="form-group">
<label>代理供应商</label> <label>代理供应商</label>
@@ -126,7 +126,6 @@ onMounted(load)
<section class="panel-box"> <section class="panel-box">
<div class="usage-head"> <div class="usage-head">
<h3>密钥用量统计</h3> <h3>密钥用量统计</h3>
<span class="usage-note">口径:真实对外请求次数(LLM 每次请求、代理每次成功提取)</span>
</div> </div>
<div class="summary-row"> <div class="summary-row">
@@ -256,10 +255,6 @@ h3 {
gap: 12px; gap: 12px;
margin-bottom: 16px; margin-bottom: 16px;
} }
.usage-note {
color: #7d8fa2;
font-size: 12px;
}
.summary-row { .summary-row {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -358,7 +358,7 @@ onMounted(load)
<input v-model="keyword" type="text" placeholder="模糊搜索用户名" @keyup.enter="search" /> <input v-model="keyword" type="text" placeholder="模糊搜索用户名" @keyup.enter="search" />
</div> </div>
<div class="form-group" style="min-width: 170px"> <div class="form-group" style="min-width: 170px">
<label>状态(三项都通过才算通过)</label> <label>状态</label>
<!-- 2026-11-17 用户口径「和亚马逊不统一」:原生 select 的弹层是浏览器直角原生物 <!-- 2026-11-17 用户口径「和亚马逊不统一」:原生 select 的弹层是浏览器直角原生物
⇒ 换 el-select(admin-filter 同壳 42px/9px 圆角,弹层是 EP 圆角面板)。 ⇒ 换 el-select(admin-filter 同壳 42px/9px 圆角,弹层是 EP 圆角面板)。
「全部状态」仍是 STATUS_OPTIONS 里的空串档(下游 checkStatus 照旧传 ''→undefined); 「全部状态」仍是 STATUS_OPTIONS 里的空串档(下游 checkStatus 照旧传 ''→undefined);
@@ -386,7 +386,7 @@ onMounted(load)
class="btn btn-ghost" class="btn btn-ghost"
type="button" type="button"
:disabled="balanceLoading || !rows.length" :disabled="balanceLoading || !rows.length"
:title="balanceNotice || '余额是实时查上游、不落库;这两列没取到时显示 —,不是 0'" :title="balanceNotice || '余额是实时查上游、不落库'"
@click="loadBalances" @click="loadBalances"
> >
{{ balanceLoading ? '余额查询中…' : '刷新余额' }} {{ balanceLoading ? '余额查询中…' : '刷新余额' }}
@@ -437,7 +437,7 @@ onMounted(load)
<div class="module-cell"> <div class="module-cell">
<span v-if="row.similarAsin?.exists" class="mono-mask" :title="moduleTooltip(row.similarAsin)">{{ row.similarAsin.masked }}</span> <span v-if="row.similarAsin?.exists" class="mono-mask" :title="moduleTooltip(row.similarAsin)">{{ row.similarAsin.masked }}</span>
<span v-else class="empty-value">未配置</span> <span v-else class="empty-value">未配置</span>
<span v-if="row.similarAsin?.exists" class="wh-pill is-source" title="该用户这把密钥所属渠道"> <span v-if="row.similarAsin?.exists" class="wh-pill is-source">
{{ llmSourceLabel(row.similarAsin.channel) }} {{ llmSourceLabel(row.similarAsin.channel) }}
</span> </span>
<span class="wh-pill" :class="moduleStatusBand(row.similarAsin).tone" :title="moduleTooltip(row.similarAsin)"> <span class="wh-pill" :class="moduleStatusBand(row.similarAsin).tone" :title="moduleTooltip(row.similarAsin)">
@@ -449,7 +449,7 @@ onMounted(load)
<div class="module-cell"> <div class="module-cell">
<span v-if="row.appearancePatent?.exists" class="mono-mask" :title="moduleTooltip(row.appearancePatent)">{{ row.appearancePatent.masked }}</span> <span v-if="row.appearancePatent?.exists" class="mono-mask" :title="moduleTooltip(row.appearancePatent)">{{ row.appearancePatent.masked }}</span>
<span v-else class="empty-value">未配置</span> <span v-else class="empty-value">未配置</span>
<span v-if="row.appearancePatent?.exists" class="wh-pill is-source" title="该用户这把密钥所属渠道"> <span v-if="row.appearancePatent?.exists" class="wh-pill is-source">
{{ llmSourceLabel(row.appearancePatent.channel) }} {{ llmSourceLabel(row.appearancePatent.channel) }}
</span> </span>
<span class="wh-pill" :class="moduleStatusBand(row.appearancePatent).tone" :title="moduleTooltip(row.appearancePatent)"> <span class="wh-pill" :class="moduleStatusBand(row.appearancePatent).tone" :title="moduleTooltip(row.appearancePatent)">
@@ -472,7 +472,7 @@ onMounted(load)
<span v-if="row.proxy?.exists" class="mono-mask" :title="moduleTooltip(row.proxy)">{{ proxyDisplayText(row.proxy) }}</span> <span v-if="row.proxy?.exists" class="mono-mask" :title="moduleTooltip(row.proxy)">{{ proxyDisplayText(row.proxy) }}</span>
<span v-else class="empty-value">未配置</span> <span v-else class="empty-value">未配置</span>
<span class="module-cell-pills"> <span class="module-cell-pills">
<span v-if="row.proxy?.exists" class="wh-pill is-source" title="该用户代理所属供应商"> <span v-if="row.proxy?.exists" class="wh-pill is-source">
{{ proxySourceLabel(row.proxy.channel) }} {{ proxySourceLabel(row.proxy.channel) }}
</span> </span>
<span class="wh-pill" :class="moduleStatusBand(row.proxy).tone" :title="moduleTooltip(row.proxy)"> <span class="wh-pill" :class="moduleStatusBand(row.proxy).tone" :title="moduleTooltip(row.proxy)">
@@ -481,7 +481,7 @@ onMounted(load)
<span <span
v-if="row.proxy?.locked" v-if="row.proxy?.locked"
class="wh-pill is-locked" class="wh-pill is-locked"
title="已由管理员代填并锁定:客户端不可修改或清空" title="已由管理员代填并锁定"
> >
已锁定 已锁定
</span> </span>
@@ -240,11 +240,9 @@ onMounted(() => {
<h3>用户列表</h3> <h3>用户列表</h3>
<button class="btn" type="button" @click="openCreate">新建用户</button> <button class="btn" type="button" @click="openCreate">新建用户</button>
</div> </div>
<p class="users-desc">当前没有开放注册入口,仅管理员可在此创建用户。层级关系:超级管理员 -&gt; 管理员 -&gt; 普通账号。</p>
<div class="form-row users-filter-row"> <div class="form-row users-filter-row">
<div class="form-group" style="min-width: 180px"> <div class="form-group" style="min-width: 180px">
<label>用户名(模糊搜索)</label> <label>用户名</label>
<input v-model="filters.keyword" type="text" placeholder="输入用户名关键字" @keyup.enter="search" /> <input v-model="filters.keyword" type="text" placeholder="输入用户名关键字" @keyup.enter="search" />
</div> </div>
<div v-if="isSuperAdmin" class="form-group" style="min-width: 160px"> <div v-if="isSuperAdmin" class="form-group" style="min-width: 160px">
@@ -72,10 +72,7 @@ async function submit(): Promise<void> {
<h3>批量编辑分类<span v-if="ownerGroupName" class="modal-sub">· {{ ownerGroupName }}</span></h3> <h3>批量编辑分类<span v-if="ownerGroupName" class="modal-sub">· {{ ownerGroupName }}</span></h3>
<button class="modal-close" type="button" aria-label="关闭" @click="emit('close')">×</button> <button class="modal-close" type="button" aria-label="关闭" @click="emit('close')">×</button>
</div> </div>
<p class="modal-tip"> <p class="modal-tip">已勾选 {{ selectedIds.length }} 个商品(翻页累计)。</p>
已勾选 {{ selectedIds.length }} 个商品(翻页累计)。选目标分类后确认;
归类只记在分类归属上,不影响采集对价格/库存的更新。
</p>
<p v-if="errorText" class="group-error">{{ errorText }}</p> <p v-if="errorText" class="group-error">{{ errorText }}</p>
<div v-if="!categories.length" class="batch-empty">本组暂无分类,先用工具栏「分类管理」新建一个</div> <div v-if="!categories.length" class="batch-empty">本组暂无分类,先用工具栏「分类管理」新建一个</div>
@@ -299,7 +299,7 @@ function cancelShopRename(): void {
<!-- 树外兜底:授权树里搜不到的历史末级名(别店未上报 / 京麦改过类目体系)。 <!-- 树外兜底:授权树里搜不到的历史末级名(别店未上报 / 京麦改过类目体系)。
不藏——藏了这些商品就点不到;也不冒充树内节点,单列一组说清来路。 --> 不藏——藏了这些商品就点不到;也不冒充树内节点,单列一组说清来路。 -->
<template v-if="catalog.orphans.length"> <template v-if="catalog.orphans.length">
<p class="jd-side-group-head">平台树外(历史类目)</p> <p class="jd-side-group-head">平台树外</p>
<div <div
v-for="row in catalog.orphans" v-for="row in catalog.orphans"
:key="`orphan:${row.name}`" :key="`orphan:${row.name}`"
@@ -317,7 +317,7 @@ function cancelShopRename(): void {
</div> </div>
</template> </template>
<p v-if="!visibleCatalogRows.length && !catalog.orphans.length" class="jd-side-empty"> <p v-if="!visibleCatalogRows.length && !catalog.orphans.length" class="jd-side-empty">
还没有采集到类目数据(先采集一次店铺即有) 还没有采集到类目数据
</p> </p>
</div> </div>
</div> </div>
@@ -575,7 +575,7 @@ function cancelShopRename(): void {
color: #409eff; color: #409eff;
} }
/* 「平台树外(历史类目)」分组头:单列一条,不冒充树内节点。 */ /* 「平台树外」分组头:单列一条,不冒充树内节点。 */
.jd-side-group-head { .jd-side-group-head {
margin: 8px 0 2px; margin: 8px 0 2px;
padding: 0 8px; padding: 0 8px;
@@ -852,11 +852,9 @@ onMounted(async () => {
</div> </div>
</div> </div>
<!-- 商品行写只对超管级(平台超管+公司超管)开放(2026-11-23 客户口径),管理人员与 <!-- 商品行写只对超管级(平台超管+公司超管)开放(2026-11-23 客户口径),写控件按
普通账号看到只读提示;分类写由当前分组 editable 决定(2026-11-23 起 admin 对 权限直接隐藏(2026-11-28 精简口径:常驻只读 tip 删);分类写由当前分组 editable
全部可见 jd 分组可写),分类维护入口=侧栏「分类管理」(只读可看,写控件按 决定,分类维护入口=侧栏「分类管理」。 -->
editable 分档)。 -->
<span v-if="!canWriteProducts" class="jd-readonly-tip">只读:编辑/删除需超级管理员或公司超级管理员;分类在左侧「分类管理」查看与维护</span>
</section> </section>
<div class="jd-body"> <div class="jd-body">
@@ -185,7 +185,7 @@ function dash(value: string | number | null | undefined): string {
</section> </section>
<section v-if="attrGroups.length" class="detail-block"> <section v-if="attrGroups.length" class="detail-block">
<h4>属性与设置(按京麦 Tab 分组)</h4> <h4>属性与设置</h4>
<div v-for="group in attrGroups" :key="group.groupName" class="attr-group"> <div v-for="group in attrGroups" :key="group.groupName" class="attr-group">
<h5>{{ group.groupName }}</h5> <h5>{{ group.groupName }}</h5>
<table> <table>
@@ -232,7 +232,7 @@ function dash(value: string | number | null | undefined): string {
</table> </table>
</div> </div>
</template> </template>
<p v-else class="drawer-tip">暂无 SKU 矩阵(V198 之前采集的旧行需重新采集)</p> <p v-else class="drawer-tip">暂无 SKU 矩阵</p>
</section> </section>
<section class="detail-block"> <section class="detail-block">
@@ -229,7 +229,7 @@ function dash(value: string | number | null | undefined): string {
<input v-model="form.categoryPath" type="text" /> <input v-model="form.categoryPath" type="text" />
</div> </div>
<div class="edit-item"> <div class="edit-item">
<label>货号(系统生成=行号,可改)</label> <label>货号</label>
<input v-model="form.itemNum" type="text" /> <input v-model="form.itemNum" type="text" />
</div> </div>
<div class="edit-item"> <div class="edit-item">
@@ -249,18 +249,18 @@ function dash(value: string | number | null | undefined): string {
<input v-model="form.stockTotal" type="text" inputmode="numeric" /> <input v-model="form.stockTotal" type="text" inputmode="numeric" />
</div> </div>
<div class="edit-item"> <div class="edit-item">
<label>商品编码(只读)</label> <label>商品编码</label>
<input type="text" :value="dash(item?.productCode)" readonly class="readonly" /> <input type="text" :value="dash(item?.productCode)" readonly class="readonly" />
</div> </div>
<div class="edit-item"> <div class="edit-item">
<label>信息分(只读)</label> <label>信息分</label>
<input type="text" :value="dash(item?.healthScore)" readonly class="readonly" /> <input type="text" :value="dash(item?.healthScore)" readonly class="readonly" />
</div> </div>
</div> </div>
</section> </section>
<section v-if="draftAttrGroups.length" class="detail-block"> <section v-if="draftAttrGroups.length" class="detail-block">
<h4>属性与设置(键值可改,行可删)</h4> <h4>属性与设置</h4>
<div v-for="group in draftAttrGroups" :key="group.groupName" class="attr-group"> <div v-for="group in draftAttrGroups" :key="group.groupName" class="attr-group">
<h5>{{ group.groupName }}</h5> <h5>{{ group.groupName }}</h5>
<table> <table>
@@ -280,7 +280,7 @@ function dash(value: string | number | null | undefined): string {
<p v-else class="drawer-tip">暂无属性</p> <p v-else class="drawer-tip">暂无属性</p>
<section class="detail-block"> <section class="detail-block">
<h4>SKU 矩阵(京东价 / 库存可改)</h4> <h4>SKU 矩阵</h4>
<template v-if="draftSkus.length"> <template v-if="draftSkus.length">
<div class="sku-table-wrap"> <div class="sku-table-wrap">
<table class="sku-table"> <table class="sku-table">
@@ -311,7 +311,7 @@ function dash(value: string | number | null | undefined): string {
</table> </table>
</div> </div>
</template> </template>
<p v-else class="drawer-tip">暂无 SKU 矩阵(V198 之前采集的旧行需重新采集)</p> <p v-else class="drawer-tip">暂无 SKU 矩阵</p>
</section> </section>
<JdProductImageManager <JdProductImageManager
@@ -324,7 +324,7 @@ function dash(value: string | number | null | undefined): string {
/> />
<div v-if="saveError" class="drawer-failure">{{ saveError }}</div> <div v-if="saveError" class="drawer-failure">{{ saveError }}</div>
<p class="save-hint">保存后该商品转为人工维护,后续采集不再覆盖它的数据(含本单重爬);删除的图片文件一并从存储桶清理(共用的保留);替换 / 新增图片立即生效并同样置锁。</p> <p class="save-hint">保存后转为人工维护,采集不再覆盖。</p>
</template> </template>
</div> </div>
@@ -146,7 +146,7 @@ const markedCount = computed(() => deleteImageIds.value.size)
>{{ uploadingImageId === image.id ? '上传中...' : '替换' }}</button> >{{ uploadingImageId === image.id ? '上传中...' : '替换' }}</button>
</div> </div>
</div> </div>
<p v-else class="drawer-tip">暂无图片(可点右上「+ 新增主图」上传本地图)</p> <p v-else class="drawer-tip">暂无图片</p>
<p v-if="uploadError" class="drawer-failure">{{ uploadError }}</p> <p v-if="uploadError" class="drawer-failure">{{ uploadError }}</p>
<p v-if="markedCount" class="delete-count">已标记删除 {{ markedCount }} 张,保存后剩余 {{ images.length - markedCount }} 张</p> <p v-if="markedCount" class="delete-count">已标记删除 {{ markedCount }} 张,保存后剩余 {{ images.length - markedCount }} 张</p>
</section> </section>
@@ -106,10 +106,7 @@ async function submit(): Promise<void> {
<h3>添加店铺<span v-if="categoryName" class="modal-sub">· {{ categoryName }}</span></h3> <h3>添加店铺<span v-if="categoryName" class="modal-sub">· {{ categoryName }}</span></h3>
<button class="modal-close" type="button" aria-label="关闭" @click="emit('close')">×</button> <button class="modal-close" type="button" aria-label="关闭" @click="emit('close')">×</button>
</div> </div>
<p class="modal-tip"> <p class="modal-tip">一次最多添加 {{ MAX_ADD_SHOPS }} 个,已有的会自动跳过。</p>
从已采集商品的店铺里勾选,或手动输入名单里还没有的店铺名;
一次最多添加 {{ MAX_ADD_SHOPS }} 个,已有的会自动跳过。
</p>
<p v-if="errorText" class="group-error">{{ errorText }}</p> <p v-if="errorText" class="group-error">{{ errorText }}</p>
<!-- 候选搜索:关键词包含匹配(服务端 DISTINCT+like),Enter 或按钮触发。 --> <!-- 候选搜索:关键词包含匹配(服务端 DISTINCT+like),Enter 或按钮触发。 -->
@@ -126,7 +123,7 @@ async function submit(): Promise<void> {
<ul class="shop-candidate-list"> <ul class="shop-candidate-list">
<li v-if="searching" class="shop-list-tip">搜索中...</li> <li v-if="searching" class="shop-list-tip">搜索中...</li>
<li v-else-if="!candidates.length && searched" class="shop-list-tip">没有可添加的候选店铺(已采商品的店铺都在名单里了,试试手动输入)</li> <li v-else-if="!candidates.length && searched" class="shop-list-tip">没有可添加的候选店铺</li>
<li <li
v-for="name in candidates" v-for="name in candidates"
:key="name" :key="name"
@@ -104,21 +104,6 @@ onMounted(() => {
<div class="auth-visual-copy"> <div class="auth-visual-copy">
<span class="auth-kicker">数富AI · 运营工作台</span> <span class="auth-kicker">数富AI · 运营工作台</span>
<h2 class="auth-visual-title">让每一次运营动作,都有清晰的工作流。</h2> <h2 class="auth-visual-title">让每一次运营动作,都有清晰的工作流。</h2>
<p class="auth-visual-description">统一管理数据、店铺、任务与版本,让团队在一个可靠的运营工作台中快速协作。</p>
<ul class="auth-feature-list" aria-label="工作台能力">
<li class="auth-feature-item">
<span class="auth-feature-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3 4 7v5c0 4.5 3.4 7.7 8 9 4.6-1.3 8-4.5 8-9V7l-8-4Z"></path><path d="m8.5 12 2.2 2.2 4.8-5"></path></svg></span>
<span>权限隔离,操作边界清晰可控</span>
</li>
<li class="auth-feature-item">
<span class="auth-feature-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8v4l3 2"></path><circle cx="12" cy="12" r="9"></circle><path d="M3 4v5h5"></path><path d="M3.5 9A9 9 0 0 1 19 5.5"></path></svg></span>
<span>任务状态,进度反馈及时透明</span>
</li>
<li class="auth-feature-item">
<span class="auth-feature-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19V5"></path><path d="M4 19h16"></path><path d="m7 15 3-4 3 2 4-6"></path><path d="M17 7h3v3"></path></svg></span>
<span>数据工具,支撑日常电商运营</span>
</li>
</ul>
</div> </div>
</div> </div>
<div class="auth-visual-footer"> <div class="auth-visual-footer">
@@ -132,7 +117,6 @@ onMounted(() => {
<header class="login-card-header"> <header class="login-card-header">
<p class="login-card-eyebrow">欢迎回来</p> <p class="login-card-eyebrow">欢迎回来</p>
<h1 class="login-title" id="loginTitle">登录工作台</h1> <h1 class="login-title" id="loginTitle">登录工作台</h1>
<p class="login-subtitle">使用管理员账号进入数富AI运营后台。</p>
</header> </header>
<form novalidate @submit.prevent="submit"> <form novalidate @submit.prevent="submit">
<p v-if="kickedNotice" class="kicked-msg" role="alert">该账号已在其他设备登录,本设备已下线。如非本人操作,请及时修改密码。</p> <p v-if="kickedNotice" class="kicked-msg" role="alert">该账号已在其他设备登录,本设备已下线。如非本人操作,请及时修改密码。</p>
@@ -165,7 +149,6 @@ onMounted(() => {
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3 4 7v5c0 4.5 3.4 7.7 8 9 4.6-1.3 8-4.5 8-9V7l-8-4Z"></path><path d="m8.5 12 2.2 2.2 4.8-5"></path></svg> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3 4 7v5c0 4.5 3.4 7.7 8 9 4.6-1.3 8-4.5 8-9V7l-8-4Z"></path><path d="m8.5 12 2.2 2.2 4.8-5"></path></svg>
<span>请勿在公共设备保存账号凭据。登录状态由本地安全会话管理。</span> <span>请勿在公共设备保存账号凭据。登录状态由本地安全会话管理。</span>
</p> </p>
<footer class="login-card-footer">数富AI · 电商运营管理工作台</footer>
</section> </section>
</main> </main>
</div> </div>
@@ -242,15 +225,6 @@ button, input { font: inherit; }
max-width: 560px; margin: 18px 0; max-width: 560px; margin: 18px 0;
font-size: clamp(30px, 4vw, 52px); font-weight: 700; letter-spacing: -1.8px; line-height: 1.12; font-size: clamp(30px, 4vw, 52px); font-weight: 700; letter-spacing: -1.8px; line-height: 1.12;
} }
.auth-visual-description { max-width: 470px; margin: 0; color: #60748a; font-size: 16px; line-height: 1.75; }
.auth-feature-list { display: grid; gap: 12px; margin: 34px 0 0; padding: 0; list-style: none; }
.auth-feature-item { display: flex; align-items: center; gap: 12px; color: #465d73; }
.auth-feature-icon {
display: inline-flex; align-items: center; justify-content: center;
flex: 0 0 30px; width: 30px; height: 30px;
border: 1px solid #c2d3e3; border-radius: 9px; background: #edf5fb; color: #2f5d8b;
}
.auth-feature-icon svg { width: 16px; height: 16px; }
.auth-visual-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #778b9f; font-size: 12px; } .auth-visual-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #778b9f; font-size: 12px; }
.auth-system-status { display: inline-flex; align-items: center; gap: 7px; color: #3d7158; } .auth-system-status { display: inline-flex; align-items: center; gap: 7px; color: #3d7158; }
.auth-system-status::before { .auth-system-status::before {
@@ -274,7 +248,6 @@ button, input { font: inherit; }
.login-card-header { margin-bottom: 30px; } .login-card-header { margin-bottom: 30px; }
.login-card-eyebrow { margin: 0 0 8px; color: #71859a; font-size: 15px; font-weight: 700; letter-spacing: 1.2px; } .login-card-eyebrow { margin: 0 0 8px; color: #71859a; font-size: 15px; font-weight: 700; letter-spacing: 1.2px; }
.login-title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.2; } .login-title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.2; }
.login-subtitle { margin: 10px 0 0; color: #5b6f83; line-height: 1.65; }
.form-group { margin-bottom: 20px; } .form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #5b6f83; font-size: 13px; font-weight: 600; } .form-group label { display: block; margin-bottom: 8px; color: #5b6f83; font-size: 13px; font-weight: 600; }
@@ -345,7 +318,6 @@ button, input { font: inherit; }
.login-security-note { display: flex; align-items: flex-start; gap: 9px; margin: 22px 0 0; color: #71859a; font-size: 12px; line-height: 1.55; } .login-security-note { display: flex; align-items: flex-start; gap: 9px; margin: 22px 0 0; color: #71859a; font-size: 12px; line-height: 1.55; }
.login-security-note svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; color: #4e806d; } .login-security-note svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; color: #4e806d; }
.login-card-footer { margin-top: 34px; padding-top: 18px; border-top: 1px solid #dce5ee; color: #778b9f; font-size: 12px; text-align: center; }
@media (max-width: 900px) { @media (max-width: 900px) {
.auth-page { display: block; } .auth-page { display: block; }
@@ -410,7 +410,7 @@ onMounted(() => {
</tr> </tr>
<tr v-else> <tr v-else>
<td colspan="9" class="empty-tip"> <td colspan="9" class="empty-tip">
{{ sourceFilter || uidFilter ? '暂无匹配日志' : '暂无日志上报(客户端/采集机上报后自动出现在这里)' }} {{ sourceFilter || uidFilter ? '暂无匹配日志' : '暂无日志上报' }}
</td> </td>
</tr> </tr>
</tbody> </tbody>
@@ -443,7 +443,7 @@ onMounted(() => {
<el-dialog v-model="configVisible" title="采集配置" width="720px"> <el-dialog v-model="configVisible" title="采集配置" width="720px">
<div class="config-block"> <div class="config-block">
<h4>全局默认模式</h4> <h4>全局默认模式</h4>
<p class="config-desc">对未单独配置的终端生效。全量=上传日志目录内全部文件;精选=排除低价值大日志(客户端排除 pywebview;麦象排除 kk-browser / 控制台 / 测试日志)。终端在下一次上报周期(约 1 分钟内)跟随新配置。</p> <p class="config-desc">对未单独配置的终端生效。全量=上传日志目录内全部文件;精选=排除低价值大日志。终端在下一次上报周期(约 1 分钟内)跟随新配置。</p>
<div class="mode-switch"> <div class="mode-switch">
<button <button
v-for="option in MODE_OPTIONS" v-for="option in MODE_OPTIONS"
@@ -305,7 +305,7 @@ onMounted(load)
</section> </section>
<el-dialog v-model="uploadVisible" title="上传数字人版本" width="560px"> <el-dialog v-model="uploadVisible" title="上传数字人版本" width="560px">
<p class="upload-desc">上传数字人程序 ZIP 包,系统会自动计算 MD5 并存储到 OSS。上传后状态为草稿,需要手动发布。</p> <p class="upload-desc">上传后状态为草稿,需要手动发布。</p>
<el-form label-width="110px"> <el-form label-width="110px">
<el-form-item label="版本号" required> <el-form-item label="版本号" required>
<el-input v-model="form.version" placeholder="如 1.0.2" /> <el-input v-model="form.version" placeholder="如 1.0.2" />
@@ -215,7 +215,6 @@ onMounted(load)
</section> </section>
<el-dialog v-model="uploadVisible" title="上传新版本" width="520px"> <el-dialog v-model="uploadVisible" title="上传新版本" width="520px">
<p class="upload-desc">上传软件 ZIP 包,系统会自动计算 MD5 并存储到 OSS。</p>
<el-form label-width="110px"> <el-form label-width="110px">
<el-form-item label="版本号" required> <el-form-item label="版本号" required>
<el-input v-model="newVersion" placeholder="例如:1.0.0" /> <el-input v-model="newVersion" placeholder="例如:1.0.0" />
@@ -398,12 +397,6 @@ h3 {
color: #8293a5; color: #8293a5;
font-size: 13.5px; font-size: 13.5px;
} }
.upload-desc {
margin: 0 0 12px;
color: #5b6f83;
font-size: 12.5px;
line-height: 1.6;
}
.zip-hint { .zip-hint {
margin: 4px 0 0; margin: 4px 0 0;
color: #5b6f83; color: #5b6f83;
@@ -281,11 +281,9 @@ onMounted(load)
</section> </section>
<el-dialog v-model="uploadVisible" title="上传教程包" width="520px"> <el-dialog v-model="uploadVisible" title="上传教程包" width="520px">
<p class="upload-desc">上传教程 ZIP 包后,工具台首页「立即下载教程」将以下载该包为准(以最新上传的为主)。</p>
<el-form label-width="110px"> <el-form label-width="110px">
<el-form-item label="版本号"> <el-form-item label="版本号">
<el-input v-model="newVersion" placeholder="例如:v2026.09 或留空" maxlength="64" /> <el-input v-model="newVersion" placeholder="例如:v2026.09 或留空" maxlength="64" />
<p class="zip-hint">仅作展示与排序用,可留空;不影响工具台按最新上传下载</p>
</el-form-item> </el-form-item>
<el-form-item label="ZIP 压缩包" required> <el-form-item label="ZIP 压缩包" required>
<el-upload :auto-upload="false" :limit="1" accept=".zip" :on-change="(file: any) => onFileChange(file.raw)" :on-remove="() => (pickedFile = null)"> <el-upload :auto-upload="false" :limit="1" accept=".zip" :on-change="(file: any) => onFileChange(file.raw)" :on-remove="() => (pickedFile = null)">
@@ -520,12 +518,6 @@ h3 {
color: #8293a5; color: #8293a5;
font-size: 13.5px; font-size: 13.5px;
} }
.upload-desc {
margin: 0 0 12px;
color: #5b6f83;
font-size: 12.5px;
line-height: 1.6;
}
.zip-hint { .zip-hint {
margin: 4px 0 0; margin: 4px 0 0;
color: #5b6f83; color: #5b6f83;
@@ -176,7 +176,6 @@ onMounted(load)
<button class="btn" type="button" @click="openUpload">上传客户端包</button> <button class="btn" type="button" @click="openUpload">上传客户端包</button>
</div> </div>
</div> </div>
<p class="page-hint">最新上传的一条即当前生效版本。</p>
<LoadFailureBar v-if="loadFailure" :message="loadFailure" @retry="load" /> <LoadFailureBar v-if="loadFailure" :message="loadFailure" @retry="load" />
<div class="table-scroll workbench-table-scroll"> <div class="table-scroll workbench-table-scroll">
@@ -238,11 +237,10 @@ onMounted(load)
</section> </section>
<el-dialog v-model="uploadVisible" title="上传客户端包" width="540px"> <el-dialog v-model="uploadVisible" title="上传客户端包" width="540px">
<p class="upload-desc">上传数富AI工作台客户端 ZIP 包后,客户端会从公开版本接口自动检测到新版本并升级;服务端会复算 sha256 供客户端校验。</p>
<el-form label-width="110px"> <el-form label-width="110px">
<el-form-item label="版本号" required> <el-form-item label="版本号" required>
<el-input v-model="newVersion" :placeholder="`例如:1.0.113(纯数字 x.y.z,最长 ${WORKBENCH_CLIENT_VERSION_MAX_LENGTH} 字符)`" :maxlength="WORKBENCH_CLIENT_VERSION_MAX_LENGTH" /> <el-input v-model="newVersion" :placeholder="`例如:1.0.113(纯数字 x.y.z,最长 ${WORKBENCH_CLIENT_VERSION_MAX_LENGTH} 字符)`" :maxlength="WORKBENCH_CLIENT_VERSION_MAX_LENGTH" />
<p class="zip-hint">客户端按版本号判断是否需要升级,必填;不要带 v 前缀</p> <p class="zip-hint">必填;不要带 v 前缀</p>
</el-form-item> </el-form-item>
<el-form-item label="ZIP 压缩包" required> <el-form-item label="ZIP 压缩包" required>
<el-upload :auto-upload="false" :limit="1" accept=".zip" :on-change="(file: any) => onFileChange(file.raw)" :on-remove="() => (pickedFile = null)"> <el-upload :auto-upload="false" :limit="1" accept=".zip" :on-change="(file: any) => onFileChange(file.raw)" :on-remove="() => (pickedFile = null)">
@@ -318,19 +316,6 @@ h3 {
border-color: #5f85ad; border-color: #5f85ad;
box-shadow: 0 0 0 3px rgba(95, 133, 173, 0.16); box-shadow: 0 0 0 3px rgba(95, 133, 173, 0.16);
} }
.page-hint {
margin: -6px 0 14px;
color: #5b6f83;
font-size: 12.5px;
}
.page-hint code {
padding: 1px 6px;
border-radius: 5px;
background: #edf4fa;
color: #2f5d8b;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
}
.btn { .btn {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@@ -459,12 +444,6 @@ h3 {
color: #8293a5; color: #8293a5;
font-size: 13.5px; font-size: 13.5px;
} }
.upload-desc {
margin: 0 0 12px;
color: #5b6f83;
font-size: 12.5px;
line-height: 1.6;
}
.zip-hint { .zip-hint {
margin: 4px 0 0; margin: 4px 0 0;
color: #5b6f83; color: #5b6f83;
@@ -263,7 +263,7 @@ onMounted(load)
<th style="width: 140px">紫鸟账号名称</th> <th style="width: 140px">紫鸟账号名称</th>
<th style="width: 160px">紫鸟令牌</th> <th style="width: 160px">紫鸟令牌</th>
<th style="width: 90px">代理</th> <th style="width: 90px">代理</th>
<th style="width: 110px">白名单状态 <span class="table-help" aria-hidden="true">?</span></th> <th style="width: 110px">白名单状态</th>
<th style="width: 160px">创建时间</th> <th style="width: 160px">创建时间</th>
<th style="width: 160px">修改时间</th> <th style="width: 160px">修改时间</th>
<th style="width: 245px">操作</th> <th style="width: 245px">操作</th>
@@ -348,7 +348,7 @@ onMounted(load)
placeholder="留空直连;形如 http://host:port 或 http://user:pass@host:port" placeholder="留空直连;形如 http://host:port 或 http://user:pass@host:port"
/> />
<div class="form-hint"> <div class="form-hint">
仅当该账号的服务器出口 IP 不在紫鸟白名单时填写:代理 IP 需已由紫鸟公司加白,留空则直连。 仅当出口 IP 不在紫鸟白名单时填写;代理 IP 需已加白。
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -527,19 +527,6 @@ h3 {
.shop-key-table-scroll tbody tr:last-child td { .shop-key-table-scroll tbody tr:last-child td {
border-bottom: 0; border-bottom: 0;
} }
.table-help {
display: inline-flex;
align-items: center;
justify-content: center;
width: 14px;
height: 14px;
margin-left: 3px;
border-radius: 50%;
background: #c7d7e5;
color: #fff;
font-size: 10px;
line-height: 1;
}
.mono-mask { .mono-mask {
font-family: Consolas, "Cascadia Mono", monospace; font-family: Consolas, "Cascadia Mono", monospace;
font-size: 12.5px; font-size: 12.5px;
@@ -324,10 +324,10 @@ onUnmounted(() => {
<div class="tc-head"> <div class="tc-head">
<div class="tabs"> <div class="tabs">
<button class="tab" :class="{ active: activeTab === 'tasks' }" type="button" @click="switchTab('tasks')"> <button class="tab" :class="{ active: activeTab === 'tasks' }" type="button" @click="switchTab('tasks')">
客户端任务 <span class="t-count" title="当前在跑任务数,与上方「进行中任务」同源">{{ runningBadge ?? '—' }}</span> 客户端任务 <span class="t-count">{{ runningBadge ?? '—' }}</span>
</button> </button>
<button class="tab" :class="{ active: activeTab === 'variant' }" type="button" @click="switchTab('variant')"> <button class="tab" :class="{ active: activeTab === 'variant' }" type="button" @click="switchTab('variant')">
变体采集 <span class="t-count" title="麦象变体采集任务条数(全部状态),「—」= 还没查到">{{ variantTotal ?? '—' }}</span> 变体采集 <span class="t-count">{{ variantTotal ?? '—' }}</span>
</button> </button>
</div> </div>
<div class="tc-head-tools"> <div class="tc-head-tools">
@@ -340,22 +340,18 @@ onUnmounted(() => {
<div class="tc-card"> <div class="tc-card">
<span class="tc-card-label">总店铺</span> <span class="tc-card-label">总店铺</span>
<span class="tc-card-value">{{ overview?.shopTotal ?? '—' }}</span> <span class="tc-card-value">{{ overview?.shopTotal ?? '—' }}</span>
<span class="tc-card-note">店铺库内可见店铺</span>
</div> </div>
<div class="tc-card"> <div class="tc-card">
<span class="tc-card-label">在跑店铺</span> <span class="tc-card-label">在跑店铺</span>
<span class="tc-card-value is-ok">{{ overview?.shopRunning ?? '—' }}</span> <span class="tc-card-value is-ok">{{ overview?.shopRunning ?? '—' }}</span>
<span class="tc-card-note">有进行中任务的店铺</span>
</div> </div>
<div class="tc-card"> <div class="tc-card">
<span class="tc-card-label">进行中任务</span> <span class="tc-card-label">进行中任务</span>
<span class="tc-card-value">{{ overview?.runningTasks ?? '—' }}</span> <span class="tc-card-value">{{ overview?.runningTasks ?? '—' }}</span>
<span class="tc-card-note">含品牌检测</span>
</div> </div>
<div class="tc-card"> <div class="tc-card">
<span class="tc-card-label">今日完成</span> <span class="tc-card-label">今日完成</span>
<span class="tc-card-value">{{ overview?.todayFinishedTasks ?? '—' }}</span> <span class="tc-card-value">{{ overview?.todayFinishedTasks ?? '—' }}</span>
<span class="tc-card-note">终态且完成于今日</span>
</div> </div>
<div class="tc-card"> <div class="tc-card">
<span class="tc-card-label">疑似卡住</span> <span class="tc-card-label">疑似卡住</span>
@@ -372,7 +368,6 @@ onUnmounted(() => {
<section class="panel-box"> <section class="panel-box">
<div class="box-head"> <div class="box-head">
<h3>任务筛选</h3> <h3>任务筛选</h3>
<span class="box-note">默认列出执行中的任务(待执行/已排期并入执行中口径),条数与上方「进行中任务」同源;看历史请换状态或选创建时间</span>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group" style="min-width: 160px"> <div class="form-group" style="min-width: 160px">
@@ -406,7 +401,6 @@ onUnmounted(() => {
> >
<el-option v-for="shop in shopOptions" :key="shop" :label="shop" :value="shop" /> <el-option v-for="shop in shopOptions" :key="shop" :label="shop" :value="shop" />
</el-select> </el-select>
<span class="filter-tip">精确匹配店铺名</span>
</div> </div>
<div class="form-group" style="min-width: 190px"> <div class="form-group" style="min-width: 190px">
<label>创建时间(起)</label> <label>创建时间(起)</label>
@@ -444,7 +438,6 @@ onUnmounted(() => {
<section class="panel-box"> <section class="panel-box">
<div class="box-head"> <div class="box-head">
<h3>变体采集(麦象批量任务)</h3> <h3>变体采集(麦象批量任务)</h3>
<span class="box-note">数据来自麦象平台,范围限本组账号,默认全部状态(待执行/处理中/成功/失败)</span>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group" style="min-width: 150px"> <div class="form-group" style="min-width: 150px">
@@ -660,22 +653,9 @@ h3 {
gap: 12px; gap: 12px;
margin-bottom: 14px; margin-bottom: 14px;
} }
.box-note {
color: #8598ab;
font-size: 12.5px;
}
.shop-filter { .shop-filter {
position: relative; position: relative;
} }
/* 提示行必须退出列流:.form-row 是 align-items: flex-end,组内多一行会把「店铺」label 顶得比别的筛选项高。 */
.filter-tip {
position: absolute;
left: 0;
top: calc(100% + 4px);
white-space: nowrap;
color: #93a4b5;
font-size: 11.5px;
}
.form-row { .form-row {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -409,7 +409,7 @@ onMounted(() => {
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div v-else-if="!pageLoading && loaded" class="g-empty">暂无数据,请先在上方新增或使用前端排查软件同步</div> <div v-else-if="!pageLoading && loaded" class="g-empty">暂无数据,可在上方新增或同步</div>
</div> </div>
<OldPagination <OldPagination
@@ -427,7 +427,6 @@ onMounted(() => {
<div class="dup-head"> <div class="dup-head">
<div> <div>
<h2>店铺数据撞款监控</h2> <h2>店铺数据撞款监控</h2>
<p>按 ASIN×店铺×站点分析同一 ASIN 在多家自营店铺/分组内的重复上架;分组归属来自店铺管理,只读展示。</p>
</div> </div>
</div> </div>
@@ -504,7 +503,6 @@ onMounted(() => {
<section v-if="consoleData" class="card store-strip"> <section v-if="consoleData" class="card store-strip">
<div class="strip-head"> <div class="strip-head">
<span class="strip-title">店铺上架分布</span> <span class="strip-title">店铺上架分布</span>
<span class="strip-note">各店铺在本批站点中的上架记录量(含重复扫描)</span>
</div> </div>
<div class="strip-bars"> <div class="strip-bars">
<div v-for="bar in pagedDistBars" :key="bar.name" class="s-bar"> <div v-for="bar in pagedDistBars" :key="bar.name" class="s-bar">
@@ -603,7 +601,7 @@ onMounted(() => {
</div> </div>
<OldPagination :total="totalDupCount" :page="matrixPage" :page-size="matrixPageSize" @change="goMatrixPage" @size-change="changeMatrixSize" /> <OldPagination :total="totalDupCount" :page="matrixPage" :page-size="matrixPageSize" @change="goMatrixPage" @size-change="changeMatrixSize" />
<div class="section-title" style="margin-top:24px">撞款详情 <span class="hint">同一 ASIN 在多家店铺的上架时间明细</span></div> <div class="section-title" style="margin-top:24px">撞款详情</div>
<div v-if="dupItems.length" class="dup-grid"> <div v-if="dupItems.length" class="dup-grid">
<div v-for="item in dupItems" :key="item.asin" class="dup-card"> <div v-for="item in dupItems" :key="item.asin" class="dup-card">
<div class="dup-head"> <div class="dup-head">
@@ -719,7 +717,6 @@ onMounted(() => {
</button> </button>
</div> </div>
<div class="drawer-body"> <div class="drawer-body">
<p class="note">分组归属来自「店铺管理」的真实店铺分组,仅用于本页分组撞款范围切换;本页不做分组编辑。如需调整店铺所属分组,请到店铺管理维护(会影响对应负责人的数据查看范围)。</p>
<table class="d-table"> <table class="d-table">
<thead><tr><th>分组</th><th>店铺数</th><th>成员店铺</th><th>组内撞款</th></tr></thead> <thead><tr><th>分组</th><th>店铺数</th><th>成员店铺</th><th>组内撞款</th></tr></thead>
<tbody> <tbody>
@@ -414,7 +414,7 @@ onMounted(load)
</el-drawer> </el-drawer>
<el-dialog v-model="permissionVisible" title="视频任务记录权限配置" width="620px"> <el-dialog v-model="permissionVisible" title="视频任务记录权限配置" width="620px">
<p class="dim">勾选允许查看视频任务记录的用户(仅数据范围)。当前已授权 {{ permissionGrantedCount }} 人。</p> <p class="dim">当前已授权 {{ permissionGrantedCount }} 人。</p>
<el-table :data="pagedPermissionItems" border size="small" max-height="420"> <el-table :data="pagedPermissionItems" border size="small" max-height="420">
<el-table-column prop="id" label="ID" min-width="80" /> <el-table-column prop="id" label="ID" min-width="80" />
<el-table-column prop="username" label="用户名" min-width="180" /> <el-table-column prop="username" label="用户名" min-width="180" />
@@ -228,7 +228,6 @@ onMounted(() => {
<section v-show="activeTab === 'usage'" class="kw-panel"> <section v-show="activeTab === 'usage'" class="kw-panel">
<div class="kw-panel-head"> <div class="kw-panel-head">
使用记录 使用记录
<span class="kw-sub">复制关键词 + 添加关键词,按时间倒序;绿色为本人的记录</span>
</div> </div>
<div class="kw-panel-body"> <div class="kw-panel-body">
<div class="kw-table-wrap" v-loading="usageLoading"> <div class="kw-table-wrap" v-loading="usageLoading">
@@ -275,7 +274,6 @@ onMounted(() => {
<section v-show="activeTab === 'deletes'" class="kw-panel"> <section v-show="activeTab === 'deletes'" class="kw-panel">
<div class="kw-panel-head"> <div class="kw-panel-head">
删除记录 删除记录
<span class="kw-sub">只读、不可删除、永久留痕可追溯;红色为本人的记录</span>
</div> </div>
<div class="kw-panel-body"> <div class="kw-panel-body">
<div class="kw-table-wrap" v-loading="deleteLoading"> <div class="kw-table-wrap" v-loading="deleteLoading">
@@ -378,12 +376,6 @@ onMounted(() => {
margin-right: 8px; margin-right: 8px;
vertical-align: 1px; vertical-align: 1px;
} }
.kw-sub {
margin-left: 8px;
font-size: 11.5px;
font-weight: 400;
color: #98a1b1;
}
.kw-panel-body { .kw-panel-body {
padding: 14px 15px; padding: 14px 15px;
} }
@@ -467,7 +467,7 @@ onMounted(load)
</section> </section>
<el-dialog v-model="permissionVisible" title="店铺数据记录数据范围授权" width="620px"> <el-dialog v-model="permissionVisible" title="店铺数据记录数据范围授权" width="620px">
<p class="dim">勾选允许查看/操作店铺数据记录的用户(仅数据范围)。当前已授权 {{ grantedCount }} 人。</p> <p class="dim">当前已授权 {{ grantedCount }} 人。</p>
<el-table :data="pagedPermissionItems" border size="small" max-height="420"> <el-table :data="pagedPermissionItems" border size="small" max-height="420">
<el-table-column prop="id" label="ID" min-width="80" /> <el-table-column prop="id" label="ID" min-width="80" />
<el-table-column prop="username" label="用户名" min-width="180" /> <el-table-column prop="username" label="用户名" min-width="180" />
@@ -62,7 +62,7 @@ test('align_digital_human_page_wiring', () => {
assert.match(page, /page-nums/, '数字页码分页(像素复刻旧版)') assert.match(page, /page-nums/, '数字页码分页(像素复刻旧版)')
assert.match(page, /设为最新/, '按钮名对齐“设为最新”') assert.match(page, /设为最新/, '按钮名对齐“设为最新”')
assert.match(page, /上传新版本/, '页头上传按钮名对齐') assert.match(page, /上传新版本/, '页头上传按钮名对齐')
assert.match(page, /上传数字人程序 ZIP 包,系统会自动计算 MD5 并存储到 OSS。上传后状态为草稿,需要手动发布/, '上传弹窗描述对齐') assert.match(page, /上传后状态为草稿,需要手动发布/, '上传弹窗描述保留草稿态提示')
assert.match(page, /正在上传/, '上传进度文案') assert.match(page, /正在上传/, '上传进度文案')
assert.match(page, /digitalHumanDeleteConfirmText/, '删除确认文案走对齐模型') assert.match(page, /digitalHumanDeleteConfirmText/, '删除确认文案走对齐模型')
assert.match(page, /fetchDigitalHumanDownloadUrl/, 'RELEASED 下载按钮点击取链接') assert.match(page, /fetchDigitalHumanDownloadUrl/, 'RELEASED 下载按钮点击取链接')
@@ -79,7 +79,7 @@ test('align_menu_list_loads_all_types_no_filter', () => {
test('align_menu_page_drag_and_type_wiring', () => { test('align_menu_page_drag_and_type_wiring', () => {
const page = readSource('src/pages/account/MenusPage.vue') const page = readSource('src/pages/account/MenusPage.vue')
assert.match(page, /拖动每行左侧的手柄可调整同级菜单的显示顺序,松开后自动保存/, '顶部拖拽提示文案对齐') assert.doesNotMatch(page, /拖动每行左侧的手柄/, '顶部拖拽提示已按精简口径删除(2026-11-28)')
assert.match(page, /draggable/, '行手柄可拖拽') assert.match(page, /draggable/, '行手柄可拖拽')
assert.match(page, /menuSiblingGroupKey/, '拖拽分组按类型+父级') assert.match(page, /menuSiblingGroupKey/, '拖拽分组按类型+父级')
assert.match(page, /MENU_TYPE_OPTIONS|菜单类型/, '新建/编辑弹窗含菜单类型下拉') assert.match(page, /MENU_TYPE_OPTIONS|菜单类型/, '新建/编辑弹窗含菜单类型下拉')
@@ -1,119 +1,35 @@
import test from 'node:test' import test from 'node:test'
import assert from 'node:assert/strict' import assert from 'node:assert/strict'
import { existsSync } from 'node:fs'
import { join } from 'node:path'
import { readSource } from './helpers.ts' import { readSource } from './helpers.ts'
import { adminPages } from '../src/router/routes.ts'
import {
OPERATION_GUIDES,
OPERATION_GUIDE_FALLBACK,
OPERATION_GUIDE_STORAGE_KEY,
operationGuideFor,
} from '../src/layout/operation-guides.ts'
/** 对齐旧版 admin-interactions.js guides 表:每业务菜单页顶部展示可折叠「当前页面操作提示」,文案沿用旧版原文;店铺撞款监控(例外)不展示。 */ /** 2026-11-28 精简口径(客户「删除多余小字,整体整洁美观」):每页顶部的「当前页面操作提示」条
* (OperationGuide.vue + operation-guides.ts 文案表)整体下线。本文件整组反向钉:组件、文案表、
* 壳层挂载点、旧文案任何一处都不许回流。 */
const EXCEPTED_KEY = 'admin_shop_data_duplicate_check' const ROOT = process.cwd()
test('align_guide_users_matches_reference_text', () => { test('operation_guide_component_and_copy_table_are_removed', () => {
const g = operationGuideFor('admin_users') for (const rel of ['src/layout/OperationGuide.vue', 'src/layout/operation-guides.ts']) {
assert.ok(g) assert.equal(existsSync(join(ROOT, rel)), false, `${rel} 已随提示条一起删除,不得回填`)
assert.match(g.text, /^先用筛选定位账号,再编辑角色和菜单权限;删除账号会要求二次确认。/)
assert.deepEqual(g.steps, ['筛选账号', '编辑权限', '确认保存'])
})
test('align_guide_history_and_version_reference_text', () => {
assert.match(operationGuideFor('admin_history')!.text, /生成记录可按用户和时间范围回溯/)
assert.deepEqual(operationGuideFor('admin_version')!.steps, ['上传压缩包', '检查版本记录', '维护历史版本'])
})
test('align_guide_group_manage_own_text', () => {
const g = operationGuideFor('admin_group_manage')
assert.ok(g)
assert.notEqual(g, OPERATION_GUIDE_FALLBACK)
assert.deepEqual(g.steps, ['选择分组', '维护负责人与归属账号', '核对店铺可见范围'])
})
test('align_guide_duplicate_check_not_present', () => {
// 例外页:不展示提示条(不参与本轮对齐)。
assert.equal(operationGuideFor(EXCEPTED_KEY), null)
assert.equal(EXCEPTED_KEY in OPERATION_GUIDES, false)
})
test('align_guide_unknown_key_null', () => {
assert.equal(operationGuideFor(undefined), null)
assert.equal(operationGuideFor(null), null)
assert.equal(operationGuideFor('not-a-menu'), null)
assert.equal(operationGuideFor(''), null)
})
test('align_guide_every_router_page_has_guide_except_duplicate_check', () => {
// 路由注册表里的业务页除例外页外都应有独立/兜底提示。
const without = adminPages.filter((p) => p.menuKey !== EXCEPTED_KEY)
assert.ok(without.length >= 15, '业务页至少 15')
for (const page of without) {
assert.ok(operationGuideFor(page.menuKey), `缺少 guide: ${page.menuKey}`)
} }
}) })
test('align_guide_storage_key_matches_legacy', () => { test('operation_guide_not_referenced_in_layout_or_router', () => {
assert.equal(OPERATION_GUIDE_STORAGE_KEY, 'shufuAdminGuideCollapsed')
})
test('align_guide_component_in_layout_headline', () => {
const layout = readSource('src/layout/AdminLayout.vue') const layout = readSource('src/layout/AdminLayout.vue')
// 钉**模板挂载点**而不是 import 行(2026-10-05 修复轮 1): // 钉**模板挂载点 + import 行**两处(与 company-tab-wiring 同形状):漏一处就是半截拆除。
// 只写 /OperationGuide/ 时,删掉模板里的 <OperationGuide /> 、留着那行 import 还是绿 assert.ok(!layout.includes('OperationGuide'), 'AdminLayout 不得再引用 OperationGuide(挂载点与 import 都算)')
// ——与 company-tab-wiring.test.ts 那条同形状,只覆盖一处等于没覆盖。 assert.ok(!layout.includes('当前页面操作提示'), '提示条标题不得回流壳层')
assert.match(layout, /<OperationGuide \/>/, '壳层模板必须挂着 <OperationGuide />') const router = readSource('src/router/routes.ts')
const comp = readSource('src/layout/OperationGuide.vue') assert.ok(!router.includes('operation-guide'), '路由层不得给提示条留注册口')
assert.match(comp, /当前页面操作提示/, '标题对齐旧版 adminOperationGuide 语义')
assert.match(comp, /收起提示/, '折叠按钮文案')
assert.match(comp, /展开提示/, '展开按钮文案')
assert.match(comp, /operationGuideFor\(route\.meta\.menuKey\)/, '按菜单 key 查文案')
assert.match(comp, /OPERATION_GUIDE_STORAGE_KEY/, '折叠态读写同一 localStorage key')
}) })
test('align_guide_fallback_shape', () => { /** 历史反钉沿用:公司 tab 的观感说明句(「超级管理员可用上方 tab 切换」等)仍不许回流 CompanyTabs。 */
assert.equal(OPERATION_GUIDE_FALLBACK.steps.length, 3) test('company_tab_copy_must_not_come_back', () => {
assert.ok(OPERATION_GUIDE_FALLBACK.text.length > 10)
})
/**
* 2026-10-14 控制方把公司 tab 那几句观感说明撤了:提示条按 menuKey 取、不分支角色,
* 谁能进这一页谁就看得到。「超级管理员可用上方 tab 切换」「本页全平台共享」这类只对超管成立的话
* 会摊到普通账号脸上,所以整批撤掉。这支用例是反向钉:**不允许回流**。
*
* 两把尺子:① ASCII 的 `tab`,②那四句原文(从已提交的那一版操作提示表里拿回来的,不是抄写)。
* ②单独不可信——中文串在工具链里被插进一个字就会永远匹配不上,而负向断言照样绿;
* 所以下面先钉死「这四句都含 ASCII 的 tab」,让①成为即使②坏了也还有牙的那一把。
*/
test('company_tab_copy_is_pulled_from_every_guide_and_must_not_come_back', () => {
const REMOVED = [
'\u8d85\u7ea7\u7ba1\u7406\u5458\u53ef\u7528\u9875\u9762\u4e0a\u65b9\u7684\u516c\u53f8 tab \u5207\u6362\u516c\u53f8\uff0c\u5207\u6362\u540e\u884c\u6570\u4f1a\u53d8\u5316\u2014\u2014\u884c\u6570\u53d8\u5c11\u4e0d\u662f\u6570\u636e\u4e22\u4e86\u3002',
'\u672c\u9875\u5168\u5e73\u53f0\u5171\u4eab\uff0c\u4e0d\u6309\u516c\u53f8\u533a\u5206\uff1a\u8d85\u7ea7\u7ba1\u7406\u5458\u5207\u6362\u4e0a\u65b9\u516c\u53f8 tab \u65f6\u5b83\u4e0d\u4f1a\u53d8\uff0c\u8fd9\u4e0d\u662f\u7b5b\u9009\u574f\u4e86\u3002',
'\u5e97\u94fa\u5f52\u54ea\u5bb6\u516c\u53f8\u7531\u300c\u8d1f\u8d23\u4eba\u300d\u51b3\u5b9a\uff0c\u4e0d\u7531\u516c\u53f8 tab \u51b3\u5b9a\uff1a\u8d1f\u8d23\u4eba\u9009\u81ea\u5df1\uff0c\u5e97\u94fa\u5c31\u843d\u5728\u4f60\u81ea\u5df1\u90a3\u5bb6\u3002',
'\u8d85\u7ea7\u7ba1\u7406\u5458\u5207\u6362\u4e0a\u65b9\u516c\u53f8 tab \u540e\uff0c\u5217\u8868\u53ea\u4fdd\u7559\u5f53\u524d\u516c\u53f8\u8d26\u53f7\u76f8\u5173\u7684\u5206\u7ec4\u3002',
]
const keys = Object.keys(OPERATION_GUIDES)
assert.ok(keys.length >= 20, `分母只有 ${keys.length} 页,不像整张注册表`)
// 禁句自检:四条互不相同、都够长、且都含 ASCII 锚 tab —— 少一条下面那把 ASCII 尺子就盖不住。
assert.equal(new Set(REMOVED).size, 4, '禁句清单塌了')
for (const s of REMOVED) {
assert.ok(s.length > 20, `禁句短得可疑:${s}`)
assert.ok(s.includes('tab'), `禁句不含 ASCII 锚 tab,反向断言会失明:${s}`)
}
for (const key of keys) {
const text = operationGuideFor(key)!.text
assert.equal(text.includes('tab'), false, `${key} 的文案又出现了 tab`)
for (const s of REMOVED) {
assert.equal(text.includes(s), false, `${key} 又带回了撤掉的那句:${s}`)
}
}
// fallback 会被所有没有独立文案的页共用,那四句同样不许进它。
assert.equal(OPERATION_GUIDE_FALLBACK.text.includes('tab'), false, 'tab 那句不许进 fallback')
// 撤的是文案,不是功能:tab 条还在,而且仍然只由 tab 自己表达"当前哪家"。
const tabs = readSource('src/layout/CompanyTabs.vue') const tabs = readSource('src/layout/CompanyTabs.vue')
assert.ok(tabs.length > 0, '取样集非空自检:CompanyTabs.vue 读到了') assert.ok(tabs.length > 0, '取样集非空自检:CompanyTabs.vue 读到了')
assert.equal(tabs.includes('company-tab-hint'), false, '不许有页头"当前公司"提示条') assert.equal(tabs.includes('company-tab-hint'), false, '不许有页头「当前公司」提示条')
assert.equal(tabs.includes('当前公司'), false, '当前公司只由 is-active 的 tab 表达') assert.equal(tabs.includes('当前公司'), false, '当前公司只由 is-active 的 tab 表达')
assert.ok(tabs.includes('useCompanyTabStore'), '公司 tab 本身没被一起撤掉') assert.ok(tabs.includes('useCompanyTabStore'), '公司 tab 本身没被一起撤掉')
}) })
@@ -13,7 +13,7 @@ test('align_software_version_page_wiring', () => {
assert.match(page, /发布成功/, '成功提示留驻弹窗') assert.match(page, /发布成功/, '成功提示留驻弹窗')
assert.match(page, /uploadMsg/, '成功/失败文案在弹窗内展示') assert.match(page, /uploadMsg/, '成功/失败文案在弹窗内展示')
// 上传弹窗文案(对齐 admin.html:6094-6110)。 // 上传弹窗文案(对齐 admin.html:6094-6110)。
assert.match(page, /上传软件 ZIP 包,系统会自动计算 MD5 并存储到 OSS。/, '弹窗描述对齐') assert.doesNotMatch(page, /自动计算 MD5/, '弹窗机制描述已按精简口径删除(2026-11-28)')
assert.match(page, /上传软件版本/, '上传按钮名对齐') assert.match(page, /上传软件版本/, '上传按钮名对齐')
assert.match(page, /上传新版本/, '弹窗标题对齐') assert.match(page, /上传新版本/, '弹窗标题对齐')
// 空态(对齐 admin.js:6296 暂无版本记录)。 // 空态(对齐 admin.js:6296 暂无版本记录)。
@@ -2,7 +2,6 @@ import test from 'node:test'
import assert from 'node:assert/strict' import assert from 'node:assert/strict'
import { readSource } from './helpers.ts' import { readSource } from './helpers.ts'
import { adminPages } from '../src/router/routes.ts' import { adminPages } from '../src/router/routes.ts'
import { OPERATION_GUIDES } from '../src/layout/operation-guides.ts'
/** 工作台客户端包管理页:独立渠道、上传直传、服务端 sha256。 */ /** 工作台客户端包管理页:独立渠道、上传直传、服务端 sha256。 */
@@ -54,9 +53,3 @@ test('align_workbench_client_model_parsers', () => {
assert.match(model, /isValidWorkbenchClientVersion/, '版本号必填校验') assert.match(model, /isValidWorkbenchClientVersion/, '版本号必填校验')
assert.match(model, /\^\\d\+\\\.\\d\+\\\.\\d\+\$/, '版本号仅接受纯数字 x.y.z') assert.match(model, /\^\\d\+\\\.\\d\+\\\.\\d\+\$/, '版本号仅接受纯数字 x.y.z')
}) })
test('align_workbench_client_guide_registered', () => {
const guide = OPERATION_GUIDES.admin_workbench_client_package
assert.ok(guide, '每个菜单页都必须有操作提示')
assert.match(guide.text, /sha256/, '提示说明服务端会复算摘要')
})
@@ -1298,9 +1298,9 @@
"reads": 1 "reads": 1
}, },
"task-center-board.test.ts": { "task-center-board.test.ts": {
"cases": 7, "cases": 24,
"pins": 3, "pins": 14,
"reads": 5 "reads": 28
}, },
"timer-cleanup-pairing.test.ts": { "timer-cleanup-pairing.test.ts": {
"cases": 5, "cases": 5,
@@ -900,9 +900,8 @@ test('挂载与单一尺子:tab 条挂在壳层、公司名读 companyName、
const layout = readSource('src/layout/AdminLayout.vue') const layout = readSource('src/layout/AdminLayout.vue')
assert.ok(layout.includes(`import CompanyTabs from '@/layout/CompanyTabs.vue'`), '壳层没 import CompanyTabs') assert.ok(layout.includes(`import CompanyTabs from '@/layout/CompanyTabs.vue'`), '壳层没 import CompanyTabs')
assert.ok(layout.includes('<CompanyTabs />'), '壳层没挂 <CompanyTabs />') assert.ok(layout.includes('<CompanyTabs />'), '壳层没挂 <CompanyTabs />')
// 钉**模板里的挂载点**而不是 import 行:只写 layout.includes('OperationGuide') 时,删掉 <OperationGuide /> // 2026-11-28 精简口径:操作提示条整体下线(align-operation-guide 反向钉),壳层不得再挂。
// 而留着那行 import 照样绿——一条"声称保护而不保护"的断言比没有更危险(后续评审会拿它当已核事实)。 assert.ok(!layout.includes('OperationGuide'), '操作提示条已删,壳层不得再引用 OperationGuide')
assert.ok(layout.includes('<OperationGuide />'), '挂 tab 时不许把 OperationGuide 摘掉(align_guide_component_in_layout_headline 钉着)')
const tabs = readSource('src/layout/CompanyTabs.vue') const tabs = readSource('src/layout/CompanyTabs.vue')
assert.ok(tabs.length > 0, '取样集非空自检:CompanyTabs.vue 读到了') assert.ok(tabs.length > 0, '取样集非空自检:CompanyTabs.vue 读到了')
@@ -9,7 +9,6 @@ import {
toCreateUserRequest, toCreateUserRequest,
validateCreateUserForm, validateCreateUserForm,
} from '../src/pages/account/user-create-model.ts' } from '../src/pages/account/user-create-model.ts'
import { OPERATION_GUIDES } from '../src/layout/operation-guides.ts'
/** /**
* 建号公司口径(2026-10-05 修订):admin/normal 建号仍不让用户挑公司——请求体不带 * 建号公司口径(2026-10-05 修订):admin/normal 建号仍不让用户挑公司——请求体不带
@@ -152,18 +151,6 @@ test('弹窗与后端同口径:角色候选来自纯函数,且后端真的
'admins 候选要带 company_id 过滤,且只在传了 company_id 时生效') 'admins 候选要带 company_id 过滤,且只在传了 company_id 时生效')
}) })
test('「公司管理」引导文案说的是自动继承,并写清公司超管这一例外', () => {
const guide = OPERATION_GUIDES.admin_companies.text
assert.match(guide, /操作者自己所在的公司/, '要写清归属的真实口径:落在操作者本公司')
assert.match(guide, /请用那个公司自己的管理员登录|用该公司自己的管理员登录/,
'要给别家建号只能换账号登录——不写这句,超管会以为自己建的号能归到别家')
assert.match(guide, /公司超级管理员/,
'2026-10-05 起开设公司超管是唯一要在建号时选公司的例外,文案要说清,别让人以为下拉没了是坏了')
for (const stale of ['建号时选哪家公司', '停用后不能再用于新建账号']) {
assert.equal(guide.includes(stale), false, `文案仍含已失效的说法:${stale}`)
}
})
/** 从 Java 源码里按大括号配平切出一个方法体(只看 resolveTargetCompanyId,别把邻居方法的 throw 算进来)。 */ /** 从 Java 源码里按大括号配平切出一个方法体(只看 resolveTargetCompanyId,别把邻居方法的 throw 算进来)。 */
function javaMethod(source: string, signature: string): string { function javaMethod(source: string, signature: string): string {
const start = source.indexOf(signature) const start = source.indexOf(signature)
@@ -25,7 +25,6 @@ import type { AdminMenuNode } from '@/types/admin'
// AdminLayout 的顶栏/告警子组件各带定时器或远端拉取,与本契约无关,替身化。 // AdminLayout 的顶栏/告警子组件各带定时器或远端拉取,与本契约无关,替身化。
vi.mock('@/components/NotificationBell.vue', () => ({ default: { template: '<div class="bell-stub" />' } })) vi.mock('@/components/NotificationBell.vue', () => ({ default: { template: '<div class="bell-stub" />' } }))
vi.mock('@/components/ExpiryNotice.vue', () => ({ default: { template: '<div class="expiry-stub" />' } })) vi.mock('@/components/ExpiryNotice.vue', () => ({ default: { template: '<div class="expiry-stub" />' } }))
vi.mock('@/layout/OperationGuide.vue', () => ({ default: { template: '<div class="guide-stub" />' } }))
vi.mock('@/layout/CompanyTabs.vue', () => ({ default: { template: '<div class="company-tabs-stub" />' } })) vi.mock('@/layout/CompanyTabs.vue', () => ({ default: { template: '<div class="company-tabs-stub" />' } }))
vi.mock('@/layout/GlobalErrorContainer.vue', () => ({ default: { template: '<div class="error-stub" />' } })) vi.mock('@/layout/GlobalErrorContainer.vue', () => ({ default: { template: '<div class="error-stub" />' } }))
@@ -1229,8 +1229,8 @@ describe('京东数据库写权限分档(商品行写=仅超管档;分组
expect(wrapper.find('.jd-toolbar').exists()).toBe(false, '工具栏(全选/归类/删除)整块不渲染') expect(wrapper.find('.jd-toolbar').exists()).toBe(false, '工具栏(全选/归类/删除)整块不渲染')
expect(wrapper.find('.jd-delete-btn').exists()).toBe(false, '删除商品按钮不渲染') expect(wrapper.find('.jd-delete-btn').exists()).toBe(false, '删除商品按钮不渲染')
expect(wrapper.find('[aria-label="当前分组"]').exists()).toBe(false, '普通员工不出分组下拉') expect(wrapper.find('[aria-label="当前分组"]').exists()).toBe(false, '普通员工不出分组下拉')
expect(wrapper.text()).toContain('只读:编辑/删除需超级管理员或公司超级管理员', '只读提示必须看得见并区分两类写权限') // 2026-11-28 精简口径:常驻只读 tip 删(写控件已按权限隐藏),改反向钉不得回流。
expect(wrapper.text()).toContain('分类在左侧「分类管理」查看与维护', '提示把分类维护入口指向侧栏「分类管理」') expect(wrapper.text()).not.toContain('只读:编辑/删除需超级管理员或公司超级管理员')
// 读面不受影响:筛选、侧栏分类行、点卡片开只读详情都还在。 // 读面不受影响:筛选、侧栏分类行、点卡片开只读详情都还在。
expect(wrapper.findAll('.jd-card')).toHaveLength(1) expect(wrapper.findAll('.jd-card')).toHaveLength(1)
@@ -1281,7 +1281,8 @@ describe('京东数据库写权限分档(商品行写=仅超管档;分组
expect(wrapper.find('.jd-delete-btn').exists()).toBe(false, '删除商品(商品行写)对管理人员收回——「弄反了」不得回潜') expect(wrapper.find('.jd-delete-btn').exists()).toBe(false, '删除商品(商品行写)对管理人员收回——「弄反了」不得回潜')
expect(toolbarBtn(wrapper, '归入分类').exists()).toBe(true, '分类写入口对可写组渲染') expect(toolbarBtn(wrapper, '归入分类').exists()).toBe(true, '分类写入口对可写组渲染')
expect(toolbarBtn(wrapper, '取消归属').exists()).toBe(true) expect(toolbarBtn(wrapper, '取消归属').exists()).toBe(true)
expect(wrapper.text()).toContain('只读:编辑/删除需超级管理员或公司超级管理员', '管理人员看到商品行写只读提示') expect(wrapper.text()).not.toContain('只读:编辑/删除需超级管理员或公司超级管理员',
'2026-11-28 精简口径:只读 tip 已删,管理人员侧同样不得回流')
// 分组筛选随分类可写放开:单组也出下拉(2026-11-23 用户口径,多组切换见后续用例)。 // 分组筛选随分类可写放开:单组也出下拉(2026-11-23 用户口径,多组切换见后续用例)。
expect(wrapper.find('[aria-label="当前分组"]').exists()).toBe(true, '管理人员出分组下拉(单组也出下拉)') expect(wrapper.find('[aria-label="当前分组"]').exists()).toBe(true, '管理人员出分组下拉(单组也出下拉)')
+1 -1
View File
@@ -10,7 +10,7 @@ test('test_task_250_users_list_normal_primary_path', () => {
const page = readSource('src/pages/account/UsersPage.vue') const page = readSource('src/pages/account/UsersPage.vue')
assert.match(page, /roleLabel/, '角色列需走中文 roleLabel 映射') assert.match(page, /roleLabel/, '角色列需走中文 roleLabel 映射')
assert.match(page, /所属管理员/, '需展示“所属管理员”列/筛选项') assert.match(page, /所属管理员/, '需展示“所属管理员”列/筛选项')
assert.match(page, /无开放注册|开放注册入口/, '页头应有“无开放注册入口”说明') assert.doesNotMatch(page, /开放注册/, '页头说明已按精简口径删除(2026-11-28)')
}) })
test('test_task_250_users_list_normal_variant_input', () => { test('test_task_250_users_list_normal_variant_input', () => {
+1 -1
View File
@@ -44,7 +44,7 @@ test('test_task_265_permission_normal_primary_path', () => {
assert.match(page, /权限配置/, '权限入口') assert.match(page, /权限配置/, '权限入口')
assert.match(page, /fetchImageVideoPermissionUsers/, '权限用户加载') assert.match(page, /fetchImageVideoPermissionUsers/, '权限用户加载')
assert.match(page, /saveImageVideoPermissions/, '权限保存') assert.match(page, /saveImageVideoPermissions/, '权限保存')
assert.match(page, /数据范围/, '权限弹窗语义') assert.doesNotMatch(page, /数据范围/, '权限弹窗说明已按精简口径删除(2026-11-28)')
}) })
test('test_task_265_permission_boundary_limit_or_missing_field', () => { test('test_task_265_permission_boundary_limit_or_missing_field', () => {
@@ -2,7 +2,6 @@ import test from 'node:test'
import assert from 'node:assert/strict' import assert from 'node:assert/strict'
import { readSource } from './helpers.ts' import { readSource } from './helpers.ts'
import { adminPages, validateAdminPages } from '../src/router/routes.ts' import { adminPages, validateAdminPages } from '../src/router/routes.ts'
import { operationGuideFor } from '../src/layout/operation-guides.ts'
import { import {
ACTIVE_TASK_STATUS, ACTIVE_TASK_STATUS,
MODULE_OPTIONS, MODULE_OPTIONS,
@@ -25,7 +24,7 @@ import {
variantStatusLabel, variantStatusLabel,
} from '../src/pages/task-center/task-center-model.ts' } from '../src/pages/task-center/task-center-model.ts'
// 客户端任务管理看板(后台):路由注册 / guides 对齐 / 接口层 / 纯逻辑映射。 // 客户端任务管理看板(后台):路由注册 / 接口层 / 纯逻辑映射。
const PAGE = 'src/pages/task-center/TaskCenterBoardPage.vue' const PAGE = 'src/pages/task-center/TaskCenterBoardPage.vue'
const TASK_TABLE = 'src/pages/task-center/TaskCenterTaskTable.vue' const TASK_TABLE = 'src/pages/task-center/TaskCenterTaskTable.vue'
@@ -41,13 +40,6 @@ test('task_center_route_registered_with_menu_key', () => {
assert.deepEqual(validateAdminPages(adminPages), []) assert.deepEqual(validateAdminPages(adminPages), [])
}) })
test('task_center_guide_present_for_menu_key', () => {
const guide = operationGuideFor('admin_task_center')
assert.ok(guide, '菜单 key 有独立 guide(align-operation-guide 强制)')
assert.ok(guide.text.length > 10)
assert.equal(guide.steps.length, 3)
})
test('task_center_api_has_five_endpoints', () => { test('task_center_api_has_five_endpoints', () => {
const api = readSource(API) const api = readSource(API)
for (const path of [ for (const path of [
@@ -145,8 +137,8 @@ test('task_center_variant_status_options_are_the_four_states', () => {
const page = readSource(PAGE) const page = readSource(PAGE)
assert.equal(/只看在跑/.test(page), false, '面板说明不再写只看在跑') assert.equal(/只看在跑/.test(page), false, '面板说明不再写只看在跑')
assert.match(page, /title="麦象变体采集任务条数(全部状态)/, '徽章 tooltip 换成全部状态口径') assert.doesNotMatch(page, /麦象变体采集任务条数/, '徽章 tooltip 已按精简口径删除(2026-11-28)')
assert.match(page, /默认全部状态(待执行\/处理中\/成功\/失败)/, '面板说明写明四态') assert.doesNotMatch(page, /默认全部状态/, '面板说明已删,四态只留在下拉选项里(2026-11-28)')
}) })
test('task_center_device_display_falls_back_to_truncated_id', () => { test('task_center_device_display_falls_back_to_truncated_id', () => {
@@ -336,7 +328,7 @@ test('task_center_task_list_columns_are_trimmed_to_the_data_that_exists', () =>
assert.equal(/colspan="9"/.test(table), false, '加国家列后空态不该还写 9 列') assert.equal(/colspan="9"/.test(table), false, '加国家列后空态不该还写 9 列')
assert.match(style, /\.shop-filter\s*\{[^}]*position: relative/, '店铺组是提示的定位父元素') assert.match(style, /\.shop-filter\s*\{[^}]*position: relative/, '店铺组是提示的定位父元素')
assert.match(style, /\.filter-tip\s*\{[^}]*position: absolute/, '提示绝对定位,不再撑高该组把 label 顶上去') assert.equal(/filter-tip/.test(page + style), false, '筛选提示整条删除(含样式,2026-11-28)')
assert.match(style, /\.form-row\s*\{[^}]*align-items: flex-end[^}]*margin-bottom: 22px/, '底部留白容纳提示行') assert.match(style, /\.form-row\s*\{[^}]*align-items: flex-end[^}]*margin-bottom: 22px/, '底部留白容纳提示行')
assert.match( assert.match(
page, page,
@@ -6,7 +6,7 @@
<aside class="left-panel left-panel--with-template"> <aside class="left-panel left-panel--with-template">
<div class="section-title">上传文件</div> <div class="section-title">上传文件</div>
<FileUploadZone <FileUploadZone
hint="选择 Excel 后点击解析,系统会识别表格里的 ID、ASIN、国家信息;每一行都会各自抓取商品页、各自送检,同一 ID 有多行也不会少检。" hint="选择 Excel 后点击解析,按表格里的 ID、ASIN、国家逐行送检。"
:names="selectedFileNames" :names="selectedFileNames"
@select-files="selectFiles" @select-files="selectFiles"
@select-folder="selectFolder" @select-folder="selectFolder"
@@ -76,7 +76,7 @@
品牌检测在桌面客户端内执行:请在本机客户端登录后打开本页面使用(浏览器仅可预览界面)。 品牌检测在桌面客户端内执行:请在本机客户端登录后打开本页面使用(浏览器仅可预览界面)。
</p> </p>
<p v-else class="loading-msg"> <p v-else class="loading-msg">
检测完成后自动生成结果 Excel(含原始数据、不符合品牌、查询失败品牌),到右侧任务列表下载。 检测完成后自动生成结果 Excel,到右侧任务列表下载。
</p> </p>
<div class="section-title">文档模板</div> <div class="section-title">文档模板</div>
@@ -57,9 +57,7 @@
<span>采集国家</span> <span>采集国家</span>
<span v-if="countryPrefSaving" class="country-pref-saving">保存中…</span> <span v-if="countryPrefSaving" class="country-pref-saving">保存中…</span>
</div> </div>
<p class="hint country-pref-hint"> <p class="hint country-pref-hint">每次任务只采集一个国家。</p>
每次任务只采集一个国家,选择后会自动保存,下次进入默认使用该国家。
</p>
<div class="country-pref-radios"> <div class="country-pref-radios">
<label <label
v-for="row in COUNTRY_OPTIONS" v-for="row in COUNTRY_OPTIONS"
@@ -96,7 +94,7 @@
{{ pushing ? '启动中...' : '重新启动' }} {{ pushing ? '启动中...' : '重新启动' }}
</button> </button>
</div> </div>
<p class="loading-msg">提交后自动识别 Excel 内容并直接开始采集,进度和结果在右侧查看。若自动启动失败(例如不在桌面客户端内),单子保持「等待中」,可在右侧历史列表点「启动任务」。</p> <p class="loading-msg">提交后自动开始采集;若自动启动失败(例如不在桌面客户端内),可在右侧历史列表点「启动任务」。</p>
<div v-if="queuePushResult" class="queue-debug-card"> <div v-if="queuePushResult" class="queue-debug-card">
<div class="section-title queue-debug-title">启动结果</div> <div class="section-title queue-debug-title">启动结果</div>
@@ -6,9 +6,6 @@
<aside class="left-panel"> <aside class="left-panel">
<div class="section-title">店铺输入</div> <div class="section-title">店铺输入</div>
<div class="input-zone"> <div class="input-zone">
<div class="hint">
左侧负责录入店铺并加入备选区,点击“匹配店铺”得到匹配结果;确认后点“启动任务”开始执行。任务只处理下方勾选的国家。
</div>
<div class="input-row"> <div class="input-row">
<el-input <el-input
v-model="shopInput" v-model="shopInput"
@@ -342,9 +339,7 @@ function toPatrolTaskView(item: PatrolDeleteHistoryItem): TaskItemView {
statusText: statusText(item.taskStatus), statusText: statusText(item.taskStatus),
statusClass: statusClass(item.taskStatus), statusClass: statusClass(item.taskStatus),
extraLines: [ extraLines: [
...(formatTaskGroupResultIds(item) ? [`结果 ID: ${formatTaskGroupResultIds(item)}`] : []), // 结果 ID/店铺 ID/平台等技术行已按 2026-11-28 精简口径下屏(店名已在卡片标题点名)。
...(formatTaskGroupShopIds(item) ? [`店铺 ID: ${formatTaskGroupShopIds(item)}`] : []),
...(item.platform ? [`平台: ${item.platform}`] : []),
`模板: ${formatTemplateSummary(item)}`, `模板: ${formatTemplateSummary(item)}`,
...(formatTaskGroupErrors(item) ? [`错误: ${userNotice(formatTaskGroupErrors(item))}`] : []), ...(formatTaskGroupErrors(item) ? [`错误: ${userNotice(formatTaskGroupErrors(item))}`] : []),
], ],
@@ -531,14 +526,6 @@ function formatTaskGroupShopNames(item: PatrolDeleteHistoryItem) {
return uniqueJoined(taskGroupItems(item).map((row) => row.shopName)) || "-"; return uniqueJoined(taskGroupItems(item).map((row) => row.shopName)) || "-";
} }
function formatTaskGroupResultIds(item: PatrolDeleteHistoryItem) {
return uniqueJoined(taskGroupItems(item).map((row) => row.resultId));
}
function formatTaskGroupShopIds(item: PatrolDeleteHistoryItem) {
return uniqueJoined(taskGroupItems(item).map((row) => row.shopId));
}
function formatTaskGroupErrors(item: PatrolDeleteHistoryItem) { function formatTaskGroupErrors(item: PatrolDeleteHistoryItem) {
return uniqueJoined(taskGroupItems(item).map((row) => row.error)); return uniqueJoined(taskGroupItems(item).map((row) => row.error));
} }
@@ -29,10 +29,6 @@
<span class="country-check-text">{{ row.label }}</span> <span class="country-check-text">{{ row.label }}</span>
</label> </label>
</div> </div>
<p class="hint">
勾选的状态在同一国家内各筛一遍、各跑一遍整店列表;同一 ASIN 命中多个状态只跟一次价。
某状态在该店铺没有商品时会被跳过并记进任务日志。
</p>
</template> </template>
<!-- 按指定ASIN文档:上传 --> <!-- 按指定ASIN文档:上传 -->
@@ -72,7 +68,6 @@
<!-- 店铺输入和备选店铺在两种 ASIN 来源模式下都可用。 --> <!-- 店铺输入和备选店铺在两种 ASIN 来源模式下都可用。 -->
<div class="section-title">店铺名称</div> <div class="section-title">店铺名称</div>
<div class="input-zone"> <div class="input-zone">
<div class="hint">输入店铺名后点「确认」加入下方备选区。可同时配合上方模式使用。</div>
<div class="input-row"> <div class="input-row">
<el-input v-model="shopInput" clearable placeholder="请输入店铺名称" @keyup.enter="confirmAdd" /> <el-input v-model="shopInput" clearable placeholder="请输入店铺名称" @keyup.enter="confirmAdd" />
<button type="button" class="opt-btn" :disabled="adding" @click="confirmAdd"> <button type="button" class="opt-btn" :disabled="adding" @click="confirmAdd">
@@ -105,9 +100,7 @@
<template v-if="!asinModeEnabled"> <template v-if="!asinModeEnabled">
<!-- 国家顺序 --> <!-- 国家顺序 -->
<div class="section-title">处理国家与顺序</div> <div class="section-title">处理国家与顺序</div>
<p class="hint country-pref-hint"> <p class="hint country-pref-hint">勾选需要处理的站点,可拖拽调整顺序。</p>
勾选需要处理的站点;拖拽调整顺序。设置会按当前登录用户保存。
</p>
<div class="country-pref-checks"> <div class="country-pref-checks">
<label v-for="row in countryCheckboxRows" :key="row.code" class="country-check-row"> <label v-for="row in countryCheckboxRows" :key="row.code" class="country-check-row">
<input type="checkbox" class="country-check-input" :checked="isCountrySelected(row.code)" <input type="checkbox" class="country-check-input" :checked="isCountrySelected(row.code)"
@@ -145,7 +138,7 @@
{{ pushing ? '启动中…' : '启动任务' }} {{ pushing ? '启动中…' : '启动任务' }}
</button> </button>
</div> </div>
<p class="loading-msg">上传ASIN文档和多选店铺<strong>可同时生效</strong>,跟价结果合并输出。全量和自定义的区别仅在于ASIN来源不同。</p> <p class="loading-msg">ASIN 文档与多选店铺可同时生效,结果合并输出;进度见右侧任务区。</p>
<div v-if="activeLoopRun" class="loop-status-card"> <div v-if="activeLoopRun" class="loop-status-card">
<div class="loop-status-line">循环任务 ID:{{ activeLoopRun.id }}</div> <div class="loop-status-line">循环任务 ID:{{ activeLoopRun.id }}</div>
@@ -6,7 +6,6 @@
<aside class="left-panel"> <aside class="left-panel">
<div class="section-title">店铺名称</div> <div class="section-title">店铺名称</div>
<div class="input-zone"> <div class="input-zone">
<div class="hint">输入店铺名后点「确认」加入下方备选区(按当前登录用户保存)。勾选备选后点「匹配店铺」,确认匹配结果后再「启动任务」。</div>
<div class="input-row"> <div class="input-row">
<el-input v-model="shopInput" clearable placeholder="请输入店铺名称" @keyup.enter="confirmAdd" /> <el-input v-model="shopInput" clearable placeholder="请输入店铺名称" @keyup.enter="confirmAdd" />
<button type="button" class="opt-btn" :disabled="adding" @click="confirmAdd"> <button type="button" class="opt-btn" :disabled="adding" @click="confirmAdd">
@@ -34,9 +33,7 @@
v-model:current-page="candidatePage" /> v-model:current-page="candidatePage" />
<div class="section-title">处理国家与顺序</div> <div class="section-title">处理国家与顺序</div>
<p class="hint country-pref-hint"> <p class="hint country-pref-hint">勾选需要处理的站点,可拖拽调整顺序。</p>
勾选需要处理的站点(可只选 2~3 国);上方勾选区<strong>先按已选顺序</strong>排列,其余未选国家排在后面。拖拽下方列表调整顺序后会与上方同步。设置会按当前登录用户保存。
</p>
<div class="country-pref-checks"> <div class="country-pref-checks">
<label v-for="row in countryCheckboxRows" :key="row.code" class="country-check-row"> <label v-for="row in countryCheckboxRows" :key="row.code" class="country-check-row">
<input type="checkbox" class="country-check-input" :checked="isCountrySelected(row.code)" <input type="checkbox" class="country-check-input" :checked="isCountrySelected(row.code)"
@@ -59,7 +56,6 @@
<div v-if="countryPrefSaving" class="country-pref-status">保存中…</div> <div v-if="countryPrefSaving" class="country-pref-status">保存中…</div>
<div class="section-title">商品列表筛选</div> <div class="section-title">商品列表筛选</div>
<p class="hint listing-filter-hint">下方选择的筛选类型会随「启动任务」一起执行。</p>
<div class="listing-filter-row"> <div class="listing-filter-row">
<el-select v-model="productRiskListingFilter" class="listing-filter-select" teleported placeholder="选择筛选类型"> <el-select v-model="productRiskListingFilter" class="listing-filter-select" teleported placeholder="选择筛选类型">
<el-option v-for="opt in PRODUCT_RISK_LISTING_FILTER_OPTIONS" :key="opt.value" :label="opt.label" <el-option v-for="opt in PRODUCT_RISK_LISTING_FILTER_OPTIONS" :key="opt.value" :label="opt.label"
@@ -77,7 +73,7 @@
{{ pushing ? '启动中…' : '启动任务' }} {{ pushing ? '启动中…' : '启动任务' }}
</button> </button>
</div> </div>
<p class="loading-msg">选「在搜索结果中禁止显示」「详情页面已删除」时会合并成一个任务一起处理(避免同时打开多个浏览器窗口);其它筛选按店铺逐个处理。系统每处理完一家店铺就会更新进度,全部完成后任务结束,结果可在右侧查看。</p> <p class="loading-msg">「禁止显示」与「已删除」会合并为一个任务;进度与结果见右侧任务区。</p>
<div v-if="queuePushResult" class="queue-debug-card"> <div v-if="queuePushResult" class="queue-debug-card">
<div class="section-title queue-debug-title">启动结果</div> <div class="section-title queue-debug-title">启动结果</div>
@@ -55,7 +55,6 @@
<span class="country-check-text">{{ row.label }} ({{ row.code }})</span> <span class="country-check-text">{{ row.label }} ({{ row.code }})</span>
</label> </label>
</div> </div>
<p class="country-hint">发布国家会从同步国家中自动排除。</p>
</div> </div>
@@ -6,9 +6,6 @@
<aside class="left-panel"> <aside class="left-panel">
<div class="section-title">店铺输入</div> <div class="section-title">店铺输入</div>
<div class="input-zone"> <div class="input-zone">
<div class="hint">
左侧负责录入店铺并加入备选区,确认匹配结果后启动任务。查询会按店铺逐个执行:上一个店铺查完会自动开始下一个,失败也会继续。
</div>
<div class="input-row"> <div class="input-row">
<el-input <el-input
v-model="shopInput" v-model="shopInput"
@@ -90,9 +87,7 @@
</button> </button>
</div> </div>
<p class="loading-msg"> <p class="loading-msg">店铺按顺序逐个查询,失败自动继续;进度与结果见右侧任务区。</p>
店铺会按顺序逐个查询:上一个店铺查完(无论成功或失败)都会自动开始下一个。如果中途网络异常,系统会自动恢复并继续处理。
</p>
<div v-if="queuePushResult" class="queue-debug-card"> <div v-if="queuePushResult" class="queue-debug-card">
<div class="section-title queue-debug-title">任务状态</div> <div class="section-title queue-debug-title">任务状态</div>
@@ -290,10 +285,7 @@ function toQueryAsinTaskView(item: QueryAsinHistoryItem): TaskItemView {
statusText: statusText(item.taskStatus), statusText: statusText(item.taskStatus),
statusClass: statusClass(item.taskStatus), statusClass: statusClass(item.taskStatus),
extraLines: [ extraLines: [
...(item.resultId ? [`结果 ID: ${item.resultId}`] : []), // 结果 ID/店铺 ID/平台/创建时间等技术行已按 2026-11-28 精简口径下屏(任务ID 在卡片上)。
...(item.shopId ? [`店铺 ID: ${item.shopId}`] : []),
...(item.platform ? [`平台: ${item.platform}`] : []),
...(startedRaw && item.createdAt && startedRaw !== item.createdAt ? [`创建时间: ${formatDateTime(item.createdAt)}`] : []),
`ASIN结构: ${formatTemplateSummary(item)}`, `ASIN结构: ${formatTemplateSummary(item)}`,
...(item.error ? [`错误: ${userNotice(item.error)}`] : []), ...(item.error ? [`错误: ${userNotice(item.error)}`] : []),
], ],
@@ -5,7 +5,6 @@
<aside class="left-panel"> <aside class="left-panel">
<div class="section-title">店铺候选</div> <div class="section-title">店铺候选</div>
<div class="input-zone"> <div class="input-zone">
<div class="hint">输入店铺名后点“添加”加入下方备选区。勾选备选店铺后先做“匹配店铺”,确认匹配结果后再启动任务。</div>
<div class="input-row"> <div class="input-row">
<el-input v-model="shopInput" clearable placeholder="请输入店铺名后回车或点击添加" @keyup.enter="confirmAdd" /> <el-input v-model="shopInput" clearable placeholder="请输入店铺名后回车或点击添加" @keyup.enter="confirmAdd" />
<button type="button" class="opt-btn" :disabled="adding" @click="confirmAdd">{{ adding ? '添加中...' : '添加' }}</button> <button type="button" class="opt-btn" :disabled="adding" @click="confirmAdd">{{ adding ? '添加中...' : '添加' }}</button>
@@ -24,7 +23,7 @@
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 class="section-title">国家配置</div> <div class="section-title">国家配置</div>
<p class="hint country-pref-hint">勾选的国家会在每一个执行时间点都执行一遍。勾选区会按照已选顺序排在前面,下方支持拖拽排序,和商品风险页保持一致。</p> <p class="hint country-pref-hint">勾选国家按已选顺序执行,可拖拽调整。</p>
<div class="country-pref-checks"> <div class="country-pref-checks">
<label v-for="row in countryCheckboxRows" :key="row.code" class="country-check-row"> <label v-for="row in countryCheckboxRows" :key="row.code" class="country-check-row">
<input type="checkbox" class="country-check-input" :checked="isCountrySelected(row.code)" :disabled="isCountrySelectionLocked(row.code)" @change="onCountryNativeChange(row.code, $event)" /> <input type="checkbox" class="country-check-input" :checked="isCountrySelected(row.code)" :disabled="isCountrySelectionLocked(row.code)" @change="onCountryNativeChange(row.code, $event)" />
@@ -42,7 +41,6 @@
</div> </div>
<div v-if="countryPrefSaving" class="country-pref-status">保存中...</div> <div v-if="countryPrefSaving" class="country-pref-status">保存中...</div>
<div class="section-title">商品列表筛选</div> <div class="section-title">商品列表筛选</div>
<p class="hint listing-filter-hint">下方选择的筛选类型会随「启动任务」一起执行。</p>
<div class="listing-filter-row"> <div class="listing-filter-row">
<el-select v-model="shopMatchListingFilter" class="listing-filter-select" teleported placeholder="选择筛选类型"> <el-select v-model="shopMatchListingFilter" class="listing-filter-select" teleported placeholder="选择筛选类型">
<el-option v-for="opt in LISTING_FILTER_OPTIONS" :key="opt.value" :label="opt.label" :value="opt.value" /> <el-option v-for="opt in LISTING_FILTER_OPTIONS" :key="opt.value" :label="opt.label" :value="opt.value" />
@@ -63,7 +61,7 @@
<button type="button" class="btn-run" :disabled="matching" @click="runMatch">{{ matching ? '匹配中...' : '匹配店铺' }}</button> <button type="button" class="btn-run" :disabled="matching" @click="runMatch">{{ matching ? '匹配中...' : '匹配店铺' }}</button>
<button type="button" class="btn-run btn-queue" :disabled="pushing || !matchedItems.length" @click="pushToPythonQueue">{{ pushing ? '启动中...' : scheduleEnabled ? '创建定时任务' : '启动任务' }}</button> <button type="button" class="btn-run btn-queue" :disabled="pushing || !matchedItems.length" @click="pushToPythonQueue">{{ pushing ? '启动中...' : scheduleEnabled ? '创建定时任务' : '启动任务' }}</button>
</div> </div>
<p class="loading-msg">支持按多个时间点定时执行;系统每处理完一家店铺就会更新进度,全部完成后任务结束,结果可在右侧查看。</p> <p class="loading-msg">进度与结果见右侧任务区。</p>
<div v-if="queuePushResult" class="queue-debug-card"><div class="section-title queue-debug-title">启动结果</div><div class="queue-debug-line">{{ queuePushResult }}</div><pre v-if="queuePayloadText" class="queue-debug-payload">{{ queuePayloadText }}</pre></div> <div v-if="queuePushResult" class="queue-debug-card"><div class="section-title queue-debug-title">启动结果</div><div class="queue-debug-line">{{ queuePushResult }}</div><pre v-if="queuePayloadText" class="queue-debug-payload">{{ queuePayloadText }}</pre></div>
</aside> </aside>
<section class="right-panel"> <section class="right-panel">
@@ -6,9 +6,6 @@
<aside class="left-panel"> <aside class="left-panel">
<div class="section-title">店铺输入</div> <div class="section-title">店铺输入</div>
<div class="input-zone"> <div class="input-zone">
<div class="hint">
左侧负责录入店铺并加入备选区,确认匹配结果后启动任务。每次启动会把本次选中的所有店铺合并为一条取款任务,任务按顺序逐个执行。
</div>
<div class="input-row"> <div class="input-row">
<el-input <el-input
v-model="shopInput" v-model="shopInput"
@@ -154,7 +151,7 @@
:key="`cur-shop-${shop.resultId || shop.shopId || shop.shopName}`" :key="`cur-shop-${shop.resultId || shop.shopId || shop.shopName}`"
class="files shop-detail-line" class="files shop-detail-line"
> >
{{ shop.shopName || "-" }} · 结果 ID: {{ shop.resultId ?? "-" }} · 店铺 ID: {{ shop.shopId || "-" }} · 平台: {{ shop.platform || "-" }} {{ shop.shopName || "-" }}
</div> </div>
</div> </div>
</template> </template>
@@ -166,7 +163,7 @@
:key="`his-shop-${shop.resultId || shop.shopId || shop.shopName}`" :key="`his-shop-${shop.resultId || shop.shopId || shop.shopName}`"
class="files shop-detail-line" class="files shop-detail-line"
> >
{{ shop.shopName || "-" }} · 结果 ID: {{ shop.resultId ?? "-" }} · 店铺 ID: {{ shop.shopId || "-" }} · 平台: {{ shop.platform || "-" }} {{ shop.shopName || "-" }}
</div> </div>
</div> </div>
</template> </template>
+8 -23
View File
@@ -77,9 +77,7 @@ const selectedTabLabels = computed(() =>
TAB_OPTIONS.filter((option) => selectedTabs.value.includes(option.value)).map((option) => option.label), TAB_OPTIONS.filter((option) => selectedTabs.value.includes(option.value)).map((option) => option.label),
) )
const tabHint = computed(() => ( const tabHint = computed(() => (
selectedTabLabels.value.length selectedTabLabels.value.length ? '' : '至少勾选一个采集状态才能开始采集。'
? `本次采集「${selectedTabLabels.value.join('、')}」的商品。`
: '至少勾选一个采集状态才能开始采集。'
)) ))
/** 勾选/取消一个状态:默认两项都选是旧行为,用户可只留一项(例如店里只剩已下架商品)。 */ /** 勾选/取消一个状态:默认两项都选是旧行为,用户可只留一项(例如店里只剩已下架商品)。 */
function toggleTab(tab: JdListTab) { function toggleTab(tab: JdListTab) {
@@ -146,7 +144,7 @@ function refreshSyncAvailability() {
canSyncCategories.value = typeof api?.get_jd_shop_categories === 'function' canSyncCategories.value = typeof api?.get_jd_shop_categories === 'function'
} }
/** 分类块底部说明:同步状态 + 选中口径 + 「先挂分类才有命中」的边界,一行讲完。 */ /** 分类块底部说明(2026-11-28 精简口径):同步状态 + 选中口径,一行讲完;机制解释句删。 */
const categoryHint = computed(() => { const categoryHint = computed(() => {
const parts: string[] = [] const parts: string[] = []
if (syncedShopName.value) { if (syncedShopName.value) {
@@ -155,12 +153,11 @@ const categoryHint = computed(() => {
: '' : ''
parts.push(`已同步店铺「${syncedShopName.value}」:${shopCategoryOptions.value.length} 个分类${suffix}`) parts.push(`已同步店铺「${syncedShopName.value}」:${shopCategoryOptions.value.length} 个分类${suffix}`)
} else { } else {
parts.push('分类来自本机客户端已登录的京麦店铺,点「同步分类」拉取;未同步或空选=全店采集') parts.push('未同步或空选=全店采集')
} }
if (selectedShopCategoryValues.value.length) { if (selectedShopCategoryValues.value.length) {
parts.push(`只采选中 ${selectedShopCategoryValues.value.length} 个分类的商品`) parts.push(`只采选中 ${selectedShopCategoryValues.value.length} 个分类的商品`)
} }
parts.push('商品要先在京麦挂上分类才会被选中')
return `${parts.join(';')}。` return `${parts.join(';')}。`
}) })
@@ -343,14 +340,10 @@ function toJdTaskView(item: JdCollectHistoryItemVo): TaskItemView {
extraLines: [ extraLines: [
...(item.listTabs?.length ? [`采集状态:${item.listTabs.map(tabLabel).join('、')}`] : []), ...(item.listTabs?.length ? [`采集状态:${item.listTabs.map(tabLabel).join('、')}`] : []),
...(item.rowCount != null ? [`已采集 ${item.rowCount} 个商品`] : []), ...(item.rowCount != null ? [`已采集 ${item.rowCount} 个商品`] : []),
...(showProgress && typeof item.page === 'number' && item.page > 0
? [`断点游标:第 ${item.page} 页 · 已回传 ${item.batches ?? 0} 批`]
: []),
// 逐分类轮次游标(2026-11-21 方案 C):多轮采集时页码归 1,靠「正在采集分类」 // 逐分类轮次游标(2026-11-21 方案 C):多轮采集时页码归 1,靠「正在采集分类」
// 消解「任务重跑了」的歧义;合并兜底轮(页面筛选未生效)明确标注,别让用户 // 消解「任务重跑了」的歧义;页码/批数等技术游标已按 2026-11-28 精简口径下屏。
// 以为只采了 shopCatName 这一个分类。
...(showProgress && item.shopCatName ...(showProgress && item.shopCatName
? [`正在采集分类:${item.shopCatName}${item.shopCatMerged ? ' 等(页面筛选未生效,兜底翻页中)' : ''}`] ? [`正在采集分类:${item.shopCatName}${item.shopCatMerged ? ' 等' : ''}`]
: []), : []),
...(item.errorMessage ? [`错误:${userNotice(item.errorMessage)}`] : []), ...(item.errorMessage ? [`错误:${userNotice(item.errorMessage)}`] : []),
], ],
@@ -466,7 +459,7 @@ async function interruptTaskRecord(item: JdCollectHistoryItemVo | null | undefin
if (!confirmed) return if (!confirmed) return
try { try {
await interruptJdCollectTask(taskId) await interruptJdCollectTask(taskId)
ElMessage.success('已中断:客户端下一跳心跳后收手,之后可点「继续」接着跑') ElMessage.success('已中断,之后可点「继续」接着跑')
await refreshBoard() await refreshBoard()
} catch (error) { } catch (error) {
ElMessage.error(error instanceof Error ? error.message : '中断失败') ElMessage.error(error instanceof Error ? error.message : '中断失败')
@@ -481,9 +474,7 @@ async function retryTaskRecord(item: JdCollectHistoryItemVo | null | undefined)
if (!(await passJdLoginGate())) return if (!(await passJdLoginGate())) return
try { try {
await retryClientTask(taskId) await retryClientTask(taskId)
ElMessage.success(isResume ElMessage.success(isResume ? '已继续:在这条任务上接着跑' : '已提交重试:在这条任务上继续跑')
? '已继续:在这条任务上接着跑(断点游标保留,不重复采集)'
: '已提交重试:在这条任务上继续跑(不新建任务)')
// 复位是 PENDING:与建单同一条激活+推队列链路,客户端才会立刻领到这一单。 // 复位是 PENDING:与建单同一条激活+推队列链路,客户端才会立刻领到这一单。
// 激活/推送失败不回滚复位——任务留在 PENDING 由客户端兜底拉取认领。 // 激活/推送失败不回滚复位——任务留在 PENDING 由客户端兜底拉取认领。
const activateError = await activateTask(taskId) const activateError = await activateTask(taskId)
@@ -687,9 +678,6 @@ onUnmounted(() => {
<div class="tool-head"> <div class="tool-head">
<router-link class="tool-head__back" :to="backHref">← 返回京东工具台</router-link> <router-link class="tool-head__back" :to="backHref">← 返回京东工具台</router-link>
<span class="tool-head__title">获取店铺数据</span> <span class="tool-head__title">获取店铺数据</span>
<span class="tool-head__desc">
一键抓取已登录京麦后台的店铺商品(列表 + 详情全部属性 + 图片),导入后台「京东数据库」。
</span>
</div> </div>
<main class="jd-body"> <main class="jd-body">
@@ -731,10 +719,7 @@ onUnmounted(() => {
{{ isRunning ? '获取中…' : (noTabSelected ? '请先勾选采集状态' : (selectedShopCategories.length ? `获取选中分类数据` : '一键获取店铺数据')) }} {{ isRunning ? '获取中…' : (noTabSelected ? '请先勾选采集状态' : (selectedShopCategories.length ? `获取选中分类数据` : '一键获取店铺数据')) }}
</button> </button>
<p class="collect-hint"> <p class="collect-hint">请保持客户端在线且京麦已登录,进度见右侧任务区。</p>
点击后本机客户端会自动打开已登录的京麦后台采集商品,请保持客户端在线且京麦已登录;
采集到的数据会实时回传并导入后台「京东数据库」。进度显示在右侧任务区。
</p>
<p v-if="successMessage" class="feedback success">{{ successMessage }}</p> <p v-if="successMessage" class="feedback success">{{ successMessage }}</p>
<p v-if="noticeMessage" class="feedback notice">{{ noticeMessage }}</p> <p v-if="noticeMessage" class="feedback notice">{{ noticeMessage }}</p>
@@ -23,10 +23,6 @@
<section class="jd-hero"> <section class="jd-hero">
<span class="hero-pill">店铺采集 · 商品上架</span> <span class="hero-pill">店铺采集 · 商品上架</span>
<h1 class="hero-title">京东运营,一键开始</h1> <h1 class="hero-title">京东运营,一键开始</h1>
<p class="hero-sub">
获取店铺数据只需一次点击:本机客户端会自动打开已登录的京麦后台抓取商品,
实时回传进度并把数据导入后台「京东数据库」。商品上架正在建设中。
</p>
</section> </section>
<header class="group-head"> <header class="group-head">
+11 -22
View File
@@ -182,8 +182,7 @@ const shopNote = ref('')
const shopError = ref('') const shopError = ref('')
const SHOP_DETECT_UNAVAILABLE = const SHOP_DETECT_UNAVAILABLE =
'当前在本机客户端之外打开或客户端版本较旧,无法检测京麦店铺。请在本机客户端中打开本页;' '当前在本机客户端之外打开或客户端版本较旧,无法检测京麦店铺,请在本机客户端中打开本页。'
+ '本机客户端发布前仍会核对任务记录的店铺,不一致整单拦下、一条都不发'
const shopGuard = computed(() => evaluateShopGuard(selectedProductRows.value, currentShop.value)) const shopGuard = computed(() => evaluateShopGuard(selectedProductRows.value, currentShop.value))
@@ -620,7 +619,7 @@ async function interruptTaskRecord(item: JdPublishHistoryItemVo | null | undefin
if (!confirmed) return if (!confirmed) return
try { try {
await interruptJdPublishTask(taskId) await interruptJdPublishTask(taskId)
ElMessage.success('已中断:客户端下一跳心跳后收手,之后可点「继续」接着跑') ElMessage.success('已中断,之后可点「继续」接着跑')
await refreshBoard() await refreshBoard()
} catch (error) { } catch (error) {
ElMessage.error(error instanceof Error ? error.message : '中断失败') ElMessage.error(error instanceof Error ? error.message : '中断失败')
@@ -714,9 +713,9 @@ async function pushToClientQueue(payload: Record<string, unknown> | undefined, a
const isRunning = computed(() => Boolean(board.dashboard.value.pendingTaskCount) || submitting.value) const isRunning = computed(() => Boolean(board.dashboard.value.pendingTaskCount) || submitting.value)
const priceRuleHint = computed(() => { const priceRuleHint = computed(() => {
if (priceMode.value === 'none') return '按京东数据库里的采集原价上架。' if (priceMode.value === 'none') return '按采集原价上架。'
if (priceMode.value === 'percent') return '按采集价上浮 N%(填 10 表示加价 10%)。' if (priceMode.value === 'percent') return '按采集价上浮的百分比,填 10 即加价 10%。'
return '每个商品统一加固定金额(填 5 表示加 5 元)。' return '每个商品统一加固定金额。'
}) })
async function startPublish() { async function startPublish() {
@@ -816,9 +815,6 @@ onUnmounted(() => {
<div class="tool-head"> <div class="tool-head">
<router-link class="tool-head__back" :to="backHref">← 返回京东工具台</router-link> <router-link class="tool-head__back" :to="backHref">← 返回京东工具台</router-link>
<span class="tool-head__title">商品上架</span> <span class="tool-head__title">商品上架</span>
<span class="tool-head__desc">
把京东数据库里的商品批量上架到京麦店铺:选分类即整分类上架、可选统一改价,本机已登录京麦的客户端逐个发布。
</span>
</div> </div>
<main class="jd-body"> <main class="jd-body">
@@ -851,7 +847,7 @@ onUnmounted(() => {
<p class="shop-alert shop-alert--cross">{{ shopGuard.message }}</p> <p class="shop-alert shop-alert--cross">{{ shopGuard.message }}</p>
<label class="shop-cross-confirm"> <label class="shop-cross-confirm">
<input v-model="crossConfirmed" type="checkbox" /> <input v-model="crossConfirmed" type="checkbox" />
我已确认:这是在目标店新建商品、需目标店类目授权并通过京东审核 我已确认在目标店新建商品
</label> </label>
</template> </template>
<p v-else-if="shopGuard.state === 'match'" class="shop-ok"> <p v-else-if="shopGuard.state === 'match'" class="shop-ok">
@@ -859,10 +855,7 @@ onUnmounted(() => {
</p> </p>
<p v-else-if="shopNote" class="category-hint">{{ shopNote }}</p> <p v-else-if="shopNote" class="category-hint">{{ shopNote }}</p>
<p v-else-if="!canDetectShop" class="category-hint">{{ SHOP_DETECT_UNAVAILABLE }}</p> <p v-else-if="!canDetectShop" class="category-hint">{{ SHOP_DETECT_UNAVAILABLE }}</p>
<p v-else class="category-hint"> <p v-else class="category-hint">点击「检测京麦店铺」核对京麦当前登录店铺。</p>
勾选商品后点「检测京麦店铺」可确认京麦当前登录的是不是同一家店;不一致时本页不让建单,
客户端发布前还会再核对一次,一条都不会发出去。
</p>
</div> </div>
<div class="category-block"> <div class="category-block">
@@ -874,7 +867,6 @@ onUnmounted(() => {
:label="`${group.name}(${group.productCount ?? 0} 个商品)`" :value="group.id" /> :label="`${group.name}(${group.productCount ?? 0} 个商品)`" :value="group.id" />
</el-select> </el-select>
<p v-if="groupsEmpty" class="category-hint category-hint--warn">{{ GROUPS_EMPTY_HINT_TEXT }}</p> <p v-if="groupsEmpty" class="category-hint category-hint--warn">{{ GROUPS_EMPTY_HINT_TEXT }}</p>
<p v-else class="category-hint">分类由管理员在后台「京东数据库」维护;选中分类即整分类上架,自动纳入你可见分类下的全部商品(同组同事采集的也能上架)。</p>
</div> </div>
<!-- 选品摘要(客户口径「商品信息不要显示,选分类上架就行」):选中分类=整分类上架。 --> <!-- 选品摘要(客户口径「商品信息不要显示,选分类上架就行」):选中分类=整分类上架。 -->
@@ -887,9 +879,7 @@ onUnmounted(() => {
正在读取本分类商品… 正在读取本分类商品…
</p> </p>
<div v-else-if="selectedProducts.size === 0" class="product-empty">该分类下暂无商品</div> <div v-else-if="selectedProducts.size === 0" class="product-empty">该分类下暂无商品</div>
<p v-else class="category-hint"> <p v-else class="category-hint">已纳入本分类全部 {{ selectedProducts.size }} 个商品。</p>
已纳入本分类全部 {{ selectedProducts.size }} 个商品,点下方按钮整批上架(不再逐个勾选)。
</p>
</div> </div>
<div class="category-block"> <div class="category-block">
@@ -908,7 +898,7 @@ onUnmounted(() => {
<input id="jd-publish-target-brand" v-model="targetBrandInput" class="target-brand-input" type="text" <input id="jd-publish-target-brand" v-model="targetBrandInput" class="target-brand-input" type="text"
required :aria-invalid="Boolean(targetBrandInput && !isValidBrand(targetBrandName))" required :aria-invalid="Boolean(targetBrandInput && !isValidBrand(targetBrandName))"
aria-describedby="jd-publish-brand-hint" placeholder="输入当前京麦店铺可用的品牌名称" /> aria-describedby="jd-publish-brand-hint" placeholder="输入当前京麦店铺可用的品牌名称" />
<p id="jd-publish-brand-hint" class="category-hint">本次选中的商品统一使用此品牌,不会修改京东数据库中的原品牌。</p> <p id="jd-publish-brand-hint" class="category-hint">本次选中的商品统一使用此品牌。</p>
</div> </div>
<button class="collect-btn" type="button" :disabled="submitDisabled" @click="startPublish"> <button class="collect-btn" type="button" :disabled="submitDisabled" @click="startPublish">
@@ -919,11 +909,10 @@ onUnmounted(() => {
<p class="collect-hint"> <p class="collect-hint">
<template v-if="usesCrossShop"> <template v-if="usesCrossShop">
跨店档会在目标店按每个商品的类目新建商品(京麦「新增商品」路径),需目标店已授权该类目并过京东审核; 将在目标店新建商品,进度见右侧任务区。
发布进度逐行显示在右侧任务区。
</template> </template>
<template v-else> <template v-else>
点击后本机客户端会逐个把商品发布到已登录的京麦店铺,请保持客户端在线且京麦已登录;发布进度逐行显示在右侧任务区。 请保持客户端在线且京麦已登录,进度见右侧任务区。
</template> </template>
</p> </p>
+2 -4
View File
@@ -21,12 +21,10 @@ export function quotaNearLimit(used: number, limit: number, unlimited: boolean):
return used >= limit; return used >= limit;
} }
/** 面板空态:额度未用满与用满两种口径分开说,别让人以为面板坏了。 */ /** 面板空态(2026-11-28 精简口径:机制解释句删,一句讲完)。 */
export function onShelfEmptyText(unlimited: boolean, used: number): string { export function onShelfEmptyText(unlimited: boolean, used: number): string {
if (used > 0) return '本页暂无更多在架商品,可翻页查看'; if (used > 0) return '本页暂无更多在架商品,可翻页查看';
return unlimited return '当前没有已上架商品';
? '当前没有已上架商品;上架成功后的商品会出现在这里,并计入额度'
: '当前没有已上架商品;额度只在商品上架成功后占用,采集入库不占';
} }
/** 标记按钮文案:delisted 态在面板里恒为「未下架」(已下架的行不进在架列表),撤销口用此文案。 */ /** 标记按钮文案:delisted 态在面板里恒为「未下架」(已下架的行不进在架列表),撤销口用此文案。 */
+11 -15
View File
@@ -68,13 +68,12 @@ export function normalizeShopRef(raw: JdShopRef | null | undefined): JdShopRef |
return { ...(shopId ? { shopId } : {}), ...(shopName ? { shopName } : {}) } return { ...(shopId ? { shopId } : {}), ...(shopName ? { shopName } : {}) }
} }
/** 人读标签:`家居日用数据库店(shopId=228346061)`,缺一半只报有的那半。 */ /** 人读标签:只出店名(2026-11-28 客户口径「shopId 啥的不要搞复杂」不上屏);缺名时 `店铺 <id>` 兜底保可识别。 */
export function shopLabel(raw: JdShopRef | null | undefined): string { export function shopLabel(raw: JdShopRef | null | undefined): string {
const shop = normalizeShopRef(raw) const shop = normalizeShopRef(raw)
if (!shop) return '未记录店铺' if (!shop) return '未记录店铺'
if (shop.shopName && shop.shopId) return `${shop.shopName}(shopId=${shop.shopId})`
if (shop.shopName) return shop.shopName if (shop.shopName) return shop.shopName
return `shopId=${shop.shopId}` return `店铺 ${shop.shopId}`
} }
/** /**
@@ -102,31 +101,28 @@ export function sourceShopRefs(products: ReadonlyArray<JdShopSource> | null | un
} }
/** /**
* 跨店整句:点名「采集店」与「目标店(京麦当前登录)」,说明三件客户要知道的事—— * 跨店整句(2026-11-28 客户口径「不要搞复杂」压成一句):点名「采集店」与「目标店(京麦当前登录)」,
* 会在目标店**新建**商品(与来源店那件各自独立,wareId 不同)、要过京东审核、 * 保留三件客户要知道的事——在目标店**新建**商品、要过京东审核、目标店须已授权该商品的类目。
* 目标店必须已授权该商品的类目。不写「稍后重试」(类目没授权是确定性失败)。 * 不写「稍后重试」(类目没授权是确定性失败)。
*/ */
export function crossShopMessage(source: JdShopRef | null | undefined, target: JdShopRef | null | undefined): string { export function crossShopMessage(source: JdShopRef | null | undefined, target: JdShopRef | null | undefined): string {
const sourceLabel = shopLabel(source) const sourceLabel = shopLabel(source)
const targetLabel = shopLabel(target) const targetLabel = shopLabel(target)
return (`跨店上架:商品采集自「${sourceLabel}」,将在京麦当前登录的「${targetLabel}」新建为全新商品` return (`跨店上架:将把「${sourceLabel}」的商品发布到京麦当前登录的「${targetLabel}」,`
+ '(与来源店那件各自独立,需京东审核通过后才上架);目标店须已授权该商品的类目,' + '在目标店新建商品(需目标店类目已授权,并通过京东审核)。')
+ '否则该商品会按「目标店没有授权类目」逐行失败。')
} }
/** 多店已检测京麦:整单跨店新增的说明句(与服务端 NEW 档口径一致)。 */ /** 多店已检测京麦:整单跨店新建的说明句(与服务端 NEW 档口径一致)。 */
export function multiShopCrossMessage(shops: ReadonlyArray<JdShopRef>, target: JdShopRef): string { export function multiShopCrossMessage(shops: ReadonlyArray<JdShopRef>, target: JdShopRef): string {
const labels = shops.map((shop) => shopLabel(shop)).join('、') const labels = shops.map((shop) => shopLabel(shop)).join('、')
return (`本次勾选的商品来自多个店铺(${labels}),将全部在京麦当前登录的「${shopLabel(target)}」` return (`勾选的商品来自多个店铺(${labels}),将统一在京麦当前登录的「${shopLabel(target)}」`
+ '以「新增商品」方式新建上架(与各来源店的商品各自独立,需京东审核通过后才上架);' + '新建上架(需类目已授权,并通过京东审核)。')
+ '目标店须已授权各商品的类目,否则按「目标店没有授权类目」逐行失败。')
} }
/** 多店还没检测京麦:先检测的指引句(不带目标店建单服务端也会拒)。 */ /** 多店还没检测京麦:先检测的指引句(不带目标店建单服务端也会拒)。 */
export function multiShopDetectMessage(shops: ReadonlyArray<JdShopRef>): string { export function multiShopDetectMessage(shops: ReadonlyArray<JdShopRef>): string {
const labels = shops.map((shop) => shopLabel(shop)).join('、') const labels = shops.map((shop) => shopLabel(shop)).join('、')
return (`本次勾选的商品来自多个店铺(${labels}):多店商品只能整单在京麦当前登录店铺` return `勾选的商品来自多个店铺(${labels}),请先点「检测京麦店铺」确认登录店后再建单。`
+ '以新增商品方式上架,请先点「检测京麦店铺」确认登录店后再建单。')
} }
/** true/false=能比;null=两边都缺可比字段(只认同一维度:id 对 id、名对名)。 */ /** true/false=能比;null=两边都缺可比字段(只认同一维度:id 对 id、名对名)。 */
+2 -2
View File
@@ -37,7 +37,7 @@ export const JD_TOOLS: ReadonlyArray<JdToolInfo> = [
{ {
id: 'jd-collect', id: 'jd-collect',
name: '获取店铺数据', name: '获取店铺数据',
desc: '一键抓取已登录京麦后台的店铺商品(列表 + 详情全部属性 + 图片),导入后台「京东数据库」', desc: '一键抓取京麦店铺商品,导入后台「京东数据库」',
tag: '核心', tag: '核心',
href: '/jd-collect', href: '/jd-collect',
permissionKeys: ['jd-collect'], permissionKeys: ['jd-collect'],
@@ -45,7 +45,7 @@ export const JD_TOOLS: ReadonlyArray<JdToolInfo> = [
{ {
id: 'jd-publish', id: 'jd-publish',
name: '商品上架', name: '商品上架',
desc: '把京东数据库里你自己的商品批量上架到京麦店铺:选分类即整分类上架、可选统一改价,本机客户端逐个发布', desc: '把京东数据库的商品批量上架到京麦店铺',
tag: '核心', tag: '核心',
href: '/jd-publish', href: '/jd-publish',
permissionKeys: ['jd-publish'], permissionKeys: ['jd-publish'],
+4 -2
View File
@@ -330,6 +330,8 @@ test('任务卡展示轮次游标:正在采集分类 + 合并兜底标注', ()
const body = page.slice(toJdTaskView, page.indexOf('// ---- 本模块的状态语义')) const body = page.slice(toJdTaskView, page.indexOf('// ---- 本模块的状态语义'))
assert.ok(body.includes('正在采集分类:${item.shopCatName}'), assert.ok(body.includes('正在采集分类:${item.shopCatName}'),
'toJdTaskView 必须在 extraLines 展示「正在采集分类」(页码归 1 消歧)') 'toJdTaskView 必须在 extraLines 展示「正在采集分类」(页码归 1 消歧)')
assert.ok(body.includes('等(页面筛选未生效,兜底翻页中)'), // 2026-11-28 精简口径:技术游标(断点页码/批数/兜底标注)下屏,轮次只留「分类名 等」。
'合并兜底轮必须带「页面筛选未生效」标注') assert.ok(body.includes("' 等'"), '合并兜底轮精简为「分类名 等」')
assert.ok(!body.includes('断点游标'), '「断点游标」技术行已删,不得回流')
assert.ok(!body.includes('页面筛选未生效'), '内部机制标注已删,不得回流')
}) })
+4 -3
View File
@@ -47,10 +47,11 @@ test('到顶判据:used≥limit 才提醒;不限档永不提醒', () => {
assert.equal(quotaNearLimit(999999, 0, true), false) assert.equal(quotaNearLimit(999999, 0, true), false)
}) })
test('空态文案:未占用点名「采集入库不占额度」,翻页态不冒充空账', () => { test('空态文案(2026-11-28 精简口径):一句讲完,机制解释句不再回流;翻页态不冒充空账', () => {
assert.match(onShelfEmptyText(false, 0), /采集入库不占/) assert.equal(onShelfEmptyText(false, 0), '当前没有已上架商品')
assert.match(onShelfEmptyText(true, 0), /上架成功后.*计入额度/s) assert.equal(onShelfEmptyText(true, 0), '当前没有已上架商品')
assert.equal(onShelfEmptyText(false, 25), '本页暂无更多在架商品,可翻页查看') assert.equal(onShelfEmptyText(false, 25), '本页暂无更多在架商品,可翻页查看')
assert.ok(!onShelfEmptyText(false, 0).includes('采集入库不占'), '机制解释句已删,不得回流')
}) })
test('分页钳制与服务端 MAX_PAGE_SIZE=100 同口径', () => { test('分页钳制与服务端 MAX_PAGE_SIZE=100 同口径', () => {
+10 -6
View File
@@ -65,10 +65,11 @@ test('同一家店两种形状(只有 id / 只有店名)在来源集里能
assert.equal(refs.length, 2) assert.equal(refs.length, 2)
}) })
test('店铺标签:名+id 全显示,缺一半只报有的那半,全空=未记录店铺', () => { test('店铺标签:只出店名(2026-11-28 精简口径 shopId 不上屏),缺名报「店铺 <id>」,全空=未记录店铺', () => {
assert.equal(shopLabel({ shopId: '1', shopName: '某店' }), '某店(shopId=1)') assert.equal(shopLabel({ shopId: '1', shopName: '某店' }), '某店')
assert.ok(!shopLabel({ shopId: '1', shopName: '某店' }).includes('shopId='), '店名上屏时不许带 shopId 技术前缀')
assert.equal(shopLabel({ shopName: '某店' }), '某店') assert.equal(shopLabel({ shopName: '某店' }), '某店')
assert.equal(shopLabel({ shopId: '1' }), 'shopId=1') assert.equal(shopLabel({ shopId: '1' }), '店铺 1')
assert.equal(shopLabel(null), '未记录店铺') assert.equal(shopLabel(null), '未记录店铺')
assert.equal(normalizeShopRef({ shopId: ' ' }), null) assert.equal(normalizeShopRef({ shopId: ' ' }), null)
}) })
@@ -79,8 +80,10 @@ test('跨店文案:点名来源店与目标店、说明会新建商品要过
{ shopId: '228346061', shopName: '家居日用数据库店' }, { shopId: '228346061', shopName: '家居日用数据库店' },
) )
assert.ok(message.startsWith('跨店上架')) assert.ok(message.startsWith('跨店上架'))
assert.ok(message.includes('汽车用品数据库店') && message.includes('148191738')) assert.ok(message.includes('汽车用品数据库店') && message.includes('家居日用数据库店'),
assert.ok(message.includes('家居日用数据库店') && message.includes('228346061')) '来源店与目标店(京麦当前登录)都要点名')
assert.ok(!message.includes('148191738') && !message.includes('shopId='),
'2026-11-28 精简口径:技术 id 不上屏')
assert.ok(message.includes('新建'), '必须说清跨店是在目标店新建商品') assert.ok(message.includes('新建'), '必须说清跨店是在目标店新建商品')
assert.ok(message.includes('授权'), '必须点名目标店类目授权这个硬前提') assert.ok(message.includes('授权'), '必须点名目标店类目授权这个硬前提')
assert.ok(message.includes('审核'), '必须说清要过京东审核') assert.ok(message.includes('审核'), '必须说清要过京东审核')
@@ -146,8 +149,9 @@ test('多店已检测京麦:整单按跨店新增放行(协议 ≥4+人工
if (guard.state === 'multi') { if (guard.state === 'multi') {
assert.deepEqual(guard.target, { shopId: '3', shopName: '丙店' }, '目标店=京麦当前登录店') assert.deepEqual(guard.target, { shopId: '3', shopName: '丙店' }, '目标店=京麦当前登录店')
assert.ok(guard.message.includes('甲店') && guard.message.includes('乙店') && guard.message.includes('丙店')) assert.ok(guard.message.includes('甲店') && guard.message.includes('乙店') && guard.message.includes('丙店'))
assert.ok(guard.message.includes('新增'), '必须说清多店是在目标店以新增商品方式上架') assert.ok(guard.message.includes('新建'), '必须说清多店是在目标店新建上架(精简后统一用「新建」)')
assert.ok(guard.message.includes('授权') && guard.message.includes('审核')) assert.ok(guard.message.includes('授权') && guard.message.includes('审核'))
assert.ok(!guard.message.includes('shopId='), '精简口径:多店文案不拼技术 id')
} }
assert.ok(shopGuardBlocks(guard), '协议 < 4 仍拦:老客户端没有新增商品路径') assert.ok(shopGuardBlocks(guard), '协议 < 4 仍拦:老客户端没有新增商品路径')
assert.equal(shopGuardMessage(guard), CROSS_UPGRADE_NOTICE) assert.equal(shopGuardMessage(guard), CROSS_UPGRADE_NOTICE)
+2 -1
View File
@@ -58,7 +58,8 @@ test('选品作用域:建单带 productIds,文案与作用域口径一致(
// 口径改:同组同事采集的商品也能上架——文案不得再写「归属你账号」,空态与说明同步。 // 口径改:同组同事采集的商品也能上架——文案不得再写「归属你账号」,空态与说明同步。
assert.ok(!tab.includes('归属你账号'), '文案不得再写「归属你账号」:起作用域是可见分类,不是建单人') assert.ok(!tab.includes('归属你账号'), '文案不得再写「归属你账号」:起作用域是可见分类,不是建单人')
assert.ok(tab.includes('该分类下暂无商品'), '空态文案必须与作用域口径一致') assert.ok(tab.includes('该分类下暂无商品'), '空态文案必须与作用域口径一致')
assert.ok(tab.includes('同组同事采集的也能上架'), '分类说明必须点名「同组同事采集的也能上架」') // 2026-11-28 精简口径(客户「删除多余小字」):常驻解释句整行删除,作用域语义只留空态。
assert.ok(!tab.includes('同组同事采集的也能上架'), '常驻分类解释句已删,不得回流')
}) })
test('建单请求体形状:categoryId + productIds + priceRule{mode,value}', () => { test('建单请求体形状:categoryId + productIds + priceRule{mode,value}', () => {
@@ -253,11 +253,12 @@ describe('获取店铺数据:一键采集 + 任务面板', () => {
const text = w.find('.task-item').text() const text = w.find('.task-item').text()
expect(text).toContain('正在采集分类:礼服/演出服') expect(text).toContain('正在采集分类:礼服/演出服')
expect(text).toContain('断点游标:第 1 页') // 2026-11-28 精简口径:断点页码/批数等技术游标下屏。
expect(text).not.toContain('断点游标')
expect(text).not.toContain('兜底翻页中') expect(text).not.toContain('兜底翻页中')
}) })
it('合并兜底轮标注「页面筛选未生效」;非轮次任务不出现该行', async () => { it('合并兜底轮显示「分类名 等」;非轮次任务不出现该行', async () => {
api.fetchJdCollectTaskProgressBatch.mockResolvedValue( api.fetchJdCollectTaskProgressBatch.mockResolvedValue(
batchOf(historyItem({ total: 6, itemsReceived: 4, rowCount: 4, page: 1, batchOf(historyItem({ total: 6, itemsReceived: 4, rowCount: 4, page: 1,
shopCatName: '工作制服', shopCatMerged: true, batches: 1 })), shopCatName: '工作制服', shopCatMerged: true, batches: 1 })),
@@ -265,8 +266,7 @@ describe('获取店铺数据:一键采集 + 任务面板', () => {
const w = await mountPage() const w = await mountPage()
await startCollect(w) await startCollect(w)
await flushPromises() await flushPromises()
expect(w.find('.task-item').text()) expect(w.find('.task-item').text()).toContain('正在采集分类:工作制服 等')
.toContain('正在采集分类:工作制服 等(页面筛选未生效,兜底翻页中)')
// 非轮次任务(游标无 shopCatName):不出现该行,其余文案不受影响 // 非轮次任务(游标无 shopCatName):不出现该行,其余文案不受影响
api.fetchJdCollectTaskProgressBatch.mockResolvedValue( api.fetchJdCollectTaskProgressBatch.mockResolvedValue(
@@ -80,7 +80,7 @@ it('不限档显「不限」,绝不显「/0」坏数', async () => {
await flushPromises() await flushPromises()
expect(w.text()).toContain('当前在架 0/不限') expect(w.text()).toContain('当前在架 0/不限')
expect(w.text()).not.toContain('/0') expect(w.text()).not.toContain('/0')
expect(w.text()).toContain('上架成功后的商品会出现在这里') expect(w.text()).toContain('当前没有已上架商品')
}) })
it('额度到顶出琥珀提醒句', async () => { it('额度到顶出琥珀提醒句', async () => {
@@ -109,7 +109,7 @@ afterEach(() => {
it('建单只原样投递服务端载荷,网页不激活任务', async () => { it('建单只原样投递服务端载荷,网页不激活任务', async () => {
const page = await mountPage() const page = await mountPage()
await startPublish(page) await startPublish(page)
expect(page.get('#jd-publish-brand-hint').text()).toContain('本次选中的商品统一使用此品牌,不会修改京东数据库') expect(page.get('#jd-publish-brand-hint').text()).toContain('本次选中的商品统一使用此品牌')
expect(api.protocol).toHaveBeenCalled() expect(api.protocol).toHaveBeenCalled()
expect(api.create).toHaveBeenCalledExactlyOnceWith(12, [23], { mode: 'none' }, '示例品牌') expect(api.create).toHaveBeenCalledExactlyOnceWith(12, [23], { mode: 'none' }, '示例品牌')
expect(api.enqueue).toHaveBeenCalledOnce() expect(api.enqueue).toHaveBeenCalledOnce()
@@ -478,9 +478,10 @@ it('分类拉回空=点名「本分组暂无分类」带动作句,不再静
expect(page.get('.collect-btn').attributes('disabled')).toBeDefined() expect(page.get('.collect-btn').attributes('disabled')).toBeDefined()
}) })
it('分类非空时不出空态告警(v-if 不成立,原静态说明照旧)', async () => { it('分类非空时不出空态告警(v-if 不成立),常驻解释句已按精简口径删除', async () => {
const page = await mountPage() const page = await mountPage()
expect(page.find('.category-hint--warn').exists()).toBe(false) expect(page.find('.category-hint--warn').exists()).toBe(false)
expect(page.text()).toContain('分类由管理员在后台「京东数据库」维护') // 2026-11-28 精简口径(客户「删除多余小字」):分类解释句整行删除,不得回流。
expect(page.text()).not.toContain('分类由管理员在后台「京东数据库」维护')
}) })