From 236d0a85bf7b3b4fcb03df314eb2e513b976b17b Mon Sep 17 00:00:00 2001 From: tikkhun Date: Sat, 24 Jan 2026 18:19:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(product):=20site=20skus=20=E7=9A=84?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E8=BF=9B=E8=A1=8C=E4=BA=86=E5=88=86=E8=A1=A8?= =?UTF-8?q?=E9=87=8D=E6=9E=84=EF=BC=8C=E5=89=8D=E7=AB=AF=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .umirc.ts | 2 +- src/pages/Product/GroupBy/index.tsx | 2 +- src/pages/Product/List/EditForm.tsx | 12 ++---------- src/pages/Product/List/index.tsx | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.umirc.ts b/.umirc.ts index f1934e1..bff8c8b 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -180,7 +180,7 @@ export default defineConfig({ component: './Product/Permutation', }, { - name: '产品品牌空间', + name: '产品聚合空间', path: '/product/groupBy', component: './Product/GroupBy', }, diff --git a/src/pages/Product/GroupBy/index.tsx b/src/pages/Product/GroupBy/index.tsx index ce23216..b197a4a 100644 --- a/src/pages/Product/GroupBy/index.tsx +++ b/src/pages/Product/GroupBy/index.tsx @@ -238,7 +238,7 @@ const ProductGroupBy: React.FC = () => { const { Title, Text } = Typography; return ( - +
{/* Filter Section */}
diff --git a/src/pages/Product/List/EditForm.tsx b/src/pages/Product/List/EditForm.tsx index 29614d2..7f99614 100644 --- a/src/pages/Product/List/EditForm.tsx +++ b/src/pages/Product/List/EditForm.tsx @@ -35,7 +35,6 @@ const EditForm: React.FC<{ const [stockStatus, setStockStatus] = useState< 'in-stock' | 'out-of-stock' | null >(null); - const [sites, setSites] = useState([]); const [categories, setCategories] = useState([]); const [activeAttributes, setActiveAttributes] = useState([]); @@ -44,10 +43,6 @@ const EditForm: React.FC<{ productcontrollerGetcategoriesall().then((res: any) => { setCategories(res?.data || []); }); - // 获取站点列表用于站点SKU选择 - sitecontrollerAll().then((res: any) => { - setSites(res?.data || []); - }); }, []); useEffect(() => { @@ -118,9 +113,6 @@ const EditForm: React.FC<{ components: components, type: type, categoryId: (record as any).categoryId || (record as any).category?.id, - // 初始化站点SKU为字符串数组 - // 修改后代码: - siteSkus: (record.siteSkus || []).map((code) => ({ code })), }; }, [record, components, type]); return ( @@ -187,7 +179,7 @@ const EditForm: React.FC<{ attributes, type: values.type, // 直接使用 type categoryId: values.categoryId, - siteSkus: values.siteSkus.map((v: { code: string }) => v.code) || [], // 直接传递字符串数组 + siteSkus: values.siteSkus.map((v: { sku: string }) => v.sku) || [], // 直接传递字符串数组 // 连带更新 components components: values.type === 'bundle' @@ -251,7 +243,7 @@ const EditForm: React.FC<{ )} > { <> {record.siteSkus?.map((siteSku, index) => ( - {siteSku} + {siteSku.sku} ))}