| | |
| | | <el-tab-pane |
| | | :label="firstLabeName" |
| | | name="camera-info" |
| | | v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('cameraAccess:cameraInfo')" |
| | | v-if="
|
| | | this.TreeDataPool.treeActiveName == 'camera' &&
|
| | | isShow('cameraAccess:cameraInfo')
|
| | | "
|
| | | > |
| | | <camera-info ref="cameraInfo" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane |
| | | :label="firstLabeName" |
| | | name="camera-info" |
| | | v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('dataStack:cameraInfo')" |
| | | v-if="
|
| | | this.TreeDataPool.treeActiveName == 'dataStack' &&
|
| | | isShow('dataStack:cameraInfo')
|
| | | "
|
| | | > |
| | | <data-stack-info ref="dataStackInfo" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane |
| | | label="独立场景" |
| | | name="separate-rule" |
| | | v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('cameraAccess:selfRule')" |
| | | v-if="
|
| | | this.TreeDataPool.treeActiveName == 'camera' &&
|
| | | isShow('cameraAccess:selfRule')
|
| | | "
|
| | | > |
| | | <separate-rules ref="sepRule" /> |
| | | <!-- <local-separate ref="localSeparate" v-else></local-separate> --> |
| | |
| | | <el-tab-pane |
| | | label="独立场景" |
| | | name="separate-rule" |
| | | v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('dataStack:selfRule')" |
| | | v-if="
|
| | | this.TreeDataPool.treeActiveName == 'dataStack' &&
|
| | | isShow('dataStack:selfRule')
|
| | | "
|
| | | > |
| | | <separate-rules ref="sepRule" /> |
| | | <!-- <local-separate ref="localSeparate" v-else></local-separate> --> |
| | |
| | | <el-tab-pane |
| | | label="联动场景" |
| | | name="linkage-rule" |
| | | v-if="(isShow('cameraAccess:linkRule')) && this.TreeDataPool.treeActiveName == 'camera'" |
| | | v-if="
|
| | | isShow('cameraAccess:linkRule') &&
|
| | | this.TreeDataPool.treeActiveName == 'camera'
|
| | | "
|
| | | > |
| | | <linkage-rule ref="linkRule" /> |
| | | </el-tab-pane> |
| | |
| | | |
| | | <script> |
| | | import CameraInfo from "../components/CameraInfo"; |
| | | import DataStackInfo from "../components/DataStackInfo" |
| | | import DataStackInfo from "../components/DataStackInfo";
|
| | | import SeparateRules from "../components/SeparateRules"; |
| | | import LinkageRule from "../components/LinkageRule"; |
| | | // import fTemplate from "@/components/common/fTemplate"; |
| | |
| | | CameraInfo, |
| | | DataStackInfo, |
| | | SeparateRules, |
| | | LinkageRule |
| | | LinkageRule,
|
| | | }, |
| | | data() { |
| | | return { |
| | | activeName: "camera-info", |
| | | buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], |
| | | intervalTimer: null |
| | | intervalTimer: null,
|
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | return false; |
| | | }, |
| | | firstLabeName() { |
| | | return this.TreeDataPool.treeActiveName === "camera" ? "摄像机信息" : "数据栈信息" |
| | | } |
| | | return this.TreeDataPool.treeActiveName === "camera"
|
| | | ? "摄像机信息"
|
| | | : "数据栈信息";
|
| | | },
|
| | | }, |
| | | watch: { |
| | | // 数据栈不显示联动规则,防止在选中联动规则tab中切换到数据栈 |
| | |
| | | }, |
| | | "TreeDataPool.selectedNode": function (node) { |
| | | if (this.activeName == "camera-info") { |
| | | if (this.TreeDataPool.treeActiveName == 'camera') { |
| | | if (this.TreeDataPool.treeActiveName == "camera") {
|
| | | this.$refs.cameraInfo.selectCamera(node); |
| | | } |
| | | } else if (this.activeName === "separate-rule") { |
| | | this.$refs.sepRule.Camera = {} |
| | | this.$refs.sepRule.Camera = {};
|
| | | this.$refs.sepRule.initCameraData(node.id); |
| | | } |
| | | }, |
| | |
| | | this.$refs.linkRule.initCameraData(); |
| | | } |
| | | }, |
| | | deep: true |
| | | deep: true,
|
| | | }, |
| | | "DataStackPool.selectedDir": { |
| | | handler(node, oldNode) { |
| | | if (this.TreeDataPool.treeActiveName !== 'dataStack') { |
| | | return |
| | | if (this.TreeDataPool.treeActiveName !== "dataStack") {
|
| | | return;
|
| | | } |
| | | this.$nextTick(() => { |
| | | if (this.activeName == "camera-info") { |
| | |
| | | } else if (this.activeName == "separate-rule" && node.length !== 0) { |
| | | this.$refs.sepRule.initCameraData(node.id); |
| | | } |
| | | }) |
| | | });
|
| | | }, |
| | | deep: true |
| | | deep: true,
|
| | | }, |
| | | |
| | | }, |
| | | created() { |
| | | if (this.TreeDataPool.treeActiveName == 'camera') { |
| | | if (this.isShow('cameraAccess:cameraInfo')) { |
| | | this.activeName = "camera-info" |
| | | } else if (this.isShow('cameraAccess:selfRule')) { |
| | | this.activeName = "separate-rule" |
| | | } else if (this.isShow('cameraAccess:linkRule')) { |
| | | this.activeName = "linkage-rule" |
| | | if (this.TreeDataPool.treeActiveName == "camera") {
|
| | | if (this.isShow("cameraAccess:cameraInfo")) {
|
| | | this.activeName = "camera-info";
|
| | | } else if (this.isShow("cameraAccess:selfRule")) {
|
| | | this.activeName = "separate-rule";
|
| | | } else if (this.isShow("cameraAccess:linkRule")) {
|
| | | this.activeName = "linkage-rule";
|
| | | } |
| | | } else { |
| | | if (this.isShow('dataStack:cameraInfo')) { |
| | | this.activeName = "camera-info" |
| | | } else if (this.isShow('dataStack:selfRule')) { |
| | | this.activeName = "separate-rule" |
| | | if (this.isShow("dataStack:cameraInfo")) {
|
| | | this.activeName = "camera-info";
|
| | | } else if (this.isShow("dataStack:selfRule")) {
|
| | | this.activeName = "separate-rule";
|
| | | } |
| | | } |
| | | |
| | |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | | bus.$on("addCameraOnTree", node => { |
| | | bus.$on("addCameraOnTree", (node) => {
|
| | | this.handAddDevice(node); |
| | | }); |
| | | bus.$on("addDirOnTree", node => { |
| | | bus.$on("addDirOnTree", (node) => {
|
| | | this.handAddDIr(node); |
| | | }); |
| | | this.TreeDataPool.clean(); |
| | |
| | | _this.PollData.statisticTaskInfo(); |
| | | this.intervalTimer = setInterval(() => { |
| | | _this.PollData.statisticTaskInfo(); |
| | | }, 10000) |
| | | }, 10000);
|
| | | }, |
| | | methods: { |
| | | isShow(authority) { |
| | | return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 |
| | | return (
|
| | | this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1
|
| | | );
|
| | | }, |
| | | handAddDevice(node) { |
| | | let _this = this; |
| | |
| | | }, 100); |
| | | }, |
| | | handleClick(tab, event) { |
| | | console.log(this.TreeDataPool);
|
| | | this.TreeDataPool.multiple = tab.name === "linkage-rule"; |
| | | if (tab.name === "camera-info") { |
| | | if (this.TreeDataPool.treeActiveName == 'camera') { |
| | | if (this.TreeDataPool.treeActiveName == "camera") {
|
| | | this.$refs.cameraInfo.selectCamera(this.TreeDataPool.selectedNode); |
| | | } else if (this.TreeDataPool.treeActiveName == 'dataStack') { |
| | | } else if (this.TreeDataPool.treeActiveName == "dataStack") {
|
| | | this.$refs.dataStackInfo.selectDir(this.DataStackPool.selectedDir); |
| | | } |
| | | } else if (tab.name === "separate-rule") { |
| | | if (this.TreeDataPool.treeActiveName == 'camera') { |
| | | if (this.TreeDataPool.treeActiveName == "camera") {
|
| | | this.$refs.sepRule.initCameraData(this.TreeDataPool.selectedNode.id); |
| | | } else if (this.TreeDataPool.treeActiveName == 'dataStack') { |
| | | } else if (this.TreeDataPool.treeActiveName == "dataStack") {
|
| | | this.$refs.sepRule.initCameraData(this.DataStackPool.selectedDir.id); |
| | | } |
| | | } else if (this.activeName == "linkage-rule") { |
| | |
| | | } else if (this.activeName == "poll-setting") { |
| | | this.$nextTick(() => { |
| | | this.$refs.pullSetting.initLineChart(); |
| | | }) |
| | | });
|
| | | } |
| | | } |
| | | } |
| | | },
|
| | | },
|
| | | }; |
| | | </script> |
| | | <style lang="scss"> |