11
This commit is contained in:
90
src/components/workflow/VideoLinkDialog.vue
Normal file
90
src/components/workflow/VideoLinkDialog.vue
Normal file
@@ -0,0 +1,90 @@
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useWorkflowStore, executeVideoRewrite } from "../../stores/workflow.js";
|
||||
|
||||
const workflow = useWorkflowStore();
|
||||
const { videoLinkModalVisible, videoShareText, videoRewriting } = storeToRefs(workflow);
|
||||
|
||||
const feedback = ref({ severity: "", message: "" });
|
||||
|
||||
const tipItems = [
|
||||
"已支持抖音分享文本、抖音视频链接、抖音短链接",
|
||||
"支持直接视频文件 URL(如 .mp4、.mov 等)",
|
||||
"快手、小红书、B站、视频号分享链接目前会提示暂不支持",
|
||||
"使用 FUNASR 进行语音识别",
|
||||
"根据设置的仿写提示词生成仿写文案",
|
||||
];
|
||||
|
||||
function onCancel() {
|
||||
feedback.value = { severity: "", message: "" };
|
||||
workflow.videoLinkModalVisible = false;
|
||||
}
|
||||
|
||||
async function onRewrite() {
|
||||
feedback.value = { severity: "", message: "" };
|
||||
const result = await executeVideoRewrite(workflow);
|
||||
if (!result.ok) {
|
||||
feedback.value = { severity: "error", message: result.message };
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog
|
||||
v-model:visible="videoLinkModalVisible"
|
||||
modal
|
||||
header="粘贴视频分享文本 - 快速仿写"
|
||||
:style="{ width: '600px' }"
|
||||
:draggable="false"
|
||||
class="ip-brain-dialog"
|
||||
>
|
||||
<div class="space-y-4">
|
||||
<Message
|
||||
v-if="feedback.message"
|
||||
:severity="feedback.severity"
|
||||
:closable="false"
|
||||
class="w-full"
|
||||
>
|
||||
{{ feedback.message }}
|
||||
</Message>
|
||||
|
||||
<div>
|
||||
<label class="mb-2 block font-medium text-slate-200">
|
||||
请粘贴视频分享文本或视频链接
|
||||
</label>
|
||||
<p class="mb-2 text-xs text-slate-500">
|
||||
支持抖音分享文本、抖音视频链接、抖音短链接,以及直接视频文件链接
|
||||
</p>
|
||||
<InputText
|
||||
v-model="videoShareText"
|
||||
type="text"
|
||||
size="large"
|
||||
class="w-full"
|
||||
placeholder="请输入分享文本、视频链接,或 mp4/mov/webm 等直链..."
|
||||
:disabled="videoRewriting"
|
||||
@keyup.enter="onRewrite"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="elegant-tip-box rounded-lg p-3">
|
||||
<div class="text-sm text-slate-300">
|
||||
<div class="mb-1 font-medium">提示:</div>
|
||||
<ul class="list-inside list-disc space-y-1">
|
||||
<li v-for="(tip, i) in tipItems" :key="i">{{ tip }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<Button
|
||||
label="取消"
|
||||
severity="secondary"
|
||||
:disabled="videoRewriting"
|
||||
@click="onCancel"
|
||||
/>
|
||||
<Button label="一键仿写" :loading="videoRewriting" @click="onRewrite" />
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
Reference in New Issue
Block a user