HistoricalDataTree.vue
2.15 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
90
91
92
93
94
95
96
97
98
99
<template>
<div style="width: 100%;height: 100%" class="page-container">
<div class="scroll-container">
<el-scrollbar style="width:100%;height: 79vh">
<el-tree v-if="historyData.length > 0" :data="historyData" class="historical-list-tree">
<span class="custom-tree-node" style="width: 100%;border: 1px" slot-scope="{ node , data }">
<history-data :data="data"></history-data>
</span>
</el-tree>
<el-empty v-else></el-empty>
</el-scrollbar>
</div>
</div>
</template>
<script>
import HistoryData from "../HistoryData.vue";
export default {
name: 'historical-data',
components: {HistoryData},
props: {
historyData: {
type: Array,
default: []
}
},
//计算属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {
},
//方法集合",
methods: {
//点击事件
clickButton(data){
this.$emit('click', data);
}
},
//生命周期 - 创建完成(可以访问当前this实例)",
created() {
},
//生命周期 - 挂载完成(可以访问DOM元素)",
mounted() {
},
beforeCreate() {
}, //生命周期 - 创建之前",
beforeMount() {
}, //生命周期 - 挂载之前",
beforeUpdate() {
}, //生命周期 - 更新之前",
updated() {
}, //生命周期 - 更新之后",
beforeDestroy() {
}, //生命周期 - 销毁之前",
destroyed() {
}, //生命周期 - 销毁完成",
activated() {
} //如果页面有keep-alive缓存功能,这个函数会触发",
};
</script>
<style scoped>
.page-container {
display: flex;
flex-direction: column;
height: 100vh; /* 视口高度的 100% */
}
.box-card {
flex-grow: 1;
display: flex;
flex-direction: column;
}
.scroll-container {
flex-grow: 1;
overflow: hidden; /* 确保内容不会溢出 */
}
/* 菜单的样式 */
.rMenu li {
width: 170px;
list-style: none outside none;
cursor: default;
color: #666;
margin-left: -20px;
}
.rMenu li:hover {
color: #EEE;
background-color: #666;
}
.historical-list-tree >>> .el-tree-node__content {
padding: 15px;
height: 20px;
}
.historical-list-tree {
margin: 10px 0 20px 0;
}
</style>