768 lines
28 KiB
Vue
768 lines
28 KiB
Vue
<script setup lang="ts">
|
||
/** 京东数据库页(v1.4 Phase 5):公共的京东商品库(2026-11-15 用户定案「不区分公司、属于
|
||
* 公共的」,分类同亚马逊口径全平台一份),筛选行(商品编码/标题关键字/分类/分类状态/
|
||
* 类目/同步起止 date 对)+查询/重置/店铺分类 + 自绘明细表(勾选列+点行开详情抽屉)
|
||
* + 删除(单行/批量,先删桶对象、全成功才删库行,确认弹窗点名数量)+ OldPagination。
|
||
* 公司维度只剩超管的公司 tab(=筛选管理员,非超管没有这个筛选、看到同一份公共全量);
|
||
* 列表按京麦商品列表样式(2026-11-15 用户口径):分类前置为第 1 列;商品信息列=京麦同款
|
||
* 合并布局(主图+图下信息分+标题两行+商品编码/货号+SKU 数标签,编码带一键复制);类目/上架
|
||
* 时间/京东创建/修改时间仍收详情抽屉基本信息(B104「详情显示全部属性」口径不变)。
|
||
* 商品状态筛选框与导出按钮随 2026-11-15 客户口径「这两个不要/导出也不用」从前端下线
|
||
* (后端 sale_status 参数与 /export 端点保留);店铺筛选与店铺列同日客户口径「店铺不需要」
|
||
* 下线(后端 shop_name 参数同窗撤);店铺仍收详情抽屉。
|
||
* 2026-11-16 三笔(用户截图反馈):① 创建/修改/同步三个时间列按「时间移动到最后去」移到
|
||
* 操作列之后收尾;② 价格列修「采集到了却全显示 -」=模型解析层 text() 丢掉后端 BigDecimal
|
||
* 的 JSON number 形状(生产库 273/273 行 price_min 全有值,jd-product-model.ts decimalText 收口);
|
||
* ③ 「上架时间 / 商品状态」合并列整列下线(「不需要采集」口径,jd_online_at/sale_status 仍收
|
||
* 详情抽屉),操作列随 2026-11-16「操作放最后一列」口径置末。
|
||
* 骨架像素复刻「外观专利数据库」页(panel-box + LoadFailureBar + 自绘 table + 旧式分页);
|
||
* 超管切公司 tab = 清筛选重取(watch 体照外观专利页逐字形状);日期对护栏:起侧 max=止侧、
|
||
* 止侧 min=起侧、两侧 @change 用 orderedPair 把倒挂交换回来(clampJdSyncedRange 照 clampDatePair)。
|
||
* 日期初值故意留空:同步数据是累计集,默认当天会让首屏只剩今天同步的行
|
||
* (date-filter-default-today 护栏 EXEMPT 口径,外观专利页同款)。 */
|
||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||
import {
|
||
deleteJdProducts,
|
||
fetchJdProductCategories,
|
||
fetchJdProductGroups,
|
||
fetchJdProductList,
|
||
type JdProductCategoryOption,
|
||
type JdProductGroup,
|
||
} from './jd-product-api.ts'
|
||
import type { JdProductItem } from './jd-product-model.ts'
|
||
import { jdPriceRange } from './jd-product-model.ts'
|
||
import { createJdProductFilterState } from './jd-product-filter.ts'
|
||
import JdProductDetailDrawer from './JdProductDetailDrawer.vue'
|
||
import JdProductEditDrawer from './JdProductEditDrawer.vue'
|
||
import JdProductGroupDialog from './JdProductGroupDialog.vue'
|
||
import JdCategoryCascader from './JdCategoryCascader.vue'
|
||
import OldPagination from '@/components/OldPagination.vue'
|
||
import { useCompanyTabStore } from '@/stores/company-tab'
|
||
import { showAdminFeedback } from '@/components/admin-feedback-ui'
|
||
import { openAdminConfirm } from '@/components/admin-confirm'
|
||
import { loadFailureMessage } from '@/components/load-failure-model'
|
||
import LoadFailureBar from '@/components/LoadFailureBar.vue'
|
||
import { formatDateTime, orderedPair } from '@/utils/datetime'
|
||
|
||
const companyTab = useCompanyTabStore()
|
||
|
||
const loading = ref(false)
|
||
const loadFailure = ref('')
|
||
const rows = ref<JdProductItem[]>([])
|
||
const total = ref(0)
|
||
const page = ref(1)
|
||
const pageSize = ref(20)
|
||
const filter = reactive(createJdProductFilterState())
|
||
/** 分组下拉选项:分组全平台一份(公共),进页取一次即可;选项失败不拦列表,只回空下拉
|
||
* (可见「全部分组」)。 */
|
||
const groupOptions = ref<JdProductGroup[]>([])
|
||
/** 类目下拉选项(京麦末级类目):与当前行集同源(超管切公司 tab 时按 tab 收窄重取、
|
||
* 普通行集全量);失败静默回空。 */
|
||
const categoryOptions = ref<JdProductCategoryOption[]>([])
|
||
/** 分组管理弹窗与详情抽屉。 */
|
||
const groupDialogVisible = ref(false)
|
||
const detailItem = ref<JdProductItem | null>(null)
|
||
const detailVisible = ref(false)
|
||
/** 行级编辑抽屉(2026-11-15 用户口径「每一条数据后面 需要编辑或者删除;编辑的话
|
||
* 这里面都是可以编辑的」):删除走下面的 removeOne(同一条删除链),编辑走独立抽屉。 */
|
||
const editItem = ref<JdProductItem | null>(null)
|
||
const editVisible = ref(false)
|
||
|
||
function openEdit(item: JdProductItem): void {
|
||
editItem.value = item
|
||
editVisible.value = true
|
||
}
|
||
|
||
function closeEdit(): void {
|
||
editVisible.value = false
|
||
editItem.value = null
|
||
}
|
||
|
||
/** 编辑保存成功:刷新列表(该行已置人工编辑锁,标题/价格等即时可见且不再被采集覆盖)。 */
|
||
async function onEditSaved(): Promise<void> {
|
||
await load()
|
||
}
|
||
|
||
/** min/max 挡不住手输,落值后把倒挂的起止交换回来。 */
|
||
function clampJdSyncedRange(): void {
|
||
const [s, e] = orderedPair(filter.syncedFrom, filter.syncedTo)
|
||
filter.syncedFrom = s
|
||
filter.syncedTo = e
|
||
}
|
||
|
||
const totalPages = computed(() => Math.max(1, Math.ceil(total.value / pageSize.value)))
|
||
|
||
/** 分组选项失败静默回空——分组只是筛选项,不该让它把首屏行集一起拖死。 */
|
||
async function loadGroupOptions(): Promise<void> {
|
||
try {
|
||
groupOptions.value = await fetchJdProductGroups()
|
||
} catch {
|
||
groupOptions.value = []
|
||
}
|
||
}
|
||
|
||
/** 类目选项同分组口径:失败静默回空下拉(可见「全部类目」),不拦首屏行集。 */
|
||
async function loadCategoryOptions(): Promise<void> {
|
||
try {
|
||
categoryOptions.value = await fetchJdProductCategories(companyTab.requestCompanyId)
|
||
} catch {
|
||
categoryOptions.value = []
|
||
}
|
||
}
|
||
|
||
/** 分组管理弹窗里做过变更:分组下拉与列表都刷新(删除分组后行集的 groupName 会变)。 */
|
||
async function onGroupChanged(): Promise<void> {
|
||
await loadGroupOptions()
|
||
page.value = 1
|
||
await load()
|
||
}
|
||
|
||
async function load(): Promise<void> {
|
||
loading.value = true
|
||
loadFailure.value = ''
|
||
try {
|
||
const result = await fetchJdProductList({
|
||
page: page.value,
|
||
pageSize: pageSize.value,
|
||
productCode: filter.productCode,
|
||
titleKeyword: filter.titleKeyword,
|
||
category: filter.category,
|
||
groupId: filter.groupId,
|
||
groupScope: filter.groupScope,
|
||
syncedFrom: filter.syncedFrom,
|
||
syncedTo: filter.syncedTo,
|
||
companyId: companyTab.requestCompanyId,
|
||
})
|
||
rows.value = result.items
|
||
total.value = result.total
|
||
if (result.page >= 1) page.value = result.page
|
||
// 重取后上一批勾选可能已不在本页(翻页/筛选变化):清空,防"看不见的勾选被一起删"。
|
||
selectedIds.value = new Set()
|
||
} catch (error) {
|
||
loadFailure.value = loadFailureMessage(error, '京东商品列表加载失败')
|
||
showAdminFeedback(loadFailure.value, 'error')
|
||
} finally {
|
||
loading.value = false
|
||
}
|
||
}
|
||
|
||
function apply(): void {
|
||
page.value = 1
|
||
void load()
|
||
}
|
||
|
||
/** 类目级联面板点末级即查:选完立刻按该类目过滤刷新(回第一页),同分组下拉口径;
|
||
* 点「全部类目」/触发框 × = 清选重查。 */
|
||
function onCategoryPicked(name: string): void {
|
||
filter.category = name
|
||
apply()
|
||
}
|
||
|
||
/** 重置:筛选面回出厂空态,回第一页重取。 */
|
||
function reset(): void {
|
||
Object.assign(filter, createJdProductFilterState())
|
||
page.value = 1
|
||
void load()
|
||
}
|
||
|
||
function changePage(next: number): void {
|
||
if (next < 1 || next > totalPages.value) return
|
||
page.value = next
|
||
void load()
|
||
}
|
||
|
||
function changeSize(size: number) {
|
||
pageSize.value = size
|
||
page.value = 1
|
||
void load()
|
||
}
|
||
|
||
function openDetail(item: JdProductItem): void {
|
||
detailItem.value = item
|
||
detailVisible.value = true
|
||
}
|
||
|
||
function closeDetail(): void {
|
||
detailVisible.value = false
|
||
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)。切页/切公司/重取后勾选清空——上一页勾的行不自动带到下一页。 */
|
||
const selectedIds = ref<Set<number>>(new Set())
|
||
const deleting = ref(false)
|
||
|
||
const selectedCount = computed(() => selectedIds.value.size)
|
||
|
||
function toggleSelect(row: JdProductItem, checked: boolean): void {
|
||
const next = new Set(selectedIds.value)
|
||
if (checked) next.add(row.id)
|
||
else next.delete(row.id)
|
||
selectedIds.value = next
|
||
}
|
||
|
||
const allSelected = computed(() => rows.value.length > 0 && rows.value.every((row) => selectedIds.value.has(row.id)))
|
||
|
||
function toggleSelectAll(checked: boolean): void {
|
||
selectedIds.value = checked ? new Set(rows.value.map((row) => row.id)) : new Set()
|
||
}
|
||
|
||
/** 单行删除入口(行内按钮):确认弹窗点名商品编码与「桶内图片一并删除」。 */
|
||
async function removeOne(row: JdProductItem): Promise<void> {
|
||
await removeMany([row], `确定删除商品「${row.productCode || row.title}」吗?`)
|
||
}
|
||
|
||
/** 批量删除入口(勾选后点工具栏按钮):确认弹窗点名行数。 */
|
||
async function removeSelected(): Promise<void> {
|
||
const picked = rows.value.filter((row) => selectedIds.value.has(row.id))
|
||
await removeMany(picked, `确定删除勾选的 ${picked.length} 个商品吗?`)
|
||
}
|
||
|
||
/** 删除主流程:二次确认 → 先删桶、全成功才删库行(后端保证)→ 刷新列表并清勾选。 */
|
||
async function removeMany(picked: JdProductItem[], message: string): Promise<void> {
|
||
if (!picked.length || deleting.value) return
|
||
const ok = await openAdminConfirm({ title: '删除京东商品', message: `${message}删除后该商品的 SKU、图片登记与 jd-products 桶内图片文件一并删除(被其他商品共用的图片会保留);此操作不可恢复。`, confirmText: '确认删除', danger: true })
|
||
if (!ok) return
|
||
deleting.value = true
|
||
try {
|
||
const receipt = await deleteJdProducts(picked.map((row) => row.id))
|
||
showAdminFeedback(`已删除 ${receipt.deleted} 个商品,清理 ${receipt.objectsDeleted} 个图片文件` +
|
||
(receipt.objectsKept ? `(${receipt.objectsKept} 个共用图片保留)` : ''), 'success')
|
||
selectedIds.value = new Set()
|
||
if (picked.length >= rows.value.length && page.value > 1) page.value -= 1
|
||
await load()
|
||
} catch (error) {
|
||
const text = error instanceof Error && error.message ? error.message : '删除失败,请稍后重试'
|
||
showAdminFeedback(text, 'error')
|
||
} finally {
|
||
deleting.value = false
|
||
}
|
||
}
|
||
|
||
// 超管切公司 tab = 重新取数:编码/关键字/类目/日期是按行集筛的自由值,在另一家的
|
||
// 行集里筛不出东西,必须一起清(分组与分类状态全平台一份,groupId/groupScope 与公司维度
|
||
// 正交、不清);类目选项与行集同源,按新 tab 重取;分组选项是全局的、进页取一次即可。
|
||
watch(() => companyTab.activeId, () => { filter.productCode = ''; filter.titleKeyword = ''; filter.category = ''; filter.syncedFrom = ''; filter.syncedTo = ''; page.value = 1; void loadCategoryOptions(); void load() })
|
||
|
||
onMounted(() => {
|
||
void loadGroupOptions()
|
||
void loadCategoryOptions()
|
||
void load()
|
||
})
|
||
</script>
|
||
|
||
<template>
|
||
<div class="jd-database-view">
|
||
<section class="panel-box">
|
||
<div class="jd-panel-head">
|
||
<h3>京东数据库</h3>
|
||
<button class="btn btn-secondary" type="button" @click="groupDialogVisible = true">店铺分类</button>
|
||
</div>
|
||
|
||
<div class="jd-filter-row">
|
||
<div class="form-group">
|
||
<label>商品编码</label>
|
||
<input v-model="filter.productCode" type="text" placeholder="输入商品编码" @keyup.enter="apply" />
|
||
</div>
|
||
<div class="form-group">
|
||
<label>标题关键字</label>
|
||
<input v-model="filter.titleKeyword" type="text" placeholder="输入标题关键字" @keyup.enter="apply" />
|
||
</div>
|
||
<div class="form-group">
|
||
<label>分类</label>
|
||
<!-- 分类选中即查:选完立刻按该分类过滤刷新(回第一页),不必再点查询。
|
||
(2026-11-15「分组管理」改「店铺分类」:同一 group 实体,只改界面措辞。) -->
|
||
<select v-model="filter.groupId" @change="apply">
|
||
<option value="">全部分类</option>
|
||
<option v-for="group in groupOptions" :key="group.id" :value="String(group.id)">{{ group.name }}</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>分类状态</label>
|
||
<!-- 分类状态(2026-11-15 客户口径「查询已分类的跟未分类,分类好的可以不显示」):
|
||
选中即查,同分组/类目口径;与上方「分类」(具体分组等值过滤)正交——
|
||
这里只按 group_id 是否为空分档。 -->
|
||
<select v-model="filter.groupScope" @change="apply">
|
||
<option value="">全部</option>
|
||
<option value="grouped">已分类</option>
|
||
<option value="ungrouped">未分类</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>类目</label>
|
||
<!-- 类目(京麦末级类目)京麦同款级联面板(2026-11-16 客户口径):一/二级为静态导航
|
||
(采集链无层级数据),第三栏已落库末级+搜索,点行选中即查(回第一页)。 -->
|
||
<JdCategoryCascader
|
||
:options="categoryOptions"
|
||
:model-value="filter.category"
|
||
@change="onCategoryPicked"
|
||
/>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>同步开始日期</label>
|
||
<input v-model="filter.syncedFrom" type="date" :max="filter.syncedTo" @change="clampJdSyncedRange" />
|
||
</div>
|
||
<div class="form-group">
|
||
<label>同步结束日期</label>
|
||
<input v-model="filter.syncedTo" type="date" :min="filter.syncedFrom" @change="clampJdSyncedRange" />
|
||
</div>
|
||
<div class="jd-filter-actions">
|
||
<button class="btn" type="button" @click="apply">查询</button>
|
||
<button class="btn btn-secondary" type="button" @click="reset">重置</button>
|
||
</div>
|
||
</div>
|
||
|
||
<LoadFailureBar v-if="loadFailure" :message="loadFailure" @retry="load" />
|
||
<div class="jd-toolbar">
|
||
<span class="jd-summary">共 {{ total }} 条京东商品</span>
|
||
<!-- 批量删除 2026-11-16 客户口径「不要勾选后才显示」:常显,勾选 0 时置灰。 -->
|
||
<button
|
||
class="btn btn-danger jd-delete-btn"
|
||
type="button"
|
||
:disabled="deleting || !selectedCount"
|
||
@click="removeSelected"
|
||
>
|
||
{{ deleting ? '删除中...' : `删除勾选(${selectedCount})` }}
|
||
</button>
|
||
</div>
|
||
<div class="table-scroll jd-table-scroll">
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th style="width: 42px"><input type="checkbox" :checked="allSelected" @change="toggleSelectAll(($event.target as HTMLInputElement).checked)" /></th>
|
||
<th style="width: 96px">分类</th>
|
||
<th>商品信息</th>
|
||
<th style="width: 76px">总库存</th>
|
||
<th style="width: 120px">价格</th>
|
||
<!-- 创建/修改/同步三个时间列 2026-11-16 客户口径「时间移动到最后去」移到收尾;
|
||
操作列 2026-11-16「操作放最后一列」口径置末(此前一版曾前置)。 -->
|
||
<th style="width: 150px">创建时间</th>
|
||
<th style="width: 150px">修改时间</th>
|
||
<th style="width: 170px">同步时间</th>
|
||
<th style="width: 138px">操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<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 :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>
|
||
<!-- 品牌·类目行:京麦列表同款(末级类目名紧随品牌),字段与顺序 2026-11-15 对齐京麦。 -->
|
||
<div v-if="row.brand || row.categoryPath" class="jd-info-meta jd-brand-cat">
|
||
<span class="jd-brand-name">{{ row.brand || '' }}</span> {{ row.categoryPath || '' }}
|
||
</div>
|
||
<div v-if="row.skuCount" class="jd-info-tags"><span class="jd-tag">{{ row.skuCount }}个SKU</span></div>
|
||
</div>
|
||
</div>
|
||
</td>
|
||
<td>{{ row.stockTotal ?? '-' }}</td>
|
||
<td>{{ jdPriceRange(row) || '-' }}</td>
|
||
<td>{{ formatDateTime(row.jdCreatedAt || '') || '-' }}</td>
|
||
<td>{{ formatDateTime(row.jdUpdatedAt || '') || '-' }}</td>
|
||
<td>{{ formatDateTime(row.syncedAt || '') }}</td>
|
||
<!-- 操作列(2026-11-15 用户口径):编辑/删除;@click.stop 防冒泡开详情抽屉。
|
||
2026-11-16「操作放最后一列」口径置末;「上架时间 / 商品状态」列同日整列下线。 -->
|
||
<td class="jd-ops-cell" @click.stop>
|
||
<button class="btn btn-sm" type="button" @click="openEdit(row)">编辑</button>
|
||
<button class="btn btn-sm btn-danger" type="button" :disabled="deleting" @click="removeOne(row)">删除</button>
|
||
</td>
|
||
</tr>
|
||
</template>
|
||
<tr v-else-if="loading">
|
||
<td colspan="9" class="empty-tip">加载中...</td>
|
||
</tr>
|
||
<tr v-else>
|
||
<td colspan="9" class="empty-tip">暂无京东商品数据</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<OldPagination :total="total" :page="page" :page-size="pageSize" @change="changePage" @size-change="changeSize" />
|
||
</section>
|
||
|
||
<JdProductDetailDrawer
|
||
:item="detailItem"
|
||
:visible="detailVisible"
|
||
@close="closeDetail"
|
||
/>
|
||
<JdProductEditDrawer
|
||
:item="editItem"
|
||
:visible="editVisible"
|
||
@close="closeEdit"
|
||
@saved="onEditSaved"
|
||
/>
|
||
<JdProductGroupDialog
|
||
:visible="groupDialogVisible"
|
||
@close="groupDialogVisible = false"
|
||
@changed="onGroupChanged"
|
||
/>
|
||
</div>
|
||
</template>
|
||
|
||
<style scoped>
|
||
/* 像素复刻「外观专利数据库」页样式(panel-box + 自绘表格 + 旧式分页);列表只摆部分字段,全量属性在详情抽屉。 */
|
||
.jd-database-view {
|
||
font-family: inherit;
|
||
color: var(--c-text, #24384d);
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 18px;
|
||
}
|
||
.panel-box {
|
||
width: 100%;
|
||
min-width: 0;
|
||
padding: 20px 22px 24px;
|
||
border: 1px solid #d8e3ee;
|
||
border-radius: 14px;
|
||
background: linear-gradient(145deg, #ffffff, #f9fbfd);
|
||
box-shadow: 0 1px 2px rgba(39, 67, 94, 0.04), 0 14px 30px -24px rgba(39, 67, 94, 0.28);
|
||
}
|
||
h3 {
|
||
margin: 0 0 16px;
|
||
font-size: 15px;
|
||
font-weight: 650;
|
||
color: #24384d;
|
||
letter-spacing: 0.2px;
|
||
}
|
||
.jd-panel-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 16px;
|
||
}
|
||
.jd-panel-head h3 {
|
||
margin: 0;
|
||
}
|
||
.jd-filter-row {
|
||
/* 可换行流式布局:固定 6 列 minmax(140px) 的网格在窄面板下最小宽超出容器,
|
||
把查询/重置挤出面板右缘(与「管理分组」重叠)。flex-wrap 让放不下的项自然折行。 */
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 12px;
|
||
align-items: flex-end;
|
||
margin-bottom: 16px;
|
||
}
|
||
.jd-filter-row .form-group {
|
||
flex: 1 1 160px;
|
||
min-width: 150px;
|
||
max-width: 260px;
|
||
}
|
||
.jd-filter-actions {
|
||
display: flex;
|
||
gap: 10px;
|
||
align-items: center;
|
||
white-space: nowrap;
|
||
}
|
||
.form-group {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 7px;
|
||
margin-bottom: 0;
|
||
}
|
||
.form-group label {
|
||
color: #5b6f83;
|
||
font-size: 12.5px;
|
||
font-weight: 600;
|
||
}
|
||
.form-group input,
|
||
.form-group select {
|
||
min-width: 0;
|
||
min-height: 42px;
|
||
padding: 8px 12px;
|
||
border: 1px solid #cbd9e6;
|
||
border-radius: 9px;
|
||
background: #f8fbfd;
|
||
color: #24384d;
|
||
font-size: 13.5px;
|
||
font-family: inherit;
|
||
color-scheme: light;
|
||
outline: none;
|
||
transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
|
||
}
|
||
.form-group input:hover,
|
||
.form-group select:hover {
|
||
border-color: #9fb7cd;
|
||
}
|
||
.form-group input:focus,
|
||
.form-group select:focus {
|
||
background: #ffffff;
|
||
border-color: #5f85ad;
|
||
box-shadow: 0 0 0 3px rgba(95, 133, 173, 0.16);
|
||
}
|
||
.form-group input[type="date"] {
|
||
color-scheme: light;
|
||
}
|
||
.btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 8px;
|
||
min-height: 42px;
|
||
padding: 9px 18px;
|
||
border: 1px solid #4f78a5;
|
||
border-radius: 9px;
|
||
background: linear-gradient(135deg, #5f85ad, #4f78a5);
|
||
color: #ffffff;
|
||
font-family: inherit;
|
||
font-size: 13.5px;
|
||
cursor: pointer;
|
||
box-shadow: 0 8px 18px -14px rgba(79, 120, 165, 0.72);
|
||
transition: background 160ms ease, box-shadow 160ms ease, transform 120ms ease;
|
||
}
|
||
.btn:hover:not(:disabled) {
|
||
background: linear-gradient(135deg, #7094ba, #5d83ac);
|
||
box-shadow: 0 11px 22px -14px rgba(79, 120, 165, 0.8);
|
||
}
|
||
.btn:disabled {
|
||
cursor: not-allowed;
|
||
opacity: 0.6;
|
||
}
|
||
.btn-secondary {
|
||
background: #ffffff;
|
||
color: #5b6f83;
|
||
border-color: #c7d7e5;
|
||
}
|
||
.btn-secondary:hover:not(:disabled) {
|
||
color: #2f5d8b;
|
||
border-color: #95b1cb;
|
||
background: #edf5fb;
|
||
}
|
||
.jd-toolbar {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 14px;
|
||
margin-bottom: 10px;
|
||
}
|
||
/* 删除按钮挂到工具栏右侧(scoped:分组弹窗那份 .btn-danger 借不过来)。 */
|
||
.jd-delete-btn {
|
||
margin-left: auto;
|
||
}
|
||
.btn-danger {
|
||
background: #ffffff;
|
||
color: #a04432;
|
||
border-color: #e4b3a8;
|
||
}
|
||
.btn-danger:hover:not(:disabled) {
|
||
background: #fdf1ef;
|
||
border-color: #d08a7b;
|
||
}
|
||
.jd-summary {
|
||
color: #5b6f83;
|
||
font-size: 13px;
|
||
white-space: nowrap;
|
||
}
|
||
.table-scroll {
|
||
width: 100%;
|
||
min-width: 0;
|
||
overflow-x: auto;
|
||
border: 1px solid #dbe5ee;
|
||
border-radius: 10px;
|
||
background: #ffffff;
|
||
}
|
||
.table-scroll table {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
table-layout: fixed;
|
||
}
|
||
.jd-table-scroll > table {
|
||
min-width: 1500px;
|
||
}
|
||
/* 操作列(编辑/删除):双小按钮需 138px(ops-cell-must-wrap 实测口径:两字按钮 53×2+24 padding)。
|
||
overflow 显式放开:td 全局是 overflow:hidden(611 行),压线时第二颗(删除)会被裁成
|
||
「编辑+…」的形状——2026-11-16 用户报「删除没了」的真因,列宽 120px < 实测 138px。 */
|
||
.jd-ops-cell {
|
||
white-space: nowrap;
|
||
text-overflow: clip;
|
||
overflow: visible;
|
||
}
|
||
.btn-sm {
|
||
min-height: 28px;
|
||
padding: 3px 10px;
|
||
font-size: 12.5px;
|
||
margin-right: 6px;
|
||
}
|
||
.btn-sm:last-child {
|
||
margin-right: 0;
|
||
}
|
||
.table-scroll th,
|
||
.table-scroll td {
|
||
padding: 10px 12px;
|
||
text-align: left;
|
||
font-size: 13.5px;
|
||
line-height: 1.5;
|
||
border-bottom: 1px solid #e0e8ef;
|
||
vertical-align: middle;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
/* 首列勾选格:checkbox 的 UA 默认 margin(3px 3px 3px 4px)使其 margin-box 溢出
|
||
42px 格的内容盒(42−24 padding=18px),配合上面的 overflow:hidden,Chromium 在
|
||
首次渲染时会把被裁的 checkbox 碎片留在裁剪边缘,看起来像格子右边多出 ".."。
|
||
margin 归零后 margin-box 收进内容盒,首渲染即干净(playwright 三次冷加载已验)。 */
|
||
.table-scroll th:first-child input,
|
||
.table-scroll td:first-child input {
|
||
margin: 0;
|
||
}
|
||
.table-scroll th {
|
||
background: #edf4fa;
|
||
color: #4e6479;
|
||
border-bottom-color: #d5e1eb;
|
||
font-size: 12.5px;
|
||
font-weight: 600;
|
||
letter-spacing: 0.4px;
|
||
}
|
||
.table-scroll tbody tr:hover td {
|
||
background: #f1f7fb;
|
||
}
|
||
.table-scroll tbody tr:last-child td {
|
||
border-bottom: 0;
|
||
}
|
||
/* 点行开详情抽屉:行级 hover 已有底色反馈,光标再点一下提示可点。 */
|
||
.jd-row {
|
||
cursor: pointer;
|
||
}
|
||
.jd-thumb {
|
||
display: block;
|
||
width: 48px;
|
||
height: 48px;
|
||
object-fit: cover;
|
||
border: 1px solid #d8e3ee;
|
||
border-radius: 6px;
|
||
background: #f2f7fb;
|
||
}
|
||
/* 商品信息列=京麦同款合并布局: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;
|
||
}
|
||
.jd-health {
|
||
color: #2e9e6b;
|
||
font-size: 11px;
|
||
line-height: 1.2;
|
||
white-space: nowrap;
|
||
}
|
||
.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;
|
||
}
|
||
/* 品牌·类目行(京麦列表同款深色文字):信息 meta 是灰色,这行按京麦用主文字色。 */
|
||
.jd-brand-cat {
|
||
color: #3d5368;
|
||
font-weight: 550;
|
||
}
|
||
.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;
|
||
text-align: center;
|
||
color: #8293a5;
|
||
font-size: 13.5px;
|
||
}
|
||
</style>
|