import{a5 as m,b as f,r as v,ae as _,o as h,y as x,q as C,v as P,p as g,n as r,s as y,bv as B,D as k}from"./index.8d733f79.js";import{d as $}from"./index.7238d098.js";import{n as b,o as N}from"./deviceType.30ac56e5.js";import"./noDevice.e92e2fe2.js";import"./deviceDataDetail.4a67ddb6.js";import"./deviceTree.170dfbd9.js";import"./dashboard.62cdb0f4.js";const M={style:{border:"1px solid #2153A3"}},V=m({name:"AssociateSensor"}),O=Object.assign(V,{emits:["refresh"],setup(S,{expose:d,emit:l}){const{t:n,locale:E}=f(),{proxy:i}=k(),s=v(!1);_("handleButtonClick",()=>{});function p(e){s.value=!0;const t=[];for(let a=0;a<e.pointCoordinates.length;a++){const o=e.pointCoordinates[a];t.push({type:"template",id:o.id,text:o.pointName,mesPoint:{x:o.xcoordinate,y:o.ycoordinate},extraPoint:{popData:[{metricName:`${n("speed")}(mm/s)`,value:""},{metricName:`${n("temperature")}(\u2103)`,value:""},{metricName:`${n("hf_acceleration")}(m/s\xB2)`,value:""}],x:o.popupX,y:o.popupY}})}setTimeout(()=>{i.$refs.deviceCanvasRef.initCanvas({mode:"pop",imageUrl:e.imageUrl,pointData:t,canEdit:!0,canEditPopPosition:!0})},0)}function c(e,t){if(console.log("\u4FEE\u6539\u540E\u7684\u6D4B\u70B9/pop\u6846\u4F4D\u7F6E",e,t),t==="point"){const a={id:e.id,xcoordinate:e.mesPoint.x,ycoordinate:e.mesPoint.y};b(a).then(o=>{i.$modal.msgSuccess(o.msg),l("refresh")})}if(t==="pop"){const a={id:e.id,popupX:e.extraPoint.x,popupY:e.extraPoint.y};N(a).then(o=>{i.$modal.msgSuccess(o.msg),l("refresh")})}}const u=()=>{s.value=!1};return d({showModal:p}),(e,t)=>{const a=B;return h(),x(a,{title:e.$t("pointPre"),modelValue:r(s),"onUpdate:modelValue":t[0]||(t[0]=o=>y(s)?s.value=o:null),width:"1200","destroy-on-close":"","align-center":!0,"append-to-body":"",onClose:u,class:"canvasModal"},{default:C(()=>[P("div",M,[g(r($),{ref:"deviceCanvasRef",onCallBackPoints:c},null,512)])]),_:1},8,["title","modelValue"])}}});export{O as default};
