|
|
|
@ -8,10 +8,10 @@
|
|
|
|
|
<el-tree
|
|
|
|
|
:data="lineTreeData"
|
|
|
|
|
:props="defaultProps"
|
|
|
|
|
:expand-on-click-node="false"
|
|
|
|
|
ref="tree"
|
|
|
|
|
node-key="id"
|
|
|
|
|
highlight-current
|
|
|
|
|
:default-expand-all="true"
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
:current-node-key="currentNodekey"
|
|
|
|
|
>
|
|
|
|
@ -20,13 +20,38 @@
|
|
|
|
|
<!-- <router-view></router-view> -->
|
|
|
|
|
<!-- 中心内容 -->
|
|
|
|
|
|
|
|
|
|
<picturemain :photoData="photoData" v-if="showBigPic"></picturemain>
|
|
|
|
|
<!-- <picturemain :photoData="photoData" v-if="showBigPic"></picturemain> -->
|
|
|
|
|
<!-- 带参数的中心内容右侧参数区 -->
|
|
|
|
|
<div class="picSetBox" v-else>
|
|
|
|
|
<div class="picSetBox">
|
|
|
|
|
<div class="swiperBox">
|
|
|
|
|
<carouselChart></carouselChart>
|
|
|
|
|
{{ terminalPhoto }}
|
|
|
|
|
<div class="pic" v-for="item in terminalPhoto">
|
|
|
|
|
<img :src="item.path" style="width: 100%; height: 100%" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<paramArea></paramArea>
|
|
|
|
|
|
|
|
|
|
<!-- <carouselChart></carouselChart> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="parameterArea">
|
|
|
|
|
<div class="monitorItemBox">
|
|
|
|
|
<h3>检测项 通道</h3>
|
|
|
|
|
<div class="btnBox">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="channelValue"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
@change="changeChannelId"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in channelOption"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <paramArea></paramArea> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -34,6 +59,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
getLineTreeListJoggle,
|
|
|
|
|
getChannelListJoggle,
|
|
|
|
|
getTerminalPhotoListJoggle,
|
|
|
|
|
} from "@/utils/api/index";
|
|
|
|
|
import carouselChart from "../components/carouselChart.vue";
|
|
|
|
@ -50,9 +76,6 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
photoData: "",
|
|
|
|
|
childData: "",
|
|
|
|
|
currentNodekey: "",
|
|
|
|
|
showBigPic: true,
|
|
|
|
|
defaultKey: "",
|
|
|
|
|
lineTreeData: [],
|
|
|
|
@ -62,6 +85,11 @@ export default {
|
|
|
|
|
label: "name",
|
|
|
|
|
},
|
|
|
|
|
currentNodekey: "", //默认选中的节点树,
|
|
|
|
|
channelId: "", //通道id
|
|
|
|
|
channelList: "", //通道数据
|
|
|
|
|
channelOption: [], //通道分类
|
|
|
|
|
channelValue: "",
|
|
|
|
|
terminalPhoto: [], //获取拍照装置当前数据
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {},
|
|
|
|
@ -70,7 +98,6 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
this.getLineTreeList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
//获取左侧树结构
|
|
|
|
|
getLineTreeList() {
|
|
|
|
@ -80,9 +107,12 @@ export default {
|
|
|
|
|
this.lineTreeData = res.data.list;
|
|
|
|
|
console.log(this.lineTreeData);
|
|
|
|
|
if (this.lineTreeData.length > 0) {
|
|
|
|
|
this.currentNodekey = this.lineTreeData[0].id;
|
|
|
|
|
this.currentNodekey = this.lineTreeData[0].id; //第一个数据
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.tree.setCurrentKey(this.currentNodekey); //一定要加这个选中了否则样式没有出来
|
|
|
|
|
console.log(this.currentNodekey);
|
|
|
|
|
this.channelId = this.currentNodekey;
|
|
|
|
|
this.getChannelList(this.channelId);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -90,14 +120,65 @@ export default {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取通道的接口
|
|
|
|
|
getChannelList(id) {
|
|
|
|
|
getChannelListJoggle({ termid: id })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.channelList = res.data.list;
|
|
|
|
|
this.getTerminalPhotoList(
|
|
|
|
|
this.channelList[0].id,
|
|
|
|
|
this.channelList[0].termId
|
|
|
|
|
); //获取图片列表是传当前设备的 id 和termid
|
|
|
|
|
this.channelList.forEach((item) => {
|
|
|
|
|
this.channelOption.push({
|
|
|
|
|
label: item.channelName,
|
|
|
|
|
value: item.id,
|
|
|
|
|
termid: item.termId,
|
|
|
|
|
});
|
|
|
|
|
}); // 选择通道一通道二select框
|
|
|
|
|
this.channelValue = this.channelOption[0].label; //默认选中第一个
|
|
|
|
|
console.log(this.channelOption);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取图片
|
|
|
|
|
getTerminalPhotoList() {},
|
|
|
|
|
getTerminalPhotoList(id, termId) {
|
|
|
|
|
getTerminalPhotoListJoggle({
|
|
|
|
|
channelid: id,
|
|
|
|
|
pageindex: 1,
|
|
|
|
|
pagesize: 1,
|
|
|
|
|
terminalid: termId,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.terminalPhoto = res.data.list;
|
|
|
|
|
console.log(this.terminalPhoto);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//切换通道
|
|
|
|
|
changeChannelId(val) {
|
|
|
|
|
console.log(val);
|
|
|
|
|
let channelObj = {};
|
|
|
|
|
channelObj = this.channelOption.find(function (i) {
|
|
|
|
|
return i.value === val;
|
|
|
|
|
});
|
|
|
|
|
console.log(channelObj);
|
|
|
|
|
this.getTerminalPhotoList(val, channelObj.termid);
|
|
|
|
|
},
|
|
|
|
|
//点击获取当前点击的tree数据
|
|
|
|
|
handleNodeClick(data, node) {
|
|
|
|
|
console.log(data, node);
|
|
|
|
|
if (data.list) {
|
|
|
|
|
this.$refs.tree.setCurrentKey(data.list[0].id);
|
|
|
|
|
}
|
|
|
|
|
this.channelId = data.id; //获取当前点击的id
|
|
|
|
|
this.getChannelList(this.channelId);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
@ -110,10 +191,6 @@ export default {
|
|
|
|
|
background: #2d8cf0 !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-tree-node > .el-tree-node__content:hover {
|
|
|
|
|
background-color: #c1ddf0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.monitor-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
height: 100%;
|
|
|
|
|