Commit 46bb957d by wuqian

修复ts

parent d4383eaa
......@@ -1373,9 +1373,7 @@
<div class="flex-between">
<div v-if="cardItem.imageAry" class="images-position">
<div
v-for="(item, index) in JSON.parse(
cardItem.imageAry || '',
)?.filter((el: { title: string }) => el.title)||[]"
v-for="(item, index) in filteredImages(cardItem.imageAry)"
:key="index"
:title="item.title"
class="item-image"
......@@ -2256,6 +2254,17 @@ const pickerOptions = {
},
],
}
const filteredImages = (imageAry: string | null) => {
if (!imageAry) return []
try {
const parsed = JSON.parse(imageAry)
return Array.isArray(parsed)
? parsed.filter((el: { title: string }) => el.title)
: []
} catch {
return []
}
}
const timeRange = ref<string[]>([])
const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => {
const end = dayjs()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment