2025-11-18 15:44:20 +08:00
|
|
|
interface IsExistenceDuplicateSelectionOptions<T> {
|
2025-10-22 14:43:42 +08:00
|
|
|
/** 需要检查重复项的目标数组 */
|
|
|
|
|
data: T[];
|
|
|
|
|
/** 用于去重判断的对象属性名 */
|
2025-11-18 15:44:20 +08:00
|
|
|
key: keyof T | string;
|
2025-10-22 14:43:42 +08:00
|
|
|
/** 可选的错误提示信息 */
|
|
|
|
|
message?: string;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-18 15:26:31 +08:00
|
|
|
/**
|
|
|
|
|
* 检查数组中是否存在重复项的函数
|
|
|
|
|
*/
|
|
|
|
|
interface IsExistenceDuplicateSelectionFunction {
|
2025-11-18 15:44:20 +08:00
|
|
|
<T>(options: IsExistenceDuplicateSelectionOptions<T>): Promise<void>;
|
2025-11-18 15:26:31 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-22 14:43:42 +08:00
|
|
|
/**
|
|
|
|
|
* 检查数组中是否存在重复项
|
|
|
|
|
*/
|
2025-11-18 15:44:20 +08:00
|
|
|
export default function useIsExistenceDuplicateSelection(): {
|
|
|
|
|
isExistenceDuplicateSelection: IsExistenceDuplicateSelectionFunction;
|
2025-11-18 15:29:16 +08:00
|
|
|
};
|