import{P as q,I as J,_ as L,$ as H,a0 as K,x as Q,y as G,L as X,M as Y,O as Z,J as ee}from"./element-plus.5df6f736.js";import{_ as te}from"./index.vue_vue_type_script_setup_true_lang.4e44db35.js";import{u as se}from"./vue-router.ed788fee.js";import{o as m,c as f,a as t,L as C,ab as D,d as T,r as k,_ as j,T as i,K as u,U as M,S as v,Q as y,u as B,a6 as oe,J as F,R as V}from"./@vue.108c970a.js";import{d as ie,t as S}from"./index.687d0718.js";import{a as ae}from"./useDictOptions.3f9d6744.js";import{a as ne,b as A}from"./device.e0369998.js";import"./@vueuse.d3d080b7.js";import"./@element-plus.d6eabd08.js";import"./lodash-es.29c53eac.js";import"./dayjs.50c3b6f7.js";import"./axios.c2a2014a.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.33f675f2.js";import"./pinia.eff1ffd5.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.5d5b8bda.js";import"./color.da05fa89.js";import"./clone.06747a68.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.1c707d7b.js";import"./ms.a9ae1d6d.js";import"./nprogress.fc605139.js";import"./vue-clipboard3.dc900a40.js";import"./clipboard.6beb87aa.js";import"./echarts.8d7a50ae.js";import"./zrender.1084fa23.js";import"./tslib.60310f1a.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.241b9b5d.js";const le={name:"VideoPlayer",props:{video_url:String},data(){return{jessibuca:null,version:"",wasm:!1,videoUrl:"",vc:"ff",playing:!1,quieting:!0,loaded:!1,showOperateBtns:!1,showBandwidth:!1,err:"",speed:0,performance:"",volume:1,rotate:0,useWCS:!1,useMSE:!0,useOffscreen:!1,recording:!1,recordType:"webm",scale:0}},mounted(){this.create(),this.videoUrl=this.video_url,window.onerror=l=>this.err=l,setTimeout(()=>{this.play()},2e3)},unmounted(){this.jessibuca.destroy()},methods:{create(l){l=l||{},this.jessibuca=new window.Jessibuca(Object.assign({container:this.$refs.container,videoBuffer:Number(this.$refs.buffer.value),isResize:!1,useWCS:this.useWCS,useMSE:this.useMSE,text:"",loadingText:"\u75AF\u72C2\u52A0\u8F7D\u4E2D...",debug:!1,decoder:"/decoder.js",supportDblclickFullscreen:!0,showBandwidth:this.showBandwidth,operateBtns:{fullscreen:this.showOperateBtns,screenshot:this.showOperateBtns,play:this.showOperateBtns,audio:this.showOperateBtns},vod:this.vod,forceNoOffscreen:!this.useOffscreen,isNotMute:!0,timeout:10},l));let o=this;this.jessibuca.on("load",function(){console.log("on load")}),this.jessibuca.on("log",function(e){console.log("on log",e)}),this.jessibuca.on("record",function(e){console.log("on record:",e)}),this.jessibuca.on("pause",function(){console.log("on pause"),o.playing=!1}),this.jessibuca.on("play",function(){console.log("on play"),o.playing=!0}),this.jessibuca.on("fullscreen",function(e){console.log("on fullscreen",e)}),this.jessibuca.on("mute",function(e){console.log("on mute",e),o.quieting=e}),this.jessibuca.on("mute",function(e){console.log("on mute2",e)}),this.jessibuca.on("audioInfo",function(e){console.log("audioInfo",e)}),this.jessibuca.on("videoInfo",function(e){console.log("videoInfo",e)}),this.jessibuca.on("error",function(e){console.log("error",e)}),this.jessibuca.on("timeout",function(){console.log("timeout")}),this.jessibuca.on("start",function(){console.log("frame start")}),this.jessibuca.on("performance",function(e){var a="\u5361\u987F";e===2?a="\u975E\u5E38\u6D41\u7545":e===1&&(a="\u6D41\u7545"),o.performance=a}),this.jessibuca.on("buffer",function(e){console.log("buffer",e)}),this.jessibuca.on("stats",function(e){console.log("stats",e)}),this.jessibuca.on("kBps",function(e){console.log("kBps",e)}),this.jessibuca.on("play",()=>{this.playing=!0,this.loaded=!0,this.quieting=this.jessibuca.isMute()}),this.jessibuca.on("recordingTimestamp",e=>{console.log("recordingTimestamp",e)})},play(){this.$refs.playUrl.value&&this.jessibuca.play(this.$refs.playUrl.value)},mute(){this.jessibuca.mute()},cancelMute(){this.jessibuca.cancelMute()},pause(){this.jessibuca.pause(),this.playing=!1,this.err="",this.performance=""},volumeChange(){this.jessibuca.setVolume(this.volume)},rotateChange(){this.jessibuca.setRotate(this.rotate)},destroy(){this.jessibuca&&this.jessibuca.destroy(),this.create(),this.playing=!1,this.loaded=!1,this.performance=""},fullscreen(){this.jessibuca.setFullscreen(!0)},clearView(){this.jessibuca.clearView()},startRecord(){const l=new Date().getTime();this.jessibuca.startRecord(l,this.recordType)},stopAndSaveRecord(){this.jessibuca.stopRecordAndSave()},screenShot(){this.jessibuca.screenshot()},restartPlay(l){l==="mse"?(this.useWCS=!1,this.useOffscreen=!1):l==="wcs"?this.useMSE=!1:l==="offscreen"&&(this.useMSE=!1),this.destroy(),setTimeout(()=>{this.play()},100)},changeBuffer(){this.jessibuca.setBufferTime(Number(this.$refs.buffer.value))},scaleChange(){this.jessibuca.setScaleMode(this.scale)}}},ue={class:"rot"},ce={class:"container-shell"},de={class:"option",style:{display:"none"}},re=t("span",null,"MediaSource",-1),_e=t("span",null,"webcodecs",-1),me={id:"container",ref:"container"},pe={class:"input",style:{display:"none"}},he=t("div",null,"\u8F93\u5165URL\uFF1A",-1),ve=["value"];function fe(l,o,e,a,p,_){return m(),f("div",ue,[t("div",ce,[t("div",de,[t("input",{style:{width:"50px"},type:"number",ref:"buffer",value:"0.2",onChange:o[0]||(o[0]=(...c)=>_.changeBuffer&&_.changeBuffer(...c))},null,544),C(t("input",{type:"checkbox","onUpdate:modelValue":o[1]||(o[1]=c=>p.useMSE=c),ref:"vod",onChange:o[2]||(o[2]=c=>_.restartPlay("mse"))},null,544),[[D,p.useMSE]]),re,C(t("input",{type:"checkbox","onUpdate:modelValue":o[3]||(o[3]=c=>p.useWCS=c),ref:"vod",onChange:o[4]||(o[4]=c=>_.restartPlay("wcs"))},null,544),[[D,p.useWCS]]),_e]),t("div",me,null,512),t("div",pe,[he,t("input",{type:"input",autocomplete:"on",ref:"playUrl",value:e.video_url},null,8,ve),p.playing?(m(),f("button",{key:1,onClick:o[6]||(o[6]=(...c)=>_.pause&&_.pause(...c))},"\u505C\u6B62")):(m(),f("button",{key:0,onClick:o[5]||(o[5]=(...c)=>_.play&&_.play(...c))},"\u64AD\u653E"))])])])}const ge=ie(le,[["render",fe]]),be=t("div",null,[t("span",{class:"card-title"},"\u8BBE\u5907\u8D44\u6599")],-1),ye={class:"flex flex-wrap"},xe={key:0,class:"w-1/2 md:w-1/3 mb-4"},we=t("div",{class:"leading-10"},"\u6240\u5C5E\u571F\u5730\uFF1A",-1),je={class:"text-3xl text-tx-gray"},Be={key:1,class:"w-1/2 md:w-1/3 mb-4"},Fe=t("div",{class:"leading-10"},"\u6240\u5C5E\u4EA7\u54C1\uFF1A",-1),Ee={class:"text-3xl text-tx-gray"},Ce={class:"flex flex-wrap"},De={class:"w-1/2 md:w-1/6 mb-4"},ke=t("div",{class:"leading-10"},"\u8BBE\u5907\u540D\u79F0\uFF1A",-1),Me={class:"text-3xl text-tx-gray"},Se={class:"w-1/2 md:w-1/6 mb-4"},Ae=t("div",{class:"leading-10"},"\u8BBE\u5907\u7F16\u7801\uFF1A",-1),Te={class:"text-3xl text-tx-gray"},Ve={class:"w-1/2 md:w-1/6 mb-4"},$e=t("div",{class:"leading-10"},"\u8BBE\u5907\u7C7B\u578B\uFF1A",-1),Oe={class:"text-3xl text-tx-gray"},Ue={class:"w-1/2 md:w-1/6 mb-4"},Re=t("div",{class:"leading-10"},"\u8BBE\u5907\u72B6\u6001\uFF1A",-1),ze={class:"text-3xl text-tx-gray"},Ne={class:"w-1/2 md:w-1/6 mb-4"},Ie=t("div",{class:"leading-10"},"\u662F\u5426\u5728\u7EBF\uFF1A",-1),Pe={class:"text-3xl text-tx-gray"},We={class:"flex justify-between mb-2"},qe={class:"mt-2 text-sm text-tx-secondary"},Je=["onClick"],Le={class:"my-6 text-3xl"},He={class:"mt-2 text-sm text-tx-secondary"},Ke=V("\u53EA\u8BFB"),Qe=T({name:"deviceDetail"}),Vt=T({...Qe,setup(l){const o=k("monitor_item"),e=j({device:{},monitor_item:[]}),a=j({device_id:"",monitor_type:"",page_no:1,page_size:15,total:""}),{dictData:p}=ae("device_type,device_status,device_online_status,device_bind_status,monitor_item"),_=se();(async()=>{ne({id:_.query.device_id}).then(s=>{e.device.name=s.name,e.device.code=s.code,e.device.type=s.type,e.device.status=s.status,e.device.is_online=s.is_online,e.device.is_bind=s.is_bind,e.device.land_id=s.land_id==null?"":s.land_id,e.device.land_title=s.land_title==null?"":s.land_title,e.device.product_id=s.product_id==null?"":s.product_id,e.device.product_name=s.product_name==null?"":s.product_name,e.monitor_item=s.monitor_item,e.device.video_url=s.video_url}).catch(s=>{console.log("err",s)})})();const b=k(!1),g=j({gridData:[{}]}),$=(s,n)=>{g.gridData=[{}],a.device_id=s,a.monitor_type=n,A({id:s,monitor_type:n,page_no:a.page_no,page_size:a.page_size}).then(d=>{b.value=!0,a.total=d.count,d.lists.map(h=>{a.total=d.count,g.gridData.push({id:h.id,date:h.create_time?S(h.create_time,"yyyy-mm-dd hh:MM:ss"):"",value:h.monitor_value})})}).catch(d=>{console.log("err",d)})},O=s=>{console.log(`current page: ${s}`),g.gridData=[{}],A({id:a.device_id,monitor_type:a.monitor_type,page_no:s,page_size:a.page_size}).then(n=>{b.value=!0,a.total=n.count,n.lists.map(d=>{g.gridData.push({id:d.id,date:d.create_time?S(d.create_time,"yyyy-mm-dd hh:MM:ss"):"",value:d.monitor_value})})}).catch(n=>{console.log("err",n)})};return(s,n)=>{const d=q,h=J,x=te,U=L,R=H,z=K,E=Q,N=G,w=X,I=Y,P=Z,W=ee;return m(),f(M,null,[t("div",null,[i(h,{class:"!border-none",shadow:"never"},{default:u(()=>[i(d,{content:"\u8BBE\u5907\u8BE6\u60C5",onBack:n[0]||(n[0]=r=>s.$router.back())})]),_:1}),i(h,{class:"!border-none mt-4 flex-1",shadow:"never"},{header:u(()=>[be]),default:u(()=>[t("div",ye,[e.device.land_id!=""?(m(),f("div",xe,[we,t("div",je,"ID\uFF1A"+v(e.device.land_id)+" / \u540D\u79F0\uFF1A"+v(e.device.land_title),1)])):y("",!0),e.device.product_id!=""?(m(),f("div",Be,[Fe,t("div",Ee,"ID\uFF1A"+v(e.device.product_id)+" / \u540D\u79F0\uFF1A"+v(e.device.product_name),1)])):y("",!0)]),t("div",Ce,[t("div",De,[ke,t("div",Me,v(e.device.name),1)]),t("div",Se,[Ae,t("div",Te,v(e.device.code),1)]),t("div",Ve,[$e,t("div",Oe,[i(x,{options:B(p).device_type,value:e.device.type},null,8,["options","value"])])]),t("div",Ue,[Re,t("div",ze,[i(x,{options:B(p).device_status,value:e.device.status},null,8,["options","value"])])]),t("div",Ne,[Ie,t("div",Pe,[i(x,{options:B(p).device_online_status,value:e.device.is_online},null,8,["options","value"])])])])]),_:1}),i(h,{class:"!border-none mt-4 flex-1",shadow:"never"},{default:u(()=>[i(N,{modelValue:o.value,"onUpdate:modelValue":n[1]||(n[1]=r=>o.value=r),class:""},{default:u(()=>[i(E,{label:"\u76D1\u63A7\u6570\u636E",name:"monitor_item"},{default:u(()=>[i(z,{gutter:12},{default:u(()=>[(m(!0),f(M,null,oe(e.monitor_item,r=>(m(),F(R,{span:6,key:r},{default:u(()=>[i(h,{shadow:"always",class:"mb-4"},{default:u(()=>[t("div",We,[t("div",qe,v(r.name),1),t("div",{class:"mt-2 text-sm text-tx-secondary",style:{cursor:"pointer"},onClick:Ge=>$(r.device_id,r.value)}," \u5386\u53F2\u6570\u636E ",8,Je)]),t("div",Le,v(r.monitor_value),1),t("div",He,[i(U,{class:"mr-2",type:"info"},{default:u(()=>[Ke]),_:1}),V(v(r.last_time),1)])]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1}),e.device.type==3?(m(),F(E,{key:0,label:"\u76D1\u63A7\u89C6\u9891",name:"monitor_video"},{default:u(()=>[e.device.video_url!=""?(m(),F(ge,{key:0,video_url:e.device.video_url},null,8,["video_url"])):y("",!0)]),_:1})):y("",!0)]),_:1},8,["modelValue"])]),_:1})]),i(W,{modelValue:b.value,"onUpdate:modelValue":n[2]||(n[2]=r=>b.value=r),title:"\u5386\u53F2\u6570\u636E"},{default:u(()=>[i(I,{data:g.gridData},{default:u(()=>[i(w,{property:"id",label:"ID",width:"80"}),i(w,{property:"date",label:"\u65F6\u95F4",width:"250"}),i(w,{property:"value",label:"\u6570\u636E"})]),_:1},8,["data"]),i(P,{small:"",background:"",layout:"prev, pager, next","page-size":a.page_size,total:a.total,class:"mt-4",onCurrentChange:O},null,8,["page-size","total"])]),_:1},8,["modelValue"])],64)}}});export{Vt as default};