| | |
| | | dframe.height = curDframe.height; |
| | | //根据分辨率动态调整(摄像机配置,数据栈配置,比对库管理,算力管理,实时监控) |
| | | //获取原始宽高比 |
| | | let ratio = curDframe.width/curDframe.height; |
| | | if(curDframe.name == 'cameraAccess' || curDframe.name == 'dataStack' || curDframe.name == 'library' || curDframe.name == 'analysisPower' || curDframe.name == 'cameraVideo'){ |
| | | let ratio = curDframe.width / curDframe.height; |
| | | if (curDframe.name == 'cameraAccess' || curDframe.name == 'dataStack' || curDframe.name == 'library' || curDframe.name == 'analysisPower' || curDframe.name == 'cameraVideo') { |
| | | //处理富余高度大于140的窗口 |
| | | if(window.screen.availHeight - curDframe.height > 140){ |
| | | dframe.height = (window.screen.availHeight - curDframe.height)/2 + curDframe.height - 50; |
| | | dframe.width = dframe.height*ratio; |
| | | if (window.screen.availHeight - curDframe.height > 140) { |
| | | dframe.height = (window.screen.availHeight - curDframe.height) / 2 + curDframe.height - 50; |
| | | dframe.width = dframe.height * ratio; |
| | | } |
| | | } |
| | | //全部绝对居中 |
| | | dframe.leftOffset = (document.body.offsetWidth - dframe.width)/2; |
| | | dframe.topOffset = (document.body.offsetHeight - dframe.height)/2; |
| | | |
| | | dframe.leftOffset = (document.body.offsetWidth - dframe.width) / 2; |
| | | dframe.topOffset = (document.body.offsetHeight - dframe.height) / 2; |
| | | |
| | | state.framesOrder = order; |
| | | state.framesOffset = offset; |
| | | state.frames.push(dframe); |
| | | |
| | | return true; |
| | | }, |
| | | shotscreen: (state, {id,src}) => { |
| | | shotscreen: (state, { id, src }) => { |
| | | let curFrame = state.frames.find(frame => frame.id == id); |
| | | if(!curFrame.isShow){ |
| | | if (!curFrame.isShow) { |
| | | return |
| | | } |
| | | let curDock = state.minDocks.find(one => one.id == id); |
| | |
| | | }, |
| | | addMinDock: (state, dock) => { |
| | | let ids = state.minDocks.map(item => item.id); |
| | | |
| | | |
| | | if (ids.indexOf(dock.id) > -1) { |
| | | //已经在mindock里 |
| | | let curFrame = state.frames.find(frame => frame.id == dock.id); |
| | | curFrame.isShow = false; |
| | | let minOne = state.minDocks.find(one => one.id == dock.id); |
| | | |
| | | |
| | | minOne.highlight = false; |
| | | debugger |
| | | minOne.screenshot = dock.screenshot?dock.screenshot:minOne.screenshot; |
| | | minOne.screenshot = dock.screenshot ? dock.screenshot : minOne.screenshot; |
| | | //找到minDocks最近打开的状态isShow为true的dock置为高亮 |
| | | let minLen = state.minDocks.length; |
| | | for(var i = minLen-1; i >= 0; i--){ |
| | | let temp = state.frames.find(frame=>frame.id == state.minDocks[i].id); |
| | | if(temp.isShow){ |
| | | for (var i = minLen - 1; i >= 0; i--) { |
| | | let temp = state.frames.find(frame => frame.id == state.minDocks[i].id); |
| | | if (temp.isShow) { |
| | | state.minDocks[i].highlight = true; |
| | | return; |
| | | } |
| | |
| | | // } |
| | | // return false; |
| | | // }); |
| | | |
| | | |
| | | state.minDocks.push(dock); |
| | | |
| | | |
| | | }, |
| | | addMessageNotice: (state, msg) => { |
| | | let ids = state.messageNotices.map(item => item.id); |
| | |
| | | } |
| | | return false; |
| | | }); |
| | | |
| | | |
| | | state.docks.find(function (it) { |
| | | if (it.id === item.id) { |
| | | it.isOpen = false; |
| | |
| | | state.safari.active = false; |
| | | } |
| | | }, |
| | | highlight(state){ |
| | | highlight(state) { |
| | | //找到minDocks最近打开的状态isShow为true的dock置为高亮 |
| | | let minLen = state.minDocks.length; |
| | | for(var i = minLen-1; i >= 0; i--){ |
| | | let temp = state.frames.find(frame=>frame.id == state.minDocks[i].id); |
| | | if(temp.isShow){ |
| | | for (var i = minLen - 1; i >= 0; i--) { |
| | | let temp = state.frames.find(frame => frame.id == state.minDocks[i].id); |
| | | if (temp.isShow) { |
| | | state.minDocks[i].highlight = true; |
| | | return; |
| | | } |
| | |
| | | state.safari.isShow = true; |
| | | }, |
| | | refreshFrame: (state, item) => { |
| | | |
| | | |
| | | state.frames.forEach(function (it) { |
| | | |
| | | |
| | | if (it.id === item.id) { |
| | | it.order = 1; |
| | | |
| | | state.minDocks.forEach((min,index)=>{ |
| | | |
| | | if(min.id == it.id){ |
| | | |
| | | state.minDocks.forEach((min, index) => { |
| | | |
| | | if (min.id == it.id) { |
| | | |
| | | min.highlight = true; |
| | | }else{ |
| | | } else { |
| | | min.highlight = false; |
| | | |
| | | |
| | | } |
| | | }) |
| | | } else { |
| | | it.order = 0; |
| | | } |
| | | }); |
| | | |
| | | |
| | | }, |
| | | refreshTime: (state) => { |
| | | state.currentDate = new Date(); |
| | |
| | | state.frames.find(function (it) { |
| | | if (it.id === id) { |
| | | it.isShow = true; |
| | | |
| | | |
| | | return true; |
| | | } |
| | | return false; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | removeMessageById: (state, id) => { |
| | | state.messageNotices.find(function (item, idx) { |