Commit de79ef54 authored by leon's avatar leon

feat:table image add preview

parent e1ea753b
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
<template v-if="item.slots.customRender == 'rank'">{{index + 1}}</template> <template v-if="item.slots.customRender == 'rank'">{{index + 1}}</template>
<template v-else-if="item.slots.customRender == 'picture'"> <template v-else-if="item.slots.customRender == 'picture'">
<u-image <u-image
:height="200" :height="100"
mode="aspectFit" mode="aspectFit"
:src="`${cell[item.dataIndex]}?${new Date().getTime()}`" :src="`${cell[item.dataIndex]}?${new Date().getTime()}`"
crossOrigin="anonymous" crossOrigin="anonymous"
@click="imageClick(cellIndex, item.dataIndex)"
></u-image> ></u-image>
</template> </template>
<template v-else-if="item.slots.customRender == 'toThousands'">{{$u.common.toThousands(cell[item.dataIndex])}}</template> <template v-else-if="item.slots.customRender == 'toThousands'">{{$u.common.toThousands(cell[item.dataIndex])}}</template>
...@@ -81,6 +82,20 @@ ...@@ -81,6 +82,20 @@
const paramName = this.elementInfo.table.primaryKey const paramName = this.elementInfo.table.primaryKey
const value = e[paramName] const value = e[paramName]
uni.$emit('handleLinkParams', { index, paramName, value: value }) uni.$emit('handleLinkParams', { index, paramName, value: value })
},
imageClick(index, key) {
debugger
const images = []
for(var i = 0; i < this.chartTables.length; i++) {
const imageUrl = this.chartTables[i][key]
images.push(imageUrl)
}
uni.previewImage({
current: index,
urls: images,
indicator: 'number',
loop: true
})
} }
} }
} }
......
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