<template>
|
<div id="index" style="position: relative">
|
<ul>
|
<li v-for="(imgItems, index) in imgList" :key="index">
|
<div v-for="(item, index) in imgItems.images" :key="index">
|
<img :src="item.url" :id="item.attachmentno" style="width: 20px;height: 20px;float: left"/>
|
</div>
|
</li>
|
</ul>
|
<div style="position: absolute;z-index: 10;background-color: #ffffff;top: 0;left: 0;height: 800px;width: 100%;"></div>
|
</div>
|
</template>
|
|
<script>
|
import { queryChannelImageInfo } from '@/api/area/partner'
|
import Viewer from 'viewerjs'
|
import 'viewerjs/dist/viewer.css'
|
export default {
|
data: function () {
|
return {
|
imgList: [],
|
attachmentno: ''
|
}
|
},
|
created () {
|
this.init()
|
},
|
methods: {
|
init () {
|
let params = {
|
objectType: this.$route.query.objectType,
|
serialno: this.$route.query.serialno,
|
}
|
this.attachmentno = this.$route.query.attachmentno
|
queryChannelImageInfo(params).then(res => {
|
this.imgList = res.result
|
this.$nextTick(() => {
|
this.initViewer()
|
})
|
})
|
},
|
initViewer () {
|
const ViewerDom = document.getElementById('index')
|
const viewer = new Viewer(ViewerDom, {})
|
document.getElementById(this.attachmentno).click()
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|