import{_ as G,b as J,Z as b,r as d,w as K,o as s,y as $,q as v,v as t,x as m,p,n as l,s as C,c as r,F as k,A as x,P as Q,aH as W,t as N,d6 as X,E as Y,i as ee,k as ae,m as te,bv as le,bH as oe,a0 as se,a1 as ie}from"./index.8d733f79.js";import{E as ne}from"./el-image.a7c44d35.js";import"./el-image-viewer.42b4b63f.js";import{u as ce,p as de,_ as D}from"./progressiveImage.298c3f69.js";import{w as re}from"./deviceTree.170dfbd9.js";import"./throttle.04d7163a.js";const S=I=>(se("data-v-400c13ac"),I=I(),ie(),I),ue={style:{"text-align":"left","font-size":"16px"}},ve={class:"point-img"},_e={class:"img-container","element-loading-background":"rgba(0,0,0,0.4)"},me={class:"content"},ge={class:"content-header"},pe=S(()=>t("img",{src:D,alt:"",class:"icon-device"},null,-1)),Ie={class:"img-name"},fe={key:0,class:"overall-img"},he={class:"view-img"},ye=["src"],be={key:1,class:"no-data"},ke={class:"img-list"},Se=["onClick"],we={class:"item-header"},Le=S(()=>t("img",{src:D,alt:"",class:"icon-device"},null,-1)),Ee=["title"],Ve={key:0,class:"overall-img"},$e={class:"item-img"},Ce=S(()=>t("div",{class:"scroll"},[t("div",{class:"scroll-bar"})],-1)),xe={__name:"pointImg",setup(I,{expose:T}){const{t:w}=J(),g=ce(),B=b(()=>g.loadStatus?g.loadStatus.value:{}),L=d(),o=d({pointId:"",deviceId:""}),E=d([]),F="./",U=e=>`${F}/equipment-web/file/downloadImage?fileId=${e}`,i=d(""),q=b(()=>{let e=[{label:w("all"),value:""}];return o.value.deviceId&&(e=e.concat([{label:w("device"),value:o.value.deviceId},...E.value])),e}),f=d(!1),y=d(!1),_=d([]),u=d({}),n=b(()=>i.value?i.value===o.value.deviceId?_.value.filter(e=>e.deviceId&&e.deviceId.toString()===i.value&&!e.pointId):_.value.filter(e=>e.pointId&&e.pointId.toString()===i.value):_.value);K(()=>n.value,()=>{n.value.length&&g.updateImageList(n.value)});const R=()=>{y.value=!0;const e={deviceId:o.value.deviceId,isLinkSensor:!0};return re(e).then(c=>{_.value=c.data||[]}).finally(()=>{y.value=!1})},z=()=>{setTimeout(()=>{u.value=n.value[0]||null})};return T({open:e=>{f.value=!0,o.value={...e},o.value.pointId=`${e.id}`.replace("_",""),o.value.deviceId&&(o.value.deviceId=o.value.deviceId.toString()),i.value=o.value.pointId,_.value=[],X({deviceId:o.value.deviceId,isLinkSensor:!0}).then(c=>{E.value=(c.data||[]).map(h=>({value:h.id.toString(),label:h.name}))}),R().then(()=>{n.value.length?u.value=n.value[0]:(i.value="",u.value=_.value[0])})}}),(e,c)=>{const h=Y,H=ee,P=ae,A=te,M=ne,O=le,Z=oe;return s(),$(O,{modelValue:l(f),"onUpdate:modelValue":c[1]||(c[1]=a=>C(f)?f.value=a:null),class:"point-img-dialog","append-to-body":!0,width:"1128px",center:!0},{header:v(()=>[t("div",ue,m(e.$t("deviceImg")),1)]),default:v(()=>[t("div",ve,[p(A,{inline:!0},{default:v(()=>[p(P,{label:"\u56FE\u7247\u7C7B\u578B",style:{"margin-bottom":"0"}},{default:v(()=>[p(H,{modelValue:l(i),"onUpdate:modelValue":c[0]||(c[0]=a=>C(i)?i.value=a:null),placeholder:e.$t("all"),clearable:"",onChange:z,teleported:!1},{default:v(()=>[(s(!0),r(k,null,x(l(q),a=>(s(),$(h,{key:a.value,label:a.label,value:a.value},{default:v(()=>[Q(m(a.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1})]),_:1}),W((s(),r("div",_e,[t("div",me,[l(n).length?(s(),r(k,{key:0},[t("div",ge,[pe,t("div",Ie,m(l(u).nodeName),1),l(u).overallImage?(s(),r("div",fe,m(e.$t("overView")),1)):N("",!0)]),t("div",he,[t("img",{src:U(l(u).imageId),alt:"",class:"img"},null,8,ye)])],64)):(s(),r("div",be,"\u6682\u65E0\u6570\u636E"))]),t("div",{class:"img-wrap",ref_key:"imgContainerRef",ref:L},[t("div",ke,[(s(!0),r(k,null,x(l(n),a=>(s(),r("div",{key:a.imageId,class:"img-item",onClick:V=>u.value=a},[t("div",we,[Le,t("div",{class:"img-name",title:a.nodeName},m(a.nodeName),9,Ee),a.overallImage?(s(),r("div",Ve,m(e.$t("overView")),1)):N("",!0)]),t("div",$e,[p(de,{imageId:a.imageId,status:l(B)[a.imageId]},{default:v(({url:V})=>[p(M,{src:V,fit:"cover",alt:"",class:"item-img",lazy:!0,"scroll-container":l(L),onLoad:j=>l(g).handleLoadSuccess(a.imageId),onError:j=>l(g).handleLoadError(a.imageId)},null,8,["src","scroll-container","onLoad","onError"])]),_:2},1032,["imageId","status"])])],8,Se))),128))])],512)])),[[Z,l(y)]]),Ce])]),_:1},8,["modelValue"])}}},Re=G(xe,[["__scopeId","data-v-400c13ac"]]);export{Re as default};
