feat: course generation

This commit is contained in:
2024-08-08 18:04:48 +08:00
parent d3c43558fd
commit 24629f8720
22 changed files with 605 additions and 679 deletions

View File

@@ -16,15 +16,21 @@ const props = defineProps({
</script>
<template>
<div class="relative font-sans select-none">
<h1
v-if="subtitle"
class="text-base text-neutral-300 italic tracking-wide font-black leading-none"
>{{ subtitle }}</h1>
<div class="relative font-sans select-none flex justify-between items-center">
<div>
<h1
v-if="subtitle"
class="text-base text-neutral-300 italic tracking-wide font-black leading-none"
>{{ subtitle }}</h1>
<h1 class="text-xl font-bold text-neutral-700 leading-none relative z-[1]">
{{ title }}
</h1>
<h1 class="text-xl font-bold text-neutral-700 leading-none relative z-[1]">
{{ title }}
</h1>
</div>
<div class="flex gap-2">
<slot name="action"/>
</div>
<div
v-if="bubble"

View File

@@ -14,27 +14,27 @@ const props = defineProps({
const emit = defineEmits({
close: () => true,
select: (value: DigitalHumanItem) => value,
select: (digitalHumans: DigitalHumanItem | DigitalHumanItem[]) => digitalHumans,
})
const loginState = useLoginState()
const modal = useModal()
const toast = useToast()
const page = ref(1)
const selectedDigitalHumans = ref<DigitalHumanItem[]>([])
const handleSelectClick = (item: DigitalHumanItem) => {
if (props.multiple) {
if (selectedDigitalHumans.value.includes(item)) {
selectedDigitalHumans.value = selectedDigitalHumans.value.filter(d => d !== item)
} else {
selectedDigitalHumans.value.push(item)
}
// 如果点击的项目已经在已选列表中,则移除;否则添加
if (selectedDigitalHumans.value.includes(item)) {
selectedDigitalHumans.value = selectedDigitalHumans.value.filter(d => d !== item)
} else {
selectedDigitalHumans.value = [item]
selectedDigitalHumans.value = props.multiple ? [...selectedDigitalHumans.value, item] : [item]
}
}
const handleClose = () => {
selectedDigitalHumans.value = []
if (props.isOpen) {
emit('close')
} else {
@@ -42,15 +42,33 @@ const handleClose = () => {
}
}
const handleSubmit = () => {
if (selectedDigitalHumans.value.length === 0) {
toast.add({
title: '请选择数字人',
description: '请至少选择一个数字人',
color: 'red',
icon: 'i-tabler-circle-x',
})
return
}
emit('select', props.multiple ? selectedDigitalHumans.value : selectedDigitalHumans.value[0])
handleClose()
setTimeout(() => {
page.value = 1
}, 300)
}
const tabItems = [{
key: 'user',
label: '用户数字人',
label: '我的数字人',
icon: 'i-tabler-user',
}, {
key: 'system',
label: '系统数字人',
icon: 'i-tabler-user-star',
}]
const tabIndex = ref(0)
watch(tabIndex, () => {
page.value = 1
})
const {
data: userDigitalList,
@@ -62,23 +80,12 @@ const {
token: loginState.token!,
user_id: loginState.user.id,
to_user_id: loginState.user.id,
page: 1,
perpage: 20,
page: page.value,
perpage: 15,
},
),
{
transform: res => {
if (res.ret !== 200) {
toast.add({
title: '获取数字人列表失败',
description: res.msg || '未知错误',
color: 'red',
icon: 'i-tabler-circle-x',
})
return []
}
return res?.data.items || []
},
watch: [page],
},
)
@@ -92,23 +99,12 @@ const {
token: loginState.token!,
user_id: loginState.user.id,
to_user_id: loginState.user.id,
page: 1,
perpage: 20,
page: page.value,
perpage: 15,
},
),
{
transform: res => {
if (res.ret !== 200) {
toast.add({
title: '获取系统数字人列表失败',
description: res.msg || '未知错误',
color: 'red',
icon: 'i-tabler-circle-x',
})
return []
}
return res?.data.items || []
},
watch: [page],
},
)
</script>
@@ -116,7 +112,7 @@ const {
<template>
<UModal
:model-value="isOpen"
:ui="{ width: 'w-full sm:max-w-4xl' }"
:ui="{ width: 'w-full sm:max-w-3xl' }"
@close="handleClose"
>
<UCard :ui="{ ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
@@ -136,30 +132,49 @@ const {
</template>
<UTabs
:items="tabItems"
:items="[
...tabItems,
loginState.user.auth_code === 2 ? {
key: 'system',
label: '系统数字人',
icon: 'i-tabler-user-star',
} : null
].filter(Boolean)"
@change="i => tabIndex = i"
>
<template #item="{ item }">
<div v-if="item.key === 'user'" class="w-full grid grid-cols-2 sm:grid-cols-4 gap-4">
<div class="w-full grid grid-cols-3 sm:grid-cols-5 gap-4">
<div
v-for="(d, i) in userDigitalList"
:key="`user-digital-${d.model_id}`" class="relative overflow-hidden w-full aspect-[10/16] bg-white rounded-md shadow-md transition-all ring-2 ring-primary-400"
v-for="(d, i) in item.key === 'user' ? userDigitalList?.data.items : systemDigitalList?.data.items"
:key="`${item.key === 'user' ? 'user' : 'system'}-digital-${d.model_id}`"
:class="{'border-primary shadow-md': selectedDigitalHumans.includes(d)}"
class="relative flex flex-col justify-center items-center gap-2 overflow-hidden w-full bg-white rounded-md border cursor-pointer transition-all duration-150 select-none"
@click="handleSelectClick(d)"
>
<div class="absolute w-full h-full -top-[35%] -left-[15%] rotate-[60deg] bg-primary-400"></div>
<div class="absolute left-0 bottom-[44%] rotate-[-30deg]">
<span class="text-xs text-white font-semibold">{{ d.description }}</span>
<div
:class="{'bg-primary-50': selectedDigitalHumans.includes(d)}"
class="relative bg-neutral-100 border-b w-full aspect-square object-cover overflow-hidden transition-all duration-150"
>
<NuxtImg :src="d.avatar" class="-translate-y-4"/>
<UIcon v-if="selectedDigitalHumans.includes(d)" class="absolute top-1 right-1 text-lg text-primary"
name="i-tabler-check"/>
</div>
<div class="absolute left-1 bottom-[34%] rotate-[-30deg]">
<span class="text-lg text-primary font-semibold">{{ d.name }}</span>
<div class="w-full flex flex-col gap-1 px-2 pb-2">
<div class="flex justify-between items-center">
<span class="text-sm text-neutral-800 font-medium line-clamp-1">{{ d.name }}</span>
<span class="text-xs text-neutral-300 font-medium">ID:{{ d.digital_human_id || d.id }}</span>
</div>
</div>
<div class="absolute left-0 bottom-0 rounded-tr bg-primary-400 px-1 pb-1">
<span class="text-xs text-white leading-none font-black">·SELECTED·</span>
</div>
<NuxtImg :src="d.avatar" class="absolute bottom-0 -right-7 h-full"/>
</div>
</div>
<div v-if="item.key === 'system'">
system
<div class="flex justify-end">
<UPagination
v-if="(item.key === 'user' ? (userDigitalList?.data.total || 0) : (systemDigitalList?.data.total || 0)) > 0"
v-model="page"
:page-count="15"
:total="item.key === 'user' ? (userDigitalList?.data.total || 0) : (systemDigitalList?.data.total || 0)"
class="pt-4"
/>
</div>
</template>
</UTabs>
@@ -167,7 +182,7 @@ const {
<template #footer>
<div class="flex justify-between items-center">
<div>
<p class="text-xs font-medium opacity-50">
<p class="text-xs font-medium opacity-50 select-none">
如果没有出现您的数字人请联系管理员开通
</p>
</div>
@@ -181,8 +196,8 @@ const {
<UButton
color="primary"
label="选择"
type="submit"
variant="solid"
@click="handleSubmit"
/>
</div>
</div>

View File

@@ -0,0 +1,240 @@
<script lang="ts" setup>
import FileDnD from '~/components/uni/FileDnD/index.vue'
import { type InferType, number, object, string } from 'yup'
import ModalDigitalHumanSelect from '~/components/ModalDigitalHumanSelect.vue'
import type { FormSubmitEvent } from '#ui/types'
import { useFetchWrapped } from '~/composables/useFetchWrapped'
const emit = defineEmits(['success'])
const slide = useSlideover()
const toast = useToast()
const loginState = useLoginState()
const creationForm = ref<HTMLFormElement>()
const creationPending = ref(false)
const isDigitalSelectorOpen = ref(false)
const createCourseSchema = object({
task_title: string().trim().min(4, '标题必须大于4个字符').max(20, '标题不能超过20个字符').required('请输入微课标题'),
digital_human_id: number().not([0], '请选择数字人'),
gen_server: string().required(),
speed: number().default(1.0).min(0.5).max(1.5).required(),
})
type CreateCourseSchema = InferType<typeof createCourseSchema>
const createCourseState = reactive({
task_title: undefined,
digital_human_id: 0,
gen_server: 'main',
speed: 1.0,
})
const selected_file = ref<File[] | null>(null)
const selected_digital_human = ref<DigitalHumanItem | null>(null)
watchEffect(() => {
if (selected_digital_human.value) {
createCourseState.digital_human_id = selected_digital_human.value.model_id || selected_digital_human.value.id!
}
})
const onCreateCourseSubmit = async (event: FormSubmitEvent<CreateCourseSchema>) => {
console.log(event.data)
if (!selected_file.value) {
toast.add({
title: '未选择文件',
description: '请先选择 PPTX 文件',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
return
}
creationPending.value = true
// upload PPTX file
useFileGo(selected_file.value[0]).then(url => {
useFetchWrapped<req.gen.CourseGenCreate & AuthedRequest, BaseResponse<resp.gen.CourseGenCreate>>('App.Digital_Convert.Create', {
token: loginState.token!,
user_id: loginState.user.id,
task_title: event.data.task_title,
gen_server: event.data.gen_server as 'main' | 'standby1',
speed: 2 - event.data.speed,
ppt_url: url,
digital_human_id: event.data.digital_human_id,
custom_video: '[]',
opening_url: '',
ending_url: '',
}).then(res => {
if (res.data.record_status === 1) {
toast.add({
title: '创建成功',
description: '已加入生成队列',
color: 'green',
icon: 'i-tabler-check',
})
emit('success')
slide.close()
} else {
toast.add({
title: '创建失败',
description: res.msg || '未知错误',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
}
creationPending.value = false
}).catch(e => {
creationPending.value = false
toast.add({
title: '创建失败',
description: e.message || '未知错误',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
})
})
}
</script>
<template>
<USlideover prevent-close>
<UCard
:ui="{ body: { base: 'flex-1' }, ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }"
class="flex flex-col flex-1"
>
<template #header>
<div class="flex items-center justify-between">
<h3 class="text-base font-semibold leading-6 text-gray-900 dark:text-white">
新建微课视频
</h3>
<UButton
class="-my-1"
color="gray"
icon="i-tabler-x"
variant="ghost"
@click="slide.close()"
/>
</div>
</template>
<UForm
ref="creationForm"
:schema="createCourseSchema"
:state="createCourseState"
class="space-y-4"
@submit="onCreateCourseSubmit"
>
<div class="flex justify-between gap-2 *:flex-1">
<UFormGroup label="微课标题" name="task_title" required>
<UInput v-model="createCourseState.task_title" placeholder="请输入微课标题"/>
</UFormGroup>
</div>
<div class="grid grid-cols-2 gap-2">
<UFormGroup label="数字人" name="digital_human_id" required>
<div
:class="{'shadow-inner': !!selected_digital_human}"
class="flex items-center gap-2 bg-neutral-100 p-2 rounded-md cursor-pointer select-none transition-all"
@click="isDigitalSelectorOpen = true"
>
<div class="w-12 aspect-square border rounded-md flex justify-center items-center overflow-hidden">
<UIcon v-if="!selected_digital_human" class="text-2xl opacity-50" name="i-tabler-user-screen"/>
<NuxtImg v-else :src="selected_digital_human?.avatar"/>
</div>
<div class="flex flex-col text-neutral-400 text-sm font-medium">
<span :class="!!selected_digital_human ? 'text-neutral-600' : ''">{{
selected_digital_human?.name || '点击选择数字人'
}}</span>
<span v-if="selected_digital_human?.description" class="text-2xs">
{{ selected_digital_human?.description }}
</span>
</div>
</div>
</UFormGroup>
<UFormGroup label="视频片头片尾" name="opening">
<div
class="flex items-center gap-2 bg-neutral-100 p-2 rounded-md cursor-pointer select-none transition-all"
>
<div class="w-12 aspect-square border rounded-md flex justify-center items-center">
<UIcon class="text-2xl opacity-50" name="i-tabler-brackets-contain"/>
</div>
<div class="flex flex-col text-neutral-400 text-sm font-medium">
<span>点击选择</span>
</div>
</div>
</UFormGroup>
</div>
<UFormGroup label="PPT 文件" required>
<FileDnD
accept="application/vnd.openxmlformats-officedocument.presentationml.presentation"
@change="file => selected_file = file"
/>
</UFormGroup>
<UAccordion :items="[{label: '高级选项'}]" color="gray" size="lg">
<template #item>
<div class="border rounded-lg space-y-4 p-4 pb-6">
<UFormGroup label="生成线路" name="gen_server">
<USelectMenu
v-model="createCourseState.gen_server"
:options="[{
label: '主线路',
value: 'main',
}, {
label: '备用线路',
value: 'standby1',
}]"
option-attribute="label"
value-attribute="value"
/>
</UFormGroup>
<UFormGroup :label="`视频倍速:${createCourseState.speed}`" name="speed">
<URange
v-model="createCourseState.speed"
:max="1.5"
:min="0.5"
:step="0.1"
class="pt-4"
size="sm"
/>
</UFormGroup>
</div>
</template>
</UAccordion>
</UForm>
<template #footer>
<div class="flex justify-end space-x-4">
<UButton
color="gray"
label="取消"
size="lg"
variant="ghost"
@click="slide.close()"
/>
<UButton
:loading="creationPending"
color="primary"
label="提交"
size="lg"
variant="solid"
@click="creationForm?.submit()"
/>
</div>
</template>
</UCard>
<ModalDigitalHumanSelect
:is-open="isDigitalSelectorOpen"
@close="isDigitalSelectorOpen = false"
@select="digitalHumans => {
selected_digital_human = (digitalHumans as DigitalHumanItem)
}"
/>
</USlideover>
</template>
<style scoped>
</style>

View File

@@ -3,7 +3,6 @@ import type { PropType } from 'vue'
import dayjs from 'dayjs'
import { useDownload } from '~/composables/useDownload'
import gsap from 'gsap'
import SRTEditor from '~/components/aigc/course-generate/SRTEditor.vue'
const toast = useToast()
const { metaSymbol } = useShortcuts()
@@ -285,7 +284,7 @@ const copyTaskId = (extraMessage?: string) => {
/>
</UCard>
</UModal>
<SRTEditor
<LazyAigcCourseGenerateSRTEditor
ref="srtEditor"
:course="course"
/>

View File

@@ -1,308 +0,0 @@
<script lang="ts" setup>
import CGTaskCard from '~/components/aigc/course-generate/CGTaskCard.vue'
import FileDnD from '~/components/uni/FileDnD/index.vue'
import { useFetchWrapped } from '~/composables/useFetchWrapped'
import { type InferType, number, object, string } from 'yup'
import type { FormSubmitEvent } from '#ui/types'
import ModalAuthentication from '~/components/ModalAuthentication.vue'
const toast = useToast()
const modal = useModal()
const loginState = useLoginState()
const isCreateCourseModalOpen = ref(false)
const creationPending = ref(false)
const deletePending = ref(false)
const {
data: courseList,
pending: courseListPending,
refresh: refreshCourseList,
} = useAsyncData(
() => useFetchWrapped<
req.gen.CourseGenList & AuthedRequest,
BaseResponse<PagedData<resp.gen.CourseGenItem>>
>('App.Digital_Convert.GetList', {
token: loginState.token!,
user_id: loginState.user.id,
to_user_id: loginState.user.id,
page: 1,
perpage: 10,
}), {
transform: res => res?.data.items || [],
},
)
const onCreateCourseClick = () => {
isCreateCourseModalOpen.value = true
}
const createCourseSchema = object({
task_title: string().trim().min(4, '标题必须大于4个字符').max(20, '标题不能超过20个字符').required('请输入微课标题'),
gen_server: string().required(),
speed: number().default(1.0).min(0.5).max(1.5).required(),
})
type CreateCourseSchema = InferType<typeof createCourseSchema>
const createCourseState = reactive({
task_title: undefined,
gen_server: 'main',
speed: 1.0,
})
const selected_file = ref<File[] | null>(null)
const onCreateCourseSubmit = async (event: FormSubmitEvent<CreateCourseSchema>) => {
console.log(event.data)
if (!selected_file.value) {
toast.add({
title: '未选择文件',
description: '请先选择 PPTX 文件',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
return
}
creationPending.value = true
// upload PPTX file
useFileGo(selected_file.value[0]).then(url => {
useFetchWrapped<req.gen.CourseGenCreate & AuthedRequest, BaseResponse<resp.gen.CourseGenCreate>>('App.Digital_Convert.Create', {
token: loginState.token!,
user_id: loginState.user.id,
task_title: event.data.task_title,
gen_server: event.data.gen_server as 'main' | 'standby1',
speed: 2 - event.data.speed,
ppt_url: url,
digital_human_id: 40696,
custom_video: '[]',
opening_url: '',
ending_url: '',
}).then(res => {
if (res.data.record_status === 1) {
toast.add({
title: '创建成功',
description: '微课视频已开始生成',
color: 'green',
icon: 'i-tabler-check',
})
refreshCourseList()
isCreateCourseModalOpen.value = false
} else {
toast.add({
title: '创建失败',
description: res.msg || '未知错误',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
}
creationPending.value = false
}).catch(e => {
creationPending.value = false
toast.add({
title: '创建失败',
description: e.message || '未知错误',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
})
})
}
const onCourseDelete = (task_id: string) => {
if (!task_id) return
deletePending.value = true
useFetchWrapped<
req.gen.CourseGenDelete & AuthedRequest,
BaseResponse<resp.gen.CourseGenDelete>
>('App.Digital_Convert.Delete', {
token: loginState.token!,
user_id: loginState.user.id,
to_user_id: loginState.user.id,
task_id,
}).then(res => {
if (res.ret === 200) {
toast.add({
title: '删除成功',
description: '已删除任务记录',
color: 'green',
icon: 'i-tabler-check',
})
} else {
toast.add({
title: '删除失败',
description: res.msg || '未知错误',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
}
}).finally(() => {
deletePending.value = false
refreshCourseList()
})
}
onMounted(() => {
const i = setInterval(refreshCourseList, 1000 * 5)
onBeforeUnmount(() => clearInterval(i))
})
</script>
<template>
<div class="font-sans h-full">
<div class="p-4 border-b dark:border-neutral-700">
<UButton
:trailing="false"
color="primary"
icon="i-tabler-plus"
label="新建微课"
size="md"
variant="solid"
@click="() => {
if (!loginState.is_logged_in) {
modal.open(ModalAuthentication)
return
}
onCreateCourseClick()
}"
/>
</div>
<Transition name="loading-screen">
<div v-if="!loginState.is_logged_in" class="w-full h-full">
<div class="w-full h-full flex flex-col justify-center items-center gap-2 bg-neutral-100 dark:bg-neutral-900">
<Icon name="i-tabler-user-circle" class="text-7xl text-neutral-300 dark:text-neutral-700"/>
<p class="text-sm text-neutral-500 dark:text-neutral-400">请登录后使用</p>
<UButton class="mt-2 font-bold" color="black" variant="solid" size="xs"
@click="modal.open(ModalAuthentication)">
登录
</UButton>
</div>
</div>
<div v-else-if="courseList?.length === 0"
class="w-full h-full flex flex-col justify-center items-center gap-2 bg-neutral-100 dark:bg-neutral-900">
<Icon name="i-tabler-photo-hexagon" class="text-7xl text-neutral-300 dark:text-neutral-700"/>
<p class="text-sm text-neutral-500 dark:text-neutral-400">
没有记录
</p>
</div>
<div v-else class="p-4">
<div class="relative grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4">
<TransitionGroup name="card">
<CGTaskCard
v-for="(course, index) in courseList"
:key="course.task_id || 'unknown' + index"
:course="course"
@delete="task_id => onCourseDelete(task_id)"
/>
</TransitionGroup>
</div>
</div>
</Transition>
<UModal
v-model="isCreateCourseModalOpen"
prevent-close
>
<UCard :ui="{ ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<template #header>
<div class="flex items-center justify-between">
<h3 class="text-base font-semibold leading-6 text-gray-900 dark:text-white">
新建微课视频
</h3>
<UButton
class="-my-1"
color="gray"
icon="i-tabler-x"
variant="ghost"
@click="isCreateCourseModalOpen = false"
/>
</div>
</template>
<UForm
:schema="createCourseSchema"
:state="createCourseState"
class="space-y-4"
@submit="onCreateCourseSubmit"
>
<div class="flex justify-between gap-2 *:flex-1">
<UFormGroup label="微课标题" name="task_title">
<UInput v-model="createCourseState.task_title" placeholder="请输入微课标题"/>
</UFormGroup>
<UFormGroup label="生成线路" name="gen_server">
<USelectMenu
v-model="createCourseState.gen_server"
:options="[{
label: '主线路',
value: 'main',
}, {
label: '备用线路',
value: 'standby1',
}]"
option-attribute="label"
value-attribute="value"
/>
</UFormGroup>
</div>
<UFormGroup :label="`视频倍速:${createCourseState.speed}`" name="speed">
<URange
v-model="createCourseState.speed"
:max="1.5"
:min="0.5"
:step="0.1"
class="pt-4"
size="sm"
/>
</UFormGroup>
<UFormGroup label="PPT 文件">
<FileDnD
accept="application/vnd.openxmlformats-officedocument.presentationml.presentation"
@change="file => selected_file = file"
/>
</UFormGroup>
<div class="flex justify-end space-x-4 pt-4">
<UButton
color="gray"
label="取消"
variant="ghost"
@click="isCreateCourseModalOpen = false"
/>
<UButton
color="primary"
label="提交"
type="submit"
variant="solid"
:loading="creationPending"
/>
</div>
</UForm>
</UCard>
</UModal>
</div>
</template>
<style scoped>
.loading-screen-leave-active {
@apply transition duration-300;
}
.loading-screen-leave-to {
@apply opacity-0;
}
.card-enter-active, .card-leave-active {
transition: opacity 0.5s;
}
.card-enter, .card-leave-to {
opacity: 0;
}
.card-enter-to, .card-leave {
opacity: 1;
}
</style>

View File

@@ -1,13 +0,0 @@
<script lang="ts" setup>
</script>
<template>
<div>
绿幕视频生成
</div>
</template>
<style scoped>
</style>

View File

@@ -40,7 +40,7 @@ const loadSrt = async () => {
} catch (err) {
toast.add({
title: '加载字幕失败',
description: err as string || '未知错误',
description: `${ err }` || '未知错误',
color: 'red',
})
} finally {

View File

@@ -1,93 +0,0 @@
<script setup lang="ts">
const props = defineProps({
record: {
type: Object,
required: true,
},
})
const dayjs = useDayjs()
</script>
<template>
<div
class="relative w-full aspect-video rounded-lg overflow-hidden shadow"
>
<NuxtImg :src="record.video_cover"></NuxtImg>
<div class="absolute inset-0 flex flex-col justify-between bg-black/10 bg-gradient-to-t from-black/20">
<div class="flex justify-between items-start p-2.5 gap-2">
<div>
<UButton icon="i-solar-play-circle-bold-duotone">预览</UButton>
</div>
<div class="flex flex-col items-end gap-1">
<UTooltip :text="record.task_id" :close-delay="300">
<h1 class="text-white text-xs font-bold font-sans">
ID: {{ record.task_id.slice(0, 6) }}
</h1>
</UTooltip>
<UTooltip :text="dayjs(record.create_time * 1000).format('YYYY-MM-DD HH:mm:ss')">
<h1 class="text-white text-xs font-bold font-sans">
{{ dayjs(record.create_time * 1000).fromNow() }}
</h1>
</UTooltip>
</div>
<!-- <UProgress-->
<!-- size="md"-->
<!-- indicator-->
<!-- :ui="{-->
<!-- wrapper: 'flex-col-reverse',-->
<!-- progress: {-->
<!-- base: '!bg-opacity-50'-->
<!-- }-->
<!-- }"-->
<!-- :value="10"-->
<!-- :max="100"-->
<!-- :animation="'carousel'"-->
<!-- />-->
</div>
<div class="flex justify-between items-center p-2.5 gap-2">
<div class="overflow-hidden whitespace-nowrap">
<UTooltip
:text="record.title"
:popper="{
placement: 'bottom-start'
}"
:open-delay="300"
:close-delay="300"
class="w-full"
>
<h1 class="text-white text-base font-bold font-sans drop-shadow overflow-hidden text-ellipsis leading-none">
{{ record.title }}
</h1>
</UTooltip>
</div>
<div class="flex-1 whitespace-nowrap flex gap-1.5">
<UButton
size="xs"
color="red"
variant="soft"
icon="i-tabler-trash"
/>
<UButton
size="xs"
color="primary"
variant="soft"
icon="i-solar-subtitles-linear"
>
字幕
</UButton>
<UButton
size="xs"
icon="i-tabler-download"
>
下载
</UButton>
</div>
</div>
</div>
</div>
</template>
<style scoped>
</style>