mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-07-06 23:21:22 +08:00
refactor(HomePage): 优化笔记表单提交状态显示
- 修改 isGenerating 函数逻辑,增加对任务状态的判断 - 在 onSubmit 函数中添加成功提交任务的提示信息
This commit is contained in:
@@ -156,7 +156,7 @@ const NoteForm = () => {
|
|||||||
}
|
}
|
||||||
const isGenerating = () => {
|
const isGenerating = () => {
|
||||||
console.log('🚀 isGenerating', getCurrentTask()?.status)
|
console.log('🚀 isGenerating', getCurrentTask()?.status)
|
||||||
return getCurrentTask()?.status === 'PENDING'
|
return getCurrentTask()?.status != 'SUCCESS' && getCurrentTask()?.status != 'FAILED' && getCurrentTask()?.status != undefined
|
||||||
}
|
}
|
||||||
const handleFileUpload = async (file: File, onSuccess: (url: string) => void) => {
|
const handleFileUpload = async (file: File, onSuccess: (url: string) => void) => {
|
||||||
if (!file) return
|
if (!file) return
|
||||||
@@ -179,6 +179,8 @@ const NoteForm = () => {
|
|||||||
// TODO 修复选择其他视频平台以后再选择本地视频还可以选择 Link 的问题
|
// TODO 修复选择其他视频平台以后再选择本地视频还可以选择 Link 的问题
|
||||||
const onSubmit = async (data: NoteFormValues) => {
|
const onSubmit = async (data: NoteFormValues) => {
|
||||||
console.log('🎯 提交内容:', data)
|
console.log('🎯 提交内容:', data)
|
||||||
|
message.success('提交任务')
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
video_url: data.video_url,
|
video_url: data.video_url,
|
||||||
platform: data.platform,
|
platform: data.platform,
|
||||||
|
|||||||
Reference in New Issue
Block a user