- 新增 ConfirmModal 组件,为6处危险操作添加二次确认弹窗 (禁用团队/用户/成员、删除视频×3处) - 所有秒数显示统一为千位分隔符+s后缀(如 36,000s) - 修复 modal/drawer 在 input 中拖拽导致误关闭的 bug (onClick → onMouseDown + e.target === e.currentTarget) - 团队模型完善:三种角色(超管/团管/成员)、四层额度检查、 团管成员管理页、超管团队管理页 - 关闭公开注册,所有账号由管理员创建 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
989 B
TypeScript
29 lines
989 B
TypeScript
import styles from './ConfirmModal.module.css';
|
|
|
|
interface ConfirmModalProps {
|
|
open: boolean;
|
|
title: string;
|
|
message: string;
|
|
confirmText?: string;
|
|
cancelText?: string;
|
|
danger?: boolean;
|
|
onConfirm: () => void;
|
|
onCancel: () => void;
|
|
}
|
|
|
|
export function ConfirmModal({ open, title, message, confirmText = '确认', cancelText = '取消', danger, onConfirm, onCancel }: ConfirmModalProps) {
|
|
if (!open) return null;
|
|
return (
|
|
<div className={styles.overlay} onMouseDown={(e) => { if (e.target === e.currentTarget) onCancel(); }}>
|
|
<div className={styles.modal}>
|
|
<h3 className={styles.title}>{title}</h3>
|
|
<p className={styles.message}>{message}</p>
|
|
<div className={styles.actions}>
|
|
<button className={styles.cancelBtn} onClick={onCancel}>{cancelText}</button>
|
|
<button className={`${styles.confirmBtn} ${danger ? styles.danger : ''}`} onClick={onConfirm}>{confirmText}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|