优化模型选择ui

This commit is contained in:
sijinhui 2024-05-15 17:21:01 +08:00
parent e098bd6f6a
commit 15ddb5fe8c
2 changed files with 11 additions and 2 deletions

View File

@ -329,4 +329,5 @@
.cus-modal-container { .cus-modal-container {
max-width: none !important; max-width: none !important;
width: 80vw !important;
} }

View File

@ -114,6 +114,7 @@ interface ModalProps {
defaultMax?: boolean; defaultMax?: boolean;
footer?: React.ReactNode; footer?: React.ReactNode;
onClose?: () => void; onClose?: () => void;
maskClosable?: boolean;
is_cus?: boolean; is_cus?: boolean;
} }
export function Modal(props: ModalProps) { export function Modal(props: ModalProps) {
@ -534,6 +535,7 @@ export function ModalSelector<T extends CheckGroupValueType>(props: {
onClose={() => props.onClose?.()} onClose={() => props.onClose?.()}
footer={null} footer={null}
is_cus={true} is_cus={true}
maskClosable={true}
> >
<AntList grid={{ gutter: 16 }}> <AntList grid={{ gutter: 16 }}>
<CheckCard.Group <CheckCard.Group
@ -541,8 +543,13 @@ export function ModalSelector<T extends CheckGroupValueType>(props: {
defaultValue={props.defaultSelectedValue} defaultValue={props.defaultSelectedValue}
> >
<Row <Row
gutter={[16, 16]} gutter={[16, 8]}
style={{ marginLeft: "-8px", marginRight: "-8px" }} style={{
marginLeft: "-8px",
marginRight: "-8px",
display: "flex",
justifyContent: "center",
}}
> >
{props.items.map((item, i) => { {props.items.map((item, i) => {
const selected = props.defaultSelectedValue === item.value; const selected = props.defaultSelectedValue === item.value;
@ -557,6 +564,7 @@ export function ModalSelector<T extends CheckGroupValueType>(props: {
props.onClose?.(); props.onClose?.();
}} }}
avatar={getCheckCardAvatar(item.value?.toString() ?? "")} avatar={getCheckCardAvatar(item.value?.toString() ?? "")}
style={{ marginBottom: "8px", width: "250px" }}
/> />
</Col> </Col>
); );