refactor(PoolSelection): 重命名组件及相关接口从Group到Pool

将组件及相关接口从GroupSelection重命名为PoolSelection以更准确反映其用途
更新相关引用和类型定义
调整流量池选择弹窗的样式和交互
This commit is contained in:
超级老白兔
2025-08-21 16:47:55 +08:00
parent 61e1ffc6c4
commit cfb752509a
7 changed files with 69 additions and 34 deletions

View File

@@ -28,7 +28,7 @@ export interface PoolItem {
tags: any[];
}
export interface GroupSelectionItem {
export interface PoolSelectionItem {
id: string;
avatar?: string;
name: string;
@@ -42,10 +42,10 @@ export interface GroupSelectionItem {
}
// 组件属性接口
export interface GroupSelectionProps {
selectedOptions: GroupSelectionItem[];
onSelect: (groups: GroupSelectionItem[]) => void;
onSelectDetail?: (groups: PoolPackageItem[]) => void;
export interface PoolSelectionProps {
selectedOptions: PoolSelectionItem[];
onSelect: (Pools: PoolSelectionItem[]) => void;
onSelectDetail?: (Pools: PoolPackageItem[]) => void;
placeholder?: string;
className?: string;
visible?: boolean;
@@ -56,6 +56,6 @@ export interface GroupSelectionProps {
readonly?: boolean;
onConfirm?: (
selectedIds: string[],
selectedItems: GroupSelectionItem[],
selectedItems: PoolSelectionItem[],
) => void;
}

View File

@@ -106,7 +106,7 @@
.groupAvatar {
width: 40px;
height: 40px;
border-radius: 50%;
border-radius: 8px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;

View File

@@ -1,10 +1,9 @@
import React, { useState } from "react";
import { SearchOutlined, DeleteOutlined } from "@ant-design/icons";
import { Button, Input } from "antd";
import { Avatar } from "antd-mobile";
import style from "./index.module.scss";
import SelectionPopup from "./selectionPopup";
import { GroupSelectionProps } from "./data";
import { PoolSelectionProps } from "./data";
export default function PoolSelection({
selectedOptions,
onSelect,
@@ -18,7 +17,7 @@ export default function PoolSelection({
showSelectedList = true,
readonly = false,
onConfirm,
}: GroupSelectionProps) {
}: PoolSelectionProps) {
const [popupVisible, setPopupVisible] = useState(false);
// 删除已选流量池项

View File

@@ -6,19 +6,19 @@ import style from "./index.module.scss";
import Layout from "@/components/Layout/Layout";
import PopupHeader from "@/components/PopuLayout/header";
import PopupFooter from "@/components/PopuLayout/footer";
import { GroupSelectionItem, PoolPackageItem } from "./data";
import { PoolSelectionItem, PoolPackageItem } from "./data";
// 弹窗属性接口
interface SelectionPopupProps {
visible: boolean;
onVisibleChange: (visible: boolean) => void;
selectedOptions: GroupSelectionItem[];
onSelect: (items: GroupSelectionItem[]) => void;
selectedOptions: PoolSelectionItem[];
onSelect: (items: PoolSelectionItem[]) => void;
onSelectDetail?: (items: PoolPackageItem[]) => void;
readonly?: boolean;
onConfirm?: (
selectedIds: string[],
selectedItems: GroupSelectionItem[],
selectedItems: PoolSelectionItem[],
) => void;
}
@@ -66,7 +66,7 @@ export default function SelectionPopup({
if (readonly) return;
// 将PoolPackageItem转换为GroupSelectionItem格式
const selectionItem: GroupSelectionItem = {
const selectionItem: PoolSelectionItem = {
id: String(item.id),
name: item.name,
description: item.description,