Commit c11fc549 authored by timel's avatar timel

fix: remove prop

parent 4792ca5d
......@@ -27,7 +27,6 @@ export default async ({
cancelable,
min: min,
max: max,
single: true,
selecteds: [...selecteds1, ...selecteds2],
mustSelects: [...mustSelect1, ...mustSelect2],
selectables: [...selectable1, ...selectable2],
......
......@@ -21,7 +21,6 @@ const defaultProps: Omit<
isChain: false,
min: 0,
max: 0,
single: true,
selecteds: [] as Option[], // 最少选择多少卡
selectables: [] as Option[], // 最多选择多少卡
mustSelects: [] as Option[], // 单选
......@@ -39,7 +38,6 @@ export const SelectActionsModal: React.FC = () => {
isChain,
min,
max,
single,
selecteds,
selectables,
mustSelects,
......@@ -77,7 +75,6 @@ export const SelectActionsModal: React.FC = () => {
isChain,
min,
max,
single,
selecteds,
selectables,
mustSelects,
......
......@@ -19,7 +19,6 @@ export interface SelectCardsModalProps {
isChain: boolean;
min: number;
max: number;
single: boolean;
selecteds: Snapshot<Option[]>; // 已经选择了的卡
selectables: Snapshot<Option[]>; // 最多选择多少卡
mustSelects: Snapshot<Option[]>; // 单选
......@@ -37,7 +36,6 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
isChain,
min,
max,
single,
selecteds,
selectables,
mustSelects,
......@@ -51,6 +49,7 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
}) => {
const [result, setResult] = useState<Option[]>([]);
const [submitable, setSubmitable] = useState(false);
const single = min === 1 && max === 1; // 是否是单选
const hint = useSnapshot(matStore.hint);
const preHintMsg = hint?.esHint || "";
......@@ -144,7 +143,6 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
<div className="checkcard-container" key={i}>
<CheckCard.Group
onChange={(res) => {
console.log("setresult", res);
setResult((single ? [res] : res) as any);
}}
// TODO 考虑如何设置默认值,比如只有一个的,就直接选中
......
......@@ -18,7 +18,6 @@ export const SimpleSelectCardsModal: React.FC = () => {
isChain={false}
min={1}
max={1}
single
selecteds={[]}
mustSelects={[]}
selectables={selectables}
......
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