fix: 修复本地上传资源路径解析

This commit is contained in:
Nixevol
2026-07-07 02:23:48 +08:00
parent 98b4b8b079
commit fa98f02458
18 changed files with 186 additions and 48 deletions
+7 -2
View File
@@ -86,6 +86,7 @@ import { fmt, statusType } from '@/utils/format';
import { useTablePage } from '@/composables/useTablePage';
import { openMediaViewer } from '@/composables/openMediaViewer';
import { useRemoteSort } from '@/utils/tableSort';
import { resolveMediaUrl } from '@/utils/mediaUrl';
const { t } = useI18n();
const auth = useAuthStore();
@@ -150,7 +151,7 @@ function renderImages(row: any) {
width: 38,
height: 38,
objectFit: 'cover',
src: item.url || item.key,
src: mediaUrl(item),
previewDisabled: true,
onClick: () => previewImages(images, index),
}),
@@ -167,11 +168,15 @@ function renderImages(row: any) {
function previewImages(images: any[], index: number) {
void openMediaViewer(
images.map((item) => ({ url: item.url || item.key, name: item.name || item.key, type: item.type || 'image' })),
images.map((item) => ({ url: mediaUrl(item), name: item.name || item.key, type: item.type || 'image' })),
index,
);
}
function mediaUrl(item: any) {
return resolveMediaUrl(item?.url || item?.key);
}
async function downloadTemplate() {
await downloadFile('/outbound/import/template', 'outbound-import-template.zip');
}