Commit c8c20766 authored by lei's avatar lei

add:监控视频播放页面

parent 872ef1df
...@@ -12,11 +12,21 @@ ...@@ -12,11 +12,21 @@
> >
</el-tree> </el-tree>
</div> --> </div> -->
<!-- 弹窗 -->
<el-dialog title="监控视频" :visible.sync="videoDialog" width="60%">
<iframe
:src="`http://10.7.148.106:10800/play.html?channel=${channel}&iframe=yes&aspect=640x360`"
width="640"
height="360"
allowfullscreen
allow="autoplay; fullscreen"
></iframe>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import iFrame from '@/components/iFrame'; import iFrame from "@/components/iFrame";
export default { export default {
name: "demonstrate", name: "demonstrate",
...@@ -24,52 +34,69 @@ export default { ...@@ -24,52 +34,69 @@ export default {
data() { data() {
return { return {
intervalId: null, intervalId: null,
msg:null, msg: null,
btnItems:[{ btnItems: [
{
id: 1, id: 1,
label: '人工设置', label: "人工设置",
children: [{ children: [
{
id: 5, id: 5,
label: '添加人工', label: "添加人工",
val:'2-0' val: "2-0",
},{ },
{
id: 6, id: 6,
label: '设置完成', label: "设置完成",
val:'2-1' val: "2-1",
}] },
}, { ],
},
{
id: 2, id: 2,
label: '障碍设置', label: "障碍设置",
children: [{ children: [
{
id: 7, id: 7,
label: '塌方', label: "塌方",
val:'3-0' val: "3-0",
}, { },
{
id: 8, id: 8,
label: '渗水', label: "渗水",
val:'3-1' val: "3-1",
}, { },
{
id: 8, id: 8,
label: '设置完成', label: "设置完成",
val:'3-2' val: "3-2",
}] },
}, { ],
},
{
id: 3, id: 3,
label: '避险', label: "避险",
children: [{ children: [
{
id: 9, id: 9,
label: '井下避险', label: "井下避险",
val:'4-0' val: "4-0",
}, { },
{
id: 10, id: 10,
label: '全员撤离', label: "全员撤离",
val:'4-1' val: "4-1",
}] },
}, { ],
},
{
id: 4, id: 4,
label: '初始化', label: "初始化",
val:'5-0' val: "5-0",
}], },
],
videoDialog: false,
channel: "",
}; };
}, },
mounted() { mounted() {
...@@ -84,61 +111,69 @@ export default { ...@@ -84,61 +111,69 @@ export default {
this.intervalId = setInterval(this.checkLocalStorage, 1000); this.intervalId = setInterval(this.checkLocalStorage, 1000);
}); });
//从路由里面拿参数
this.channel = this.$route.query.channel;
if (this.channel) {
// 打开弹窗
this.videoDialog = true;
} else {
// 关闭弹窗
this.videoDialog = false;
}
}, },
methods: { methods: {
nodeClick(obj){ nodeClick(obj) {
if(obj.val){ if (obj.val) {
this.sendTo3D(obj.val) this.sendTo3D(obj.val);
} }
}, },
checkLocalStorage() { checkLocalStorage() {
let name = localStorage.getItem('name'); let name = localStorage.getItem("name");
if (name) { if (name) {
// console.log('找到:', name); // console.log('找到:', name);
clearInterval(this.intervalId); clearInterval(this.intervalId);
this.msg = name; this.msg = name;
} else { } else {
console.log('Name not found, continuing to check...'); console.log("Name not found, continuing to check...");
} }
}, },
sendTo3D(val) { sendTo3D(val) {
localStorage.removeItem("to3d"); localStorage.removeItem("to3d");
localStorage.setItem("to3d", val); localStorage.setItem("to3d", val);
}, },
}, },
beforeDestroy() { beforeDestroy() {
localStorage.removeItem("to3d"); localStorage.removeItem("to3d");
localStorage.removeItem("name"); localStorage.removeItem("name");
clearInterval(this.intervalId); clearInterval(this.intervalId);
} },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.demonstrate{ .demonstrate {
position: relative; position: relative;
.u3d-iframe{ .u3d-iframe {
width: 100%; width: 100%;
} }
.u3d-btn{ .u3d-btn {
width: 140px; width: 140px;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0%; left: 0%;
top: 10%; top: 10%;
.u3d-btn-item{ .u3d-btn-item {
font-size: 30px; font-size: 30px;
line-height: 1.5em; line-height: 1.5em;
font-weight: bold; font-weight: bold;
color: #0394d0; color: #0394d0;
cursor: pointer; cursor: pointer;
&:hover{ &:hover {
color:rgba(13, 29, 55); color: rgba(13, 29, 55);
} }
} }
} }
} }
::v-deep .el-tree{ ::v-deep .el-tree {
background: none; background: none;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment