<template>
|
<div class="CameraManage">
|
<div class="cluster">
|
<div class="title">集群选择</div>
|
<el-select v-model="cluster" placeholder="请选择">
|
<el-option
|
v-for="item in clusterArr"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</div>
|
<div class="content">
|
<CameraLeft :appName="'Camera'" ref="left"></CameraLeft>
|
<div class="right">
|
<div class="tabs">
|
<div
|
class="tab"
|
:class="{ active: activeTab === '信息维护' }"
|
@click="handleClick('信息维护')"
|
>
|
信息维护
|
</div>
|
<div
|
class="tab"
|
:class="{ active: activeTab === '场景配置' }"
|
@click="handleClick('场景配置')"
|
>
|
场景配置
|
</div>
|
</div>
|
|
<CameraInfo
|
ref="cameraInfo"
|
v-show="activeTab === '信息维护'"
|
></CameraInfo>
|
<CameraRules
|
v-show="activeTab === '场景配置'"
|
ref="sepRule"
|
></CameraRules>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import CameraLeft from "@/components/CameraLeft";
|
import CameraInfo from "./CameraInfo";
|
import CameraRules from "./CameraRules";
|
|
import bus from "@/plugin/bus";
|
export default {
|
components: {
|
CameraLeft,
|
CameraInfo,
|
CameraRules,
|
},
|
|
data() {
|
return {
|
activeTab: "信息维护",
|
clusterArr: [
|
{
|
value: 0,
|
label: "集群一",
|
},
|
{
|
value: 1,
|
label: "集群二",
|
},
|
],
|
cluster: "",
|
intervalTimer: null,
|
leftWith: 0,
|
screenHeight: 0,
|
};
|
},
|
|
destroyed() {
|
this.TreeDataPool.readonly = true;
|
},
|
|
watch: {
|
"TreeDataPool.selectedNode": function (node) {
|
if (this.activeTab == "信息维护") {
|
if (this.TreeDataPool.treeActiveName == "camera") {
|
this.$refs.cameraInfo.selectCamera(node);
|
}
|
} else if (this.activeTab === "场景配置") {
|
this.$refs.sepRule.initCameraData(node.id);
|
}
|
},
|
"TreeDataPool.selectedNodes": {
|
handler(nodes) {
|
if (this.activeTab == "场景配置") {
|
// this.$refs.sepRule.initCameraData();
|
}
|
},
|
deep: true,
|
},
|
"DataStackPool.selectedDir": {
|
handler(node, oldNode) {
|
if (this.TreeDataPool.treeActiveName !== "dataStack") {
|
return;
|
}
|
this.$nextTick(() => {
|
if (this.activeTab == "信息维护") {
|
// this.$refs.dataStackInfo.selectDir(node);
|
} else if (this.activeTab == "场景配置" && node.length !== 0) {
|
this.$refs.sepRule.initCameraData(node.id);
|
}
|
});
|
},
|
deep: true,
|
},
|
},
|
created() {
|
this.PollData.statistics();
|
this.TreeDataPool.readonly = false;
|
|
// this.TreeDataPool.readonly = true;
|
//this.TreeDataPool.gbReadonly = true;
|
this.TreeDataPool.multiple = false;
|
this.TreeDataPool.selectedNode = "";
|
this.selectedNodes = [];
|
this.VideoManageData.init();
|
},
|
beforeDestroy() {
|
clearInterval(this.intervalTimer);
|
//this.TreeDataPool.treeActiveName = "camera";
|
},
|
mounted() {
|
this.$nextTick(() => {
|
bus.$on("addCameraOnTree", (node) => {
|
this.handAddDevice(node);
|
});
|
bus.$on("addDirOnTree", (node) => {
|
this.handAddDIr(node);
|
});
|
this.TreeDataPool.clean();
|
});
|
|
let _this = this;
|
_this.PollData.statisticTaskInfo();
|
this.intervalTimer = setInterval(() => {
|
_this.PollData.statisticTaskInfo();
|
}, 10000);
|
},
|
methods: {
|
handAddDevice(node) {
|
let _this = this;
|
setTimeout(() => {
|
_this.$refs.cameraInfo.addDevice(node);
|
_this.activeTab = "信息维护";
|
}, 100);
|
},
|
handAddDIr(node) {
|
let _this = this;
|
setTimeout(() => {
|
_this.$refs.dataStackInfo.addDir(node);
|
_this.activeTab = "信息维护";
|
}, 100);
|
},
|
handleClick(tab) {
|
//这个控制是否多选
|
// this.TreeDataPool.multiple = tab.name === "场景配置";
|
this.activeTab = tab;
|
if (tab === "信息维护") {
|
if (this.TreeDataPool.treeActiveName == "camera") {
|
this.$refs.cameraInfo.selectCamera(this.TreeDataPool.selectedNode);
|
} else if (this.TreeDataPool.treeActiveName == "dataStack") {
|
this.$refs.dataStackInfo.selectDir(this.DataStackPool.selectedDir);
|
}
|
} else if (tab === "场景配置") {
|
if (this.TreeDataPool.treeActiveName == "camera") {
|
this.$refs.sepRule.initCameraData(this.TreeDataPool.selectedNode.id);
|
} else if (this.TreeDataPool.treeActiveName == "dataStack") {
|
this.$refs.sepRule.initCameraData(this.DataStackPool.selectedDir.id);
|
}
|
}
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.CameraManage {
|
.cluster {
|
display: flex;
|
align-items: center;
|
box-sizing: border-box;
|
margin-bottom: 24px;
|
padding: 10px;
|
height: 72px;
|
background-color: #fff;
|
|
.title {
|
box-sizing: border-box;
|
padding-left: 10px;
|
margin-right: 40px;
|
height: 22px;
|
font-size: 16px;
|
font-weight: 700;
|
border-left: 4px solid #0065ff;
|
}
|
|
.el-select {
|
width: 272px;
|
height: 32px;
|
line-height: 32px;
|
|
::v-deep input:focus {
|
border-color: #0065ff;
|
}
|
|
::v-deep .el-input.is-focus .el-input__inner {
|
border-color: #0065ff;
|
}
|
|
::v-deep input {
|
border-radius: 0;
|
height: 32px;
|
}
|
|
::v-deep .el-icon-arrow-up {
|
line-height: 32px;
|
}
|
}
|
}
|
|
.content {
|
box-sizing: border-box;
|
margin-bottom: 60px;
|
display: flex;
|
align-items: stretch;
|
.CameraLeft {
|
margin-right: 24px;
|
width: 292px;
|
}
|
|
.right {
|
flex: 1;
|
|
.tabs {
|
display: flex;
|
margin-bottom: 24px;
|
height: 42px;
|
background-color: #fff;
|
|
.tab {
|
width: 104px;
|
height: 42px;
|
text-align: center;
|
line-height: 42px;
|
border-bottom: 2px solid #fff;
|
color: #666;
|
cursor: pointer;
|
|
&.active {
|
color: #0065ff;
|
border-color: #0065ff;
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|