From ef8c96162616c6d9d24eb1bdccbcd95e6ee65943 Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 11 Apr 2026 11:01:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99?= =?UTF-8?q?=E5=BA=93):=20=E5=AE=9E=E7=8E=B0=205=20=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E7=BA=A6=E6=9D=9F=E6=94=B6=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 5 字段唯一约束最终方案 createSubstrate 新增合并逻辑: 1. **完全重复** (相同 5 字段 + 相同花色) → 拒绝,报错「基材库已有相同规格的基材,不可重复创建」 2. **花色不同** (相同 5 字段 + 不同花色) → 合并新花色到已有基材,重建名称 3. **规格不同** (5 字段不同) → 新建基材,自动编码 BC-XXXX 5 字段 = categoryId + environmentGradeId + thicknessSpecId + surfaceOptionId + systemNameOptionId 实木 (无 surfaceOptionId) 按 null 处理,纳入 5 字段匹配 ## 验证 - TypeScript 编译: 0 errors - 基础资料库测试: 48/48 passed --- .../MaterialLibraryClient.test.tsx | 2 +- .../platform/PlatformSplitLayout.tsx | 7 +++ .../__tests__/asset-center.service.test.ts | 9 --- .../server/services/asset-center.service.ts | 61 ++++++++++++++++--- .../src/server/services/index.ts | 24 ++++---- 5 files changed, 71 insertions(+), 32 deletions(-) diff --git a/furniture-3d-system/src/app/asset-center/material-library/MaterialLibraryClient.test.tsx b/furniture-3d-system/src/app/asset-center/material-library/MaterialLibraryClient.test.tsx index d89303b7..f7e6cc8d 100644 --- a/furniture-3d-system/src/app/asset-center/material-library/MaterialLibraryClient.test.tsx +++ b/furniture-3d-system/src/app/asset-center/material-library/MaterialLibraryClient.test.tsx @@ -134,7 +134,7 @@ describe('MaterialLibraryClient', () => { // Switch to substrate tab first await actor.click(screen.getByRole('button', { name: /基材录入/ })) - await actor.click(screen.getByRole('button', { name: '新建基材' })) + await actor.click(screen.getByRole('button', { name: /新建/ })) await actor.type(screen.getByLabelText('售价'), '200') await actor.click(screen.getByRole('button', { name: '创建' })) diff --git a/furniture-3d-system/src/components/platform/PlatformSplitLayout.tsx b/furniture-3d-system/src/components/platform/PlatformSplitLayout.tsx index 12d6e470..06064cae 100644 --- a/furniture-3d-system/src/components/platform/PlatformSplitLayout.tsx +++ b/furniture-3d-system/src/components/platform/PlatformSplitLayout.tsx @@ -47,6 +47,7 @@ export function PlatformSplitLayout({ }: PlatformSplitLayoutProps) { return (
+ {/* 页面标题区(如果有) */} {title ? (
@@ -76,6 +77,7 @@ export function PlatformSplitLayout({
) : null} + {/* 指标条 */} {metrics && metrics.length > 0 ? (
@@ -99,6 +101,7 @@ export function PlatformSplitLayout({
) : null} + {/* 反馈提示 */} {feedback ? (
) : null} + {/* 主体:左右分栏 */}
+ {/* 左侧:3D 预览区 */}
{leftContent}
+ + {/* 右侧:检查器面板 */}