+
{selectedContent && selectedContent !== 'loading' && selectedContent !== 'empty' ? (
<>
{showChat === 'full' && currentTask ? (
@@ -497,36 +509,53 @@ const MarkdownViewer: FC = memo(({ status }) => {
) : (
- <>
-
-
-
-
-
-
- {selectedContent.replace(/^>\s*来源链接:[^\n]*\n*/m, '')}
-
-
-
- {showTranscribe && (
-
-
-
- )}
- {/* 侧边问答模式:markdown + ChatPanel 各占一半 */}
- {showChat === 'half' && currentTask && (
-
-
-
- )}
- >
+ <>
+
+
+
+
+
+
+ {selectedContent.replace(/^>\s*来源链接:[^\n]*\n*/m, '')}
+
+
+
+ {showTranscribe && (
+
+
+ 原文参照
+
+
+
+
+
+
+ )}
+ {/* 侧边问答模式:markdown + ChatPanel 各占一半 */}
+ {showChat === 'half' && currentTask && (
+
+
+
+ )}
+ >
)}
>
) : (
diff --git a/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx b/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx
index 9e9cbfa5..24645e07 100644
--- a/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx
+++ b/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx
@@ -7,8 +7,8 @@ import {
FormLabel,
FormMessage,
} from '@/components/ui/form.tsx'
-import { useEffect,useState } from 'react'
-import { useForm, useWatch } from 'react-hook-form'
+import { useEffect, useState } from 'react'
+import { type FieldErrors, useForm, useWatch } from 'react-hook-form'
import { zodResolver } from '@hookform/resolvers/zod'
import { z } from 'zod'
@@ -25,7 +25,6 @@ import {
TooltipTrigger,
} from '@/components/ui/tooltip.tsx'
import { Checkbox } from '@/components/ui/checkbox.tsx'
-import { ScrollArea } from '@/components/ui/scroll-area.tsx'
import { Button } from '@/components/ui/button.tsx'
import {
Select,
@@ -37,7 +36,6 @@ import {
import { Input } from '@/components/ui/input.tsx'
import { Textarea } from '@/components/ui/textarea.tsx'
import { noteStyles, noteFormats, videoPlatforms } from '@/constant/note.ts'
-import { fetchModels } from '@/services/model.ts'
import { useNavigate } from 'react-router-dom'
import toast from 'react-hot-toast'
@@ -65,18 +63,14 @@ const formSchema = z
if (!video_url) {
ctx.addIssue({ code: 'custom', message: '本地视频路径不能为空', path: ['video_url'] })
}
- }
- else {
+ } else {
if (!video_url) {
ctx.addIssue({ code: 'custom', message: '视频链接不能为空', path: ['video_url'] })
- }
- else {
+ } else {
try {
const url = new URL(video_url)
- if (!['http:', 'https:'].includes(url.protocol))
- throw new Error()
- }
- catch {
+ if (!['http:', 'https:'].includes(url.protocol)) throw new Error()
+ } catch {
ctx.addIssue({ code: 'custom', message: '请输入正确的视频链接', path: ['video_url'] })
}
}
@@ -111,7 +105,7 @@ const CheckboxGroup = ({
onChange: (v: string[]) => void
disabledMap: Record
}) => (
-
+
{noteFormats.map(({ label, value: v }) => (