Commit 7963b699 authored by Chunchi Che's avatar Chunchi Che

add quick select for OptionModal

parent cd7b3165
Pipeline #28882 passed with stages
in 8 minutes and 56 seconds
.container { .container {
:global(.ant-pro-checkcard-header) { :global(.ant-pro-checkcard-description) {
font-family: var(--theme-font); font-family: var(--theme-font);
font-size: 2rem; font-size: 0.9rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
......
...@@ -54,6 +54,13 @@ export const OptionModal = () => { ...@@ -54,6 +54,13 @@ export const OptionModal = () => {
setSelecteds(Array.from({ length: maxPage }).map((_) => [])); setSelecteds(Array.from({ length: maxPage }).map((_) => []));
}, [options]); }, [options]);
const onQuickSelect = (response: number) => {
if (store.min === 1) {
sendSelectOptionResponse(container.conn, response);
rs();
}
};
return ( return (
<NeosModal <NeosModal
title={title} title={title}
...@@ -80,12 +87,16 @@ export const OptionModal = () => { ...@@ -80,12 +87,16 @@ export const OptionModal = () => {
}} }}
> >
{options.map((option, idx) => ( {options.map((option, idx) => (
<CheckCard <div
key={idx} key={idx}
className={styles["check-card"]} onDoubleClick={() => onQuickSelect(option.response)}
description={option.info} >
value={option.response} <CheckCard
/> className={styles["check-card"]}
description={option.info}
value={option.response}
/>
</div>
))} ))}
</CheckCard.Group> </CheckCard.Group>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment