DatavDecorationPanel.vue
1.99 KB
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
<template>
<el-scrollbar class="scrollbar-fullheight">
<div class="control-list">
<template>
<div v-for="(value, key, index) in decorationMap" :key="index" style="padding-right:45px;">
<draggable
class="flex-container"
tag="div"
:list="value.items"
v-bind="{group:{ name:'form', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}"
@end="handleMoveEnd"
@start="handleMoveStart"
:move="handleMove"
>
<div class="block" style="float: left;padding-right:5px;" v-for="(item, key, index) in value.items" :key="index">
<img :src="item.icon" :title="item.name" style="width: 28px; height: 28px;margin-bottom: 5px;position: relative;display: inline-block;overflow: hidden;" class="image">
</div>
</draggable>
</div>
</template>
</div>
</el-scrollbar>
</template>
<script>
import Draggable from "vuedraggable";
export default {
name: "datav-decoration-panel",
components: { Draggable },
props: {
decorationMap: {
type: Object
}
},
data() {
return {};
},
methods: {
handleMoveEnd: function() {},
handleMoveStart: function() {},
handleMove: function() {}
}
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/form-editor.scss";
.widget-cate {
padding: 10px 0 0 10px;
font-weight: bold;
color: #777;
}
ul.flex-container {
margin: 0;
list-style: none;
padding: 10px 5px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
ul.flex-container > li.flex-item {
padding: 5px;
height: 17px;
border: 1px solid #ccc;
margin: 4px;
width: 120px;
border-radius: 5px;
cursor: pointer;
}
ul.flex-container > li.flex-item:hover {
box-shadow: 0 2px 5px rgba(86, 96, 117, 0.15);
}
li.flex-item > a > i {
font-size: 16px;
}
li.flex-item > a > div {
margin-left: 8px;
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
}
.el-scrollbar__wrap {
overflow-x: hidden;
}
</style>