<template>
|
<div class="column">
|
<div class="search_cluster">
|
<el-select
|
v-model="cluster"
|
placeholder="请选择集群"
|
@change="selectCluster"
|
>
|
<el-option
|
v-for="item in clusterArr"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</div>
|
<div class="column-left">
|
<div class="resize-bar"></div>
|
<div class="resize-line"></div>
|
<div class="resize-save">
|
<left-nav :appName="'Camera'"></left-nav>
|
</div>
|
</div>
|
<div class="column-right">
|
<right-side />
|
</div>
|
<card-window></card-window>
|
</div>
|
</template>
|
|
<script>
|
import LeftNav from "@/components/CameraLeft";
|
import RightSide from "./Searching";
|
import CardWindow from "./components/CardWindow";
|
import { getClusterDevList } from "@/api/clusterManage";
|
|
export default {
|
name: "SearchPage",
|
components: {
|
LeftNav,
|
RightSide,
|
CardWindow,
|
},
|
data() {
|
return {
|
screenHeight: 0,
|
clusterArr: [],
|
cluster: "",
|
};
|
},
|
created() {
|
// this.parseUrl();
|
this.getCluster();
|
},
|
mounted() {
|
this.screenHeight = document.documentElement.clientHeight - 20;
|
window.onresize = () => {
|
return (() => {
|
this.screenHeight = document.documentElement.clientHeight - 20;
|
})();
|
};
|
},
|
beforeDestroy() {
|
sessionStorage.removeItem("clusterId");
|
sessionStorage.removeItem("devId");
|
},
|
methods: {
|
parseUrl() {},
|
selectCluster(val) {
|
const arr = val.split("$$");
|
if (arr[0] == "0") {
|
sessionStorage.setItem("clusterId", arr[1]);
|
sessionStorage.setItem("devId", "");
|
console.log(this.clusterData);
|
this.clusterData.forEach((item) => {
|
if (arr[1] == item.cluster_id) {
|
sessionStorage.setItem("nodeId", item.nodeList[0].devId);
|
}
|
});
|
}
|
if (arr[0] == "1") {
|
sessionStorage.setItem("clusterId", "");
|
sessionStorage.setItem("devId", arr[1]);
|
sessionStorage.setItem("nodeId", arr[1]);
|
}
|
this.TreeDataPool.fetchTreeData();
|
this.PollData.statisticTaskInfo();
|
this.VideoManageData.init();
|
this.PollData.statistics();
|
},
|
async getCluster() {
|
const res = await getClusterDevList();
|
if (res && res.success) {
|
this.clusterData = res.data.clusterList;
|
if (res.data.clusterList <= 0 && res.data.devList <= 0) {
|
this.$confirm(
|
"系统检测到您还未添加设备, 请在设备管理页面维护",
|
"提示",
|
{
|
confirmButtonText: "跳转",
|
cancelButtonText: "取消",
|
type: "warning",
|
}
|
)
|
.then(() => {
|
this.$router.push("/manageCenter");
|
})
|
.catch(() => {});
|
}
|
|
res.data.clusterList.forEach((item) => {
|
this.clusterArr.push({
|
label: item.cluster_name,
|
value: "0$$" + item.cluster_id,
|
});
|
});
|
|
res.data.devList.forEach((item) => {
|
this.clusterArr.push({
|
label: item.devName,
|
value: "1$$" + item.devId,
|
});
|
});
|
|
this.cluster = this.clusterArr[0].value;
|
this.selectCluster(this.clusterArr[0].value);
|
}
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" >
|
.left-tree-box .local-vedio-area .dev-vedio-list {
|
height: calc(100vh - 130px);
|
}
|
.left-tree-box .el-tabs--border-card .el-tabs__header {
|
margin-bottom: 10px;
|
}
|
.column {
|
overflow: hidden;
|
min-width: 1399px;
|
height: 100%;
|
}
|
.column-left {
|
background-color: #fff;
|
position: relative;
|
float: left;
|
height: 100vh;
|
}
|
.column-right {
|
height: 100vh;
|
background-color: #eee;
|
box-sizing: border-box;
|
overflow: hidden;
|
}
|
.heigher-index {
|
position: absolute;
|
top: 0;
|
z-index: 10;
|
width: 100%;
|
height: 100%;
|
}
|
.resize-save {
|
position: absolute;
|
top: 0;
|
right: 5px;
|
bottom: 0;
|
left: 0;
|
padding: 16px;
|
padding-top: 8px;
|
overflow-x: hidden;
|
}
|
.resize-bar {
|
width: 338px;
|
height: inherit;
|
resize: horizontal;
|
cursor: ew-resize;
|
opacity: 0;
|
overflow: scroll;
|
max-width: 500px; //设定最大拉伸长度
|
min-width: 33px; //设定最小宽度
|
}
|
/* 拖拽线 */
|
.resize-line {
|
position: absolute;
|
right: 0;
|
top: 0;
|
bottom: 0;
|
border-right: 2px solid #efefef;
|
border-left: 1px solid #e0e0e0;
|
}
|
.resize-bar:hover ~ .resize-line,
|
.resize-bar:active ~ .resize-line {
|
border-left: 1px dashed skyblue;
|
}
|
.resize-bar::-webkit-scrollbar {
|
width: 200px;
|
height: inherit;
|
}
|
|
.search_cluster {
|
top: 18px;
|
left: 172px;
|
position: fixed;
|
width: 135px;
|
z-index: 4;
|
}
|
|
/* Firefox只有下面一小块区域可以拉伸 */
|
@supports (-moz-user-select: none) {
|
.resize-bar:hover ~ .resize-line,
|
.resize-bar:active ~ .resize-line {
|
border-left: 1px solid #bbb;
|
}
|
.resize-bar:hover ~ .resize-line::after,
|
.resize-bar:active ~ .resize-line::after {
|
content: "";
|
position: absolute;
|
width: 16px;
|
height: 16px;
|
bottom: 0;
|
right: -8px;
|
// background: url(./resize.svg);
|
background-size: 100% 100%;
|
}
|
}
|
</style>
|