Commit 46bb957d by wuqian

修复ts

parent d4383eaa
...@@ -1373,9 +1373,7 @@ ...@@ -1373,9 +1373,7 @@
<div class="flex-between"> <div class="flex-between">
<div v-if="cardItem.imageAry" class="images-position"> <div v-if="cardItem.imageAry" class="images-position">
<div <div
v-for="(item, index) in JSON.parse( v-for="(item, index) in filteredImages(cardItem.imageAry)"
cardItem.imageAry || '',
)?.filter((el: { title: string }) => el.title)||[]"
:key="index" :key="index"
:title="item.title" :title="item.title"
class="item-image" class="item-image"
...@@ -2256,6 +2254,17 @@ const pickerOptions = { ...@@ -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 timeRange = ref<string[]>([])
const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => { const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => {
const end = dayjs() 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