Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ai_fundub
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
ai_fundub
Commits
a81536e1
Commit
a81536e1
authored
Jan 20, 2026
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
9cf2f743
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
35 deletions
+111
-35
index.css
form/index.css
+5
-0
index.html
form/index.html
+77
-30
index.js
form/index.js
+29
-5
No files found.
form/index.css
View file @
a81536e1
...
@@ -265,6 +265,11 @@
...
@@ -265,6 +265,11 @@
margin-right
:
4px
;
margin-right
:
4px
;
}
}
/* 提示包裹,保证禁用按钮仍可触发 tooltip */
.disabled-tip
{
display
:
inline-block
;
}
/* 卡片悬停效果 */
/* 卡片悬停效果 */
.upload-section
,
.upload-section
,
.video-section
,
.video-section
,
...
...
form/index.html
View file @
a81536e1
...
@@ -39,8 +39,16 @@
...
@@ -39,8 +39,16 @@
<el-button
type=
"primary"
icon=
"el-icon-upload"
>
上传视频
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-upload"
>
上传视频
</el-button>
</el-upload>
</el-upload>
<el-button
v-if=
"videoUrl"
type=
"warning"
icon=
"el-icon-refresh"
@
click=
"confirmReupload"
>
重新上传
</el-button>
<el-button
v-if=
"videoUrl"
type=
"warning"
icon=
"el-icon-refresh"
@
click=
"confirmReupload"
>
重新上传
</el-button>
<el-tooltip
:content=
"isAnyTaskRunning() ? '有任务进行中,完成后可操作' : ''"
:disabled=
"!isAnyTaskRunning()"
placement=
"top"
>
<span
class=
"disabled-tip"
>
<el-button
v-if=
"videoUrl"
type=
"primary"
@
click=
"generateSubtitles"
:disabled=
"isAnyTaskRunning()"
>
{{ subtitlesResult ? '重新生成字幕' : '生成字幕' }}
</el-button>
<el-button
v-if=
"videoUrl"
type=
"primary"
@
click=
"generateSubtitles"
:disabled=
"isAnyTaskRunning()"
>
{{ subtitlesResult ? '重新生成字幕' : '生成字幕' }}
</el-button>
</span>
</el-tooltip>
<el-tooltip
:content=
"isAnyTaskRunning() ? '有任务进行中,完成后可操作' : ''"
:disabled=
"!isAnyTaskRunning()"
placement=
"top"
>
<span
class=
"disabled-tip"
>
<el-button
v-if=
"videoUrl"
type=
"success"
@
click=
"removeVocals"
:disabled=
"isAnyTaskRunning()"
>
AI去除人声
</el-button>
<el-button
v-if=
"videoUrl"
type=
"success"
@
click=
"removeVocals"
:disabled=
"isAnyTaskRunning()"
>
AI去除人声
</el-button>
</span>
</el-tooltip>
<!-- 上传进度条 -->
<!-- 上传进度条 -->
<div
v-if=
"uploading"
class=
"upload-progress"
>
<div
v-if=
"uploading"
class=
"upload-progress"
>
...
@@ -69,28 +77,53 @@
...
@@ -69,28 +77,53 @@
</video>
</video>
</div>
</div>
<!-- 任务状态看板(统一:字幕/去人声 共用) -->
<!-- 任务状态看板(分开显示:字幕 / 去人声) -->
<div
class=
"task-board"
v-if=
"task_uuid || vocalTaskUuid"
style=
"max-width:800px;margin-top:16px;"
>
<div
class=
"task-boards"
v-if=
"task_uuid || subtitlePollTimer || vocalTaskUuid || vocalPollTimer"
style=
"display:flex; gap:16px; flex-wrap:wrap; max-width: 90%; margin-top:16px;"
>
<!-- 字幕任务状态 -->
<div
style=
"flex:1; min-width:320px;"
v-if=
"task_uuid || subtitlePollTimer"
>
<el-card
shadow=
"hover"
>
<el-card
shadow=
"hover"
>
<div
slot=
"header"
class=
"card-header"
>
<div
slot=
"header"
class=
"card-header"
>
<div
class=
"card-header__title"
>
<div
class=
"card-header__title"
>
<i
class=
"el-icon-time
"
></i>
<i
class=
"el-icon-document
"
></i>
<span>
任务状态
</span>
<span>
字幕
任务状态
</span>
</div>
</div>
<div
class=
"card-header__actions"
>
<div
class=
"card-header__actions"
>
<el-tag
v-if=
"getCurrentTaskUuid()"
size=
"mini"
type=
"info"
>
进行中
</el-tag>
<el-tag
size=
"mini"
type=
"info"
>
进行中
</el-tag>
</div>
</div>
</div>
</div>
<div
class=
"board-row"
style=
"margin-bottom:8px;"
>
<div
class=
"board-row"
style=
"margin-bottom:8px;"
>
<span
style=
"color:#909399;"
>
任务UUID:
</span>
<span
style=
"color:#909399;"
>
任务UUID:
</span>
<span>
{{ getCurrentTaskUuid()
|| '—' }}
</span>
<span>
{{ task_uuid
|| '—' }}
</span>
</div>
</div>
<div
class=
"board-row"
>
<div
class=
"board-row"
>
<span
style=
"color:#909399;"
>
状态与进度:
</span>
<span
style=
"color:#909399;"
>
状态与进度:
</span>
<span>
{{ getCurrentLoadingText()
|| '—' }}
</span>
<span>
{{ loadingText
|| '—' }}
</span>
</div>
</div>
</el-card>
</el-card>
</div>
</div>
<!-- 去人声任务状态 -->
<div
style=
"flex:1; min-width:320px;"
v-if=
"vocalTaskUuid || vocalPollTimer"
>
<el-card
shadow=
"hover"
>
<div
slot=
"header"
class=
"card-header"
>
<div
class=
"card-header__title"
>
<i
class=
"el-icon-headset"
></i>
<span>
去人声任务状态
</span>
</div>
<div
class=
"card-header__actions"
>
<el-tag
size=
"mini"
type=
"info"
>
进行中
</el-tag>
</div>
</div>
<div
class=
"board-row"
style=
"margin-bottom:8px;"
>
<span
style=
"color:#909399;"
>
任务UUID:
</span>
<span>
{{ vocalTaskUuid || '—' }}
</span>
</div>
<div
class=
"board-row"
>
<span
style=
"color:#909399;"
>
状态与进度:
</span>
<span>
{{ vocalLoadingText || '—' }}
</span>
</div>
</el-card>
</div>
</div>
<!-- 结果区:同排展示两个结果卡片 -->
<!-- 结果区:同排展示两个结果卡片 -->
<div
class=
"results-row"
v-if=
"subtitlesResult || vocalResult"
style=
"display:flex; gap:16px; flex-wrap:wrap; width: 90%; margin-top:16px;"
>
<div
class=
"results-row"
v-if=
"subtitlesResult || vocalResult"
style=
"display:flex; gap:16px; flex-wrap:wrap; width: 90%; margin-top:16px;"
>
...
@@ -108,13 +141,18 @@
...
@@ -108,13 +141,18 @@
size=
"mini"
size=
"mini"
type=
"success"
type=
"success"
>
已完成
</el-tag>
>
已完成
</el-tag>
<el-tooltip
:content=
"isAnyTaskRunning() ? '有任务进行中,完成后可操作' : ''"
:disabled=
"!isAnyTaskRunning()"
placement=
"top"
>
<span
class=
"disabled-tip"
>
<el-button
<el-button
v-if=
"subtitlesResult && subtitlesResult.subtitleJsonUrl && subtitlesResult.translatedJsonUrl"
v-if=
"subtitlesResult && subtitlesResult.subtitleJsonUrl && subtitlesResult.translatedJsonUrl"
:disabled=
"isAnyTaskRunning()"
size=
"mini"
size=
"mini"
type=
"primary"
type=
"primary"
icon=
"el-icon-edit"
icon=
"el-icon-edit"
@
click=
"openSubtitleEditor"
@
click=
"openSubtitleEditor"
>
字幕编辑
</el-button>
>
字幕编辑
</el-button>
</span>
</el-tooltip>
</div>
</div>
</div>
</div>
<div>
<div>
...
@@ -182,10 +220,19 @@
...
@@ -182,10 +220,19 @@
content=
"字幕编辑器"
>
content=
"字幕编辑器"
>
</el-page-header>
</el-page-header>
</span>
</span>
<div
v-loading=
"subtitleEditorLoading"
>
<div
v-loading=
"subtitleEditorLoading || isAnyTaskRunning()"
:element-loading-text=
"isAnyTaskRunning() ? '任务进行中,编辑已锁定' : ''"
element-loading-spinner=
"el-icon-loading"
element-loading-background=
"rgba(255, 255, 255, 0.5)"
>
<div
style=
"margin-bottom:12px;"
>
<div
style=
"margin-bottom:12px;"
>
<!-- <el-button type="primary" size="mini" @click="applyEditorChanges">保存修改</el-button> -->
<!-- <el-button type="primary" size="mini" @click="applyEditorChanges">保存修改</el-button> -->
<el-button
type=
"primary"
size=
"mini"
@
click=
"overwriteAndRegenerateLyrics"
>
覆盖上传并重新生成歌词
</el-button>
<el-tooltip
:content=
"isAnyTaskRunning() ? '有任务进行中,完成后可操作' : ''"
:disabled=
"!isAnyTaskRunning()"
placement=
"top"
>
<span
class=
"disabled-tip"
>
<el-button
type=
"primary"
size=
"mini"
:disabled=
"isAnyTaskRunning()"
@
click=
"overwriteAndRegenerateLyrics"
>
覆盖上传并重新生成歌词
</el-button>
</span>
</el-tooltip>
</div>
</div>
<div
v-if=
"subtitleEditor && subtitleEditor.mergedList"
>
<div
v-if=
"subtitleEditor && subtitleEditor.mergedList"
>
<el-timeline>
<el-timeline>
...
...
form/index.js
View file @
a81536e1
...
@@ -460,10 +460,21 @@ function initVueApp(savedData) {
...
@@ -460,10 +460,21 @@ function initVueApp(savedData) {
this
.
uploading
=
false
;
this
.
uploading
=
false
;
this
.
uploadProgress
=
100
;
this
.
uploadProgress
=
100
;
// await this.deepCheckUtilHave(res);
// await this.deepCheckUtilHave(res);
// 清理上一次任务与结果,准备并行新任务
this
.
stopSubtitlePolling
&&
this
.
stopSubtitlePolling
();
this
.
stopVocalPolling
&&
this
.
stopVocalPolling
();
this
.
task_uuid
=
''
;
this
.
vocalTaskUuid
=
''
;
this
.
subtitlesResult
=
null
;
this
.
vocalResult
=
null
;
this
.
loadingText
=
''
;
this
.
vocalLoadingText
=
''
;
this
.
videoUrl
=
res
;
this
.
videoUrl
=
res
;
this
.
$message
.
success
(
'
视频上传成功!
'
);
this
.
$message
.
success
(
'
视频上传成功!
'
);
this
.
saveData
();
this
.
saveData
();
// 自动并行触发两个任务
this
.
generateSubtitles
();
this
.
removeVocals
();
}
}
});
});
// 开始上传,显示进度条
// 开始上传,显示进度条
...
@@ -498,6 +509,15 @@ function initVueApp(savedData) {
...
@@ -498,6 +509,15 @@ function initVueApp(savedData) {
this
.
uploading
=
false
;
this
.
uploading
=
false
;
this
.
uploadProgress
=
0
;
this
.
uploadProgress
=
0
;
this
.
playbackRate
=
1
;
// 重置播放速度
this
.
playbackRate
=
1
;
// 重置播放速度
// 同时清理任务/结果与轮询,避免重新上传后阻塞或误判
this
.
stopSubtitlePolling
&&
this
.
stopSubtitlePolling
();
this
.
stopVocalPolling
&&
this
.
stopVocalPolling
();
this
.
task_uuid
=
''
;
this
.
vocalTaskUuid
=
''
;
this
.
subtitlesResult
=
null
;
this
.
vocalResult
=
null
;
this
.
loadingText
=
''
;
this
.
vocalLoadingText
=
''
;
// 保存重置后的数据
// 保存重置后的数据
this
.
saveData
();
this
.
saveData
();
// 触发文件选择
// 触发文件选择
...
@@ -517,8 +537,8 @@ function initVueApp(savedData) {
...
@@ -517,8 +537,8 @@ function initVueApp(savedData) {
this
.
$message
.
warning
(
'
请先上传或选择视频
'
);
this
.
$message
.
warning
(
'
请先上传或选择视频
'
);
return
;
return
;
}
}
if
(
this
.
task_uuid
||
this
.
vocalTaskUuid
)
{
if
(
this
.
task_uuid
)
{
this
.
$message
.
warning
(
'
有任务正在处理中,请等待完成后再试
'
);
this
.
$message
.
warning
(
'
字幕任务正在处理中,请稍候
'
);
return
;
return
;
}
}
if
(
this
.
subtitlesResult
!=
null
)
{
if
(
this
.
subtitlesResult
!=
null
)
{
...
@@ -572,8 +592,8 @@ function initVueApp(savedData) {
...
@@ -572,8 +592,8 @@ function initVueApp(savedData) {
this
.
$message
.
warning
(
'
请先上传或选择视频
'
);
this
.
$message
.
warning
(
'
请先上传或选择视频
'
);
return
;
return
;
}
}
if
(
this
.
vocalTaskUuid
||
this
.
task_uuid
)
{
if
(
this
.
vocalTaskUuid
)
{
this
.
$message
.
warning
(
'
有任务正在处理中,请等待完成后再试
'
);
this
.
$message
.
warning
(
'
去人声任务正在处理中,请稍候
'
);
return
;
return
;
}
}
if
(
this
.
vocalResult
!=
null
)
{
if
(
this
.
vocalResult
!=
null
)
{
...
@@ -620,6 +640,10 @@ function initVueApp(savedData) {
...
@@ -620,6 +640,10 @@ function initVueApp(savedData) {
// 打开字幕编辑器
// 打开字幕编辑器
async
openSubtitleEditor
()
{
async
openSubtitleEditor
()
{
if
(
this
.
isAnyTaskRunning
())
{
this
.
$message
.
warning
(
'
有任务正在处理中,暂不可编辑字幕
'
);
return
;
}
if
(
!
this
.
subtitlesResult
||
!
this
.
subtitlesResult
.
subtitleJsonUrl
||
!
this
.
subtitlesResult
.
translatedJsonUrl
)
{
if
(
!
this
.
subtitlesResult
||
!
this
.
subtitlesResult
.
subtitleJsonUrl
||
!
this
.
subtitlesResult
.
translatedJsonUrl
)
{
this
.
$message
.
warning
(
'
暂无可编辑的字幕数据
'
);
this
.
$message
.
warning
(
'
暂无可编辑的字幕数据
'
);
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment