apply Network.ts
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// components/travel-location-popup/index.ts
|
||||
import { TravelLocation, TravelLocationTypeLabel, TravelLocationTypeIcon } from "../../types/Travel";
|
||||
import { TravelLocationApi } from "../../api/TravelLocationApi";
|
||||
import { MediaAttachExt, MediaAttachType } from "../../types/Attachment";
|
||||
import { ImageMetadata, MediaAttachType } from "../../types/Attachment";
|
||||
import { MediaItem, MediaItemType } from "../../types/UI";
|
||||
import config from "../../config/index";
|
||||
import Toolkit from "../../utils/Toolkit";
|
||||
@ -39,11 +39,11 @@ Component({
|
||||
|
||||
// 处理附件数据
|
||||
const attachments = location.items || [];
|
||||
const thumbItems = attachments.filter((item: any) => item.attachType === MediaAttachType.THUMB);
|
||||
const thumbItems = attachments.filter(item => item.attachType === MediaAttachType.THUMB);
|
||||
|
||||
if (0 < thumbItems.length) {
|
||||
const mediaItems: MediaItem[] = thumbItems.map((thumbItem: any, index: number) => {
|
||||
const metadata = thumbItem.metadata;
|
||||
const mediaItems: MediaItem[] = thumbItems.map((thumbItem, index) => {
|
||||
const metadata = thumbItem.metadata as ImageMetadata;
|
||||
const ext = typeof thumbItem.ext === "string" ? JSON.parse(thumbItem.ext) : thumbItem.ext;
|
||||
const thumbURL = `${config.url}/attachment/read/${thumbItem.mongoId}`;
|
||||
const sourceURL = `${config.url}/attachment/read/${ext.sourceMongoId}`;
|
||||
|
||||
Reference in New Issue
Block a user