feat: 展示数字人来源

This commit is contained in:
2025-04-28 10:20:34 +08:00
parent 627ac24e04
commit 15f175aee1
3 changed files with 155 additions and 50 deletions

View File

@@ -111,6 +111,10 @@ const columns = [
key: 'model_id',
label: 'ID',
},
{
key: 'type',
label: '来源',
},
{
key: 'description',
label: '备注',
@@ -120,6 +124,12 @@ const columns = [
},
]
const sourceTypeList = [
{ label: 'TX', value: 1, color: 'blue' },
{ label: 'XSH', value: 2, color: 'green' },
{ label: 'XB', value: 3, color: 'indigo' },
]
const isCreateSlideOpen = ref(false)
const createAvatarState = reactive({
@@ -265,7 +275,7 @@ const onAvatarUpload = async (files: FileList) => {
class="w-full h-full object-cover"
/>
<div
class="absolute inset-x-0 bottom-0 p-2 bg-gradient-to-t from-black/50 to-transparent"
class="absolute inset-x-0 bottom-0 p-2 bg-gradient-to-t from-black/50 to-transparent flex gap-2"
>
<UBadge
color="white"
@@ -274,6 +284,17 @@ const onAvatarUpload = async (files: FileList) => {
>
{{ avatar.name }}
</UBadge>
<template
v-for="(t, i) in sourceTypeList"
:key="i"
>
<UBadge
v-if="t.value === avatar.type"
variant="subtle"
:color="t.color"
:label="t.label"
/>
</template>
</div>
<div
class="absolute inset-0 flex flex-col justify-center items-center bg-white/50 dark:bg-neutral-800/50 backdrop-blur opacity-0 group-hover:opacity-100 transition-opacity"
@@ -321,6 +342,19 @@ const onAvatarUpload = async (files: FileList) => {
class="h-16 aspect-[9/16] rounded-lg"
/>
</template>
<template #type-data="{ row }">
<template
v-for="(t, i) in sourceTypeList"
:key="i"
>
<UBadge
v-if="t.value === row.type"
variant="subtle"
:color="t.color"
:label="t.label"
/>
</template>
</template>
<template #actions-data="{ row }">
<div class="flex gap-2">
<UButton
@@ -422,12 +456,10 @@ const onAvatarUpload = async (files: FileList) => {
label="类型"
name="type"
>
<USelect
<USelectMenu
v-model="createAvatarState.type"
:options="[
{ label: '内部', value: 2 },
{ label: '上游(万木)', value: 1 },
]"
value-attribute="value"
:options="sourceTypeList"
/>
</UFormGroup>
<UFormGroup class="flex justify-end pt-4">