kongdeqiang
2023-06-09 105abcb08f5d1c1114ce0e093d1a4912fbbfd609
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
    <div>
      <el-dialog
          class="pic-dia"
        title="图像证据"
        :close-on-click-modal="false"
        :visible.sync="visible"
        v-dialogDrag
        >
        <div class="demo-image__preview">
          <div class="preview-box">
          <div v-for="item in  pictureList" :key="Math.random()"
          >
            <el-image
                :src="item"
                style="width: 100px;height: 200px"
                :preview-src-list="[item]"
            >
            </el-image>
          </div>
            </div>
 
        </div>
      </el-dialog>
    </div>
</template>
 
<script>
    export default {
        name: "pictureForm",
        data() {
            return {
                visible:false,
                pictureList: []
            }
        },
        methods: {
            init(data) {
                this.pictureList=[]
                this.visible = true
                // this.pictureList = data.map((item,index) => {
                //     return {
                //         url: this.$systemconfig.basePath+'/ffzf/fileInfo/showImg?path='+item,
                //         // title: item,
                //         // preview:'1',
                //         //larg: require('@/assets/img/enlarge.png')
                //     }
                // })
                for (let i = 0; i < data.length; i++) {
                  let a= this.$systemconfig.basePath+'/ffzf/fileInfo/showImg?path='+data[i]
                  this.pictureList.push(a.toString())
                }
                this.$previewRefresh();
                console.log(this.pictureList)
            }
        }
    }
</script>
 
<style lang="scss" scoped>
  .pswp{
    z-index: 9999;
    display: none;
  }
  .preview-box{
    display: flex;
    flex-wrap: wrap;
    overflow: auto;
    div{
      margin: 5px;
    }
  }
  .pic-dia{
    ::v-deep.el-dialog{
      width: 40%;
      height: 60%;
    }
  }
 
 
</style>
<style lang="scss" scoped>
  .previewDialog{
    position: relative;
    cursor: pointer;
    height: 1000px;
    /*.enlargeBox{*/
    /*  position: absolute;*/
    /*  z-index: 99999;*/
    /*  left: 50%;*/
    /*  top: 50%;*/
    /*  background: rgba(0,0,0,0.5);*/
    /*  padding: 20px;*/
    /*  border-radius: 20px;*/
    /*  box-shadow:inset 0 0 2px 3px rgba(255,255,255,0.2), 0 0 8px rgba(255,255,255,0.6),0 0 20px rgba(255,255,255,0.3);*/
    /*}*/
  }
</style>