refactor(product): site skus 的后端进行了分表重构,前端跟随修改。
This commit is contained in:
parent
f2db99c630
commit
686432f893
|
|
@ -180,7 +180,7 @@ export default defineConfig({
|
||||||
component: './Product/Permutation',
|
component: './Product/Permutation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '产品品牌空间',
|
name: '产品聚合空间',
|
||||||
path: '/product/groupBy',
|
path: '/product/groupBy',
|
||||||
component: './Product/GroupBy',
|
component: './Product/GroupBy',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ const ProductGroupBy: React.FC = () => {
|
||||||
const { Title, Text } = Typography;
|
const { Title, Text } = Typography;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContainer title="品牌空间">
|
<PageContainer title="聚合空间">
|
||||||
<div style={{ padding: '16px', background: '#fff' }}>
|
<div style={{ padding: '16px', background: '#fff' }}>
|
||||||
{/* Filter Section */}
|
{/* Filter Section */}
|
||||||
<div style={{ marginBottom: '24px' }}>
|
<div style={{ marginBottom: '24px' }}>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ const EditForm: React.FC<{
|
||||||
const [stockStatus, setStockStatus] = useState<
|
const [stockStatus, setStockStatus] = useState<
|
||||||
'in-stock' | 'out-of-stock' | null
|
'in-stock' | 'out-of-stock' | null
|
||||||
>(null);
|
>(null);
|
||||||
const [sites, setSites] = useState<any[]>([]);
|
|
||||||
|
|
||||||
const [categories, setCategories] = useState<any[]>([]);
|
const [categories, setCategories] = useState<any[]>([]);
|
||||||
const [activeAttributes, setActiveAttributes] = useState<any[]>([]);
|
const [activeAttributes, setActiveAttributes] = useState<any[]>([]);
|
||||||
|
|
@ -44,10 +43,6 @@ const EditForm: React.FC<{
|
||||||
productcontrollerGetcategoriesall().then((res: any) => {
|
productcontrollerGetcategoriesall().then((res: any) => {
|
||||||
setCategories(res?.data || []);
|
setCategories(res?.data || []);
|
||||||
});
|
});
|
||||||
// 获取站点列表用于站点SKU选择
|
|
||||||
sitecontrollerAll().then((res: any) => {
|
|
||||||
setSites(res?.data || []);
|
|
||||||
});
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -118,9 +113,6 @@ const EditForm: React.FC<{
|
||||||
components: components,
|
components: components,
|
||||||
type: type,
|
type: type,
|
||||||
categoryId: (record as any).categoryId || (record as any).category?.id,
|
categoryId: (record as any).categoryId || (record as any).category?.id,
|
||||||
// 初始化站点SKU为字符串数组
|
|
||||||
// 修改后代码:
|
|
||||||
siteSkus: (record.siteSkus || []).map((code) => ({ code })),
|
|
||||||
};
|
};
|
||||||
}, [record, components, type]);
|
}, [record, components, type]);
|
||||||
return (
|
return (
|
||||||
|
|
@ -187,7 +179,7 @@ const EditForm: React.FC<{
|
||||||
attributes,
|
attributes,
|
||||||
type: values.type, // 直接使用 type
|
type: values.type, // 直接使用 type
|
||||||
categoryId: values.categoryId,
|
categoryId: values.categoryId,
|
||||||
siteSkus: values.siteSkus.map((v: { code: string }) => v.code) || [], // 直接传递字符串数组
|
siteSkus: values.siteSkus.map((v: { sku: string }) => v.sku) || [], // 直接传递字符串数组
|
||||||
// 连带更新 components
|
// 连带更新 components
|
||||||
components:
|
components:
|
||||||
values.type === 'bundle'
|
values.type === 'bundle'
|
||||||
|
|
@ -251,7 +243,7 @@ const EditForm: React.FC<{
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
name="code"
|
name="sku"
|
||||||
width="md"
|
width="md"
|
||||||
placeholder="请输入站点SKU"
|
placeholder="请输入站点SKU"
|
||||||
rules={[{ required: true, message: '请输入站点SKU' }]}
|
rules={[{ required: true, message: '请输入站点SKU' }]}
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ const List: React.FC = () => {
|
||||||
<>
|
<>
|
||||||
{record.siteSkus?.map((siteSku, index) => (
|
{record.siteSkus?.map((siteSku, index) => (
|
||||||
<Tag key={index} color="cyan">
|
<Tag key={index} color="cyan">
|
||||||
{siteSku}
|
{siteSku.sku}
|
||||||
</Tag>
|
</Tag>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -1627,9 +1627,11 @@ declare namespace API {
|
||||||
details?: ShippingDetailsDTO;
|
details?: ShippingDetailsDTO;
|
||||||
stockPointId?: number;
|
stockPointId?: number;
|
||||||
orderIds?: number[];
|
orderIds?: number[];
|
||||||
|
shipmentPlatform?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ShipmentFeeBookDTO = {
|
type ShipmentFeeBookDTO = {
|
||||||
|
shipmentPlatform?: string;
|
||||||
stockPointId?: number;
|
stockPointId?: number;
|
||||||
sender?: string;
|
sender?: string;
|
||||||
startPhone?: string;
|
startPhone?: string;
|
||||||
|
|
@ -1650,6 +1652,7 @@ declare namespace API {
|
||||||
dimensionUom?: string;
|
dimensionUom?: string;
|
||||||
weight?: number;
|
weight?: number;
|
||||||
weightUom?: string;
|
weightUom?: string;
|
||||||
|
address_id?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ShippingAddress = {
|
type ShippingAddress = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue