import{_ as z,a5 as A,b as J,r as d,o as m,y as $,q as n,v as k,p as i,P as b,x as f,n as r,c as C,F as E,A as S,t as G,s as H,l as Q,cp as W,E as X,i as Y,cq as Z,bv as ee,D as le}from"./index.8d733f79.js";import{E as oe}from"./el-image-viewer.42b4b63f.js";import{I as ae,J as te,K as ne,L as ie}from"./deviceTree.170dfbd9.js";import"./throttle.04d7163a.js";const se={class:""},de=["src","onClick"],re={class:"dialog-footer"},ce=A({name:"PasteModal"}),ue=Object.assign(ce,{setup(pe,{expose:V}){const{t:_}=J(),{proxy:c}=le(),P="./",v=d(!1),L={1:"\u6A2A\u88C5",2:"\u70B9\u88C5",3:"\u7AD6\u88C5"},u=d({factoryId:"",deviceId:"",deviceCode:"",productKey:""}),p=d([]),g=d([]),T=d(""),I=d(!1),y=d([]),w=d(0);function N(e,l){u.value={factoryId:e,deviceCode:l.code,deviceTypeId:l.deviceTypeId,productKey:l.productKey,deviceName:l.name},v.value=!0,D(),M()}function D(){ae({...u.value}).then(e=>{for(let l=0;l<e.data.length;l++){const t=e.data[l];t.hasIdentifier=!!t.pointIdentifier}p.value=e.data,T.value=e.data.length?e.data[0].updateTime:"-"}).catch(e=>{})}function M(){te({...u.value}).then(e=>{g.value=e.data}).catch(e=>{})}function U(){let e=!1;for(let l=0;l<p.value.length;l++)if(p.value[l].pointImage.length){e=!0;break}if(!e){c.$modal.msgError(_("noPicDownload"));return}c.$modal.loading("\u4E0B\u8F7D\u4E2D"),ne({...u.value}).then(l=>{const t=new Blob([l]),o=document.createElement("a");o.href=URL.createObjectURL(t),o.download=`${u.value.deviceName}-${_("onSiteImg")}.zip`,o.style.display="none",document.body.appendChild(o),o.click(),o.remove(),c.$modal.closeLoading(),c.$modal.msgSuccess(_("exportSuccess"))}).catch(l=>{c.$modal.closeLoading()})}function B(){ie([...p.value]).then(e=>{e.code===200&&(c.$modal.msgSuccess(_("saveSuccess")),h())}).catch(e=>{})}function j(e,l){const t=[];for(let o=0;o<e.length;o++)t.push(`${P}/equipment-web/file/downloadImage?fileId=${e[o]}`);y.value=t||[],w.value=l,I.value=!0}function h(){v.value=!1,u.value={factoryId:"",deviceId:""},p.value=[],g.value=[]}return V({showModal:N}),(e,l)=>{const t=Q,o=W,q=X,x=Y,K=Z,O=oe,R=ee;return m(),$(R,{title:e.$t("deployInfo")+"("+e.$t("deployInfoUploadTime")+":"+r(T)+")",modelValue:r(v),"onUpdate:modelValue":l[2]||(l[2]=a=>H(v)?v.value=a:null),width:"1100px","align-center":!0,"append-to-body":"",onClose:h},{footer:n(()=>[k("div",re,[i(t,{onClick:h},{default:n(()=>[b(f(e.$t("cancel")),1)]),_:1}),i(t,{type:"primary",onClick:B},{default:n(()=>[b(f(e.$t("confirm")),1)]),_:1})])]),default:n(()=>[k("div",se,[i(t,{type:"primary",onClick:l[0]||(l[0]=a=>U()),style:{"margin-bottom":"16px"}},{default:n(()=>[b("\u4E0B\u8F7D\u6240\u6709\u6D4B\u70B9\u56FE\u7247")]),_:1}),i(K,{data:r(p)},{default:n(()=>[i(o,{label:e.$t("pointName"),prop:"pointName"},null,8,["label"]),i(o,{label:e.$t("linkSensor"),prop:"sn"},{default:n(a=>[b(f(a.row.sensorSn)+"_"+f(a.row.sensorSn?e.$t("channel"):"")+f(a.row.channelNo),1)]),_:1},8,["label"]),i(o,{label:e.$t("sensorIntallType"),prop:"installType"},{default:n(a=>[b(f(a.row.installType?L[a.row.installType]:"-"),1)]),_:1},8,["label"]),i(o,{label:e.$t("directionLink"),prop:"axialMapping"},null,8,["label"]),i(o,{label:e.$t("image"),prop:"pointImage"},{default:n(a=>[(m(!0),C(E,null,S(a.row.pointImage,(s,F)=>(m(),C("div",{key:s,style:{display:"inline-block","margin-right":"4px"}},[k("img",{src:`${r(P)}/equipment-web/file/downloadImage?fileId=${s}`,onClick:me=>j(a.row.pointImage,F),width:"30",alt:""},null,8,de)]))),128))]),_:1},8,["label"]),i(o,{label:e.$t("actualPointLink"),prop:"name"},{default:n(a=>[i(x,{modelValue:a.row.pointIdentifier,"onUpdate:modelValue":s=>a.row.pointIdentifier=s,clearable:"",placeholder:e.$t("selectPointP"),disabled:a.row.hasIdentifier,style:{width:"80%"},teleported:!1},{default:n(()=>[(m(!0),C(E,null,S(r(g),s=>(m(),$(q,{key:s.identifier,label:s.componentName+"-"+s.name,value:s.identifier},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","disabled"])]),_:1},8,["label"])]),_:1},8,["data"])]),r(I)?(m(),$(O,{key:0,"url-list":r(y),"initial-index":r(w),onClose:l[1]||(l[1]=a=>{I.value=!1,w.value=0,y.value=[]})},null,8,["url-list","initial-index"])):G("",!0)]),_:1},8,["title","modelValue"])}}}),ge=z(ue,[["__scopeId","data-v-bb14e113"]]);export{ge as default};
