import{a5 as D,r as d,o as c,y as v,q as n,v as y,p as f,P as p,x as m,n as i,s as k,c as B,F as M,A as P,aE as w,c6 as L,l as N,bv as S}from"./index.8d733f79.js";import{k as $}from"./deviceTree.170dfbd9.js";const F={class:"dialog-footer"},I=D({name:"MesurePointCheckModal"}),A=Object.assign(I,{emits:["mesurePointEnsure"],setup(U,{expose:g,emit:h}){const s=d(!1),u=d(""),o=d([]);function b(t,e){s.value=!0,o.value=e,C(t)}function C(t){$({deviceId:t.deviceId||t.id,isLinkSensor:!0}).then(e=>{u.value=e.data.imageCoordinates[0].pointCoordinates||[]})}function V(){const t=[];for(let e=0;e<u.value.length;e++)for(let l=0;l<o.value.length;l++)u.value[e].identifier===o.value[l].identifier&&t.push(o.value[l]);h("mesurePointEnsure",t),r()}function r(){o.value=[],s.value=!1}return g({showModal:b}),(t,e)=>{const l=w,E=L,_=N,x=S;return c(),v(x,{title:t.$t("selectPoint"),modelValue:i(s),"onUpdate:modelValue":e[1]||(e[1]=a=>k(s)?s.value=a:null),width:"416px","align-center":!0,onClose:r},{footer:n(()=>[y("div",F,[f(_,{onClick:r},{default:n(()=>[p(m(t.$t("cancel")),1)]),_:1}),f(_,{type:"primary",onClick:V,disabled:!i(o)||!i(o).length},{default:n(()=>[p(m(t.$t("confirm")),1)]),_:1},8,["disabled"])])]),default:n(()=>[f(E,{modelValue:i(o),"onUpdate:modelValue":e[0]||(e[0]=a=>k(o)?o.value=a:null)},{default:n(()=>[(c(!0),B(M,null,P(i(u),a=>(c(),v(l,{key:a.identifier,value:a},{default:n(()=>[p(m(a.pointName),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["title","modelValue"])}}});export{A as default};
