- {{ zzCmdid }}
+ {{ zzCmdid }}
+
+ {{ collectFlag ? "取消收藏" : "添加收藏" }}
日历快速查询
@@ -314,6 +363,7 @@ import {
getTakePicStatusJoggle,
setTermGPSJoggle,
updateTermCamera,
+ addFavorList,
} from "@/utils/api/index";
import previewContain from "./previewContain.vue";
import carouselChart from "../components/carouselChart.vue";
@@ -321,6 +371,7 @@ import setschedule from "./components/setschedule.vue";
import infoDialog from "./components/infoDialog.vue";
import gpsPosition from "./components/gpsPosition.vue";
import morePicPreveiw from "./components/morePicPreveiw.vue";
+
import { number } from "echarts";
export default {
components: {
@@ -387,9 +438,22 @@ export default {
selectTowerId: "",
currentData: "", //保存选中的数据
zzradio: -1,
+
+ favorVal: -1, //收藏夹默认选中
+ showFavor: false,
+ collectFlag: false,
+ favorData: [
+ {
+ id: 1,
+ name: "收藏夹",
+ list: [],
+ },
+ ],
};
},
watch: {
+ //增量刷新内容
+
filterText(val) {
console.log(val);
this.$refs.tree.filter(val);
@@ -427,6 +491,22 @@ export default {
}, 300000);
},
methods: {
+ //获取收藏
+ getfavRadio() {
+ console.log("点击了收藏");
+ console.log(this.showFavor);
+ console.log(this.favorVal);
+ if (this.favorVal == -1) {
+ console.log("全部");
+ this.showFavor = false;
+ this.getLineTreeList();
+ } else {
+ console.log("收藏");
+ this.showFavor = true;
+ this.getFavorTreeList();
+ }
+ },
+ //
//获取当前选中的radio
getRadio() {
console.log(this.zzradio);
@@ -451,6 +531,11 @@ export default {
this.zztermId = data.id;
this.zzprotocol = data.protocol;
this.CurrentData = data;
+ if (data.isfavor == 0 || data.isfavor == null) {
+ this.collectFlag = false;
+ } else {
+ this.collectFlag = true;
+ }
//this.previewData = data;
if (data.dyValue) {
this.LineFlag = true;
@@ -554,52 +639,74 @@ export default {
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey); //一定要加这个选中了否则样式没有出来
});
- // }
- // if (this.zzradio == -1) {
- // this.lineTreeData = this.lineTreeData;
- // } else if (this.zzradio == 1) {
- // //在线
- // var data = JSON.parse(JSON.stringify(this.lineTreeData));
- // console.log(data);
- // const filterId = (data, id) => {
- // if (!Array.isArray(data)) {
- // return data;
- // }
- // return data.filter((item) => {
- // if ("list" in item) {
- // item.list = filterId(item.list, id);
- // }
- // return item.onlinestatus !== 0;
- // });
- // };
- // const filtredData = filterId(data);
- // console.log(filtredData);
- // this.lineTreeData = filtredData;
- // } else if (this.zzradio == 0) {
- // //离线
- // var data = JSON.parse(JSON.stringify(this.lineTreeData));
- // console.log(data);
- // const filterId = (data, id) => {
- // if (!Array.isArray(data)) {
- // return data;
- // }
- // return data.filter((item) => {
- // if ("list" in item) {
- // item.list = filterId(item.list, id);
- // }
- // return item.onlinestatus !== 1;
- // });
- // };
- // const filtredData = filterId(data);
- // console.log(filtredData);
- // this.lineTreeData = filtredData;
- // }
})
.catch((err) => {
console.log(err); //代码错误、请求失败捕获
});
},
-
+ //获取收藏夹结构数据
+ getFavorTreeList() {
+ getdyTreeListJoggle({ type: this.zzradio })
+ .then((res) => {
+ console.log(res);
+ this.favorData[0].list = res.data.favorlist;
+ console.log(this.favorData);
+ this.onlineNum = res.data.onlineNum;
+ this.totalNum = res.data.totalNum;
+ this.currentData = this.favorData[0].list[0];
+ console.log(this.currentData);
+ this.handleFavorNodeClick(this.currentData);
+ this.$nextTick(() => {
+ this.$refs.favortree.setCurrentKey(this.currentData.id); //一定要加这个选中了否则样式没有出来
+ });
+ })
+ .catch((err) => {
+ console.log(err); //代码错误、请求失败捕获
+ });
+ },
+ getupdateFavorTreeList() {
+ getdyTreeListJoggle({ type: this.zzradio })
+ .then((res) => {
+ console.log(res);
+ this.favorData[0].list = res.data.favorlist;
+ console.log(this.favorData);
+ })
+ .catch((err) => {
+ console.log(err); //代码错误、请求失败捕获
+ });
+ },
+ handleFavorNodeClick(data) {
+ this.clearfun();
+ console.log(data, "11111111");
+ this.selectData = data;
+ this.zztermId = data.id;
+ this.zzprotocol = data.protocol;
+ this.CurrentData = data;
+ //this.previewData = data;
+ if (data.isfavor == 0 || data.isfavor == null) {
+ this.collectFlag = false;
+ } else {
+ this.collectFlag = true;
+ }
+ console.log(this.collectFlag, "22222222");
+ if (data.name == "收藏夹") {
+ return;
+ } else {
+ console.log("杆塔");
+ this.LineFlag = false;
+ this.towerFlag = true;
+ this.towertitle = data.name;
+ this.zzCmdid = data.cmdid;
+ //this.previewData = data;
+ if (data.isfavor == 0 || data.isfavor == null) {
+ this.collectFlag = false;
+ } else {
+ this.collectFlag = true;
+ }
+ this.getChannelList(data.id);
+ // this.getTerminalPhotoList(id, date, data.id);
+ }
+ },
//获取通道的接口
getChannelList(id) {
getChannelByTermidJoggle({ termid: id })
@@ -703,6 +810,51 @@ export default {
console.log(err); //代码错误、请求失败捕获
});
},
+ addCollectClick() {
+ if (!this.collectFlag) {
+ this.$confirm("此操作将添加至收藏夹, 是否继续?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ this.collectFlag = true;
+ addFavorList({ list: [this.zztermId], type: 1 }).then((res) => {
+ this.getupdateFavorTreeList();
+ });
+ this.$message({
+ type: "success",
+ message: "添加成功!",
+ });
+ })
+ .catch(() => {
+ this.$message({
+ type: "info",
+ message: "已取消该操作",
+ });
+ });
+ } else {
+ this.$confirm("此操作将取消收藏, 是否继续?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ this.collectFlag = false;
+ addFavorList({ list: [this.zztermId], type: 0 }).then((res) => {
+ this.getFavorTreeList();
+ });
+ this.$message({
+ type: "success",
+ message: "取消收藏!",
+ }).catch(() => {
+ this.$message({
+ type: "info",
+ message: "已取消该操作",
+ });
+ });
+ });
+ }
+ },
//点击图片列表执行函数
jumpTowerPic(data) {
console.log("我是从子组件过来的数据");
@@ -1270,30 +1422,68 @@ export default {
//border-right: 1px solid @border-color-base;
display: flex;
flex-direction: column;
- padding: 16px 0px;
- .searchBar {
- width: 94%;
- margin: 0 auto;
+ // padding: 16px 0px;
+ .barHead {
+ width: calc(100% - 12px);
+ height: 32px;
+ background: linear-gradient(180deg, #4cdbc8 10%, #128071);
+ line-height: 32px;
+ display: flex;
+ align-items: center;
+ padding-left: 12px;
margin-bottom: 8px;
+ .el-divider--vertical {
+ width: 2px;
+ margin-left: 0px;
+ }
+ h2 {
+ color: #fff;
+ font-size: 16px;
+ font-weight: normal;
+ }
}
- .deviceNum {
- width: 94%;
- margin: 0 auto;
+ .tabMenu {
margin-bottom: 8px;
- height: 20px;
- line-height: 20px;
- font-size: 12px;
- .el-statistic {
- display: flex;
- justify-content: center;
- align-items: center;
- .head {
+ padding-left: 12px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 8px;
+ .el-radio-group {
+ .el-radio-button {
+ margin-right: 12px;
+ .el-radio-button__inner {
+ border-radius: 4px;
+ border: 1px solid #dcdfe6;
+ box-shadow: none;
+ }
}
- .con {
- color: #169e8c;
+ }
+ .deviceNum {
+ // width: 94%;
+ // margin: 0 auto;
+ // margin-bottom: 8px;
+ height: 20px;
+ line-height: 20px;
+ font-size: 12px;
+ .el-statistic {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ .head {
+ }
+ .con {
+ color: #169e8c;
+ }
}
}
}
+ .searchBar {
+ width: 94%;
+ margin: 0 auto;
+ margin-bottom: 8px;
+ }
+
.radioFilter {
width: 94%;
margin: 0 auto;
@@ -1312,9 +1502,11 @@ export default {
}
}
}
- .el-tree {
+ .treeboxAll {
overflow-y: auto;
overflow-x: hidden;
+ }
+ .el-tree {
.el-tree-node__content {
height: 32px;
font-size: 12px;
@@ -1412,11 +1604,17 @@ export default {
.zzbox {
height: 32px;
line-height: 32px;
- color: #169e8c;
- font-size: 14px;
- font-weight: normal;
+ display: flex;
//margin-bottom: 16px;
//background-color: #169e8cb0;
+ b {
+ color: #169e8c;
+ font-size: 14px;
+ font-weight: normal;
+ }
+ .el-button--text {
+ color: #f08200;
+ }
}
.paramsDate,
.monitorItemBox,
diff --git a/src/views/realTimeSearch/index.vue b/src/views/realTimeSearch/index.vue
index ca1fb6a..0eca190 100644
--- a/src/views/realTimeSearch/index.vue
+++ b/src/views/realTimeSearch/index.vue
@@ -130,7 +130,6 @@
-
{{ item.linename }} /
@@ -156,6 +155,14 @@
}} -->
+
+
+