Commit fb8097c0 authored by 梁淳峰's avatar 梁淳峰

240720

parent b586f5b0
<template> <template>
<el-menu active-text-color="#409eff" text-color="#fff" default-active="1" class="el-menu-vertical-demo " style="height: 100%;" <el-menu active-text-color="#409eff" text-color="#fff" default-active="1" class="el-menu-vertical-demo " style="height: 100%;"
@select="subEvent" @open="subEvent"> @select="subEvent" >
<MyMenu :meun="toRaw(meun)" :thisIndex="'1'"></MyMenu> <MyMenu :meun="toRaw(meun)" :thisIndex="'1'"></MyMenu>
</el-menu> </el-menu>
...@@ -28,7 +28,7 @@ import { reactive, ref } from 'vue' ...@@ -28,7 +28,7 @@ import { reactive, ref } from 'vue'
import MyMenu from './MyMenu.vue'; import MyMenu from './MyMenu.vue';
import { toRaw } from '@vue/reactivity' import { toRaw } from '@vue/reactivity'
const props = defineProps(['meun']); const props = defineProps(['meun']);
const emit= defineEmits(['subEvent']); const emit= defineEmits(['subEvent','openM','closeM']);
// console.log('data props:') // console.log('data props:')
...@@ -45,8 +45,23 @@ function subEvent(index, indexPath,item){ ...@@ -45,8 +45,23 @@ function subEvent(index, indexPath,item){
emit('subEvent',index) emit('subEvent',index)
} }
function closeM(){
console.log('提交收起事件')
emit('closeM');
}
function test()
{
console.log('test');
}
function openM(){
console.log('提交展开事件')
emit('openM');
}
function subMenuEvent(menu){ function subMenuEvent(menu){
emit('subEvent',menu.menuId); emit('subEvent',menu.menuId);
} }
const handleOpen = (key: string, keyPath: string[]) => {
console.log(key, keyPath)
}
</script> </script>
\ No newline at end of file
...@@ -102,8 +102,9 @@ onDeactivated(() => { ...@@ -102,8 +102,9 @@ onDeactivated(() => {
//声明公用变量 //声明公用变量
var initCount = 0; var initCount = 0;
var pubKey = ''; var pubKey = '';
var playWnd_width = window.innerWidth; var playWnd_width = window.innerWidth - 200;
var playWnd_height = 700; console.log(app)
var playWnd_height = window.innerHeight - 220;
var oWebControl; var oWebControl;
var videoIp; var videoIp;
var videoPort=1443; var videoPort=1443;
...@@ -123,6 +124,15 @@ function down(){ ...@@ -123,6 +124,15 @@ function down(){
const filepath='/OutputFile/VideoWebPlugin.zip'; const filepath='/OutputFile/VideoWebPlugin.zip';
window.open(filepath); window.open(filepath);
} }
function resetVideoWidth(){
var menuWidth=localStorage.getItem("tabWidth");
if(!menuWidth || menuWidth ==='' || !Number(menuWidth)){
playWnd_width = window.innerWidth - 200;
}else{
playWnd_width = window.innerWidth - Number(menuWidth);
}
console.log('playVW',playWnd_width);
}
//获取服务中心->供热站->换热站,三级列表 //获取服务中心->供热站->换热站,三级列表
function getStats() { function getStats() {
...@@ -238,7 +248,6 @@ $(document).ready(function () { ...@@ -238,7 +248,6 @@ $(document).ready(function () {
$('#startPlay').click( $('#startPlay').click(
function () { function () {
if (oWebControl) { if (oWebControl) {
// resizeVideo();
showPlay(); showPlay();
} else { } else {
initPlugin(); initPlugin();
...@@ -403,15 +412,15 @@ function setEncrypt(value) { ...@@ -403,15 +412,15 @@ function setEncrypt(value) {
// 监听resize事件,使插件窗口尺寸跟随DIV窗口变化 // 监听resize事件,使插件窗口尺寸跟随DIV窗口变化
$(window).resize(function () { $(window).resize(function () {
resetVideoWidth();
if (oWebControl != null) { if (oWebControl != null) {
oWebControl.JS_Resize(playWnd_width, playWnd_height); oWebControl.JS_Resize(playWnd_width, playWnd_height);
setWndCover(); setWndCover();
} }
}); });
function resizeVideo() { function resizeVideo() {
playWnd_width = window.innerWidth; resetVideoWidth();
if (oWebControl != null) { if (oWebControl != null) {
oWebControl.JS_Resize(playWnd_width, playWnd_height); oWebControl.JS_Resize(playWnd_width, playWnd_height);
setWndCover(); setWndCover();
...@@ -420,6 +429,7 @@ function resizeVideo() { ...@@ -420,6 +429,7 @@ function resizeVideo() {
// 监听滚动条scroll事件,使插件窗口跟随浏览器滚动而移动 // 监听滚动条scroll事件,使插件窗口跟随浏览器滚动而移动
$(window).scroll(function () { $(window).scroll(function () {
resetVideoWidth();
if (oWebControl != null) { if (oWebControl != null) {
oWebControl.JS_Resize(playWnd_width, playWnd_height); oWebControl.JS_Resize(playWnd_width, playWnd_height);
setWndCover(); setWndCover();
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</i> </i>
</div> </div>
<div class="ams-menu"> <div class="ams-menu">
<DataMenu></DataMenu> <DataMenu @mouseenter="enterMenu" @mouseleave="leaveMenu"></DataMenu>
</div> </div>
</div> </div>
<div class="ams-container" :style="{ left: menuWidth - 2 + 'px' }"> <div class="ams-container" :style="{ left: menuWidth - 2 + 'px' }">
...@@ -216,6 +216,7 @@ var $this; ...@@ -216,6 +216,7 @@ var $this;
var $interval; var $interval;
const componentView = ref(null); const componentView = ref(null);
localStorage.setItem('tabWidth','');
export default defineComponent({ export default defineComponent({
components: { components: {
...@@ -290,15 +291,13 @@ export default defineComponent({ ...@@ -290,15 +291,13 @@ export default defineComponent({
amslogo_style.width = store.state.iscollapse ? 40 : 150; amslogo_style.width = store.state.iscollapse ? 40 : 150;
mainWidth.value = window.innerWidth - menuWidth.value; mainWidth.value = window.innerWidth - menuWidth.value;
await EventBus.emit('changeValue', mainWidth.value); await EventBus.emit('changeValue', mainWidth.value);
localStorage.setItem('tabWidth',menuWidth.value);
console.log('触发') console.log('触发')
// console.log(proxy.$refs.componentView); // console.log(proxy.$refs.componentView);
// console.log(proxy.$refs.componentView.resizeVideo); // console.log(proxy.$refs.componentView.resizeVideo);
if(proxy.$refs.componentView && proxy.$refs.componentView.showPlay){ if(proxy.$refs.componentView && proxy.$refs.componentView.showPlay){
proxy.$refs.componentView.showPlay(); proxy.$refs.componentView.showPlay();
} }
// if(proxy.$refs.componentView && proxy.$refs.componentView.resizeVideo){
// proxy.$refs.componentView.resizeVideo();
// }
} }
//开放手动折叠菜单方法 //开放手动折叠菜单方法
...@@ -534,6 +533,29 @@ export default defineComponent({ ...@@ -534,6 +533,29 @@ export default defineComponent({
} }
} }
} }
function enterMenu(){
var menuWidth=localStorage.getItem("tabWidth");
if(menuWidth && menuWidth === '63'){
// console.log('e');
//隐藏视频插件
if (proxy.$refs.componentView && proxy.$refs.componentView.hidePlay) {
proxy.$refs.componentView.hidePlay();
}
}
}
function leaveMenu(){
var menuWidth=localStorage.getItem("tabWidth");
if(menuWidth && menuWidth === '63'){
// console.log('l');
//重置视频插件位置
if (proxy.$refs.componentView && proxy.$refs.componentView.showPlay) {
proxy.$refs.componentView.showPlay();
}
}
}
function openMap(){ function openMap(){
const routePath = '/GisHome'; // 要导航到的路由路径 const routePath = '/GisHome'; // 要导航到的路由路径
...@@ -574,7 +596,9 @@ export default defineComponent({ ...@@ -574,7 +596,9 @@ export default defineComponent({
changeTabsHandle, changeTabsHandle,
activeTable, activeTable,
logout, logout,
openMap openMap,
enterMenu,
leaveMenu
//enterpriseId //enterpriseId
}; };
}, },
......
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