fe1c6c8158
Allow multi-select uploads in HQ, partner, and shop for the three image galleries. Co-authored-by: Cursor <cursoragent@cursor.com>
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { Typography } from 'antd';
|
|
import MultiImageUpload from './MultiImageUpload';
|
|
|
|
type Props = {
|
|
name?: string;
|
|
label: string;
|
|
bizType?: string;
|
|
/** 最多可添加张数;不传则不限制 */
|
|
maxCount?: number;
|
|
/** Form.Item 注入 */
|
|
value?: string[];
|
|
onChange?: (urls: string[]) => void;
|
|
};
|
|
|
|
/**
|
|
* 商品详情/轮播等多图列表。
|
|
* 可直接包在 Form.Item 下(value/onChange),也可用 Form.List 的 name 外层再包 Form.Item。
|
|
*/
|
|
export default function DetailImageUrlList({
|
|
label,
|
|
bizType = 'DETAIL',
|
|
maxCount,
|
|
value,
|
|
onChange,
|
|
}: Props) {
|
|
return (
|
|
<>
|
|
<Typography.Text type="secondary" style={{ display: 'block', marginBottom: 8 }}>
|
|
{label}:支持批量上传{maxCount != null ? `,最多 ${maxCount} 张` : ''}
|
|
</Typography.Text>
|
|
<MultiImageUpload
|
|
bizType={bizType}
|
|
mediaType="IMAGE"
|
|
maxCount={maxCount}
|
|
value={value}
|
|
onChange={onChange}
|
|
tip={`支持一次选择多张${label}`}
|
|
/>
|
|
</>
|
|
);
|
|
}
|