zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<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 { queryBuildImageInfo } from '@/api/area/building'
import Viewer from 'viewerjs'
import 'viewerjs/dist/viewer.css'
export default {
  data: function() {
    return {
      imgList: [],
      attachmentno: ''
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      let params = {
        serialno: this.$route.query.serialNo
      }
      this.attachmentno = this.$route.query.attachmentno
      queryBuildImageInfo(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>