feat(web): 支持后台列表图片大图预览
This commit is contained in:
1 parent
046400ae4a
commit
8a84f24baf
10 files changed
+202
-13
No files matched your search
@@ -1,9 +1,10 @@
|
||||
<!-- Author: fruit.com.cn -->
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { AppIcons } from '@/constants/icons'
|
||||
import { AppImage } from '@/components/AppImage'
|
||||
import PageHeading from '@/views/components/PageHeading.vue'
|
||||
import CreatorCenterPage from './components/CreatorCenterPage.vue'
|
||||
import { useCreatorAccess } from './composables/useCreatorAccess'
|
||||
@@ -43,6 +44,14 @@ const {
|
||||
|
||||
const activeTab = ref('dramas')
|
||||
|
||||
const workspaceCoverPreviewList = computed(() =>
|
||||
(dramas.rows || []).map((row) => row.cover).filter(Boolean)
|
||||
)
|
||||
|
||||
function workspaceCoverPreviewIndex(row) {
|
||||
return Math.max(0, workspaceCoverPreviewList.value.indexOf(row.cover))
|
||||
}
|
||||
|
||||
function onTabChange(name) {
|
||||
if (name === 'notices' && !notices.loaded) loadNotices()
|
||||
}
|
||||
@@ -149,7 +158,15 @@ function openEdit(row) {
|
||||
<template #default="{ row }">
|
||||
<div class="creator-drama-cell">
|
||||
<div class="creator-drama-cover">
|
||||
<img v-if="row.cover" :src="row.cover" alt="" />
|
||||
<AppImage
|
||||
v-if="row.cover"
|
||||
:src="row.cover"
|
||||
:preview-list="workspaceCoverPreviewList"
|
||||
:initial-index="workspaceCoverPreviewIndex(row)"
|
||||
fit="cover"
|
||||
class="creator-drama-image"
|
||||
:alt="row.title"
|
||||
/>
|
||||
<span v-else>{{ (row.title || '?').slice(0, 1) }}</span>
|
||||
</div>
|
||||
<div class="creator-drama-meta">
|
||||
|
||||
Reference in new issue
Block a user