fix ProductStockSkuList.vue style

This commit is contained in:
Timi
2026-09-07 13:32:58 +08:00
parent aa2cacf88e
commit 4aef5bddc7
+13 -40
View File
@@ -1,10 +1,5 @@
<template> <template>
<div v-can="permissionCodes.productStock.read" class="product-stock-sku-list"> <div v-can="permissionCodes.productStock.read" class="product-stock-sku-list">
<div class="product-context">
<strong v-text="product?.name || '产品 SKU'" />
<span v-text="product?.code || productId" />
</div>
<div class="search bg-white"> <div class="search bg-white">
<t-input <t-input
v-model="keyword" v-model="keyword"
@@ -15,7 +10,6 @@
placeholder="搜索 SKU 名称、编码或规格" placeholder="搜索 SKU 名称、编码或规格"
/> />
</div> </div>
<t-pull-down-refresh <t-pull-down-refresh
class="list-wrap empty-cell-title-margin" class="list-wrap empty-cell-title-margin"
v-model="isRefreshing" v-model="isRefreshing"
@@ -23,6 +17,10 @@
@refresh="refresh" @refresh="refresh"
@scrolltolower="loadMore" @scrolltolower="loadMore"
> >
<div class="content">
<t-cell-group theme="card">
<t-cell title="产品" :note="product?.name" />
</t-cell-group>
<t-cell-group v-if="skuStockList.length" theme="card" class="list fix-last-cell-line"> <t-cell-group v-if="skuStockList.length" theme="card" class="list fix-last-cell-line">
<t-cell <t-cell
v-for="(item, index) in skuStockList" v-for="(item, index) in skuStockList"
@@ -42,9 +40,6 @@
<t-tag size="small" variant="outline" :content="item.sku?.code || '无 SKU 编码'" /> <t-tag size="small" variant="outline" :content="item.sku?.code || '无 SKU 编码'" />
</div> </div>
</template> </template>
<template #note>
<span class="sku-spec" v-text="getSkuSpecText(item)" />
</template>
<template #description> <template #description>
<div class="stock"> <div class="stock">
<span class="on-hand"> <span class="on-hand">
@@ -65,6 +60,7 @@
</t-cell-group> </t-cell-group>
<div v-else class="center-tips" v-text="emptyText" /> <div v-else class="center-tips" v-text="emptyText" />
<div v-if="skuStockList.length" class="center-tips" v-text="isLoading ? '正在加载更多' : isNoMore ? '已经到底了' : '上拉加载更多'" /> <div v-if="skuStockList.length" class="center-tips" v-text="isLoading ? '正在加载更多' : isNoMore ? '已经到底了' : '上拉加载更多'" />
</div>
</t-pull-down-refresh> </t-pull-down-refresh>
</div> </div>
</template> </template>
@@ -75,7 +71,7 @@ import ProductAPI from "@/api/ProductAPI";
import { useNavBarStore } from "@/store/navBarStore"; import { useNavBarStore } from "@/store/navBarStore";
import type { Product, ProductStock } from "@/types/Product"; import type { Product, ProductStock } from "@/types/Product";
import { getErrorMessage } from "@/utils/error"; import { getErrorMessage } from "@/utils/error";
import { getProductQuantityText, getProductSkuSpecEntries } from "@/utils/product"; import { getProductQuantityText } from "@/utils/product";
import { Message } from "@/utils/message"; import { Message } from "@/utils/message";
import { permissionCodes } from "@/utils/permission"; import { permissionCodes } from "@/utils/permission";
@@ -110,15 +106,6 @@ let keywordTimer: number | undefined;
let requestToken = 0; let requestToken = 0;
let suppressKeywordFetch = false; let suppressKeywordFetch = false;
function getSkuSpecText(item: ProductStock): string {
const sku = item.sku;
if (!sku) {
return "未配置规格";
}
const entries = getProductSkuSpecEntries(sku, product.value?.specList || []);
return entries.length ? entries.map(entry => `${entry.specName}:${entry.valueName}`).join(" · ") : sku.specSummary || "无多规格";
}
function getCurrentRouteDepth(): number { function getCurrentRouteDepth(): number {
const transitionDepth = Array.isArray(route.query.transitionDepth) const transitionDepth = Array.isArray(route.query.transitionDepth)
? route.query.transitionDepth[0] ? route.query.transitionDepth[0]
@@ -250,26 +237,6 @@ onUnmounted(() => {
.product-stock-sku-list { .product-stock-sku-list {
padding: var(--app-nav-height) 0 1rem; padding: var(--app-nav-height) 0 1rem;
.product-context {
gap: .25rem;
display: flex;
padding: .75rem 1rem;
background: var(--td-bg-color-container);
flex-direction: column;
strong,
span {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
span {
color: var(--td-text-color-secondary);
font-size: .75rem;
}
}
.search { .search {
top: var(--app-nav-height); top: var(--app-nav-height);
z-index: 10; z-index: 10;
@@ -288,9 +255,14 @@ onUnmounted(() => {
.list-wrap { .list-wrap {
min-height: 70vh; min-height: 70vh;
padding-top: .75rem;
.content {
gap: 1rem;
display: flex;
flex-direction: column;
.list { .list {
padding-top: .75rem;
.item { .item {
padding: 10px; padding: 10px;
@@ -354,4 +326,5 @@ onUnmounted(() => {
} }
} }
} }
}
</style> </style>