diff --git a/src/components/OperationCard.tsx b/src/components/OperationCard.tsx index 9cd29d7b..f8979ce2 100644 --- a/src/components/OperationCard.tsx +++ b/src/components/OperationCard.tsx @@ -18,7 +18,17 @@ import { UserName } from './UserName' import { EDifficulty } from './entity/EDifficulty' import { EDifficultyLevel, NeoELevel } from './entity/ELevel' -export const NeoOperationCard = ({ operation }: { operation: Operation }) => { +export const NeoOperationCard = ({ + operation, + selected, + selectable, + onSelect, +}: { + operation: Operation + selectable?: boolean + selected?: boolean + onSelect?: (operation: Operation, selected: boolean) => void +}) => { const { data: levels } = useLevels() return ( @@ -113,7 +123,13 @@ export const NeoOperationCard = ({ operation }: { operation: Operation }) => { - + ) } @@ -247,11 +263,27 @@ const OperatorTags = ({ operation }: { operation: Operation }) => { const CardActions = ({ className, operation, + selected, + selectable, + onSelect, }: { className?: string operation: Operation + selectable?: boolean + selected?: boolean + onSelect?: (operation: Operation, selected: boolean) => void }) => { - return ( + return selectable ? ( + + ))} + + +
+ + + + + op.id)} + > + 添加到作业集 + +
+ + )} + {items} {isReachingEnd && operations.length === 0 && ( diff --git a/src/components/Operations.tsx b/src/components/Operations.tsx index 142f19ab..05eb0a68 100644 --- a/src/components/Operations.tsx +++ b/src/components/Operations.tsx @@ -42,6 +42,7 @@ export const Operations: ComponentType = withSuspensable(() => { const [selectedUser, setSelectedUser] = useState() const [neoLayout, setNeoLayout] = useAtom(neoLayoutAtom) const [tab, setTab] = useState<'operation' | 'operationSet'>('operation') + const [multiselect, setMultiselect] = useState(false) return ( <> @@ -74,7 +75,15 @@ export const Operations: ComponentType = withSuspensable(() => { title="作业集" /> - + +
+ {!!singleOperationId && ( + + setOnlyShowAdded((e.target as HTMLInputElement).checked) + } + /> + )} +