@opengis/gis 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import-file.cjs +1 -1
- package/dist/import-file.js +7 -3
- package/module/gis/card/gis.metadata.table/main_info.hbs +2 -2
- package/module/gis/card/gis.rasters.table/main_info.hbs +2 -2
- package/module/gis/card/gis.registers.table/main_info.hbs +2 -2
- package/module/gis/card/gis.services.table/main_info.hbs +2 -2
- package/module/gis/table/gis.maps.table.json +4 -11
- package/module/gis/table/gis.registers.table.json +4 -11
- package/module/gis/table/gis.services.table.json +4 -11
- package/package.json +4 -3
- package/server/routes/gis/index.mjs +2 -1
- package/server/routes/gis/registers/funcs/handleRegistryRequest.js +3 -1
- package/server/routes/gis/registers/gis.registry.js +14 -9
- package/server/routes/map/controllers/mapCatalog.js +5 -1
- package/server/routes/map/controllers/vtile.js +4 -2
package/dist/import-file.cjs
CHANGED
|
@@ -842,4 +842,4 @@ Expecting `+ct.join(", ")+", got '"+(this.terminals_[Ie]||Ie)+"'":_t="Parse erro
|
|
|
842
842
|
</div>
|
|
843
843
|
`},yt=it=>({legend:Rx,basemaps:Ox,layers:db,info:xb,attribute:Yb,catalog:Sw,filters:u2,"inline-filters":m2,list:E2,card:cy})[it],ct=_.computed(()=>!!O.value&&Array.isArray(O.value.widgets)&&O.value.widgets.some(it=>it.type==="filters")),_t=it=>{P.value=it};function qt(){const it=new URLSearchParams(window.location.search),vt=parseFloat(it.get("x")),At=parseFloat(it.get("y")),Mt=parseFloat(it.get("z")),Ht=parseFloat(it.get("bearing")),Et=parseFloat(it.get("pitch"));return{center:isFinite(vt)&&isFinite(At)?[vt,At]:null,zoom:isFinite(Mt)?Mt:null,bearing:isFinite(Ht)?Ht:null,pitch:isFinite(Et)?Et:null}}function Qt({center:it,zoom:vt,bearing:At,pitch:Mt}){const Ht=new URLSearchParams(window.location.search);Ht.set("x",it[0].toFixed(5)),Ht.set("y",it[1].toFixed(5)),Ht.set("z",vt.toFixed(2)),Ht.set("bearing",At.toFixed(2)),Ht.set("pitch",Mt.toFixed(2));const Et=`${window.location.pathname}?${Ht.toString()}`;window.history.replaceState({},"",Et)}const xr=()=>{var Et,zt,or;if(!O.value||!O.value.map)return;const it={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{voyager:{type:"raster",tiles:["https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"],tileSize:256,attribution:"© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>, © <a href='https://carto.com/attributions'>CARTO</a>"}},layers:[{id:"voyager",type:"raster",source:"voyager",minzoom:0,maxzoom:22}]};let vt=O.value.map.center,At=O.value.map.zoom,Mt=O.value.map.bearing||0,Ht=O.value.map.pitch||0;if(O.value.history){const Jt=qt();Jt.center&&(vt=Jt.center),Jt.zoom!==null&&(At=Jt.zoom),Jt.bearing!==null&&(Mt=Jt.bearing),Jt.pitch!==null&&(Ht=Jt.pitch)}if(y.value=new tp.Map({container:"maplibre-demo-map",style:it,center:vt,zoom:At,bearing:Mt,pitch:Ht,maxBounds:[18.0856083513,40.3614785833,58.0807890155,56.3350745713]}),(or=(zt=(Et=O==null?void 0:O.value)==null?void 0:Et.interactions)==null?void 0:zt.navigation)!=null&&or.enabled){const Jt=new tp.NavigationControl({showCompass:!0,showZoom:!0,visualizePitch:!0});y.value.addControl(Jt,"top-right")}y.value.on("load",async()=>{var Vr,ni,mi,Mi,gi;await o2(y.value);const Jt=qt(),Ir=Jt.center&&Jt.zoom!==null;if((Vr=O.value.map)!=null&&Vr.bbox&&!Ir){const[dr,Wt,Pt,Bt]=O.value.map.bbox;y.value.fitBounds([[dr,Wt],[Pt,Bt]],{padding:50,duration:0})}if(await(async()=>{var Wt,Pt,Bt,xt,ke;const dr=((ke=(xt=(Bt=(Pt=(Wt=O.value)==null?void 0:Wt.widgets)==null?void 0:Pt.find(K=>K.type==="layers"))==null?void 0:Bt.config)==null?void 0:xt.layers)==null?void 0:ke.filter(K=>{var Q;return((Q=K.style)==null?void 0:Q.attrType)==="icon-by-attribute"}))||[];for(const K of dr){const{rules:Q,default_icon:te,icon_base_url:he}=K.style,xe=[...Q.map(Y=>Y.icon),te].filter(Boolean);for(const Y of xe)try{const Pe=`${he}${Y}`,Ae=await y.value.loadImage(Pe);y.value.hasImage(Y)||y.value.addImage(Y,Ae.data)}catch(Pe){console.error(`Failed to load icon: ${Y}`,Pe)}}})(),(Mi=(mi=(ni=O.value)==null?void 0:ni.interactions)==null?void 0:mi.hover)!=null&&Mi.enabled&&(y.value.on("mousemove",dr=>{var K,Q,te,he,xe,Y,Pe,Ae;const Wt=y.value.queryRenderedFeatures(dr.point);if(y.value&&y.value.getCanvas&&(y.value.getCanvas().style.cursor=Wt.length?"pointer":""),!Wt.length){if(x.value){const Te=(K=y.value.getSource(x.value.source))==null?void 0:K.type;x.value.source,x.value.id,Te==="vector"&&x.value.source,fr(y.value,x.value.source,x.value.id,{hovered:!1}),x.value=null}k&&(k.remove(),k=null);return}const Pt=Wt[0];if(!x.value||x.value.id!==Pt.id||x.value.source!==Pt.layer.source){if(x.value){const ze=(Q=y.value.getSource(x.value.source))==null?void 0:Q.type;x.value.source,x.value.id,ze==="vector"&&x.value.source,fr(y.value,x.value.source,x.value.id,{hovered:!1})}const Te=(te=y.value.getSource(Pt.layer.source))==null?void 0:te.type;Pt.layer.source,Pt.id,Te==="vector"&&Pt.layer.source,fr(y.value,Pt.layer.source,Pt.id,{hovered:!0}),x.value={source:Pt.layer.source,id:Pt.id}}const Bt=(xe=(he=O.value)==null?void 0:he.widgets)==null?void 0:xe.find(Te=>Te.type==="layers"),xt=(Pe=(Y=O.value)==null?void 0:Y.widgets)==null?void 0:Pe.find(Te=>Te.type==="attribute");let ke=null;if(Bt&&(ke=Bt.config.layers.find(Te=>Te.id===Pt.layer.source)),!ke&&xt&&xt.config.layer.id===Pt.layer.source&&(ke=xt.config.layer),(Ae=ke==null?void 0:ke.style)!=null&&Ae.popup){const Te=ke.style.popup;let ze=Te.title,Me="";Te.mode==="markdown"?Me=Array.isArray(Te.content)?Te.content.join(`
|
|
844
844
|
|
|
845
|
-
`):"":Me=Array.isArray(Te.content)?Te.content.join(""):"",k||(k=document.createElement("div"),y.value.getContainer().appendChild(k));const Qe=y.value.project(dr.lngLat);k.innerHTML=St(ze,Me,Te.fields,Pt.properties,Te.mode,Qe)}}),y.value.on("mouseleave",()=>{var dr;if(k&&(k.remove(),k=null),x.value){const Wt=(dr=y.value.getSource(x.value.source))==null?void 0:dr.type;x.value.source,x.value.id,Wt==="vector"&&x.value.source,fr(y.value,x.value.source,x.value.id,{hovered:!1}),x.value=null}y.value&&y.value.getCanvas&&(y.value.getCanvas().style.cursor="")})),y.value.on("click",async dr=>{var Q,te,he,xe,Y;if(["length","area","print"].includes(M.value))return;const Wt=y.value.queryRenderedFeatures(dr.point);if(!Wt.length)return;o.value.forEach(Pe=>{var Te;const Ae=(Te=y.value.getSource(Pe.source))==null?void 0:Te.type;Pe.source,Pe.id,Ae==="vector"&&Pe.source,fr(y.value,Pe.source,Pe.id,{selected:!1})}),o.value=[];const Pt=Wt[0],Bt=(Q=y.value.getSource(Pt.layer.source))==null?void 0:Q.type;Pt.layer.source,Pt.id,Bt==="vector"&&Pt.layer.source,fr(y.value,Pt.layer.source,Pt.id,{selected:!0}),o.value.push({source:Pt.layer.source,id:Pt.id});const xt=(he=(te=O.value)==null?void 0:te.widgets)==null?void 0:he.find(Pe=>Pe.type==="layers"),ke=(Y=(xe=O.value)==null?void 0:xe.widgets)==null?void 0:Y.find(Pe=>Pe.type==="attribute");let K=(ke==null?void 0:ke.config.layer)||(xt==null?void 0:xt.config.layers.find(Pe=>Pe.id===Pt.layer.source));D.value={layer:(K==null?void 0:K.service_key)||"",map:(K==null?void 0:K.map_key)||"",id:Pt.properties.id,title:(K==null?void 0:K.title)||""}}),y.value.on("dblclick",dr=>{var Bt,xt,ke;if(["length","area","print"].includes(M.value))return;ri([dr.lngLat.lng,dr.lngLat.lat]);const Wt=(xt=(Bt=O.value)==null?void 0:Bt.widgets)==null?void 0:xt.find(K=>K.type==="layers");let Pt=null;(ke=Wt==null?void 0:Wt.config)!=null&&ke.layers&&(Pt=Wt.config.layers.find(K=>K.visible!==!1&&["tms","wms","raster"].includes((K.service_type||K.service||"").toLowerCase()))),D.value={layer:(Pt==null?void 0:Pt.map_key)||"",map:(Pt==null?void 0:Pt.service_key)||"",id:"",title:(Pt==null?void 0:Pt.title)||""}}),y.value.resize(),b.value=!0,(gi=O==null?void 0:O.value)!=null&&gi.history){const dr=()=>{const Wt=y.value.getCenter();Qt({center:[Wt.lng,Wt.lat],zoom:y.value.getZoom(),bearing:y.value.getBearing(),pitch:y.value.getPitch()})};y.value.on("moveend",dr),y.value.on("rotate",dr),y.value.on("pitch",dr)}})},gr=()=>{Bi(),o.value.forEach(it=>{y.value&&fr(y.value,it.source,it.id,{selected:!1})}),o.value=[],D.value=null};_.onMounted(async()=>{await ar(),await _.nextTick(),xr(),window.addEventListener("resize",()=>{Le()}),_.watch([C["top-left"],C["top-right"],C["top-center"],C.center,C["bottom-left"],C["bottom-right"],C["bottom-center"],()=>O.value.widgets,B],async()=>{await _.nextTick(),Le(),setTimeout(Le,0)},{deep:!0}),_.watch(b,it=>{it&&_.nextTick().then(()=>{Le()})}),_.watch(()=>p.table,async it=>{if(it){if(y.value){try{y.value.remove()}catch{}y.value=null,b.value=!1}await ar(),await _.nextTick(),xr(),Le(),window.removeEventListener("resize",Le),window.addEventListener("resize",Le),_.watch([C["top-left"],C["top-right"],C["top-center"],C.center,C["bottom-left"],C["bottom-right"],C["bottom-center"],()=>O.value.widgets,B],async()=>{await _.nextTick(),Le(),setTimeout(Le,0)},{deep:!0}),_.watch(b,vt=>{vt&&_.nextTick().then(()=>{Le()})})}})}),_.onUnmounted(()=>{window.removeEventListener("resize",Le)});const ti=_.computed(()=>{var vt,At,Mt;return{height:((vt=O==null?void 0:O.value)==null?void 0:vt.height)||((Mt=(At=O==null?void 0:O.value)==null?void 0:At.map)==null?void 0:Mt.height)||"100vh",width:"100%"}}),ar=async()=>{const it=await Br.get(`/api/map/${p.table}`);O.value=it.data},Zi=it=>{if(!O.value||!O.value.widgets)return"400px";const vt=O.value.widgets.find(At=>At.position===it);return(vt==null?void 0:vt.width)||"400px"},Nr=_.ref([]);_.watch(()=>O.value,it=>{it&&it.map&&(Nr.value=Ki(),xr())});const Ki=()=>{var vt;if(!O.value||!O.value.widgets)return[];const it=O.value.widgets.find(At=>At.type==="layers");return(vt=it==null?void 0:it.config)!=null&&vt.layers?it.config.layers.map(At=>({...At,visible:At.visible??!1})).filter(At=>At.visible).map(At=>At.id):[]};function fr(it,vt,At,Mt){it.getStyle().layers.filter(Et=>Et.source===vt).forEach(Et=>{var or;const zt={source:vt,id:At};((or=it.getSource(vt))==null?void 0:or.type)==="vector"&&Et["source-layer"]&&(zt.sourceLayer=Et["source-layer"]),it.setFeatureState(zt,Mt)})}const on=_.computed(()=>!!O.value&&!!O.value.interactions&&!!O.value.interactions.navigation&&O.value.interactions.navigation.enabled),Ti=_.computed(()=>!!O.value&&Array.isArray(O.value.tools)&&O.value.tools.length>0),Ur=_.computed(()=>on.value||Ti.value?"70px":"20px");function Bi(){y.value&&(y.value.getLayer("layer-with-pulsing-dot")&&y.value.removeLayer("layer-with-pulsing-dot"),y.value.getSource("dot-point")&&y.value.removeSource("dot-point"),y.value.hasImage&&y.value.hasImage("pulsing-dot")&&y.value.removeImage("pulsing-dot"))}function ri(it){var Mt,Ht,Et,zt;Bi();const vt=80,At={width:vt,height:vt,data:new Uint8Array(vt*vt*4),onAdd(){const or=document.createElement("canvas");or.width=this.width,or.height=this.height,this.context=or.getContext("2d",{willReadFrequently:!0})},render(){var mi;const Jt=performance.now()%2e3/2e3,Ir=vt/2*.3,ii=vt/2*.7*Jt+Ir,{context:Vr}=this;Vr.clearRect(0,0,this.width,this.height),Vr.beginPath(),Vr.arc(this.width/2,this.height/2,ii,0,Math.PI*2),Vr.fillStyle=`rgba(255, 100, 100, ${1-Jt})`,Vr.fill();const ni=vt/2*.7*(Jt-.5<0?Jt-.5+1:Jt-.5)+Ir;return Vr.beginPath(),Vr.arc(this.width/2,this.height/2,ni,0,Math.PI*2),Vr.fillStyle=`rgba(255, 100, 100, ${1-(Jt-.5<0?Jt-.5+1:Jt-.5)})`,Vr.fill(),this.data=Vr.getImageData(0,0,this.width,this.height).data,(mi=y.value)==null||mi.triggerRepaint(),!0}};(Mt=y.value)!=null&&Mt.hasImage("pulsing-dot")||(Ht=y.value)==null||Ht.addImage("pulsing-dot",At,{pixelRatio:2}),(Et=y.value)==null||Et.addSource("dot-point",{type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:it}}}),(zt=y.value)==null||zt.addLayer({id:"layer-with-pulsing-dot",type:"symbol",source:"dot-point",layout:{"icon-image":"pulsing-dot"},paint:{"icon-opacity":.6}})}const Gi=_.computed(()=>{var it,vt,At,Mt,Ht,Et,zt,or,Jt,Ir;return{center:(vt=(it=O==null?void 0:O.value)==null?void 0:it.map)==null?void 0:vt.center,zoom:(Mt=(At=O==null?void 0:O.value)==null?void 0:At.map)==null?void 0:Mt.zoom,pitch:((Et=(Ht=O==null?void 0:O.value)==null?void 0:Ht.map)==null?void 0:Et.pitch)||0,bearing:((or=(zt=O==null?void 0:O.value)==null?void 0:zt.map)==null?void 0:or.bearing)||0,bbox:((Ir=(Jt=O==null?void 0:O.value)==null?void 0:Jt.map)==null?void 0:Ir.bbox)||null}}),Vi={home:O2,print:W2,geolocation:mS,pitch:G2,length:WS,area:sA},Cn=it=>{M.value=it};function Gr(it){if(!O.value||!O.value.widgets)return;const vt=O.value.widgets.find(Ht=>Ht.type==="list");if(!vt||!vt.config)return;const{map_key:At,service_key:Mt}=vt.config;At&&Mt&&(D.value={id:it,map:At,layer:Mt})}function fi(it){switch(it){case"top-left":return U.value;case"top-right":return G.value;case"top-center":return ie.value;case"center":return le.value;case"bottom-left":return Ie.value;case"bottom-right":return ee.value;case"bottom-center":return me.value;default:return 0}}const Jr=_.computed(()=>O.value&&O.value.widgets?O.value.widgets.filter(it=>it.position==="absolute"):[]);return(it,vt)=>{var At,Mt,Ht,Et;return _.openBlock(),_.createElementBlock("div",{id:"maplibre-demo-map",style:_.normalizeStyle(ti.value)},[b.value?_.createCommentVNode("",!0):(_.openBlock(),_.createBlock(M2,{key:0})),_.withDirectives(_.createElementVNode("div",cA,[(_.openBlock(),_.createElementBlock(_.Fragment,null,_.renderList(L,zt=>{var or,Jt;return _.createVNode(lA,{key:zt,position:zt,widgets:qe(zt),map:y.value,mapLoaded:b.value,cardValues:D.value,hasFilters:ct.value,history:(Jt=(or=O.value)==null?void 0:or.value)==null?void 0:Jt.history,currentFilterLayer:P.value,enabledLayerIds:Nr.value,getWidgetComponent:yt,getColumnWidth:Zi,rightColumnOffset:zt==="top-right"?Ur.value:void 0,maxHeight:fi(zt),ref_for:!0,ref:Ir=>T(zt,Ir),onSetFilterLayer:_t,"onUpdate:enabledLayerIds":vt[0]||(vt[0]=Ir=>Nr.value=Ir),onCardValuesId:Gr,onCloseCard:gr,onContentResize:()=>Le(zt)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset","maxHeight","onContentResize"])}),64)),(Mt=(At=O.value)==null?void 0:At.value)!=null&&Mt.tools?(_.openBlock(),_.createElementBlock("div",uA,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((Et=(Ht=O.value)==null?void 0:Ht.value)==null?void 0:Et.tools,zt=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:zt},[b.value&&Vi[zt]?(_.openBlock(),_.createBlock(_.resolveDynamicComponent(Vi[zt]),_.mergeProps({key:0,map:y.value,activeTool:M.value,setActiveTool:Cn,ref_for:!0},zt==="home"?{initialView:Gi.value}:{},{onCardValuesId:Gr}),null,16,["map","activeTool"])):_.createCommentVNode("",!0)],64))),128))])):_.createCommentVNode("",!0)],512),[[_.vShow,b.value]]),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(Jr.value,(zt,or)=>(_.openBlock(),_.createElementBlock("div",{key:"abs-"+(zt.id||zt.type||or),class:"absolute z-20",style:_.normalizeStyle(zt.style)},[(_.openBlock(),_.createBlock(_.resolveDynamicComponent(yt(zt.type)),{map:y.value,config:zt.config,hasFilters:ct.value,currentFilterLayer:P.value,enabledLayerIds:Nr.value,cardValues:D.value,onSetFilterLayer:_t,"onUpdate:enabledLayerIds":vt[1]||(vt[1]=Jt=>Nr.value=Jt),onCardValuesId:Gr,onCloseCard:gr},null,40,["map","config","hasFilters","currentFilterLayer","enabledLayerIds","cardValues"]))],4))),128))],4)}}},dA=pr(hA,[["__scopeId","data-v-edaa6750"]]),pA={props:{title:{type:String,required:!0},description:{type:String,required:!0}}},fA={class:"text-center mb-12"},mA={class:"text-3xl font-bold mb-4"},gA={class:"text-slate-600 max-w-2xl mx-auto"};function yA(u,p,y,b,k,P){return _.openBlock(),_.createElementBlock("div",fA,[_.createElementVNode("h2",mA,_.toDisplayString(y.title),1),_.createElementVNode("p",gA,_.toDisplayString(y.description),1)])}const Sy=pr(pA,[["render",yA]]),_A={name:"RegistryList",components:{HeroBlock:Sy},props:{title:{type:String,required:!0},description:{type:String,default:""},type:{type:String,default:"data"},items:{type:Array,default:()=>[]},total:{type:Number,default:0},filters:{type:Array,default:()=>null},emptyStateText:{type:String,default:"Немає даних"},limit:{type:Number,default:16},breadcrumbs:{type:Array,default:()=>[]},dialog:{type:Boolean,default:!0},token:{type:String,default:""},table:{type:String,required:!0}},data(){return{filterUrl:"",mounted:!1,tableData:[],currentPage:1,limit:16,localTotal:0}},created(){this.tableData=this.items,this.localTotal=this.total},mounted(){this.mounted=!0},methods:{handleFilterChange({url:u}){this.currentPage=1,this.filterUrl=u,this.getData()},handlePageChange(u){this.currentPage=u,this.getData()},changeLimit(u){this.limit=u,this.currentPage=1,this.getData()},async getData(){try{const u=this.type==="registry"?"/api/gis-registry":"/api/data",{data:p}=await Br.get(`${u}/${this.table}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`);p&&(this.tableData=p==null?void 0:p.rows,this.localTotal=this.type==="registry"?p==null?void 0:p.total:p==null?void 0:p.filtered)}catch(u){console.error(u.message)}}}},vA={class:"py-16 md:py-24"},xA={class:"py-6"},bA={class:"container"},wA={key:0,class:"flex items-center text-sm text-muted-foreground mb-6"},SA=["href"],AA={key:1,class:"text-foreground font-medium truncate"},kA={class:"flex flex-col md:flex-row gap-4 justify-end"},CA={class:"container"},TA={key:0,class:"space-y-4"},EA={class:"my-5 pr-2"},PA={class:"paginationWrapper relative flex justify-center"},IA={key:1,class:"text-center text-slate-400"};function MA(u,p,y,b,k,P){var D,M;const x=_.resolveComponent("HeroBlock"),o=_.resolveComponent("VsFilterList"),B=_.resolveComponent("VsPagination");return _.openBlock(),_.createElementBlock("div",vA,[_.createElementVNode("section",null,[_.createVNode(x,{title:y.title,description:y.description},null,8,["title","description"])]),_.createElementVNode("section",xA,[_.createElementVNode("div",bA,[(D=y.breadcrumbs)!=null&&D.length?(_.openBlock(),_.createElementBlock("div",wA,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.breadcrumbs,(O,L)=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:L},[L<y.breadcrumbs.length-1?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createElementVNode("a",{href:O.link,class:"hover:text-foreground"},_.toDisplayString(O.name),9,SA),p[0]||(p[0]=_.createElementVNode("span",{class:"mx-2"},"/",-1))],64)):(_.openBlock(),_.createElementBlock("span",AA,_.toDisplayString(O.name),1))],64))),128))])):_.createCommentVNode("",!0),_.createElementVNode("div",kA,[y.filters&&k.mounted?(_.openBlock(),_.createBlock(o,{key:0,ref:"filter",scheme:y.filters,isDialog:y.dialog,urlSeparator:"true",view:"plain",token:y.token,name:"filter",onFilterChange:P.handleFilterChange},{button:_.withCtx(()=>p[1]||(p[1]=[_.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground px-3 py-2",type:"button"}," Фільтри ",-1)])),_:1},8,["scheme","isDialog","token","onFilterChange"])):_.createCommentVNode("",!0)])])]),_.createElementVNode("section",null,[_.createElementVNode("div",CA,[((M=k.tableData)==null?void 0:M.length)>0?(_.openBlock(),_.createElementBlock("div",TA,[_.renderSlot(u.$slots,"default",{items:k.tableData}),_.createElementVNode("div",EA,[_.createElementVNode("div",PA,[_.createVNode(B,{total:k.localTotal,maxPages:4,defaultPage:k.currentPage,pageSize:k.limit,goTo:!1,size:"medium",backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[9,18,27,36],onPageChange:P.handlePageChange,onPageSizeChange:P.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])])):(_.openBlock(),_.createElementBlock("div",IA,_.toDisplayString(y.emptyStateText),1))])])])}const Ay=pr(_A,[["render",MA]]),LA={name:"Template2",props:{items:{type:Array,required:!0},path:{type:String,required:!0}},methods:{formatDate(u){return new Date(u).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"})}}},RA={class:"flex flex-col space-y-1.5 p-4 pb-2 bg-slate-50"},DA={class:"flex items-center justify-between"},zA={class:"text-lg font-bold line-clamp-2"},BA={class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground ml-2 whitespace-nowrap","data-v0-t":"badge"},VA={class:"p-4 pt-2"},OA={class:"grid grid-cols-2 gap-3 text-sm"},FA={class:"flex items-center gap-1.5"},NA={class:"font-medium"},qA={class:"flex items-center gap-1.5"},UA={class:"font-medium"},jA={class:"flex items-center gap-1.5"},HA={class:"font-medium"},WA={class:"flex items-center gap-1.5"},ZA={class:"font-medium"},KA={class:"items-center p-3 bg-slate-50 flex justify-end"},GA=["href"];function JA(u,p,y,b,k,P){return _.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.items,x=>(_.openBlock(),_.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground overflow-hidden border-none shadow-md relative","data-v0-t":"card"},[p[8]||(p[8]=_.createElementVNode("div",{class:"absolute left-0 top-0 bottom-0 w-1 bg-blue-500"},null,-1)),_.createElementVNode("div",RA,[_.createElementVNode("div",DA,[_.createElementVNode("h2",zA,_.toDisplayString(x.name),1),_.createElementVNode("div",BA,_.toDisplayString(x.status_text),1)])]),_.createElementVNode("div",VA,[_.createElementVNode("div",OA,[_.createElementVNode("div",FA,[p[0]||(p[0]=_.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hash h-3.5 w-3.5 text-muted-foreground flex-shrink-0"><line x1="4" x2="20" y1="9" y2="9"></line><line x1="4" x2="20" y1="15" y2="15"></line><line x1="10" x2="8" y1="3" y2="21"></line><line x1="16" x2="14" y1="3" y2="21"></line></svg>',1)),_.createElementVNode("div",null,[_.createElementVNode("span",NA,_.toDisplayString(x.parent_text),1)])]),_.createElementVNode("div",qA,[p[2]||(p[2]=_.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-building h-3.5 w-3.5 text-muted-foreground flex-shrink-0"><rect width="16" height="20" x="4" y="2" rx="2" ry="2"></rect><path d="M9 22v-4h6v4"></path><path d="M8 6h.01"></path><path d="M16 6h.01"></path><path d="M12 6h.01"></path><path d="M12 10h.01"></path><path d="M12 14h.01"></path><path d="M16 10h.01"></path><path d="M16 14h.01"></path><path d="M8 10h.01"></path><path d="M8 14h.01"></path></svg>',1)),_.createElementVNode("div",null,[p[1]||(p[1]=_.createElementVNode("span",{class:"text-muted-foreground"},"Статус: ",-1)),_.createElementVNode("span",UA,_.toDisplayString(x.status_text),1)])]),_.createElementVNode("div",jA,[p[4]||(p[4]=_.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-building h-3.5 w-3.5 text-muted-foreground flex-shrink-0"><rect width="16" height="20" x="4" y="2" rx="2" ry="2"></rect><path d="M9 22v-4h6v4"></path><path d="M8 6h.01"></path><path d="M16 6h.01"></path><path d="M12 6h.01"></path><path d="M12 10h.01"></path><path d="M12 14h.01"></path><path d="M16 10h.01"></path><path d="M16 14h.01"></path><path d="M8 10h.01"></path><path d="M8 14h.01"></path></svg>',1)),_.createElementVNode("div",null,[_.createElementVNode("div",null,[p[3]||(p[3]=_.createElementVNode("span",{class:"text-muted-foreground"},"Тип: ",-1)),_.createElementVNode("span",HA,_.toDisplayString(x.type_text),1)])])]),_.createElementVNode("div",WA,[p[6]||(p[6]=_.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-calendar h-3.5 w-3.5 text-muted-foreground flex-shrink-0"><path d="M8 2v4"></path><path d="M16 2v4"></path><rect width="18" height="18" x="3" y="4" rx="2"></rect><path d="M3 10h18"></path></svg>',1)),_.createElementVNode("div",null,[p[5]||(p[5]=_.createElementVNode("span",{class:"text-muted-foreground"},"Дата видачі: ",-1)),_.createElementVNode("span",ZA,_.toDisplayString(P.formatDate(x.cdate)),1)])])])]),_.createElementVNode("div",KA,[_.createElementVNode("a",{href:`${y.path}/${x.id}`,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 rounded-md px-3"},p[7]||(p[7]=[_.createTextVNode(" Детальніше"),_.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-arrow-right ml-1 h-3.5 w-3.5"},[_.createElementVNode("path",{d:"M5 12h14"}),_.createElementVNode("path",{d:"m12 5 7 7-7 7"})],-1)]),8,GA)])]))),128)}const XA=pr(LA,[["render",JA]]),QA={name:"Template2",props:{items:{type:Array,required:!0},path:{type:String,required:!0}},methods:{formatDate(u){return new Date(u).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"})}}},YA={class:"flex flex-col space-y-1.5 p-6 pb-2 border-b"},$A={class:"flex justify-between items-center"},ek={class:"tracking-tight text-lg font-medium"},tk={class:"inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800"},rk={class:"p-6 py-4"},ik={class:"grid grid-cols-1 gap-3"},nk={class:"flex items-center"},ok={class:"font-medium"},sk={class:"flex items-center"},ak={class:"font-medium"},lk={class:"items-center p-6 pt-0 flex justify-end"},ck=["href"];function uk(u,p,y,b,k,P){return _.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.items,x=>(_.openBlock(),_.createElementBlock("div",{key:x.id,class:"rounded-lg bg-card text-card-foreground border-0 shadow-md","data-v0-t":"card"},[_.createElementVNode("div",YA,[_.createElementVNode("div",$A,[_.createElementVNode("h3",ek,_.toDisplayString(x.name),1),_.createElementVNode("span",tk,_.toDisplayString(x.status_text),1)])]),_.createElementVNode("div",rk,[_.createElementVNode("div",ik,[_.createElementVNode("div",nk,[p[0]||(p[0]=_.createElementVNode("div",{class:"w-32 flex-shrink-0"},[_.createElementVNode("p",{class:"text-sm font-semibold text-gray-500"},"Номер адреси:")],-1)),_.createElementVNode("p",ok,_.toDisplayString(x.parent_text),1)]),_.createElementVNode("div",sk,[p[1]||(p[1]=_.createElementVNode("div",{class:"w-32 flex-shrink-0"},[_.createElementVNode("p",{class:"text-sm font-semibold text-gray-500"},"Дата видачі:")],-1)),_.createElementVNode("p",ak,_.toDisplayString(P.formatDate(x.cdate)),1)])])]),_.createElementVNode("div",lk,[_.createElementVNode("a",{href:`${y.path}/${x.id}`,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 h-10 px-4 py-2 rounded-md bg-gray-900 text-white hover:bg-black"}," Детальніше ",8,ck)])]))),128)}const hk=pr(QA,[["render",uk]]),dk={name:"Template3",props:{items:{type:Array,required:!0},path:{type:String,required:!0}},methods:{formatDate(u){return new Date(u).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"})}}},pk={class:"flex items-center py-2 px-3"},fk={class:"grid grid-cols-12 gap-2 w-full text-sm"},mk={class:"col-span-5"},gk={class:"font-medium line-clamp-1"},yk={class:"inline-flex items-center rounded-full border transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 mt-1 text-[10px] font-normal px-1.5 py-0","data-v0-t":"badge"},_k={class:"col-span-2"},vk={class:"truncate"},xk={class:"col-span-2"},bk={class:"truncate"},wk={class:"col-span-2"},Sk={class:"col-span-1 flex justify-end items-center"},Ak=["href"];function kk(u,p,y,b,k,P){return _.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.items,x=>(_.openBlock(),_.createElementBlock("div",{class:"border-b border-slate-200 hover:bg-slate-50 transition-colors",key:x.id},[_.createElementVNode("div",pk,[p[4]||(p[4]=_.createElementVNode("div",{class:"w-1 h-8 rounded-full mr-3 bg-blue-500"},null,-1)),_.createElementVNode("div",fk,[_.createElementVNode("div",mk,[_.createElementVNode("p",gk,_.toDisplayString(x.name),1),_.createElementVNode("div",yk,_.toDisplayString(x.type_text),1)]),_.createElementVNode("div",_k,[p[0]||(p[0]=_.createElementVNode("p",{class:"text-[10px] text-muted-foreground"},"Територіальна належність",-1)),_.createElementVNode("p",vk,_.toDisplayString(x.parent_text),1)]),_.createElementVNode("div",xk,[p[1]||(p[1]=_.createElementVNode("p",{class:"text-[10px] text-muted-foreground"},"Статус",-1)),_.createElementVNode("p",bk,_.toDisplayString(x.status_text),1)]),_.createElementVNode("div",wk,[p[2]||(p[2]=_.createElementVNode("p",{class:"text-[10px] text-muted-foreground"},"Дата видачі",-1)),_.createElementVNode("p",null,_.toDisplayString(P.formatDate(x.cdate)),1)]),_.createElementVNode("div",Sk,[_.createElementVNode("a",{href:`${y.path}/${x.id}`,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-7 w-7 p-0"},p[3]||(p[3]=[_.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-chevron-right h-4 w-4"},[_.createElementVNode("path",{d:"m9 18 6-6-6-6"})],-1)]),8,Ak)])])])]))),128)}const Ck=pr(dk,[["render",kk]]),Tk={name:"Template3",props:{items:{type:Array,required:!0},path:{type:String,required:!0}},methods:{formatDate(u){return u?new Date(u).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"}):"Не вказано"}}},Ek={class:"grid grid-cols-12 divide-x divide-gray-100"},Pk={class:"col-span-7 p-4"},Ik={class:"flex items-center mb-1"},Mk={class:"text-base font-bold text-gray-900 mr-2"},Lk={class:"inline-flex items-center rounded-full px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-primary/80 bg-blue-100 text-blue-800 border-0 text-xs"},Rk={class:"text-sm text-gray-600 line-clamp-1 mb-2"},Dk={class:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm"},zk={class:"flex items-center"},Bk={class:"text-gray-600 truncate"},Vk={class:"col-span-2 flex flex-col justify-center items-center bg-gray-50 border-l p-2"},Ok={class:"w-full space-y-2"},Fk=["href"];function Nk(u,p,y,b,k,P){return _.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.items,x=>(_.openBlock(),_.createElementBlock("div",{key:x.id,class:"bg-white border border-gray-200 rounded-lg overflow-hidden transition-all duration-200 hover:shadow-md"},[_.createElementVNode("div",Ek,[p[2]||(p[2]=_.createElementVNode("div",{class:"col-span-1 flex items-center justify-center"},[_.createElementVNode("div",{class:"w-3 h-12 rounded-sm bg-red-500",title:"Пріоритет: Високий","aria-hidden":"true"})],-1)),_.createElementVNode("div",Pk,[_.createElementVNode("div",Ik,[_.createElementVNode("h3",Mk,_.toDisplayString(x.name),1),_.createElementVNode("div",Lk,_.toDisplayString(x.type_text),1)]),_.createElementVNode("p",Rk,_.toDisplayString(x.parent_text),1),_.createElementVNode("div",Dk,[_.createElementVNode("div",zk,[p[0]||(p[0]=_.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-clock h-3.5 w-3.5 text-gray-400 mr-1 flex-shrink-0"},[_.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),_.createElementVNode("polyline",{points:"12 6 12 12 16 14"})],-1)),_.createElementVNode("span",Bk,"Оновлено: "+_.toDisplayString(P.formatDate(x.editor_date)),1)])])]),p[3]||(p[3]=_.createStaticVNode('<div class="col-span-2 p-3 bg-gray-50 flex flex-col justify-center"><p class="text-xs text-gray-500 mb-1.5">Категорії:</p><div class="flex flex-wrap gap-1"><div class="inline-flex items-center rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 bg-white border border-gray-200 text-gray-700 text-xs px-1.5 py-0"> Житловий </div><div class="inline-flex items-center rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 bg-white border border-gray-200 text-gray-700 text-xs px-1.5 py-0"> Центр </div></div></div>',1)),_.createElementVNode("div",Vk,[_.createElementVNode("div",Ok,[_.createElementVNode("a",{href:`${y.path}/${x.id}`,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md px-3 w-full bg-blue-600 hover:bg-blue-700 text-white text-xs h-8"}," Детальніше",8,Fk),p[1]||(p[1]=_.createElementVNode("button",{disabled:"",class:"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border bg-background hover:text-accent-foreground rounded-md px-3 w-full text-gray-700 border-gray-300 hover:bg-gray-100 text-xs h-8"}," Завантажити ",-1))])])])]))),128)}const qk=pr(Tk,[["render",Nk]]),Uk={template1:XA,template2:hk,template3:Ck,template4:qk},jk={name:"RegistryList",components:{HeroBlock:Sy,...Uk},props:{title:{type:String,required:!0},description:{type:String,default:""},type:{type:String,default:"list"},items:{type:Array,default:()=>[]},total:{type:Number,default:0},filters:{type:Array,default:()=>null},emptyStateText:{type:String,default:"Немає даних"},limit:{type:Number,default:16},currentPage:{type:Number,default:1},breadcrumbs:{type:Array,default:()=>[]},path:{type:String,default:""},id_key:{type:String,default:"id"},dialog:{type:Boolean,default:!0},token:{type:String,default:""},table:{type:String,required:!0}},data(){return{filterUrl:"",mounted:!1,templateViews:[{value:"template1",label:"Шаблон 1"},{value:"template2",label:"Шаблон 2"},{value:"template3",label:"Шаблон 3"},{value:"template4",label:"Шаблон 4"}],templateView:"template1",tableData:[],localTotal:0}},created(){this.tableData=this.items,this.localTotal=this.total},mounted(){this.mounted=!0},methods:{handleFilterChange({url:u}){this.currentPage=1,this.filterUrl=u,this.getData()},handlePageChange(u){this.currentPage=u,this.getData(),this.$nextTick(()=>{this.$refs.componentRef.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})})},changeLimit(u){this.limit=u,this.currentPage=1,this.getData()},async getData(){try{const u=this.type==="registry"?"/api/gis-registry":"/api/data",{data:p}=await Br.get(`${u}/${this.table}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`);p&&(this.tableData=p==null?void 0:p.rows,this.localTotal=this.type==="registry"?p==null?void 0:p.filtered:p==null?void 0:p.total)}catch(u){console.error(u.message)}}}},Hk={class:"py-16 md:py-24"},Wk={class:"py-6",ref:"componentRef"},Zk={class:"container"},Kk={key:0,class:"flex items-center text-sm text-muted-foreground mb-6"},Gk=["href"],Jk={key:1,class:"text-foreground font-medium truncate"},Xk={class:"flex flex-col md:flex-row gap-4 justify-end"},Qk={class:"container"},Yk={key:0,class:"space-y-4"},$k={class:"my-5 pr-2"},eC={class:"paginationWrapper relative flex justify-center"},tC={key:1,class:"text-center text-slate-400"};function rC(u,p,y,b,k,P){var O,L;const x=_.resolveComponent("HeroBlock"),o=_.resolveComponent("VsFilterList"),B=_.resolveComponent("VsAutocompleteOption"),D=_.resolveComponent("VsAutocomplete"),M=_.resolveComponent("VsPagination");return _.openBlock(),_.createElementBlock("div",Hk,[_.createElementVNode("section",null,[_.createVNode(x,{title:y.title,description:y.description,path:y.path},null,8,["title","description","path"])]),_.createElementVNode("section",Wk,[_.createElementVNode("div",Zk,[(O=y.breadcrumbs)!=null&&O.length?(_.openBlock(),_.createElementBlock("div",Kk,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.breadcrumbs,(C,T)=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:T},[T<y.breadcrumbs.length-1?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createElementVNode("a",{href:C.link,class:"hover:text-foreground"},_.toDisplayString(C.name),9,Gk),p[1]||(p[1]=_.createElementVNode("span",{class:"mx-2"},"/",-1))],64)):(_.openBlock(),_.createElementBlock("span",Jk,_.toDisplayString(C.name),1))],64))),128))])):_.createCommentVNode("",!0),_.createElementVNode("div",Xk,[y.filters&&k.mounted?(_.openBlock(),_.createBlock(o,{key:0,ref:"filter",scheme:y.filters,token:y.token,isDialog:y.dialog,urlSeparator:"true",view:"plain",name:"filter",onFilterChange:P.handleFilterChange},{button:_.withCtx(()=>p[2]||(p[2]=[_.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground px-3 py-2",type:"button"}," Фільтри ",-1)])),_:1},8,["scheme","token","isDialog","onFilterChange"])):_.createCommentVNode("",!0),_.createVNode(D,{modelValue:k.templateView,"onUpdate:modelValue":p[0]||(p[0]=C=>k.templateView=C),class:"w-[150px]"},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(k.templateViews,C=>(_.openBlock(),_.createBlock(B,{label:C.label,value:C.value},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(C.label),1)]),_:2},1032,["label","value"]))),256))]),_:1},8,["modelValue"])])])],512),_.createElementVNode("section",null,[_.createElementVNode("div",Qk,[((L=k.tableData)==null?void 0:L.length)>0?(_.openBlock(),_.createElementBlock("div",Yk,[(_.openBlock(),_.createBlock(_.resolveDynamicComponent(k.templateView),{items:k.tableData,path:y.path,id_key:y.id_key},null,8,["items","path","id_key"])),_.createElementVNode("div",$k,[_.createElementVNode("div",eC,[_.createVNode(M,{total:k.localTotal,maxPages:4,defaultPage:y.currentPage,pageSize:y.limit,goTo:!1,size:"medium",backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30,40],onPageChange:P.handlePageChange,onPageSizeChange:P.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])])):(_.openBlock(),_.createElementBlock("div",tC,_.toDisplayString(y.emptyStateText),1))])])])}const ky=pr(jk,[["render",rC]]),iC={class:"pt-[10px]"},nC={__name:"vs-editor-style-ace",props:{yamlValue:{type:null,default:()=>""}},setup(u){const p=u,y=_.ref(p.yamlValue);return(b,k)=>{const P=_.resolveComponent("VsFormAce");return _.openBlock(),_.createElementBlock("div",iC,[_.createVNode(P,{modelValue:y.value,"onUpdate:modelValue":k[0]||(k[0]=x=>y.value=x),value:y.value,fontSize:"12px"},null,8,["modelValue","value"])])}}},oC={components:{VsEditorStyleAce:nC},props:{data:Object,value:null,name:String},data(){var u,p,y;return{style:((y=(p=(u=this.data)==null?void 0:u.rows)==null?void 0:p[0])==null?void 0:y.style)||""}}};function sC(u,p,y,b,k,P){const x=_.resolveComponent("VsEditorStyleAce");return _.openBlock(),_.createBlock(x,{yamlValue:k.style,onChangeData:u.onChange,height:500,onUpdate:u.getData},null,8,["yamlValue","onChangeData","onUpdate"])}const aC=pr(oC,[["render",sC]]),lC={install(u){u.component("MapCustom",dA),u.component("RegistryList",Ay),u.component("RegistryListCustom",ky),u.component("vs-style-yml",aC)}};exports.RegistryList=Ay;exports.RegistryListCustom=ky;exports.default=lC;
|
|
845
|
+
`):"":Me=Array.isArray(Te.content)?Te.content.join(""):"",k||(k=document.createElement("div"),y.value.getContainer().appendChild(k));const Qe=y.value.project(dr.lngLat);k.innerHTML=St(ze,Me,Te.fields,Pt.properties,Te.mode,Qe)}}),y.value.on("mouseleave",()=>{var dr;if(k&&(k.remove(),k=null),x.value){const Wt=(dr=y.value.getSource(x.value.source))==null?void 0:dr.type;x.value.source,x.value.id,Wt==="vector"&&x.value.source,fr(y.value,x.value.source,x.value.id,{hovered:!1}),x.value=null}y.value&&y.value.getCanvas&&(y.value.getCanvas().style.cursor="")})),y.value.on("click",async dr=>{var Q,te,he,xe,Y;if(["length","area","print"].includes(M.value))return;const Wt=y.value.queryRenderedFeatures(dr.point);if(!Wt.length)return;o.value.forEach(Pe=>{var Te;const Ae=(Te=y.value.getSource(Pe.source))==null?void 0:Te.type;Pe.source,Pe.id,Ae==="vector"&&Pe.source,fr(y.value,Pe.source,Pe.id,{selected:!1})}),o.value=[];const Pt=Wt[0],Bt=(Q=y.value.getSource(Pt.layer.source))==null?void 0:Q.type;Pt.layer.source,Pt.id,Bt==="vector"&&Pt.layer.source,fr(y.value,Pt.layer.source,Pt.id,{selected:!0}),o.value.push({source:Pt.layer.source,id:Pt.id});const xt=(he=(te=O.value)==null?void 0:te.widgets)==null?void 0:he.find(Pe=>Pe.type==="layers"),ke=(Y=(xe=O.value)==null?void 0:xe.widgets)==null?void 0:Y.find(Pe=>Pe.type==="attribute");let K=(ke==null?void 0:ke.config.layer)||(xt==null?void 0:xt.config.layers.find(Pe=>Pe.id===Pt.layer.source));D.value={layer:(K==null?void 0:K.service_key)||"",map:(K==null?void 0:K.map_key)||"",id:Pt.properties.id,title:(K==null?void 0:K.title)||""}}),y.value.on("dblclick",dr=>{var Bt,xt,ke;if(["length","area","print"].includes(M.value))return;ri([dr.lngLat.lng,dr.lngLat.lat]);const Wt=(xt=(Bt=O.value)==null?void 0:Bt.widgets)==null?void 0:xt.find(K=>K.type==="layers");let Pt=null;(ke=Wt==null?void 0:Wt.config)!=null&&ke.layers&&(Pt=Wt.config.layers.find(K=>K.visible!==!1&&["tms","wms","raster"].includes((K.service_type||K.service||"").toLowerCase()))),D.value={layer:(Pt==null?void 0:Pt.map_key)||"",map:(Pt==null?void 0:Pt.service_key)||"",id:"",title:(Pt==null?void 0:Pt.title)||""}}),y.value.resize(),b.value=!0,(gi=O==null?void 0:O.value)!=null&&gi.history){const dr=()=>{const Wt=y.value.getCenter();Qt({center:[Wt.lng,Wt.lat],zoom:y.value.getZoom(),bearing:y.value.getBearing(),pitch:y.value.getPitch()})};y.value.on("moveend",dr),y.value.on("rotate",dr),y.value.on("pitch",dr)}})},gr=()=>{Bi(),o.value.forEach(it=>{y.value&&fr(y.value,it.source,it.id,{selected:!1})}),o.value=[],D.value=null};_.onMounted(async()=>{await ar(),await _.nextTick(),xr(),window.addEventListener("resize",()=>{Le()}),_.watch([C["top-left"],C["top-right"],C["top-center"],C.center,C["bottom-left"],C["bottom-right"],C["bottom-center"],()=>O.value.widgets,B],async()=>{await _.nextTick(),Le(),setTimeout(Le,0)},{deep:!0}),_.watch(b,it=>{it&&_.nextTick().then(()=>{Le()})}),_.watch(()=>p.table,async it=>{if(it){if(y.value){try{y.value.remove()}catch{}y.value=null,b.value=!1}await ar(),await _.nextTick(),xr(),Le(),window.removeEventListener("resize",Le),window.addEventListener("resize",Le),_.watch([C["top-left"],C["top-right"],C["top-center"],C.center,C["bottom-left"],C["bottom-right"],C["bottom-center"],()=>O.value.widgets,B],async()=>{await _.nextTick(),Le(),setTimeout(Le,0)},{deep:!0}),_.watch(b,vt=>{vt&&_.nextTick().then(()=>{Le()})})}})}),_.onUnmounted(()=>{window.removeEventListener("resize",Le)});const ti=_.computed(()=>{var vt,At,Mt;return{height:((vt=O==null?void 0:O.value)==null?void 0:vt.height)||((Mt=(At=O==null?void 0:O.value)==null?void 0:At.map)==null?void 0:Mt.height)||"100vh",width:"100%"}}),ar=async()=>{const it=await Br.get(`/api/map/${p.table}`);O.value=it.data},Zi=it=>{if(!O.value||!O.value.widgets)return"400px";const vt=O.value.widgets.find(At=>At.position===it);return(vt==null?void 0:vt.width)||"400px"},Nr=_.ref([]);_.watch(()=>O.value,it=>{it&&it.map&&(Nr.value=Ki(),xr())});const Ki=()=>{var vt;if(!O.value||!O.value.widgets)return[];const it=O.value.widgets.find(At=>At.type==="layers");return(vt=it==null?void 0:it.config)!=null&&vt.layers?it.config.layers.map(At=>({...At,visible:At.visible??!1})).filter(At=>At.visible).map(At=>At.id):[]};function fr(it,vt,At,Mt){it.getStyle().layers.filter(Et=>Et.source===vt).forEach(Et=>{var or;const zt={source:vt,id:At};((or=it.getSource(vt))==null?void 0:or.type)==="vector"&&Et["source-layer"]&&(zt.sourceLayer=Et["source-layer"]),it.setFeatureState(zt,Mt)})}const on=_.computed(()=>!!O.value&&!!O.value.interactions&&!!O.value.interactions.navigation&&O.value.interactions.navigation.enabled),Ti=_.computed(()=>!!O.value&&Array.isArray(O.value.tools)&&O.value.tools.length>0),Ur=_.computed(()=>on.value||Ti.value?"70px":"20px");function Bi(){y.value&&(y.value.getLayer("layer-with-pulsing-dot")&&y.value.removeLayer("layer-with-pulsing-dot"),y.value.getSource("dot-point")&&y.value.removeSource("dot-point"),y.value.hasImage&&y.value.hasImage("pulsing-dot")&&y.value.removeImage("pulsing-dot"))}function ri(it){var Mt,Ht,Et,zt;Bi();const vt=80,At={width:vt,height:vt,data:new Uint8Array(vt*vt*4),onAdd(){const or=document.createElement("canvas");or.width=this.width,or.height=this.height,this.context=or.getContext("2d",{willReadFrequently:!0})},render(){var mi;const Jt=performance.now()%2e3/2e3,Ir=vt/2*.3,ii=vt/2*.7*Jt+Ir,{context:Vr}=this;Vr.clearRect(0,0,this.width,this.height),Vr.beginPath(),Vr.arc(this.width/2,this.height/2,ii,0,Math.PI*2),Vr.fillStyle=`rgba(255, 100, 100, ${1-Jt})`,Vr.fill();const ni=vt/2*.7*(Jt-.5<0?Jt-.5+1:Jt-.5)+Ir;return Vr.beginPath(),Vr.arc(this.width/2,this.height/2,ni,0,Math.PI*2),Vr.fillStyle=`rgba(255, 100, 100, ${1-(Jt-.5<0?Jt-.5+1:Jt-.5)})`,Vr.fill(),this.data=Vr.getImageData(0,0,this.width,this.height).data,(mi=y.value)==null||mi.triggerRepaint(),!0}};(Mt=y.value)!=null&&Mt.hasImage("pulsing-dot")||(Ht=y.value)==null||Ht.addImage("pulsing-dot",At,{pixelRatio:2}),(Et=y.value)==null||Et.addSource("dot-point",{type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:it}}}),(zt=y.value)==null||zt.addLayer({id:"layer-with-pulsing-dot",type:"symbol",source:"dot-point",layout:{"icon-image":"pulsing-dot"},paint:{"icon-opacity":.6}})}const Gi=_.computed(()=>{var it,vt,At,Mt,Ht,Et,zt,or,Jt,Ir;return{center:(vt=(it=O==null?void 0:O.value)==null?void 0:it.map)==null?void 0:vt.center,zoom:(Mt=(At=O==null?void 0:O.value)==null?void 0:At.map)==null?void 0:Mt.zoom,pitch:((Et=(Ht=O==null?void 0:O.value)==null?void 0:Ht.map)==null?void 0:Et.pitch)||0,bearing:((or=(zt=O==null?void 0:O.value)==null?void 0:zt.map)==null?void 0:or.bearing)||0,bbox:((Ir=(Jt=O==null?void 0:O.value)==null?void 0:Jt.map)==null?void 0:Ir.bbox)||null}}),Vi={home:O2,print:W2,geolocation:mS,pitch:G2,length:WS,area:sA},Cn=it=>{M.value=it};function Gr(it){if(!O.value||!O.value.widgets)return;const vt=O.value.widgets.find(Ht=>Ht.type==="list");if(!vt||!vt.config)return;const{map_key:At,service_key:Mt}=vt.config;At&&Mt&&(D.value={id:it,map:At,layer:Mt})}function fi(it){switch(it){case"top-left":return U.value;case"top-right":return G.value;case"top-center":return ie.value;case"center":return le.value;case"bottom-left":return Ie.value;case"bottom-right":return ee.value;case"bottom-center":return me.value;default:return 0}}const Jr=_.computed(()=>O.value&&O.value.widgets?O.value.widgets.filter(it=>it.position==="absolute"):[]);return(it,vt)=>{var At,Mt,Ht,Et;return _.openBlock(),_.createElementBlock("div",{id:"maplibre-demo-map",style:_.normalizeStyle(ti.value)},[b.value?_.createCommentVNode("",!0):(_.openBlock(),_.createBlock(M2,{key:0})),_.withDirectives(_.createElementVNode("div",cA,[(_.openBlock(),_.createElementBlock(_.Fragment,null,_.renderList(L,zt=>{var or,Jt;return _.createVNode(lA,{key:zt,position:zt,widgets:qe(zt),map:y.value,mapLoaded:b.value,cardValues:D.value,hasFilters:ct.value,history:(Jt=(or=O.value)==null?void 0:or.value)==null?void 0:Jt.history,currentFilterLayer:P.value,enabledLayerIds:Nr.value,getWidgetComponent:yt,getColumnWidth:Zi,rightColumnOffset:zt==="top-right"?Ur.value:void 0,maxHeight:fi(zt),ref_for:!0,ref:Ir=>T(zt,Ir),onSetFilterLayer:_t,"onUpdate:enabledLayerIds":vt[0]||(vt[0]=Ir=>Nr.value=Ir),onCardValuesId:Gr,onCloseCard:gr,onContentResize:()=>Le(zt)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset","maxHeight","onContentResize"])}),64)),(Mt=(At=O.value)==null?void 0:At.value)!=null&&Mt.tools?(_.openBlock(),_.createElementBlock("div",uA,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((Et=(Ht=O.value)==null?void 0:Ht.value)==null?void 0:Et.tools,zt=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:zt},[b.value&&Vi[zt]?(_.openBlock(),_.createBlock(_.resolveDynamicComponent(Vi[zt]),_.mergeProps({key:0,map:y.value,activeTool:M.value,setActiveTool:Cn,ref_for:!0},zt==="home"?{initialView:Gi.value}:{},{onCardValuesId:Gr}),null,16,["map","activeTool"])):_.createCommentVNode("",!0)],64))),128))])):_.createCommentVNode("",!0)],512),[[_.vShow,b.value]]),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(Jr.value,(zt,or)=>(_.openBlock(),_.createElementBlock("div",{key:"abs-"+(zt.id||zt.type||or),class:"absolute z-20",style:_.normalizeStyle(zt.style)},[(_.openBlock(),_.createBlock(_.resolveDynamicComponent(yt(zt.type)),{map:y.value,config:zt.config,hasFilters:ct.value,currentFilterLayer:P.value,enabledLayerIds:Nr.value,cardValues:D.value,onSetFilterLayer:_t,"onUpdate:enabledLayerIds":vt[1]||(vt[1]=Jt=>Nr.value=Jt),onCardValuesId:Gr,onCloseCard:gr},null,40,["map","config","hasFilters","currentFilterLayer","enabledLayerIds","cardValues"]))],4))),128))],4)}}},dA=pr(hA,[["__scopeId","data-v-edaa6750"]]),pA={props:{title:{type:String,required:!0},description:{type:String,required:!0}}},fA={class:"text-center mb-12"},mA={class:"text-3xl font-bold mb-4"},gA={class:"text-slate-600 max-w-2xl mx-auto"};function yA(u,p,y,b,k,P){return _.openBlock(),_.createElementBlock("div",fA,[_.createElementVNode("h2",mA,_.toDisplayString(y.title),1),_.createElementVNode("p",gA,_.toDisplayString(y.description),1)])}const Sy=pr(pA,[["render",yA]]),_A={name:"RegistryList",components:{HeroBlock:Sy},props:{title:{type:String,required:!0},description:{type:String,default:""},type:{type:String,default:"data"},items:{type:Array,default:()=>[]},total:{type:Number,default:0},filters:{type:Array,default:()=>null},emptyStateText:{type:String,default:"Немає даних"},limit:{type:Number,default:16},breadcrumbs:{type:Array,default:()=>[]},dialog:{type:Boolean,default:!0},token:{type:String,default:""},table:{type:String,default:""},slug:{type:String,default:""}},data(){return{filterUrl:"",mounted:!1,tableData:[],currentPage:1,limit:16,localTotal:0}},created(){this.tableData=this.items,this.localTotal=this.total},mounted(){this.mounted=!0},methods:{handleFilterChange({url:u}){this.currentPage=1,this.filterUrl=u,this.getData()},handlePageChange(u){this.currentPage=u,this.getData()},changeLimit(u){this.limit=u,this.currentPage=1,this.getData()},async getData(){try{const u=this.type==="registry"?`/api/gis-registry/${this.slug}`:`/api/data/${this.table}`,{data:p}=await Br.get(`${u}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`);p&&(this.tableData=p==null?void 0:p.rows,this.localTotal=this.type==="registry"?p==null?void 0:p.total:p==null?void 0:p.filtered)}catch(u){console.error(u.message)}}}},vA={class:"py-16 md:py-24"},xA={class:"py-6"},bA={class:"container"},wA={key:0,class:"flex items-center text-sm text-muted-foreground mb-6"},SA=["href"],AA={key:1,class:"text-foreground font-medium truncate"},kA={class:"flex flex-col md:flex-row gap-4 justify-end"},CA={class:"container"},TA={key:0,class:"space-y-4"},EA={class:"my-5 pr-2"},PA={class:"paginationWrapper relative flex justify-center"},IA={key:1,class:"text-center text-slate-400"};function MA(u,p,y,b,k,P){var D,M;const x=_.resolveComponent("HeroBlock"),o=_.resolveComponent("VsFilterList"),B=_.resolveComponent("VsPagination");return _.openBlock(),_.createElementBlock("div",vA,[_.createElementVNode("section",null,[_.createVNode(x,{title:y.title,description:y.description},null,8,["title","description"])]),_.createElementVNode("section",xA,[_.createElementVNode("div",bA,[(D=y.breadcrumbs)!=null&&D.length?(_.openBlock(),_.createElementBlock("div",wA,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.breadcrumbs,(O,L)=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:L},[L<y.breadcrumbs.length-1?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createElementVNode("a",{href:O.link,class:"hover:text-foreground"},_.toDisplayString(O.name),9,SA),p[0]||(p[0]=_.createElementVNode("span",{class:"mx-2"},"/",-1))],64)):(_.openBlock(),_.createElementBlock("span",AA,_.toDisplayString(O.name),1))],64))),128))])):_.createCommentVNode("",!0),_.createElementVNode("div",kA,[y.filters&&k.mounted?(_.openBlock(),_.createBlock(o,{key:0,ref:"filter",scheme:y.filters,isDialog:y.dialog,urlSeparator:"true",view:"plain",token:y.token,name:"filter",onFilterChange:P.handleFilterChange},{button:_.withCtx(()=>p[1]||(p[1]=[_.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground px-3 py-2",type:"button"}," Фільтри ",-1)])),_:1},8,["scheme","isDialog","token","onFilterChange"])):_.createCommentVNode("",!0)])])]),_.createElementVNode("section",null,[_.createElementVNode("div",CA,[((M=k.tableData)==null?void 0:M.length)>0?(_.openBlock(),_.createElementBlock("div",TA,[_.renderSlot(u.$slots,"default",{items:k.tableData}),_.createElementVNode("div",EA,[_.createElementVNode("div",PA,[_.createVNode(B,{total:k.localTotal,maxPages:4,defaultPage:k.currentPage,pageSize:k.limit,goTo:!1,size:"medium",backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[9,18,27,36],onPageChange:P.handlePageChange,onPageSizeChange:P.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])])):(_.openBlock(),_.createElementBlock("div",IA,_.toDisplayString(y.emptyStateText),1))])])])}const Ay=pr(_A,[["render",MA]]),LA={name:"Template2",props:{items:{type:Array,required:!0},path:{type:String,required:!0}},methods:{formatDate(u){return new Date(u).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"})}}},RA={class:"flex flex-col space-y-1.5 p-4 pb-2 bg-slate-50"},DA={class:"flex items-center justify-between"},zA={class:"text-lg font-bold line-clamp-2"},BA={class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground ml-2 whitespace-nowrap","data-v0-t":"badge"},VA={class:"p-4 pt-2"},OA={class:"grid grid-cols-2 gap-3 text-sm"},FA={class:"flex items-center gap-1.5"},NA={class:"font-medium"},qA={class:"flex items-center gap-1.5"},UA={class:"font-medium"},jA={class:"flex items-center gap-1.5"},HA={class:"font-medium"},WA={class:"flex items-center gap-1.5"},ZA={class:"font-medium"},KA={class:"items-center p-3 bg-slate-50 flex justify-end"},GA=["href"];function JA(u,p,y,b,k,P){return _.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.items,x=>(_.openBlock(),_.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground overflow-hidden border-none shadow-md relative","data-v0-t":"card"},[p[8]||(p[8]=_.createElementVNode("div",{class:"absolute left-0 top-0 bottom-0 w-1 bg-blue-500"},null,-1)),_.createElementVNode("div",RA,[_.createElementVNode("div",DA,[_.createElementVNode("h2",zA,_.toDisplayString(x.name),1),_.createElementVNode("div",BA,_.toDisplayString(x.status_text),1)])]),_.createElementVNode("div",VA,[_.createElementVNode("div",OA,[_.createElementVNode("div",FA,[p[0]||(p[0]=_.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hash h-3.5 w-3.5 text-muted-foreground flex-shrink-0"><line x1="4" x2="20" y1="9" y2="9"></line><line x1="4" x2="20" y1="15" y2="15"></line><line x1="10" x2="8" y1="3" y2="21"></line><line x1="16" x2="14" y1="3" y2="21"></line></svg>',1)),_.createElementVNode("div",null,[_.createElementVNode("span",NA,_.toDisplayString(x.parent_text),1)])]),_.createElementVNode("div",qA,[p[2]||(p[2]=_.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-building h-3.5 w-3.5 text-muted-foreground flex-shrink-0"><rect width="16" height="20" x="4" y="2" rx="2" ry="2"></rect><path d="M9 22v-4h6v4"></path><path d="M8 6h.01"></path><path d="M16 6h.01"></path><path d="M12 6h.01"></path><path d="M12 10h.01"></path><path d="M12 14h.01"></path><path d="M16 10h.01"></path><path d="M16 14h.01"></path><path d="M8 10h.01"></path><path d="M8 14h.01"></path></svg>',1)),_.createElementVNode("div",null,[p[1]||(p[1]=_.createElementVNode("span",{class:"text-muted-foreground"},"Статус: ",-1)),_.createElementVNode("span",UA,_.toDisplayString(x.status_text),1)])]),_.createElementVNode("div",jA,[p[4]||(p[4]=_.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-building h-3.5 w-3.5 text-muted-foreground flex-shrink-0"><rect width="16" height="20" x="4" y="2" rx="2" ry="2"></rect><path d="M9 22v-4h6v4"></path><path d="M8 6h.01"></path><path d="M16 6h.01"></path><path d="M12 6h.01"></path><path d="M12 10h.01"></path><path d="M12 14h.01"></path><path d="M16 10h.01"></path><path d="M16 14h.01"></path><path d="M8 10h.01"></path><path d="M8 14h.01"></path></svg>',1)),_.createElementVNode("div",null,[_.createElementVNode("div",null,[p[3]||(p[3]=_.createElementVNode("span",{class:"text-muted-foreground"},"Тип: ",-1)),_.createElementVNode("span",HA,_.toDisplayString(x.type_text),1)])])]),_.createElementVNode("div",WA,[p[6]||(p[6]=_.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-calendar h-3.5 w-3.5 text-muted-foreground flex-shrink-0"><path d="M8 2v4"></path><path d="M16 2v4"></path><rect width="18" height="18" x="3" y="4" rx="2"></rect><path d="M3 10h18"></path></svg>',1)),_.createElementVNode("div",null,[p[5]||(p[5]=_.createElementVNode("span",{class:"text-muted-foreground"},"Дата видачі: ",-1)),_.createElementVNode("span",ZA,_.toDisplayString(P.formatDate(x.cdate)),1)])])])]),_.createElementVNode("div",KA,[_.createElementVNode("a",{href:`${y.path}/${x.id}`,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 rounded-md px-3"},p[7]||(p[7]=[_.createTextVNode(" Детальніше"),_.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-arrow-right ml-1 h-3.5 w-3.5"},[_.createElementVNode("path",{d:"M5 12h14"}),_.createElementVNode("path",{d:"m12 5 7 7-7 7"})],-1)]),8,GA)])]))),128)}const XA=pr(LA,[["render",JA]]),QA={name:"Template2",props:{items:{type:Array,required:!0},path:{type:String,required:!0}},methods:{formatDate(u){return new Date(u).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"})}}},YA={class:"flex flex-col space-y-1.5 p-6 pb-2 border-b"},$A={class:"flex justify-between items-center"},ek={class:"tracking-tight text-lg font-medium"},tk={class:"inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800"},rk={class:"p-6 py-4"},ik={class:"grid grid-cols-1 gap-3"},nk={class:"flex items-center"},ok={class:"font-medium"},sk={class:"flex items-center"},ak={class:"font-medium"},lk={class:"items-center p-6 pt-0 flex justify-end"},ck=["href"];function uk(u,p,y,b,k,P){return _.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.items,x=>(_.openBlock(),_.createElementBlock("div",{key:x.id,class:"rounded-lg bg-card text-card-foreground border-0 shadow-md","data-v0-t":"card"},[_.createElementVNode("div",YA,[_.createElementVNode("div",$A,[_.createElementVNode("h3",ek,_.toDisplayString(x.name),1),_.createElementVNode("span",tk,_.toDisplayString(x.status_text),1)])]),_.createElementVNode("div",rk,[_.createElementVNode("div",ik,[_.createElementVNode("div",nk,[p[0]||(p[0]=_.createElementVNode("div",{class:"w-32 flex-shrink-0"},[_.createElementVNode("p",{class:"text-sm font-semibold text-gray-500"},"Номер адреси:")],-1)),_.createElementVNode("p",ok,_.toDisplayString(x.parent_text),1)]),_.createElementVNode("div",sk,[p[1]||(p[1]=_.createElementVNode("div",{class:"w-32 flex-shrink-0"},[_.createElementVNode("p",{class:"text-sm font-semibold text-gray-500"},"Дата видачі:")],-1)),_.createElementVNode("p",ak,_.toDisplayString(P.formatDate(x.cdate)),1)])])]),_.createElementVNode("div",lk,[_.createElementVNode("a",{href:`${y.path}/${x.id}`,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 h-10 px-4 py-2 rounded-md bg-gray-900 text-white hover:bg-black"}," Детальніше ",8,ck)])]))),128)}const hk=pr(QA,[["render",uk]]),dk={name:"Template3",props:{items:{type:Array,required:!0},path:{type:String,required:!0}},methods:{formatDate(u){return new Date(u).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"})}}},pk={class:"flex items-center py-2 px-3"},fk={class:"grid grid-cols-12 gap-2 w-full text-sm"},mk={class:"col-span-5"},gk={class:"font-medium line-clamp-1"},yk={class:"inline-flex items-center rounded-full border transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 mt-1 text-[10px] font-normal px-1.5 py-0","data-v0-t":"badge"},_k={class:"col-span-2"},vk={class:"truncate"},xk={class:"col-span-2"},bk={class:"truncate"},wk={class:"col-span-2"},Sk={class:"col-span-1 flex justify-end items-center"},Ak=["href"];function kk(u,p,y,b,k,P){return _.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.items,x=>(_.openBlock(),_.createElementBlock("div",{class:"border-b border-slate-200 hover:bg-slate-50 transition-colors",key:x.id},[_.createElementVNode("div",pk,[p[4]||(p[4]=_.createElementVNode("div",{class:"w-1 h-8 rounded-full mr-3 bg-blue-500"},null,-1)),_.createElementVNode("div",fk,[_.createElementVNode("div",mk,[_.createElementVNode("p",gk,_.toDisplayString(x.name),1),_.createElementVNode("div",yk,_.toDisplayString(x.type_text),1)]),_.createElementVNode("div",_k,[p[0]||(p[0]=_.createElementVNode("p",{class:"text-[10px] text-muted-foreground"},"Територіальна належність",-1)),_.createElementVNode("p",vk,_.toDisplayString(x.parent_text),1)]),_.createElementVNode("div",xk,[p[1]||(p[1]=_.createElementVNode("p",{class:"text-[10px] text-muted-foreground"},"Статус",-1)),_.createElementVNode("p",bk,_.toDisplayString(x.status_text),1)]),_.createElementVNode("div",wk,[p[2]||(p[2]=_.createElementVNode("p",{class:"text-[10px] text-muted-foreground"},"Дата видачі",-1)),_.createElementVNode("p",null,_.toDisplayString(P.formatDate(x.cdate)),1)]),_.createElementVNode("div",Sk,[_.createElementVNode("a",{href:`${y.path}/${x.id}`,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-7 w-7 p-0"},p[3]||(p[3]=[_.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-chevron-right h-4 w-4"},[_.createElementVNode("path",{d:"m9 18 6-6-6-6"})],-1)]),8,Ak)])])])]))),128)}const Ck=pr(dk,[["render",kk]]),Tk={name:"Template3",props:{items:{type:Array,required:!0},path:{type:String,required:!0}},methods:{formatDate(u){return u?new Date(u).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"}):"Не вказано"}}},Ek={class:"grid grid-cols-12 divide-x divide-gray-100"},Pk={class:"col-span-7 p-4"},Ik={class:"flex items-center mb-1"},Mk={class:"text-base font-bold text-gray-900 mr-2"},Lk={class:"inline-flex items-center rounded-full px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-primary/80 bg-blue-100 text-blue-800 border-0 text-xs"},Rk={class:"text-sm text-gray-600 line-clamp-1 mb-2"},Dk={class:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm"},zk={class:"flex items-center"},Bk={class:"text-gray-600 truncate"},Vk={class:"col-span-2 flex flex-col justify-center items-center bg-gray-50 border-l p-2"},Ok={class:"w-full space-y-2"},Fk=["href"];function Nk(u,p,y,b,k,P){return _.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.items,x=>(_.openBlock(),_.createElementBlock("div",{key:x.id,class:"bg-white border border-gray-200 rounded-lg overflow-hidden transition-all duration-200 hover:shadow-md"},[_.createElementVNode("div",Ek,[p[2]||(p[2]=_.createElementVNode("div",{class:"col-span-1 flex items-center justify-center"},[_.createElementVNode("div",{class:"w-3 h-12 rounded-sm bg-red-500",title:"Пріоритет: Високий","aria-hidden":"true"})],-1)),_.createElementVNode("div",Pk,[_.createElementVNode("div",Ik,[_.createElementVNode("h3",Mk,_.toDisplayString(x.name),1),_.createElementVNode("div",Lk,_.toDisplayString(x.type_text),1)]),_.createElementVNode("p",Rk,_.toDisplayString(x.parent_text),1),_.createElementVNode("div",Dk,[_.createElementVNode("div",zk,[p[0]||(p[0]=_.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-clock h-3.5 w-3.5 text-gray-400 mr-1 flex-shrink-0"},[_.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),_.createElementVNode("polyline",{points:"12 6 12 12 16 14"})],-1)),_.createElementVNode("span",Bk,"Оновлено: "+_.toDisplayString(P.formatDate(x.editor_date)),1)])])]),p[3]||(p[3]=_.createStaticVNode('<div class="col-span-2 p-3 bg-gray-50 flex flex-col justify-center"><p class="text-xs text-gray-500 mb-1.5">Категорії:</p><div class="flex flex-wrap gap-1"><div class="inline-flex items-center rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 bg-white border border-gray-200 text-gray-700 text-xs px-1.5 py-0"> Житловий </div><div class="inline-flex items-center rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 bg-white border border-gray-200 text-gray-700 text-xs px-1.5 py-0"> Центр </div></div></div>',1)),_.createElementVNode("div",Vk,[_.createElementVNode("div",Ok,[_.createElementVNode("a",{href:`${y.path}/${x.id}`,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md px-3 w-full bg-blue-600 hover:bg-blue-700 text-white text-xs h-8"}," Детальніше",8,Fk),p[1]||(p[1]=_.createElementVNode("button",{disabled:"",class:"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border bg-background hover:text-accent-foreground rounded-md px-3 w-full text-gray-700 border-gray-300 hover:bg-gray-100 text-xs h-8"}," Завантажити ",-1))])])])]))),128)}const qk=pr(Tk,[["render",Nk]]),Uk={template1:XA,template2:hk,template3:Ck,template4:qk},jk={name:"RegistryList",components:{HeroBlock:Sy,...Uk},props:{title:{type:String,required:!0},description:{type:String,default:""},type:{type:String,default:"list"},items:{type:Array,default:()=>[]},total:{type:Number,default:0},filters:{type:Array,default:()=>null},emptyStateText:{type:String,default:"Немає даних"},limit:{type:Number,default:16},currentPage:{type:Number,default:1},breadcrumbs:{type:Array,default:()=>[]},path:{type:String,default:""},id_key:{type:String,default:"id"},dialog:{type:Boolean,default:!0},token:{type:String,default:""},table:{type:String,required:!0}},data(){return{filterUrl:"",mounted:!1,templateViews:[{value:"template1",label:"Шаблон 1"},{value:"template2",label:"Шаблон 2"},{value:"template3",label:"Шаблон 3"},{value:"template4",label:"Шаблон 4"}],templateView:"template1",tableData:[],localTotal:0}},created(){this.tableData=this.items,this.localTotal=this.total},mounted(){this.mounted=!0},methods:{handleFilterChange({url:u}){this.currentPage=1,this.filterUrl=u,this.getData()},handlePageChange(u){this.currentPage=u,this.getData(),this.$nextTick(()=>{this.$refs.componentRef.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})})},changeLimit(u){this.limit=u,this.currentPage=1,this.getData()},async getData(){try{const u=this.type==="registry"?"/api/gis-registry":"/api/data",{data:p}=await Br.get(`${u}/${this.table}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`);p&&(this.tableData=p==null?void 0:p.rows,this.localTotal=this.type==="registry"?p==null?void 0:p.filtered:p==null?void 0:p.total)}catch(u){console.error(u.message)}}}},Hk={class:"py-16 md:py-24"},Wk={class:"py-6",ref:"componentRef"},Zk={class:"container"},Kk={key:0,class:"flex items-center text-sm text-muted-foreground mb-6"},Gk=["href"],Jk={key:1,class:"text-foreground font-medium truncate"},Xk={class:"flex flex-col md:flex-row gap-4 justify-end"},Qk={class:"container"},Yk={key:0,class:"space-y-4"},$k={class:"my-5 pr-2"},eC={class:"paginationWrapper relative flex justify-center"},tC={key:1,class:"text-center text-slate-400"};function rC(u,p,y,b,k,P){var O,L;const x=_.resolveComponent("HeroBlock"),o=_.resolveComponent("VsFilterList"),B=_.resolveComponent("VsAutocompleteOption"),D=_.resolveComponent("VsAutocomplete"),M=_.resolveComponent("VsPagination");return _.openBlock(),_.createElementBlock("div",Hk,[_.createElementVNode("section",null,[_.createVNode(x,{title:y.title,description:y.description,path:y.path},null,8,["title","description","path"])]),_.createElementVNode("section",Wk,[_.createElementVNode("div",Zk,[(O=y.breadcrumbs)!=null&&O.length?(_.openBlock(),_.createElementBlock("div",Kk,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(y.breadcrumbs,(C,T)=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:T},[T<y.breadcrumbs.length-1?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createElementVNode("a",{href:C.link,class:"hover:text-foreground"},_.toDisplayString(C.name),9,Gk),p[1]||(p[1]=_.createElementVNode("span",{class:"mx-2"},"/",-1))],64)):(_.openBlock(),_.createElementBlock("span",Jk,_.toDisplayString(C.name),1))],64))),128))])):_.createCommentVNode("",!0),_.createElementVNode("div",Xk,[y.filters&&k.mounted?(_.openBlock(),_.createBlock(o,{key:0,ref:"filter",scheme:y.filters,token:y.token,isDialog:y.dialog,urlSeparator:"true",view:"plain",name:"filter",onFilterChange:P.handleFilterChange},{button:_.withCtx(()=>p[2]||(p[2]=[_.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground px-3 py-2",type:"button"}," Фільтри ",-1)])),_:1},8,["scheme","token","isDialog","onFilterChange"])):_.createCommentVNode("",!0),_.createVNode(D,{modelValue:k.templateView,"onUpdate:modelValue":p[0]||(p[0]=C=>k.templateView=C),class:"w-[150px]"},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(k.templateViews,C=>(_.openBlock(),_.createBlock(B,{label:C.label,value:C.value},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(C.label),1)]),_:2},1032,["label","value"]))),256))]),_:1},8,["modelValue"])])])],512),_.createElementVNode("section",null,[_.createElementVNode("div",Qk,[((L=k.tableData)==null?void 0:L.length)>0?(_.openBlock(),_.createElementBlock("div",Yk,[(_.openBlock(),_.createBlock(_.resolveDynamicComponent(k.templateView),{items:k.tableData,path:y.path,id_key:y.id_key},null,8,["items","path","id_key"])),_.createElementVNode("div",$k,[_.createElementVNode("div",eC,[_.createVNode(M,{total:k.localTotal,maxPages:4,defaultPage:y.currentPage,pageSize:y.limit,goTo:!1,size:"medium",backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30,40],onPageChange:P.handlePageChange,onPageSizeChange:P.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])])):(_.openBlock(),_.createElementBlock("div",tC,_.toDisplayString(y.emptyStateText),1))])])])}const ky=pr(jk,[["render",rC]]),iC={class:"pt-[10px]"},nC={__name:"vs-editor-style-ace",props:{yamlValue:{type:null,default:()=>""}},setup(u){const p=u,y=_.ref(p.yamlValue);return(b,k)=>{const P=_.resolveComponent("VsFormAce");return _.openBlock(),_.createElementBlock("div",iC,[_.createVNode(P,{modelValue:y.value,"onUpdate:modelValue":k[0]||(k[0]=x=>y.value=x),value:y.value,fontSize:"12px"},null,8,["modelValue","value"])])}}},oC={components:{VsEditorStyleAce:nC},props:{data:Object,value:null,name:String},data(){var u,p,y;return{style:((y=(p=(u=this.data)==null?void 0:u.rows)==null?void 0:p[0])==null?void 0:y.style)||""}}};function sC(u,p,y,b,k,P){const x=_.resolveComponent("VsEditorStyleAce");return _.openBlock(),_.createBlock(x,{yamlValue:k.style,onChangeData:u.onChange,height:500,onUpdate:u.getData},null,8,["yamlValue","onChangeData","onUpdate"])}const aC=pr(oC,[["render",sC]]),lC={install(u){u.component("MapCustom",dA),u.component("RegistryList",Ay),u.component("RegistryListCustom",ky),u.component("vs-style-yml",aC)}};exports.RegistryList=Ay;exports.RegistryListCustom=ky;exports.default=lC;
|
package/dist/import-file.js
CHANGED
|
@@ -33472,7 +33472,11 @@ const Qy = /* @__PURE__ */ br(jA, [["render", KA]]), GA = {
|
|
|
33472
33472
|
},
|
|
33473
33473
|
table: {
|
|
33474
33474
|
type: String,
|
|
33475
|
-
|
|
33475
|
+
default: ""
|
|
33476
|
+
},
|
|
33477
|
+
slug: {
|
|
33478
|
+
type: String,
|
|
33479
|
+
default: ""
|
|
33476
33480
|
}
|
|
33477
33481
|
},
|
|
33478
33482
|
data() {
|
|
@@ -33503,8 +33507,8 @@ const Qy = /* @__PURE__ */ br(jA, [["render", KA]]), GA = {
|
|
|
33503
33507
|
},
|
|
33504
33508
|
async getData() {
|
|
33505
33509
|
try {
|
|
33506
|
-
const u = this.type === "registry" ?
|
|
33507
|
-
`${u}
|
|
33510
|
+
const u = this.type === "registry" ? `/api/gis-registry/${this.slug}` : `/api/data/${this.table}`, { data: d } = await Zr.get(
|
|
33511
|
+
`${u}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`
|
|
33508
33512
|
);
|
|
33509
33513
|
d && (this.tableData = d == null ? void 0 : d.rows, this.localTotal = this.type === "registry" ? d == null ? void 0 : d.total : d == null ? void 0 : d.filtered);
|
|
33510
33514
|
} catch (u) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div class="flex justify-between items-center pb-[5px]">
|
|
3
3
|
<div class="font-semibold text-[16px] dark:text-white">Загальна інформація</div>
|
|
4
4
|
<div class="flex gap-[5px] items-center">
|
|
5
|
-
{{{button this token=(token table="gis.metadata" form="gis.metadata.form" id=metadata_id) edit=1 }}}
|
|
6
|
-
{{{button this token=(token table="gis.metadata" id=metadata_id) del=1 }}}
|
|
5
|
+
{{{button this token=(token table="gis.metadata.table" form="gis.metadata.form" id=metadata_id) edit=1 }}}
|
|
6
|
+
{{{button this token=(token table="gis.metadata.table" id=metadata_id) del=1 }}}
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
{{{descriptionList
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div class="flex justify-between items-center pb-[5px]">
|
|
3
3
|
<div class="font-semibold text-[16px] dark:text-white">Загальна інформація</div>
|
|
4
4
|
<div class="flex gap-[5px] items-center">
|
|
5
|
-
{{{button this token=(token table="gis.rasters" form="gis.rasters.form" id=raster_id) edit=1 }}}
|
|
6
|
-
{{{button this token=(token table="gis.rasters" id=raster_id) del=1 }}}
|
|
5
|
+
{{{button this token=(token table="gis.rasters.table" form="gis.rasters.form" id=raster_id) edit=1 }}}
|
|
6
|
+
{{{button this token=(token table="gis.rasters.table" id=raster_id) del=1 }}}
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
{{{descriptionList
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div class="flex justify-between items-center pb-[5px]">
|
|
3
3
|
<div class="font-semibold text-[16px] dark:text-white">Загальна інформація</div>
|
|
4
4
|
<div class="flex gap-[5px] items-center">
|
|
5
|
-
{{{button this token=(token table="gis.registers" form="gis.registers.form" id=register_id) edit=1 }}}
|
|
6
|
-
{{{button this token=(token table="gis.registers" id=register_id) del=1 }}}
|
|
5
|
+
{{{button this token=(token table="gis.registers.table" form="gis.registers.form" id=register_id) edit=1 }}}
|
|
6
|
+
{{{button this token=(token table="gis.registers.table" id=register_id) del=1 }}}
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
{{{descriptionList
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div class="flex justify-between items-center pb-[5px]">
|
|
3
3
|
<div class="font-semibold text-[16px] dark:text-white">Загальна інформація</div>
|
|
4
4
|
<div class="flex gap-[5px] items-center">
|
|
5
|
-
{{{button this token=(token table="gis.services" form="gis.services.form" id=service_id) edit=1 }}}
|
|
6
|
-
{{{button this token=(token table="gis.services" id=service_id) del=1 }}}
|
|
5
|
+
{{{button this token=(token table="gis.services.table" form="gis.services.form" id=service_id) edit=1 }}}
|
|
6
|
+
{{{button this token=(token table="gis.services.table" id=service_id) del=1 }}}
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
{{{descriptionList
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "map_id",
|
|
3
3
|
"table": "gis.maps",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"del"
|
|
8
|
-
],
|
|
9
|
-
"controls": [
|
|
10
|
-
"search",
|
|
11
|
-
"list",
|
|
12
|
-
"add"
|
|
13
|
-
],
|
|
4
|
+
"public": true,
|
|
5
|
+
"actions": ["add", "edit", "del"],
|
|
6
|
+
"controls": ["search", "list", "add"],
|
|
14
7
|
"access": "user",
|
|
15
8
|
"order": "created_at desc",
|
|
16
9
|
"meta": {
|
|
17
10
|
"title": "name",
|
|
18
11
|
"search": "name,description"
|
|
19
12
|
},
|
|
20
|
-
"title":"Тематичні карти",
|
|
13
|
+
"title": "Тематичні карти",
|
|
21
14
|
"form": "gis.maps.form",
|
|
22
15
|
"sql": [
|
|
23
16
|
{
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "register_id",
|
|
3
3
|
"table": "gis.registers",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"del"
|
|
8
|
-
],
|
|
9
|
-
"controls": [
|
|
10
|
-
"search",
|
|
11
|
-
"list",
|
|
12
|
-
"add"
|
|
13
|
-
],
|
|
4
|
+
"public": true,
|
|
5
|
+
"actions": ["add", "edit", "del"],
|
|
6
|
+
"controls": ["search", "list", "add"],
|
|
14
7
|
"access": "user",
|
|
15
8
|
"order": "created_at desc",
|
|
16
9
|
"meta": {
|
|
17
10
|
"title": "name",
|
|
18
11
|
"search": "name,description"
|
|
19
12
|
},
|
|
20
|
-
"title":"Реєстри",
|
|
13
|
+
"title": "Реєстри",
|
|
21
14
|
"form": "gis.registers.form",
|
|
22
15
|
"columns": [
|
|
23
16
|
{
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "service_id",
|
|
3
3
|
"table": "gis.services",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"del"
|
|
8
|
-
],
|
|
9
|
-
"controls": [
|
|
10
|
-
"search",
|
|
11
|
-
"list",
|
|
12
|
-
"add"
|
|
13
|
-
],
|
|
4
|
+
"public": true,
|
|
5
|
+
"actions": ["add", "edit", "del"],
|
|
6
|
+
"controls": ["search", "list", "add"],
|
|
14
7
|
"access": "user",
|
|
15
8
|
"order": "created_by desc",
|
|
16
9
|
"meta": {
|
|
17
10
|
"title": "name",
|
|
18
11
|
"search": "name,description,source_path"
|
|
19
12
|
},
|
|
20
|
-
"title":"Набори даних",
|
|
13
|
+
"title": "Набори даних",
|
|
21
14
|
"form": "gis.services.form",
|
|
22
15
|
"sqlColumns": "*",
|
|
23
16
|
"columns": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengis/gis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Softpro",
|
|
6
6
|
"main": "import-file.js",
|
|
@@ -39,15 +39,16 @@
|
|
|
39
39
|
"handlebars": "4.7.8",
|
|
40
40
|
"maplibre-gl": "5.5.0",
|
|
41
41
|
"marked": "15.0.12",
|
|
42
|
+
"monaco-editor": "^0.52.2",
|
|
42
43
|
"vue": "^3.5.13",
|
|
43
44
|
"vue-router": "4.5.1",
|
|
44
45
|
"vue3-smooth-dnd": "0.0.6"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
48
|
-
"vite": "^6.3.5",
|
|
49
49
|
"eslint": "8.49.0",
|
|
50
50
|
"eslint-config-airbnb": "19.0.4",
|
|
51
|
-
"sass-embedded": "1.86.3"
|
|
51
|
+
"sass-embedded": "1.86.3",
|
|
52
|
+
"vite": "^6.3.5"
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -10,7 +10,8 @@ export default async function route(app) {
|
|
|
10
10
|
app.put('/insert-columns/:token', insertColumns);
|
|
11
11
|
app.put('/insert-filters/:token', insertFilters);
|
|
12
12
|
app.get('/gis-registry/:slug', { config: { policy: ['public'] } }, gisRegistry);
|
|
13
|
-
app.get('/gis-registry
|
|
13
|
+
app.get('/gis-registry/:slug/:objectId', { config: { policy: ['public'] } }, gisRegistry);
|
|
14
|
+
app.get('/gis-registry', { config: { policy: ['public'] } }, gisRegistryList);
|
|
14
15
|
app.get('/map-registry/:slug/:id', { config: { policy: ['public'] } }, mapRegistry);
|
|
15
16
|
|
|
16
17
|
app.get('/xml/:id', { config: { policy: ['public'] } }, metadataXML);
|
|
@@ -2,7 +2,7 @@ import { attachClassifiers } from './classifiers.js';
|
|
|
2
2
|
import { extractVisibleColumns } from './columns.js';
|
|
3
3
|
import { getMeta, getFilterSQL } from "@opengis/fastify-table/utils.js";
|
|
4
4
|
|
|
5
|
-
export async function handleRegistryRequest({ settings, query, object_id, offset, limit, page, pg }) {
|
|
5
|
+
export async function handleRegistryRequest({ settings, query, object_id, offset = 0, limit = 16, page = 1, pg }) {
|
|
6
6
|
const { name, table_name, columns, filters, query: whereQuery, order, pk, register_id, is_files } = settings;
|
|
7
7
|
const parsedColumns = Array.isArray(columns) ? columns : JSON.parse(columns);
|
|
8
8
|
const filtersParsed = Array.isArray(filters) ? filters : JSON.parse(filters);
|
|
@@ -39,6 +39,8 @@ export async function handleRegistryRequest({ settings, query, object_id, offset
|
|
|
39
39
|
|
|
40
40
|
await attachClassifiers(row, classifiers);
|
|
41
41
|
|
|
42
|
+
return row;
|
|
43
|
+
|
|
42
44
|
return {
|
|
43
45
|
row,
|
|
44
46
|
columns: columnsInfo,
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { pgClients, getTemplate } from "@opengis/fastify-table/utils.js";
|
|
2
|
+
|
|
2
3
|
import { handleRegistryRequest } from './funcs/handleRegistryRequest.js';
|
|
3
|
-
const pg = pgClients.client;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const maxLimit = 100;
|
|
6
|
+
const defaultLimit = 9;
|
|
7
|
+
|
|
8
|
+
export default async function gisRegistry({
|
|
9
|
+
pg = pgClients.client, params = {}, query = {},
|
|
10
|
+
}) {
|
|
11
|
+
const { slug, objectId } = params;
|
|
12
|
+
|
|
13
|
+
const limit = Math.min(query.limit || defaultLimit, maxLimit);
|
|
14
|
+
const offset = query.page && query.page > 0 && !objectId ? (query.page - 1) * limit : 0;
|
|
10
15
|
|
|
11
16
|
//if (!slug) return reply.code(404).send({ message: 'Params slug is required', status: 404 });
|
|
12
17
|
if (!slug) throw new Error('Params slug is required');
|
|
@@ -19,14 +24,14 @@ export default async function gisRegistry(req = {}) {
|
|
|
19
24
|
WHERE register_key = $1`,
|
|
20
25
|
[slug]
|
|
21
26
|
);
|
|
22
|
-
|
|
27
|
+
|
|
23
28
|
if (registry) {
|
|
24
|
-
return
|
|
29
|
+
return handleRegistryRequest({ settings: registry, query, object_id: objectId, offset, limit, page: query.page, pg });
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
const registryTemplate = await getTemplate('registry', slug);
|
|
28
33
|
//if (!registryTemplate) return reply.code(404).send({ message: 'Template not found', status: 404 });
|
|
29
34
|
if (!registryTemplate) throw new Error('Template not found');
|
|
30
35
|
|
|
31
|
-
return
|
|
36
|
+
return handleRegistryRequest({ settings: registryTemplate, query, object_id: objectId, offset, limit, page: query.page, pg });
|
|
32
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { config, pgClients } from "@opengis/fastify-table/utils.js";
|
|
1
|
+
import { config, pgClients, yml2json } from "@opengis/fastify-table/utils.js";
|
|
2
2
|
|
|
3
3
|
const { prefix = '/api' } = config;
|
|
4
4
|
|
|
@@ -25,6 +25,10 @@ export default async function mapCatalog({ pg = pgClients.client }, reply) {
|
|
|
25
25
|
)
|
|
26
26
|
: {};
|
|
27
27
|
|
|
28
|
+
services.filter(row => row.style).map(row => {
|
|
29
|
+
row.style = yml2json(row.style);
|
|
30
|
+
});
|
|
31
|
+
|
|
28
32
|
services.filter(el => el.bbox).forEach(el => {
|
|
29
33
|
el.bbox = getBBox(el.bbox);
|
|
30
34
|
});
|
|
@@ -5,7 +5,7 @@ import { readFile, stat, mkdir, writeFile } from 'node:fs/promises';
|
|
|
5
5
|
|
|
6
6
|
import Sphericalmercator from '@mapbox/sphericalmercator';
|
|
7
7
|
|
|
8
|
-
import { getTemplate, pgClients, getFilterSQL, getMeta } from '@opengis/fastify-table/utils.js';
|
|
8
|
+
import { getTemplate, pgClients, getFilterSQL, getMeta, yml2json } from '@opengis/fastify-table/utils.js';
|
|
9
9
|
|
|
10
10
|
import rootFolder from '../../../plugins/mapnik/funcs/rootFolder.mjs';
|
|
11
11
|
|
|
@@ -64,7 +64,9 @@ export default async function vtile({ pg = pgClients.client, params = {}, query
|
|
|
64
64
|
return reply.status(404).send('service not found');
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const { source,
|
|
67
|
+
const { source, gt, gc } = data;
|
|
68
|
+
|
|
69
|
+
const style = data.style ? yml2json(data.style) : {};
|
|
68
70
|
|
|
69
71
|
if (!source) {
|
|
70
72
|
return reply.status(400).send('invalid service source path');
|