Commit 290dbc7a authored by 王晓倩's avatar 王晓倩

视频监控树检索节点

parent e1b2db8f
...@@ -2,25 +2,36 @@ ...@@ -2,25 +2,36 @@
<div class="app-container"> <div class="app-container">
<el-row :gutter="5" type="flex" justify="space-around"> <el-row :gutter="5" type="flex" justify="space-around">
<el-col :lg="4" :xl="4"> <el-col :lg="4" :xl="4">
<el-tree id="videoTree" <div class="head-container">
<el-input
v-model="videoTree"
placeholder="请输入监控名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="treeData" :data="treeData"
:props="treeProps" :props="treeProps"
ref="Tree" :expand-on-click-node="false"
node-key="id" :filter-node-method="filterNode"
:highlight-current="true" ref="tree"
:default-expanded-keys="[0]" default-expand-all
:default-checked-keys="[]" prefix="el-icon-video-play"
@node-click="nodeClick" @node-click="nodeClick"
style="background-color: white; color: #606266" style="background-color: white; color: #606266"
> >
<!--<template slot-scope="{node, data}"> <template slot-scope="{ node, data }" class="custom-tree-node">
<span> <span>
<i class="'#' + iconArrClass[data.level]" aria-hidden="true"> <i class="iconfont" :class="[data.icon, 'tree-icon']" />
</i> {{ node.label }}
{{node.label}}
</span> </span>
</template>--> </template>
</el-tree> </el-tree>
</div>
</el-col> </el-col>
<el-col :lg="20" :xl="20"> <el-col :lg="20" :xl="20">
...@@ -55,18 +66,17 @@ ...@@ -55,18 +66,17 @@
</template> </template>
<style lang="scss" scped> <style lang="scss" scped>
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content { .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
background-color: #a5a5a8; background-color: white;
color: white;
} }
.el-tree--highlight-current .el-tree-node > .el-tree-node__content:hover { .el-tree--highlight-current .el-tree-node > .el-tree-node__content:hover {
background-color: #a5a5a8; background-color: white;
color: #454547; color: #454547;
} }
/*main > div { main > div {
background: #ffffff; background: #ffffff;
height: calc(100vh - 110px) !important; height: calc(100vh - 110px) !important;
padding: 0px 0px 0px 10px !important; padding: 0px 0px 0px 10px !important;
}*/ }
.row{ .row{
display: flex; display: flex;
.box{ .box{
...@@ -87,15 +97,12 @@ ...@@ -87,15 +97,12 @@
line-height: calc((100vh - 130px)/2); line-height: calc((100vh - 130px)/2);
color: white; color: white;
} }
/* .nodeImg1{ .nodeImg1{
background: url('../../assets/qiye.png') no-repeat center, background: url("../../../assets/images/video1.png") no-repeat center;
} }
.nodeImg2{ .nodeImg2{
background: url("../../assets/enterprises.png") no-repeat center, background: url("../../../assets/images/video2.png") no-repeat center;
} }
.nodeImg3{
background: url("../../assets/video.png") no-repeat center,
}*/
</style> </style>
<script> <script>
...@@ -105,6 +112,7 @@ ...@@ -105,6 +112,7 @@
}, },
data() { data() {
return { return {
videoTree: undefined,
loading: false, loading: false,
playerWindow: "newplay1", playerWindow: "newplay1",
flag: 1, flag: 1,
...@@ -112,14 +120,10 @@ ...@@ -112,14 +120,10 @@
{ {
name: "企业视频监控", name: "企业视频监控",
level: 0, level: 0,
icon: "nodeImg1",
childList: [] childList: []
} }
], ],
/*iconArrClass: [
"nodeImg1",
"nodeImg2",
"nodeImg3"
],*/
treeProps: { treeProps: {
children: "childList", children: "childList",
label: "name" label: "name"
...@@ -128,25 +132,42 @@ ...@@ -128,25 +132,42 @@
ideoController: {}, ideoController: {},
} }
}, },
watch: {
// 根据名称筛选视频监控
videoTree(val) {
console.log("val", val)
this.$refs.tree.filter(val);
}
},
methods: { methods: {
getTreeData() { getTreeData() {
let that = this; let that = this;
that.treeData[0].childList = [ that.treeData[0].childList = [
{ {
name: "视频监控1", name: "视频监控1",
icon: "nodeImg2",
deviceCode: "34020000001110000003_0200000004", deviceCode: "34020000001110000003_0200000004",
},{ },{
name: "视频监控2", name: "视频监控2",
icon: "nodeImg2",
deviceCode: "34020000001110000003_0200000005", deviceCode: "34020000001110000003_0200000005",
},{ },{
name: "视频监控3", name: "视频监控3",
deviceCode: "stream_58_0", icon: "nodeImg2",
deviceCode: "stream_36_0",
},{ },{
name: "视频监控4", name: "视频监控4",
deviceCode: "stream_58_0", icon: "nodeImg2",
deviceCode: "stream_37_0",
} }
]; ];
}, },
// 筛选节点
filterNode(value, data) {
console.log(value, data)
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
nodeClick(data, node, target) { nodeClick(data, node, target) {
let that = this; let that = this;
that.treecheckedObj = node.data; that.treecheckedObj = node.data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment