import{_ as C,a5 as g,r as c,o as P,y as b,q as p,v,p as i,P as _,x as M,n as d,s as S,ay as z,j as N,l as j,bv as $,a0 as B,a1 as U}from"./index.8d733f79.js";const D=r=>(B("data-v-1d946f0d"),r=r(),U(),r),J=D(()=>v("div",{id:"deviceMap"},null,-1)),E={class:"dialog-footer"},F=g({name:"PositionMapModal"}),T=Object.assign(F,{emits:["coordChange"],setup(r,{expose:w,emit:x}){let a=null;const s=c(!1),f=c(!1),l=c({floorId:""});function I(o,e){f.value=e,s.value=!0,z(()=>{h(o)})}function h(o){let e="/loadMap/factory";a=new jsmap.JSMap({container:"deviceMap",mapServerURL:e,showGlobe:!0}),a.openMapById(o.factoryId),a.on("loadComplete",()=>{console.log("Map loadComplete!",a,a.focusFloorId,l),o&&o.xcoordinate&&m({floorId:o.floor,x:Number(o.xcoordinate),y:Number(o.ycoordinate),z:Number(o.zcoordinate)})}),a.on("mapClickNode",t=>{console.log(t),f.value||m({floorId:t.floorId,x:t.mapCoord.x,y:t.mapCoord.y,z:t.mapCoord.z})})}function m(o){a.removeAllMarker(),l.value.floorId=o.floorId,l.value.x=o.x,l.value.y=o.y,l.value.z=o.z;const e=new jsmap.JSPointMarker({id:"point1",color:"#00FF00",size:16,position:new jsmap.JSPoint(o.x,o.y,o.z),floorId:o.floorId,outlineWidth:2,allowPicking:!0,displayCondition:new jsmap.JSDisplayCondition(0,1e3),depthTest:!1,alwaysShow:!0,show:!0});a.addMarker(e)}function V(){x("coordChange",l.value),u()}function u(){a&&(a.destroy(),a=null),l.value={},s.value=!1}return w({showModal:I}),(o,e)=>{const t=N,y=j,k=$;return P(),b(k,{title:o.$t("devicePoint"),modelValue:d(s),"onUpdate:modelValue":e[3]||(e[3]=n=>S(s)?s.value=n:null),width:"800px","align-center":!0,"destroy-on-close":"","append-to-body":"",onClose:u},{footer:p(()=>[v("div",E,[i(y,{onClick:u},{default:p(()=>[_(M(o.$t("cancel")),1)]),_:1}),i(y,{type:"primary",onClick:V},{default:p(()=>[_(M(o.$t("confirm")),1)]),_:1})])]),default:p(()=>[i(t,{modelValue:d(l).floorId,"onUpdate:modelValue":e[0]||(e[0]=n=>d(l).floorId=n),style:{width:"220px"},placeholder:o.$t("pokePointP"),disabled:""},null,8,["modelValue","placeholder"]),i(t,{modelValue:d(l).x,"onUpdate:modelValue":e[1]||(e[1]=n=>d(l).x=n),style:{width:"220px","margin-left":"16px"},placeholder:o.$t("pokePointP"),disabled:""},null,8,["modelValue","placeholder"]),i(t,{modelValue:d(l).y,"onUpdate:modelValue":e[2]||(e[2]=n=>d(l).y=n),style:{width:"220px","margin-left":"16px"},placeholder:o.$t("pokePointP"),disabled:""},null,8,["modelValue","placeholder"]),J]),_:1},8,["title","modelValue"])}}}),q=C(T,[["__scopeId","data-v-1d946f0d"]]);export{q as default};
