Blame view

ant-design-vue-jeecg/src/views/jeecg/ImagPreview.vue 3.18 KB
肖超群 authored
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
<template>
  <a-card :bordered="false">
    <a-col :span="18">
      <a-spin tip="Loading..." :spinning="spinning">
        <div>
          <a-row>
            <a-col :span="18">
              <p>
                <a-divider orientation="left">组一</a-divider>
              </p>
            </a-col>
            <a-col :span="6"></a-col>
            <!-- 预览区域 -->
            <a-col :span="12">
              <template>
                <div v-for="(fileDetail,index) in dataSource[0].fileDetails" :key="index">
                  <div style="float: left;width:104px;height:104px;margin-right: 10px;margin: 0 8px 8px 0;">
                    <div
                      style="width: 100%;height: 100%;position: relative;padding: 8px;border: 1px solid #d9d9d9;border-radius: 4px;">
                      <img style="width: 100%;" :src="fileDetail.imgUrl" :preview="dataSource[0].key">
                    </div>
                  </div>
                </div>
              </template>
            </a-col>
          </a-row>
        </div>
        <div>
          <a-row>
            <a-col :span="18">
              <p>
                <a-divider orientation="left">组二</a-divider>
              </p>
            </a-col>
            <a-col :span="6"></a-col>
            <!-- 预览区域 -->
            <a-col :span="12">
              <template>
                <div v-for="(fileDetail,index) in dataSource[1].fileDetails" :key="index">
                  <div style="float: left;width:104px;height:104px;margin-right: 10px;margin: 0 8px 8px 0;">
                    <div
                      style="width: 100%;height: 100%;position: relative;padding: 8px;border: 1px solid #d9d9d9;border-radius: 4px;">
肖超群 authored
43
                      <img style="width: 100%;" :src="fileDetail.imgUrl" :preview="dataSource[1].key">
肖超群 authored
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
                    </div>
                  </div>
                </div>
              </template>
            </a-col>
          </a-row>
        </div>
      </a-spin>
      <p></p>
    </a-col>
  </a-card>
</template>

<script>
肖超群 authored
59
import ARow from 'ant-design-vue/es/grid/Row'
肖超群 authored
60
肖超群 authored
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
export default {
  name: 'ImagPreview',
  components: {
    ARow
  },
  data() {
    return {
      description: '图片预览页面',
      spinning: false,
      //数据集
      dataSource: [{
        key: 0,
        fileDetails: [
          {
            imgUrl: "https://static.jeecg.com/upload/test/3a4490d5d1cd495b826e528537a47cc1.jpg"
          },
          {
            imgUrl: "https://static.jeecg.com/temp/国炬软件logo_1606575029126.png"
          }
        ]
      }, {
        key: 1,
        fileDetails: [
          {
            imgUrl: "https://static.jeecg.com/upload/test/u27356337152749454924fm27gp0_1588149731821.jpg"
          },
          {
            imgUrl: "https://static.jeecg.com/upload/test/1_1588149743473.jpg"
          }
        ]
肖超群 authored
91
      }
肖超群 authored
92
93
      ],
      url: {}
肖超群 authored
94
    }
肖超群 authored
95
96
97
98
99
  },
  created() {
  },
  methods: {}
}
肖超群 authored
100
101
</script>
<style scoped>
肖超群 authored
102
103
104
.table-operator {
  margin-bottom: 10px
}
肖超群 authored
105
肖超群 authored
106
107
108
.clName .ant-tree li span.ant-tree-switcher, .ant-tree li span.ant-tree-iconEle {
  width: 10px !important;
}
肖超群 authored
109
肖超群 authored
110
111
112
.clName .ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
  background-color: #1890FF !important;
}
肖超群 authored
113
</style>