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
| <template>
| <div class="bs-design-wrap bs-picture">
| <div class="content-box">
| <el-image
| :src="getCoverPicture(config.customize.url) || noImageUrl"
| fit="fill"
| :style="{
| width: '100%',
| height: '100%',
| opacity: config.customize.opacity,
| borderRadius: config.customize.radius + 'px'
| }"
| draggable="false"
| >
| <div
| slot="placeholder"
| class="image-slot"
| >
| 加载中···
| </div>
| </el-image>
| </div>
| </div>
| </template>
| <script>
| import { getFileUrl } from 'data-room-ui/js/utils/file'
| import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent'
|
| export default {
| name: 'PictureChart',
| components: {},
| mixins: [refreshComponentMixin],
| props: {
| config: {
| type: Object,
| default: () => ({})
| }
| },
| data () {
| return {
| noImageUrl: require('data-room-ui/BasicComponents/Picture/images/noImage.png')
| }
| },
| computed: {},
| watch: {},
| mounted () {},
| methods: {
| /**
| * 获取图片访问地址,如果是相对路径则拼接上文件访问前缀地址
| * @param url
| * @returns {*}
| */
| getCoverPicture (url) {
| return getFileUrl(url)
| },
| }
| }
| </script>
|
| <style lang="scss" scoped>
| .bs-design-wrap {
| width: 100%;
| background-color: rgba(0, 0, 0, 0);
| .content-box {
| width: 100%;
| height: 100%;
| }
| }
| </style>
|
|