fix ProductDetail.vue style

This commit is contained in:
Timi
2026-09-03 15:11:34 +08:00
parent 333999fe21
commit 2acdf46d5d
3 changed files with 177 additions and 120 deletions
+7 -1
View File
@@ -1,4 +1,5 @@
import type { ProductCategoryStatus, ProductStatus, ProductType, StockOperationType } from "@/types/Product";
import type { Product, ProductCategoryStatus, ProductStatus, ProductType, StockOperationType } from "@/types/Product";
import { getAttachmentReadURL } from "@/utils/attachment.ts";
/** 生成产品域写操作的幂等请求号。一次失败重试应复用调用方已经生成的请求号。 */
export function createProductRequestNo(): string {
@@ -76,6 +77,11 @@ export function getStockOperationText(type?: StockOperationType): string {
} as Record<string, string>)[type || ""] || "未知操作";
}
export function getProductPhotoURL(item: Product): string {
const attachment = item.attachmentList?.find(item => item.attachType === "PHOTO" && !!item.id);
return attachment?.id ? getAttachmentReadURL(attachment.id, 128) : "";
}
/** 将数量转换成稳定的展示文本,兼容后端 BigDecimal 字符串。 */
export function getProductQuantityText(value?: number | string | null): string {
if (value === undefined || value === null || value === "") {