fix(jd): 客户五截图排查窗三面修复——点父级类目0条断链、管理链上溯恒判异司、上架分类空态静默
① 后管:JdProductListParams 补 categoryNames 字段,load() 把页面按服务端真树展开好的 子树名集合透传到序列化层(此前到不了,退回内置快照重展开失败→单名等值 IN→ 「收纳用品 81」点开 0 条)。计数与过滤从此同一棵树。回归:纯函数序列化 1 支+ mount 真树≠快照点父级 1 支(反向验证:摘透传当场红);source-pin 台账逐格点名 jd-database-page.test.ts cases 7→8。 ② 后端:selectLedGroups 投影补 company_id——collectAncestorGroups 的「只继承同公司组」 闸读的就是这列,缺列时每行恒 null、管理链上溯继承整段失效,「管理员名下所有普通 员工都能看到分类」(2026-11-24 客户口径)在生产永不生效,普通账号分类页「本组暂无 分类」、上架页下拉全空。SQL 契约格改钉新投影并记第三次缺列病灶(服务层 mock 夹具 自带 companyId,行为测试照绿,只有本格拦得住回退;反向验证:删列 2 支当场红)。 ③ 用户端:上架页分类空态点名——groupsEmpty 判据+两常量单出口(下拉 empty-text+ 块下琥珀动作句),不再静默空下拉+永久灰按钮。回归:mount 2 支(空态点名/非空 不误报)+源码绊线 1 支(文案单出口)。 验证读数:后管 node --test 1984/vitest 259/vue-tsc rc=0;用户端 node --test 1136/ vitest 143/vue-tsc rc=0;后端 mvn -o test 整量 5843 例 0 失败 19 skip。
This commit is contained in:
@@ -84,6 +84,15 @@ async function loadGroups() {
|
||||
}
|
||||
}
|
||||
|
||||
// 分类空态点名(2026-11-25 客户实况「上架页分类无数据、也就上架不了」):拉完仍为空=
|
||||
// 本账号可见分组里没有分类(/groups 按数据权限分组收窄,V203)。此前静默空下拉+
|
||||
// 建单按钮永久置灰、零解释——现在点名「本分组暂无分类」与动作「找管理员在后台建分类」。
|
||||
// 文案单出口两常量:下拉内空态(短)+块下说明(带动作句),mount/绊线测试按名钉。
|
||||
const GROUPS_EMPTY_DROPDOWN_TEXT = '本分组暂无分类'
|
||||
const GROUPS_EMPTY_HINT_TEXT =
|
||||
'本分组暂无分类——请联系管理员在后台「京东数据库 → 店铺分类」创建分类并归入你的分组后再上架。'
|
||||
const groupsEmpty = computed(() => !groupsLoading.value && groupOptions.value.length === 0)
|
||||
|
||||
// ---- 选品分页(owner 过滤在服务端;勾选跨页累计在本地 Map,翻页不清空)----
|
||||
const PRODUCT_PAGE_SIZE = 12
|
||||
const products = ref<JdPublishProductVo[]>([])
|
||||
@@ -813,11 +822,13 @@ onUnmounted(() => {
|
||||
<div class="category-block">
|
||||
<span class="category-label">自定义分类</span>
|
||||
<el-select v-model="selectedGroupId" placeholder="选择分类" class="shop-cat-select"
|
||||
:loading="groupsLoading" @change="changeGroup">
|
||||
:loading="groupsLoading" :empty-text="groupsEmpty ? GROUPS_EMPTY_DROPDOWN_TEXT : '无数据'"
|
||||
@change="changeGroup">
|
||||
<el-option v-for="group in groupOptions" :key="group.id"
|
||||
:label="`${group.name}(${group.productCount ?? 0} 个商品)`" :value="group.id" />
|
||||
</el-select>
|
||||
<p class="category-hint">分类由管理员在后台「京东数据库」维护;列表只显示归属你账号的商品。</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 class="product-block" v-loading="productsLoading">
|
||||
@@ -942,6 +953,8 @@ onUnmounted(() => {
|
||||
.category-block { margin-bottom: 16px; }
|
||||
.category-label { display: block; margin-bottom: 8px; color: #c8d2e2; font-size: 13px; font-weight: 600; }
|
||||
.category-hint { margin: 8px 0 0; color: #7f8ca3; font-size: 12px; line-height: 1.6; }
|
||||
/* 分类空态点名用琥珀档:取 notification-bell 暗色档 --bell-warning 同值,和普通灰字说明区分开。 */
|
||||
.category-hint--warn { color: #f0bb61; }
|
||||
.shop-guard { padding: 10px 12px; border: 1px solid #2c3547; border-radius: 8px; background: #20283a; }
|
||||
.shop-line { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12px; line-height: 1.5; }
|
||||
.shop-line__key { flex-shrink: 0; color: #7f8ca3; }
|
||||
|
||||
Reference in New Issue
Block a user