| | |
| | | <div class="CameraManage"> |
| | | <div class="cluster"> |
| | | <div class="title">集群选择</div> |
| | | <el-select v-model="cluster" placeholder="请选择"> |
| | | <el-select v-model="cluster" placeholder="请选择" @change="selectCluster"> |
| | | <el-option |
| | | v-for="item in clusterArr" |
| | | :key="item.value" |
| | |
| | | import CameraRules from "./CameraRules"; |
| | | import VideoRuleData from "@/Pool/VideoRuleData"; |
| | | |
| | | import { getClusterDevList } from "@/api/clusterManage"; |
| | | |
| | | import bus from "@/plugin/bus"; |
| | | export default { |
| | | components: { |
| | |
| | | data() { |
| | | return { |
| | | activeTab: "信息维护", |
| | | clusterArr: [ |
| | | { |
| | | value: 0, |
| | | label: "集群一", |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: "集群二", |
| | | }, |
| | | ], |
| | | clusterArr: [], |
| | | cluster: "", |
| | | intervalTimer: null, |
| | | leftWith: 0, |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getCluster(); |
| | | this.PollData.statistics(); |
| | | this.TreeDataPool.readonly = false; |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | async getCluster() { |
| | | const res = await getClusterDevList(); |
| | | console.log(res); |
| | | if (res && res.success) { |
| | | 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; |
| | | } |
| | | }, |
| | | selectCluster(val) { |
| | | const arr = val.split("$$"); |
| | | console.log(arr); |
| | | if (arr[0] == "0") { |
| | | this.TreeDataPool.clusterId = arr[1]; |
| | | this.TreeDataPool.devId = ""; |
| | | } |
| | | if (arr[0] == "1") { |
| | | this.TreeDataPool.devId = arr[1]; |
| | | this.TreeDataPool.clusterId = ""; |
| | | } |
| | | this.TreeDataPool.fetchTreeData(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |