From 1d4e8cffc2ed3e79b06e0c55bf3722d6f4041306 Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Thu, 11 Jun 2026 01:41:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(storage):=20=E6=89=93=E9=80=9A=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E5=AD=98=E5=82=A8=E8=BE=B9=E7=95=8C=E4=B8=8E=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApprovalWorkflowPageClient.tsx | 12 +- furniture-3d-system/src/app/users/page.tsx | 7 +- .../components/users/ActivateUserModal.tsx | 4 +- .../src/components/users/CreateUserModal.tsx | 4 +- .../src/components/users/EditUserModal.tsx | 4 +- .../src/lib/business-account-types.ts | 24 +- .../src/lib/material-asset-path.test.ts | 2 +- .../src/lib/material-asset-path.ts | 2 +- .../src/lib/object-storage-url.ts | 244 ++++++++++++++++++ furniture-3d-system/src/lib/storage.test.ts | 6 +- furniture-3d-system/src/lib/storage.ts | 213 +++++++++------ .../server/services/product-write.service.ts | 6 +- .../src/server/services/user.service.ts | 4 +- .../validators/business-role.validator.ts | 9 +- 14 files changed, 432 insertions(+), 109 deletions(-) create mode 100644 furniture-3d-system/src/lib/object-storage-url.ts diff --git a/furniture-3d-system/src/app/approval-workflows/[accessKey]/ApprovalWorkflowPageClient.tsx b/furniture-3d-system/src/app/approval-workflows/[accessKey]/ApprovalWorkflowPageClient.tsx index 358de31a..e701aad9 100644 --- a/furniture-3d-system/src/app/approval-workflows/[accessKey]/ApprovalWorkflowPageClient.tsx +++ b/furniture-3d-system/src/app/approval-workflows/[accessKey]/ApprovalWorkflowPageClient.tsx @@ -4,7 +4,11 @@ import { useEffect, useMemo, useState } from 'react' import type { ApprovalWorkflowStatus, BusinessAccountType } from '@prisma/client' import { AlertCircle, Clock3, FileStack, Lock, RefreshCw, ShieldCheck } from 'lucide-react' import { AuthProvider, useAuth } from '@/hooks/useAuth' -import { BUSINESS_ACCOUNT_TYPE_LABELS, BUSINESS_ACCOUNT_TYPE_OPTIONS } from '@/lib/business-account-types' +import { + BUSINESS_ACCOUNT_TYPE_LABELS, + BUSINESS_ACCOUNT_TYPE_OPTIONS, + type AppBusinessAccountType, +} from '@/lib/business-account-types' type FieldMatrixItem = { key: string @@ -113,7 +117,7 @@ function ApprovalWorkflowPageBody({ accessKey }: { accessKey: string }) { }, [accessKey]) const groupedFields = useMemo(() => { - const groups = new Map() + const groups = new Map() for (const role of APPROVAL_BUSINESS_ROLE_ORDER) { groups.set(role, []) } @@ -132,7 +136,7 @@ function ApprovalWorkflowPageBody({ accessKey }: { accessKey: string }) { }, [workflow]) const groupedFieldSections = useMemo(() => { - const sections = new Map>() + const sections = new Map>() for (const role of APPROVAL_BUSINESS_ROLE_ORDER) { const roleFields = groupedFields.get(role) || [] const bySection = new Map() @@ -283,7 +287,7 @@ function ApprovalWorkflowPageBody({ accessKey }: { accessKey: string }) { {APPROVAL_BUSINESS_ROLE_ORDER.map((role) => { const sections = groupedFieldSections.get(role) || [] if (sections.length === 0) return null - const mine = myBusinessRoles.includes(role) + const mine = myBusinessRoles.some((myRole) => myRole === role) return (
setBusinessRoleFilter('')} /> - {BUSINESS_ACCOUNT_TYPE_OPTIONS.map((option) => ( + {DATABASE_BUSINESS_ACCOUNT_TYPE_OPTIONS.map((option) => (
- {BUSINESS_ACCOUNT_TYPE_OPTIONS.map((option) => ( + {DATABASE_BUSINESS_ACCOUNT_TYPE_OPTIONS.map((option) => (