From b2d0ac2db80c08783fd848933230618cc30d76a2 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 30 八月 2023 11:38:24 +0800
Subject: [PATCH] 添加锦汇企业编码. 修复点位列表平铺的bug
---
src/views/GB28181/components/TreeArea.vue | 107 +++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 98 insertions(+), 9 deletions(-)
diff --git a/src/views/GB28181/components/TreeArea.vue b/src/views/GB28181/components/TreeArea.vue
index f9382c7..3ea8c29 100644
--- a/src/views/GB28181/components/TreeArea.vue
+++ b/src/views/GB28181/components/TreeArea.vue
@@ -1,6 +1,27 @@
<template>
<div class="TreeArea">
<div class="refresh">
+ <span v-if="nodeList && nodeList.length > 0">閰嶇疆瑙勫垯</span>
+ <el-switch
+ v-model="ruleType"
+ active-color="#0065FF"
+ inactive-color="#ED7E2F"
+ :width="52"
+ v-if="nodeList && nodeList.length > 0"
+ >
+ </el-switch>
+ <span
+ class="des1"
+ @click="ruleType = false"
+ v-if="ruleType && nodeList && nodeList.length > 0"
+ >鑷姩</span
+ >
+ <span
+ class="des2"
+ @click="ruleType = true"
+ v-if="!ruleType && nodeList && nodeList.length > 0"
+ >鎵嬪姩</span
+ >
<div class="button" @click="updateCamerasFromVideosvr">鍒锋柊</div>
鍗曞彴璁惧鏈�澶ф敮鎸侀厤缃�500璺憚鍍忔満锛岄泦缇ゆ渶澶ф敮鎸侀厤缃矾鏁�=闆嗙兢鍐呰澶囨�婚噺*500
</div>
@@ -18,7 +39,10 @@
:node="TreeDataPool.treeData"
:height="600"
:setting="treeSettings"
+ :showDevArea="!ruleType"
+ :nodeList="nodeList"
@itemChecked="onItemCheck"
+ @saveTree="tempSaveTree"
search
style="width: 450px; min-height: 600px"
/>
@@ -68,7 +92,7 @@
</template>
<script>
-import { saveGb28181CamTree } from "@/api/Gb28181";
+import { saveGb28181CamTree, saveTree } from "@/api/Gb28181";
import TreeMenu from "@/components/giantTree/index";
import ZTree from "@/components/giantTree/zTree/ztree";
@@ -76,6 +100,10 @@
components: {
TreeMenu,
ZTree,
+ },
+ props: {
+ id: {},
+ nodeList: {},
},
data() {
return {
@@ -91,7 +119,13 @@
},
dstTreeData: [],
loading: null,
+ ruleType: true,
+ allTreeData: {},
};
+ },
+ created() {
+ this.TreeDataPool.clusterId = this.id.clusterId ? this.id.clusterId : "";
+ this.TreeDataPool.devId = this.id.devId ? this.id.devId : "";
},
mounted() {
this.TreeDataPool.multiple = true;
@@ -127,6 +161,13 @@
this.TreeDataPool.activeTreeData
);
},
+ tempSaveTree(tab) {
+ console.log(1212);
+ console.log(tab);
+ this.allTreeData[tab.devId] = this.TreeDataPool.newTreeByChecked(
+ this.TreeDataPool.activeTreeData
+ );
+ },
saveChecked() {
localStorage.setItem(
"ztree_fold_list",
@@ -148,8 +189,12 @@
this.TreeDataPool.activeTreeData
);
- saveGb28181CamTree({ checkedMenus: treeData })
- .then((rsp) => {
+ if (this.ruleType) {
+ saveGb28181CamTree({
+ clusterId: this.id.clusterId ? this.id.clusterId : "",
+ devId: this.id.devId ? this.id.devId : "",
+ checkedMenus: treeData,
+ }).then((rsp) => {
if (rsp && rsp.success) {
this.$message({
type: "success",
@@ -157,14 +202,30 @@
});
}
this.loading = false;
- })
- .catch((err) => {
- this.$message({
- type: "error",
- message: "淇濆瓨澶辫触",
+ });
+ } else {
+ let tab = this.$refs["ztree"].activeTabObj;
+ this.allTreeData[tab.devId] = treeData;
+ let params = [];
+ for (const key in this.allTreeData) {
+ params.push({
+ devId: key,
+ checkedMenus: this.allTreeData[key],
});
+ }
+
+ saveTree({
+ list: params,
+ }).then((rsp) => {
+ if (rsp && rsp.success) {
+ this.$message({
+ type: "success",
+ message: "淇濆瓨鎴愬姛",
+ });
+ }
this.loading = false;
});
+ }
},
},
};
@@ -181,6 +242,34 @@
align-items: center;
font-size: 12px;
color: #666666;
+ position: relative;
+
+ span {
+ font-size: 14px;
+ }
+
+ .el-switch {
+ margin-left: 16px;
+ margin-right: 32px;
+ }
+
+ .des1 {
+ top: 7px;
+ left: 78px;
+ position: absolute;
+ font-size: 12px;
+ color: #fff;
+ cursor: pointer;
+ }
+
+ .des2 {
+ top: 7px;
+ left: 92px;
+ position: absolute;
+ font-size: 12px;
+ color: #fff;
+ cursor: pointer;
+ }
.button {
margin-right: 10px;
@@ -278,7 +367,7 @@
padding: 20px 0;
border-top: 1px solid #e9ebee;
display: flex;
- justify-content: end;
+ justify-content: flex-end;
text-align: center;
.cancel {
--
Gitblit v1.8.0