Files
wvp-platform/web_src/src/components/common/DeviceTree.vue

83 lines
2.1 KiB
Vue
Raw Normal View History

2022-04-20 18:21:18 +08:00
<template>
<div id="DeviceTree" style="width: 100%;height: 100%; background-color: #FFFFFF; overflow: auto">
2022-04-20 18:21:18 +08:00
<el-container>
2024-09-12 17:49:16 +08:00
<el-header>
<div style="display: grid; grid-template-columns: auto auto">
<div >通道列表</div>
<div >
<el-switch
v-model="showRegion"
active-color="#13ce66"
inactive-color="rgb(64, 158, 255)"
active-text="行政区划"
inactive-text="业务分组">
</el-switch>
</div>
2022-04-20 18:21:18 +08:00
</div>
2024-09-12 17:49:16 +08:00
</el-header>
<el-main style="background-color: #ffffff;">
<RegionTree v-if="showRegion" ref="regionTree" :edit="false" :showHeader="false" :clickEvent="treeNodeClickEvent" ></RegionTree>
<GroupTree v-if="!showRegion" ref="groupTree" :edit="false" :showHeader="false" :clickEvent="treeNodeClickEvent" ></GroupTree>
2022-04-20 18:21:18 +08:00
</el-main>
</el-container>
</div>
</template>
<script>
import DeviceService from "../service/DeviceService.js";
2024-09-12 17:49:16 +08:00
import RegionTree from "./RegionTree.vue";
import GroupTree from "./GroupTree.vue";
2022-04-20 18:21:18 +08:00
export default {
name: 'DeviceTree',
2024-09-12 17:49:16 +08:00
components: {GroupTree, RegionTree},
2022-04-20 18:21:18 +08:00
data() {
return {
2024-09-12 17:49:16 +08:00
showRegion: true,
2022-04-20 18:21:18 +08:00
deviceService: new DeviceService(),
defaultProps: {
children: 'children',
label: 'name',
isLeaf: 'isLeaf'
}
};
},
2022-07-03 07:40:54 +08:00
props: ['device', 'onlyCatalog', 'clickEvent', 'contextMenuEvent'],
2022-04-20 18:21:18 +08:00
methods: {
2024-09-12 17:49:16 +08:00
handleClick: function (tab, event){
2022-04-20 18:21:18 +08:00
},
2024-09-12 17:49:16 +08:00
treeNodeClickEvent: function (data){
2022-04-20 18:21:18 +08:00
2024-09-12 17:49:16 +08:00
if (data.leaf) {
console.log(23111)
console.log(data)
if (this.clickEvent){
this.clickEvent(data.id)
2022-07-03 07:40:54 +08:00
}
2022-04-20 18:21:18 +08:00
}
}
},
destroyed() {
// if (this.jessibuca) {
// this.jessibuca.destroy();
// }
// this.playing = false;
// this.loaded = false;
// this.performance = "";
},
}
</script>
<style>
.device-tree-main-box{
text-align: left;
}
.device-online{
color: #252525;
}
.device-offline{
color: #727272;
}
</style>