feat: 本次提交更新内容如下

组件优化完成
This commit is contained in:
2025-07-22 19:10:14 +08:00
parent 3987bfa551
commit 00900e1ea3
2 changed files with 15 additions and 3 deletions

View File

@@ -35,6 +35,7 @@ interface GroupSelectionProps {
showInput?: boolean;
showSelectedList?: boolean;
readonly?: boolean;
onConfirm?: (selectedIds: string[], selectedItems: WechatGroup[]) => void; // 新增
}
export default function GroupSelection({
@@ -49,6 +50,7 @@ export default function GroupSelection({
showInput = true,
showSelectedList = true,
readonly = false,
onConfirm,
}: GroupSelectionProps) {
const [popupVisible, setPopupVisible] = useState(false);
const [groups, setGroups] = useState<WechatGroup[]>([]);
@@ -160,8 +162,12 @@ export default function GroupSelection({
return `已选择 ${selectedGroups.length} 个群聊`;
};
// 确认按钮逻辑
const handleConfirm = () => {
setRealVisible(false);
if (onConfirm) {
onConfirm(selectedGroups, selectedGroupObjs);
}
};
// 清空搜索
@@ -395,7 +401,7 @@ export default function GroupSelection({
<AntdButton type="default" onClick={() => setRealVisible(false)}>
</AntdButton>
<AntdButton type="primary" onClick={() => setRealVisible(false)}>
<AntdButton type="primary" onClick={handleConfirm}>
</AntdButton>
</div>