Blame view

frontend/manage/src/components/portal/SnapshotImg.vue 1.12 KB
8d73e917   陈威   初始化提交
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
<template>
  <div class="snapshot-img">
    <template v-if="imageData.snapshotId">
      <datav-cover
        :fileId="imageData.snapshotId"
        :key="imageData.snapshotId ? imageData.snapshotId : imageData.id"
        :fit="fit"
        class="template-item_img"
      />
    </template>
    <template v-else>
      <img :src="noDataImg" class="template-local_img" />
    </template>
  </div>
</template>

<script>
const DatavCover = () => import('@/components/portal/datav/DatavCover.vue')

export default {
  name: 'SnapshotImg',
  components: {DatavCover},
  props: {
    imageData: {
      type: Object,
      default: () => {}
    },
    fit:{
      type: String,
      default: 'contain'
    }
  },
  data() {
    return {
      noDataImg:require(`@/assets/nodata_images/picture-no-data.jpg`)
    }
  },
  computed: {},

  watch: {},
  methods: {}
}
</script>

<style lang="scss" scoped>
.snapshot-img {
  .template-item_img {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .template-local_img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
</style>