style:更新所有Modal弹窗样式使用自定义风格
This commit is contained in:
@@ -28,6 +28,7 @@ const ChapterContentComparison: React.FC<ChapterContentComparisonProps> = ({
|
||||
}) => {
|
||||
const [applying, setApplying] = useState(false);
|
||||
const [viewMode, setViewMode] = useState<'split' | 'unified'>('split');
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
|
||||
const originalWordCount = originalContent.length;
|
||||
const wordCountDiff = wordCount - originalWordCount;
|
||||
@@ -85,9 +86,10 @@ const ChapterContentComparison: React.FC<ChapterContentComparisonProps> = ({
|
||||
};
|
||||
|
||||
const handleDiscard = () => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: '确认放弃',
|
||||
content: '确定要放弃新生成的内容吗?此操作不可恢复。',
|
||||
centered: true,
|
||||
okText: '确定放弃',
|
||||
cancelText: '取消',
|
||||
okButtonProps: { danger: true },
|
||||
@@ -100,6 +102,8 @@ const ChapterContentComparison: React.FC<ChapterContentComparisonProps> = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<Modal
|
||||
title={`内容对比 - ${chapterTitle}`}
|
||||
open={visible}
|
||||
@@ -216,6 +220,7 @@ const ChapterContentComparison: React.FC<ChapterContentComparisonProps> = ({
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ const ChapterRegenerationModal: React.FC<ChapterRegenerationModalProps> = ({
|
||||
hasAnalysis
|
||||
}) => {
|
||||
const [form] = Form.useForm();
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [progress, setProgress] = useState(0);
|
||||
const [status, setStatus] = useState<'idle' | 'generating' | 'success' | 'error'>('idle');
|
||||
@@ -202,9 +203,10 @@ const ChapterRegenerationModal: React.FC<ChapterRegenerationModalProps> = ({
|
||||
|
||||
const handleCancel = () => {
|
||||
if (loading) {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: '确认取消',
|
||||
content: '生成正在进行中,确定要取消吗?',
|
||||
centered: true,
|
||||
onOk: () => {
|
||||
setLoading(false);
|
||||
setStatus('idle');
|
||||
@@ -217,6 +219,8 @@ const ChapterRegenerationModal: React.FC<ChapterRegenerationModalProps> = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<Modal
|
||||
title={`重新生成章节 - 第${chapterNumber}章:${chapterTitle}`}
|
||||
open={visible}
|
||||
@@ -387,6 +391,7 @@ const ChapterRegenerationModal: React.FC<ChapterRegenerationModalProps> = ({
|
||||
title="重新生成章节"
|
||||
/>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ export const CharacterCareerCard: React.FC<Props> = ({
|
||||
const [mainForm] = Form.useForm();
|
||||
const [subForm] = Form.useForm();
|
||||
const [progressForm] = Form.useForm();
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
|
||||
useEffect(() => {
|
||||
fetchCharacterCareers();
|
||||
@@ -149,9 +150,10 @@ export const CharacterCareerCard: React.FC<Props> = ({
|
||||
};
|
||||
|
||||
const handleRemoveSubCareer = (careerId: string) => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '确定要移除这个副职业吗?',
|
||||
centered: true,
|
||||
onOk: async () => {
|
||||
try {
|
||||
await axios.delete(
|
||||
@@ -237,6 +239,7 @@ export const CharacterCareerCard: React.FC<Props> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<Card
|
||||
title={
|
||||
<Space>
|
||||
|
||||
@@ -39,6 +39,7 @@ export default function Careers() {
|
||||
const [editingCareer, setEditingCareer] = useState<Career | null>(null);
|
||||
const [form] = Form.useForm();
|
||||
const [aiForm] = Form.useForm();
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
|
||||
// AI生成状态
|
||||
const [aiGenerating, setAiGenerating] = useState(false);
|
||||
@@ -129,9 +130,10 @@ export default function Careers() {
|
||||
};
|
||||
|
||||
const handleDelete = async (id: string) => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '确定要删除这个职业吗?如果有角色使用了该职业,将无法删除。',
|
||||
centered: true,
|
||||
onOk: async () => {
|
||||
try {
|
||||
await api.delete(`/careers/${id}`);
|
||||
@@ -264,6 +266,8 @@ export default function Careers() {
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<div style={{
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
@@ -424,5 +428,6 @@ export default function Careers() {
|
||||
onCancel={() => setAiGenerating(false)}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -113,9 +113,10 @@ export default function MCPPluginsPage() {
|
||||
};
|
||||
|
||||
const handleDelete = (plugin: MCPPlugin) => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: '删除插件',
|
||||
content: `确定要删除插件 "${plugin.display_name || plugin.plugin_name}" 吗?`,
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
okType: 'danger',
|
||||
|
||||
@@ -43,6 +43,7 @@ export default function Relationships() {
|
||||
const [isEditMode, setIsEditMode] = useState(false);
|
||||
const [editingRelationship, setEditingRelationship] = useState<Relationship | null>(null);
|
||||
const [form] = Form.useForm();
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
const [isMobile, setIsMobile] = useState(window.innerWidth <= 768);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
@@ -149,7 +150,7 @@ export default function Relationships() {
|
||||
};
|
||||
|
||||
const handleDeleteRelationship = async (id: string) => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: '确认删除',
|
||||
content: '确定要删除这条关系吗?',
|
||||
centered: true,
|
||||
@@ -304,6 +305,8 @@ export default function Relationships() {
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<div>
|
||||
<Card
|
||||
title={
|
||||
@@ -523,5 +526,6 @@ export default function Relationships() {
|
||||
</Form>
|
||||
</Modal>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -107,9 +107,10 @@ export default function SettingsPage() {
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: '重置设置',
|
||||
content: '确定要重置为默认值吗?',
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
@@ -127,9 +128,10 @@ export default function SettingsPage() {
|
||||
};
|
||||
|
||||
const handleDelete = () => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: '删除设置',
|
||||
content: '确定要删除所有设置吗?此操作不可恢复。',
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
okType: 'danger',
|
||||
|
||||
Reference in New Issue
Block a user