(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[16],{"96a5":function(t,o,i){},c306:function(t,o,i){"use strict";i("96a5")},ed6dc:function(t,o,i){"use strict";i.r(o);var e=function(){var t=this,o=t._self._c;return o("div",{ref:"monitor",staticClass:"monitor"},[o("dlp-title-corder",{staticClass:"pos-title",attrs:{name:t.monitorWorkShop.label}}),o("div",{ref:"boxWrapper",staticClass:"scrollbar box-wrapper"},[1===t.ipList.length?o("div",{staticClass:"wrap"},[o("div",{staticClass:"video-box full-width",staticStyle:{height:"85vh"}},[o("iframe",{attrs:{width:"100%",height:"100%",src:t.ipList[0],frameborder:"0"}})])]):2===t.ipList.length?o("div",{staticClass:"flex wrap"},[o("div",{staticClass:"video-box",staticStyle:{width:"50%",height:"85vh"}},[o("iframe",{attrs:{width:"100%",height:"100%",src:t.ipList[0],frameborder:"0"}})]),o("div",{staticClass:"video-box",staticStyle:{width:"50%",height:"85vh"}},[o("iframe",{attrs:{width:"100%",height:"100%",src:t.ipList[1],frameborder:"0"}})])]):o("div",{staticClass:"flex wrap"},t._l(t.ipList,(function(t,i){return o("div",{key:i,staticClass:"video-box",staticStyle:{width:"50%",height:"42.5vh"}},[o("iframe",{attrs:{width:"100%",height:"100%",src:t,frameborder:"0"}})])})),0)]),o("workshop-set",{ref:"workshopSetDialog",on:{submit:t.changeWorkshop}})],1)},a=[],r=i("ded3"),s=i.n(r),n=(i("d3b7"),i("159b"),i("c975"),i("14d9"),i("cb9a")),h=i("2f62"),c=i("d3de"),l=(i("99af"),i("e6cf"),i("758b")),p=i("b21a"),d=p["a"].tpmUrl;function f(t){var o="".concat(d,"/workshop/").concat(t,"/camera_config");return l["a"].get(o).then((function(t){return Promise.resolve(t)}))}var u=.3,m=60,v={name:"index",components:{WorkshopSet:c["a"]},data:function(){return{yPosition:"bottom",yInterval:"",yStepValue:0,ipList:[]}},computed:s()({},Object(h["c"])(["monitorShow","monitorWorkShop"])),watch:{monitorShow:function(t){t?this.$refs.workshopSetDialog.showDialog(this.monitorWorkShop.value):this.$refs.workshopSetDialog.hideDialog()}},mounted:function(){this.getWorkshop()},methods:s()(s()({},Object(h["d"])({setMonitorWorkShop:"SET_MONITOR_WORKSHOP"})),{},{getWorkshop:function(){var t=this;Object(n["i"])().then((function(o){o.data.length>0?(t.monitorWorkShop||t.setMonitorWorkShop(o.data[0]),t.getCameraConfigData(t.monitorWorkShop.value)):t.$message("您当前还没有创建车间数据，请先去创建车间")}))},changeWorkshop:function(t){this.setMonitorWorkShop(t),this.getCameraConfigData(this.monitorWorkShop.value)},getCameraConfigData:function(t){var o=this;f(t).then((function(t){var i=t.data,e=[];i.forEach((function(t){t.cameraIp.indexOf("http")>-1?e.push(t.cameraIp):e.push("http://"+t.cameraIp)})),o.ipList=e,o.ipList.length>4&&o.scrollTopAndBottom()}))},scrollTopAndBottom:function(){var t=this;this.$nextTick((function(){var o=t.$refs.boxWrapper,i=o.clientHeight,e=o.scrollHeight;if(e>i){var a=0,r=e-i;clearInterval(t.yInterval),t.yInterval=setInterval((function(){o.scrollTop=t.yStepValue,t.yStepValue=t.yStepValue+u*("bottom"===t.yPosition?1:-1),t.yStepValue<=a&&(t.yPosition="bottom"),t.yStepValue>=r&&(t.yPosition="top")}),m),t.$once("hook:beforeDestroy",(function(){clearInterval(t.yInterval)}))}}))}})},g=v,b=(i("c306"),i("2877")),w=Object(b["a"])(g,e,a,!1,null,"66577826",null);o["default"]=w.exports}}]);