fix:图片显示
All checks were successful
/ Explore-Gitea-Actions (push) Successful in 13m48s

This commit is contained in:
2025-08-23 19:25:11 +08:00
parent 5c40b534f2
commit 67b7e64600
18 changed files with 191 additions and 75 deletions

View File

@@ -24,6 +24,7 @@ import {getDictOptions} from "#/utils/dict";
import type {KnowledgeForm, KnowledgeVO} from "#/api/property/maintenance/knowledge/model";
import {renderDict} from "#/utils/render";
import knowledgeDetail from '../knowledge/knowledge-detail.vue';
import {ossInfo} from "#/api/system/oss";
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
const [KnowledgeModal, modalApi] = useVbenModal({
@@ -66,6 +67,16 @@ const handleClean = () => {
async function queryPageList() {
const res = await knowledgeList(formState)
pageList.value = res.rows
for (const item of pageList.value) {
if (item.covers) {
try {
const res = await ossInfo([item.covers]);
item.coversPath = res?.[0]?.url;
} catch (e) {
item.coversPath = '';
}
}
}
total.value = res.total
}
@@ -132,7 +143,7 @@ async function handleInfo(row: Required<KnowledgeForm>) {
<template #cover>
<img class="card-img"
alt="图片加载失败"
:src="item.covers"/>
:src="item.coversPath"/>
</template>
<CardMeta :title="item.title">
<template #description>