fix ProductDetail.vue style
This commit is contained in:
@@ -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 === "") {
|
||||
|
||||
Reference in New Issue
Block a user