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:
@@ -330,6 +330,8 @@ test('任务卡展示轮次游标:正在采集分类 + 合并兜底标注', ()
|
||||
const body = page.slice(toJdTaskView, page.indexOf('// ---- 本模块的状态语义'))
|
||||
assert.ok(body.includes('正在采集分类:${item.shopCatName}'),
|
||||
'toJdTaskView 必须在 extraLines 展示「正在采集分类」(页码归 1 消歧)')
|
||||
assert.ok(body.includes('等(页面筛选未生效,兜底翻页中)'),
|
||||
'合并兜底轮必须带「页面筛选未生效」标注')
|
||||
// 2026-11-28 精简口径:技术游标(断点页码/批数/兜底标注)下屏,轮次只留「分类名 等」。
|
||||
assert.ok(body.includes("' 等'"), '合并兜底轮精简为「分类名 等」')
|
||||
assert.ok(!body.includes('断点游标'), '「断点游标」技术行已删,不得回流')
|
||||
assert.ok(!body.includes('页面筛选未生效'), '内部机制标注已删,不得回流')
|
||||
})
|
||||
|
||||
@@ -47,10 +47,11 @@ test('到顶判据:used≥limit 才提醒;不限档永不提醒', () => {
|
||||
assert.equal(quotaNearLimit(999999, 0, true), false)
|
||||
})
|
||||
|
||||
test('空态文案:未占用点名「采集入库不占额度」,翻页态不冒充空账', () => {
|
||||
assert.match(onShelfEmptyText(false, 0), /采集入库不占/)
|
||||
assert.match(onShelfEmptyText(true, 0), /上架成功后.*计入额度/s)
|
||||
test('空态文案(2026-11-28 精简口径):一句讲完,机制解释句不再回流;翻页态不冒充空账', () => {
|
||||
assert.equal(onShelfEmptyText(false, 0), '当前没有已上架商品')
|
||||
assert.equal(onShelfEmptyText(true, 0), '当前没有已上架商品')
|
||||
assert.equal(onShelfEmptyText(false, 25), '本页暂无更多在架商品,可翻页查看')
|
||||
assert.ok(!onShelfEmptyText(false, 0).includes('采集入库不占'), '机制解释句已删,不得回流')
|
||||
})
|
||||
|
||||
test('分页钳制与服务端 MAX_PAGE_SIZE=100 同口径', () => {
|
||||
|
||||
@@ -65,10 +65,11 @@ test('同一家店两种形状(只有 id / 只有店名)在来源集里能
|
||||
assert.equal(refs.length, 2)
|
||||
})
|
||||
|
||||
test('店铺标签:名+id 全显示,缺一半只报有的那半,全空=未记录店铺', () => {
|
||||
assert.equal(shopLabel({ shopId: '1', shopName: '某店' }), '某店(shopId=1)')
|
||||
test('店铺标签:只出店名(2026-11-28 精简口径 shopId 不上屏),缺名报「店铺 <id>」,全空=未记录店铺', () => {
|
||||
assert.equal(shopLabel({ shopId: '1', shopName: '某店' }), '某店')
|
||||
assert.ok(!shopLabel({ shopId: '1', shopName: '某店' }).includes('shopId='), '店名上屏时不许带 shopId 技术前缀')
|
||||
assert.equal(shopLabel({ shopName: '某店' }), '某店')
|
||||
assert.equal(shopLabel({ shopId: '1' }), 'shopId=1')
|
||||
assert.equal(shopLabel({ shopId: '1' }), '店铺 1')
|
||||
assert.equal(shopLabel(null), '未记录店铺')
|
||||
assert.equal(normalizeShopRef({ shopId: ' ' }), null)
|
||||
})
|
||||
@@ -79,8 +80,10 @@ test('跨店文案:点名来源店与目标店、说明会新建商品要过
|
||||
{ shopId: '228346061', shopName: '家居日用数据库店' },
|
||||
)
|
||||
assert.ok(message.startsWith('跨店上架'))
|
||||
assert.ok(message.includes('汽车用品数据库店') && message.includes('148191738'))
|
||||
assert.ok(message.includes('家居日用数据库店') && message.includes('228346061'))
|
||||
assert.ok(message.includes('汽车用品数据库店') && message.includes('家居日用数据库店'),
|
||||
'来源店与目标店(京麦当前登录)都要点名')
|
||||
assert.ok(!message.includes('148191738') && !message.includes('shopId='),
|
||||
'2026-11-28 精简口径:技术 id 不上屏')
|
||||
assert.ok(message.includes('新建'), '必须说清跨店是在目标店新建商品')
|
||||
assert.ok(message.includes('授权'), '必须点名目标店类目授权这个硬前提')
|
||||
assert.ok(message.includes('审核'), '必须说清要过京东审核')
|
||||
@@ -146,8 +149,9 @@ test('多店已检测京麦:整单按跨店新增放行(协议 ≥4+人工
|
||||
if (guard.state === 'multi') {
|
||||
assert.deepEqual(guard.target, { shopId: '3', shopName: '丙店' }, '目标店=京麦当前登录店')
|
||||
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('shopId='), '精简口径:多店文案不拼技术 id')
|
||||
}
|
||||
assert.ok(shopGuardBlocks(guard), '协议 < 4 仍拦:老客户端没有新增商品路径')
|
||||
assert.equal(shopGuardMessage(guard), CROSS_UPGRADE_NOTICE)
|
||||
|
||||
@@ -58,7 +58,8 @@ test('选品作用域:建单带 productIds,文案与作用域口径一致(
|
||||
// 口径改:同组同事采集的商品也能上架——文案不得再写「归属你账号」,空态与说明同步。
|
||||
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}', () => {
|
||||
|
||||
@@ -253,11 +253,12 @@ describe('获取店铺数据:一键采集 + 任务面板', () => {
|
||||
|
||||
const text = w.find('.task-item').text()
|
||||
expect(text).toContain('正在采集分类:礼服/演出服')
|
||||
expect(text).toContain('断点游标:第 1 页')
|
||||
// 2026-11-28 精简口径:断点页码/批数等技术游标下屏。
|
||||
expect(text).not.toContain('断点游标')
|
||||
expect(text).not.toContain('兜底翻页中')
|
||||
})
|
||||
|
||||
it('合并兜底轮标注「页面筛选未生效」;非轮次任务不出现该行', async () => {
|
||||
it('合并兜底轮显示「分类名 等」;非轮次任务不出现该行', async () => {
|
||||
api.fetchJdCollectTaskProgressBatch.mockResolvedValue(
|
||||
batchOf(historyItem({ total: 6, itemsReceived: 4, rowCount: 4, page: 1,
|
||||
shopCatName: '工作制服', shopCatMerged: true, batches: 1 })),
|
||||
@@ -265,8 +266,7 @@ describe('获取店铺数据:一键采集 + 任务面板', () => {
|
||||
const w = await mountPage()
|
||||
await startCollect(w)
|
||||
await flushPromises()
|
||||
expect(w.find('.task-item').text())
|
||||
.toContain('正在采集分类:工作制服 等(页面筛选未生效,兜底翻页中)')
|
||||
expect(w.find('.task-item').text()).toContain('正在采集分类:工作制服 等')
|
||||
|
||||
// 非轮次任务(游标无 shopCatName):不出现该行,其余文案不受影响
|
||||
api.fetchJdCollectTaskProgressBatch.mockResolvedValue(
|
||||
|
||||
@@ -80,7 +80,7 @@ it('不限档显「不限」,绝不显「/0」坏数', async () => {
|
||||
await flushPromises()
|
||||
expect(w.text()).toContain('当前在架 0/不限')
|
||||
expect(w.text()).not.toContain('/0')
|
||||
expect(w.text()).toContain('上架成功后的商品会出现在这里')
|
||||
expect(w.text()).toContain('当前没有已上架商品')
|
||||
})
|
||||
|
||||
it('额度到顶出琥珀提醒句', async () => {
|
||||
|
||||
@@ -109,7 +109,7 @@ afterEach(() => {
|
||||
it('建单只原样投递服务端载荷,网页不激活任务', async () => {
|
||||
const page = await mountPage()
|
||||
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.create).toHaveBeenCalledExactlyOnceWith(12, [23], { mode: 'none' }, '示例品牌')
|
||||
expect(api.enqueue).toHaveBeenCalledOnce()
|
||||
@@ -478,9 +478,10 @@ it('分类拉回空=点名「本分组暂无分类」带动作句,不再静
|
||||
expect(page.get('.collect-btn').attributes('disabled')).toBeDefined()
|
||||
})
|
||||
|
||||
it('分类非空时不出空态告警(v-if 不成立,原静态说明照旧)', async () => {
|
||||
it('分类非空时不出空态告警(v-if 不成立),常驻解释句已按精简口径删除', async () => {
|
||||
const page = await mountPage()
|
||||
expect(page.find('.category-hint--warn').exists()).toBe(false)
|
||||
expect(page.text()).toContain('分类由管理员在后台「京东数据库」维护')
|
||||
// 2026-11-28 精简口径(客户「删除多余小字」):分类解释句整行删除,不得回流。
|
||||
expect(page.text()).not.toContain('分类由管理员在后台「京东数据库」维护')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user