fix(image): 修复审核图片鉴权加载
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
ZoomIn,
|
||||
ZoomOut,
|
||||
} from '@element-plus/icons-vue'
|
||||
import AuthImage from '@/shared/components/business/AuthImage.vue'
|
||||
|
||||
export interface PreviewScreenshotItem {
|
||||
url: string
|
||||
@@ -25,12 +26,10 @@ const props = withDefaults(
|
||||
images: PreviewScreenshotItem[]
|
||||
initialIndex?: number
|
||||
isPeekMode?: boolean
|
||||
previewUrls?: Record<string, string>
|
||||
}>(),
|
||||
{
|
||||
initialIndex: 0,
|
||||
isPeekMode: false,
|
||||
previewUrls: () => ({}),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -68,11 +67,6 @@ const currentItem = computed<PreviewScreenshotItem | null>(() => {
|
||||
return props.images[currentIndex.value] || props.images[0] || null
|
||||
})
|
||||
|
||||
const currentDisplayUrl = computed(() => {
|
||||
if (!currentItem.value) return ''
|
||||
return props.previewUrls[currentItem.value.url] || currentItem.value.url
|
||||
})
|
||||
|
||||
const imageTransformStyle = computed(() => ({
|
||||
transform: `scale(${zoomScale.value}) rotate(${rotationDeg.value}deg)`,
|
||||
transition: 'transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
@@ -272,12 +266,13 @@ onUnmounted(() => {
|
||||
|
||||
<!-- Image Stage -->
|
||||
<div class="image-stage" @click.self="handleClose">
|
||||
<img
|
||||
:src="currentDisplayUrl"
|
||||
<AuthImage
|
||||
:source="currentItem.url"
|
||||
:alt="currentItem.label"
|
||||
:style="imageTransformStyle"
|
||||
class="preview-image"
|
||||
draggable="false"
|
||||
variant="medium"
|
||||
:image-style="imageTransformStyle"
|
||||
image-class="preview-image"
|
||||
loading="eager"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user