feat(jd): 后管京东数据库列表按京麦样式重排(2026-11-15 用户口径)——店铺/分组前置为第 1/2 数据列;商品信息列京麦同款合并布局(主图+图下信息分+标题两行+商品编码带一键复制+货号+SKU 数标签),品牌/价格区间/总库存/商品状态/同步时间随后;类目/上架时间/创建/修改仍收详情抽屉(B104 口径不变)
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
/** 京东数据库页(v1.4 Phase 5):公司隔离的京东商品库,筛选行(店铺/商品编码/标题关键字/商品状态/
|
||||
* 分组/同步起止 date 对)+查询/导出/重置/管理分组 + 自绘明细表(勾选列+点行开详情抽屉)
|
||||
* + 删除(单行/批量,先删桶对象、全成功才删库行,确认弹窗点名数量)+ OldPagination。
|
||||
* 列表只摆部分字段(B104 用户口径「外边列表部分字段,详情显示全部属性」):类目/信息分/SKU 数/
|
||||
* 上架时间/京东创建/修改时间不再上列表,全部收进详情抽屉基本信息。
|
||||
* 列表按京麦商品列表样式(2026-11-15 用户口径):店铺/分组前置为第 1/2 列;商品信息列=京麦同款
|
||||
* 合并布局(主图+图下信息分+标题两行+商品编码/货号+SKU 数标签,编码带一键复制);类目/上架
|
||||
* 时间/京东创建/修改时间仍收详情抽屉基本信息(B104「详情显示全部属性」口径不变)。
|
||||
* 骨架像素复刻「外观专利数据库」页(panel-box + LoadFailureBar + 自绘 table + 旧式分页);
|
||||
* 公司 tab 切换=清筛选重取(watch 体照外观专利页逐字形状);日期对护栏:起侧 max=止侧、
|
||||
* 止侧 min=起侧、两侧 @change 用 orderedPair 把倒挂交换回来(clampJdSyncedRange 照 clampDatePair)。
|
||||
@@ -168,6 +169,17 @@ function closeDetail(): void {
|
||||
detailItem.value = null
|
||||
}
|
||||
|
||||
/** 商品编码一键复制(京麦同款 ⧉):@click.stop 防冒泡开抽屉;剪贴板不可用(非安全上下文)时弹失败文案。 */
|
||||
async function copyText(text: string): Promise<void> {
|
||||
if (!text) return
|
||||
try {
|
||||
await navigator.clipboard.writeText(text)
|
||||
showAdminFeedback(`已复制 ${text}`, 'success')
|
||||
} catch {
|
||||
showAdminFeedback('复制失败,请手动选择复制', 'error')
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- 删除(先删桶、全成功才删库行,语义在后端 JdProductDeleteService) ----------------
|
||||
|
||||
/** 本页勾选集(按行 id)。切页/切公司/重取后勾选清空——上一页勾的行不自动带到下一页。 */
|
||||
@@ -299,16 +311,13 @@ onMounted(() => {
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 42px"><input type="checkbox" :checked="allSelected" @change="toggleSelectAll(($event.target as HTMLInputElement).checked)" /></th>
|
||||
<th style="width: 76px">主图</th>
|
||||
<th style="width: 130px">店铺</th>
|
||||
<th style="width: 96px">分组</th>
|
||||
<th>商品信息</th>
|
||||
<th style="width: 118px">商品编码</th>
|
||||
<th style="width: 118px">货号</th>
|
||||
<th style="width: 96px">品牌</th>
|
||||
<th style="width: 112px">价格区间</th>
|
||||
<th style="width: 90px">品牌</th>
|
||||
<th style="width: 110px">价格区间</th>
|
||||
<th style="width: 76px">总库存</th>
|
||||
<th style="width: 86px">商品状态</th>
|
||||
<th style="width: 120px">店铺</th>
|
||||
<th style="width: 100px">分组</th>
|
||||
<th style="width: 170px">同步时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -316,27 +325,38 @@ onMounted(() => {
|
||||
<template v-if="rows.length">
|
||||
<tr v-for="row in rows" :key="row.id" class="jd-row" @click="openDetail(row)">
|
||||
<td @click.stop><input type="checkbox" :checked="selectedIds.has(row.id)" @change="toggleSelect(row, ($event.target as HTMLInputElement).checked)" /></td>
|
||||
<td>
|
||||
<img v-if="row.mainImageUrl" class="jd-thumb" :src="row.mainImageUrl" alt="" loading="lazy" />
|
||||
<span v-else class="empty-mini">无图</span>
|
||||
<td :title="row.shopName || ''">{{ row.shopName || '-' }}</td>
|
||||
<td :title="row.groupName || ''">{{ row.groupName || '未分组' }}</td>
|
||||
<td class="jd-info-cell">
|
||||
<div class="jd-info-wrap">
|
||||
<div class="jd-info-figure">
|
||||
<img v-if="row.mainImageUrl" class="jd-thumb" :src="row.mainImageUrl" alt="" loading="lazy" />
|
||||
<span v-else class="jd-thumb jd-thumb-empty">无图</span>
|
||||
<span v-if="row.healthScore !== null" class="jd-health">信息分 {{ row.healthScore }}</span>
|
||||
</div>
|
||||
<div class="jd-info-body">
|
||||
<div class="jd-info-title" :title="row.title">{{ row.title || '-' }}</div>
|
||||
<div class="jd-info-meta">
|
||||
商品编码:<span class="jd-info-code">{{ row.productCode || '-' }}</span>
|
||||
<button v-if="row.productCode" class="jd-copy-btn" type="button" title="复制商品编码" @click.stop="copyText(row.productCode)">⧉</button>
|
||||
</div>
|
||||
<div class="jd-info-meta">货号:<span class="jd-info-code">{{ row.itemNum || '-' }}</span></div>
|
||||
<div v-if="row.skuCount" class="jd-info-tags"><span class="jd-tag">{{ row.skuCount }}个SKU</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="title-cell" :title="row.title">{{ row.title || '-' }}</td>
|
||||
<td class="mono-cell">{{ row.productCode || '-' }}</td>
|
||||
<td class="mono-cell">{{ row.itemNum || '-' }}</td>
|
||||
<td>{{ row.brand || '-' }}</td>
|
||||
<td>{{ jdPriceRange(row) || '-' }}</td>
|
||||
<td>{{ row.stockTotal ?? '-' }}</td>
|
||||
<td>{{ row.saleStatus || '-' }}</td>
|
||||
<td :title="row.shopName || ''">{{ row.shopName || '-' }}</td>
|
||||
<td :title="row.groupName || ''">{{ row.groupName || '未分组' }}</td>
|
||||
<td>{{ formatDateTime(row.syncedAt || '') }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<tr v-else-if="loading">
|
||||
<td colspan="12" class="empty-tip">加载中...</td>
|
||||
<td colspan="9" class="empty-tip">加载中...</td>
|
||||
</tr>
|
||||
<tr v-else>
|
||||
<td colspan="12" class="empty-tip">暂无京东商品数据</td>
|
||||
<td colspan="9" class="empty-tip">暂无京东商品数据</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -522,7 +542,7 @@ h3 {
|
||||
table-layout: fixed;
|
||||
}
|
||||
.jd-table-scroll > table {
|
||||
min-width: 1360px;
|
||||
min-width: 1180px;
|
||||
}
|
||||
.table-scroll th,
|
||||
.table-scroll td {
|
||||
@@ -563,16 +583,100 @@ h3 {
|
||||
border-radius: 6px;
|
||||
background: #f2f7fb;
|
||||
}
|
||||
.empty-mini {
|
||||
/* 商品信息列=京麦同款合并布局:td 的全局 nowrap/ellipsis 与多行内容冲突,本列放开换行,
|
||||
截断交给内部各行(标题两行 line-clamp、编码/货号单行 ellipsis)。 */
|
||||
.jd-info-cell {
|
||||
white-space: normal;
|
||||
text-overflow: clip;
|
||||
}
|
||||
.jd-info-wrap {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
}
|
||||
.jd-info-figure {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.jd-thumb-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #8293a5;
|
||||
font-size: 12px;
|
||||
}
|
||||
.mono-cell {
|
||||
font-family: "Cascadia Mono", "SF Mono", Consolas, "Courier New", monospace;
|
||||
font-size: 12.5px;
|
||||
.jd-health {
|
||||
color: #2e9e6b;
|
||||
font-size: 11px;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.title-cell {
|
||||
max-width: 260px;
|
||||
.jd-info-body {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
}
|
||||
.jd-info-title {
|
||||
color: #24384d;
|
||||
font-size: 13.5px;
|
||||
font-weight: 500;
|
||||
line-height: 1.45;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
}
|
||||
.jd-info-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
color: #7b8a99;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.jd-info-code {
|
||||
font-family: "Cascadia Mono", "SF Mono", Consolas, "Courier New", monospace;
|
||||
color: #4e6479;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.jd-copy-btn {
|
||||
flex-shrink: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: #8aa5bf;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
padding: 0 2px;
|
||||
line-height: 1;
|
||||
}
|
||||
.jd-copy-btn:hover {
|
||||
color: #3b82c4;
|
||||
}
|
||||
.jd-info-tags {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.jd-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 18px;
|
||||
padding: 0 6px;
|
||||
border: 1px solid #cfe3f5;
|
||||
border-radius: 3px;
|
||||
background: #eef5fc;
|
||||
color: #3b82c4;
|
||||
font-size: 11.5px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.empty-tip {
|
||||
padding: 44px 24px;
|
||||
|
||||
Reference in New Issue
Block a user