import{at as O,b_ as L,by as p,a1 as u,bq as k,bs as P,an as j,ak as d,aq as a,y as R,ct as l,p as q,q as M,ap as r,bO as f,g as h,bT as v,cp as G,aR as I,u as N,_ as B}from"./index-BVAEVuZQ.js";import{E as D}from"./el-select-v2-Bi4SQfgN.js";import{a as F,E as z}from"./el-col-CztUE8lk.js";import{M as A,V as Y,q as U,b as W}from"./TileImage-B-0PORC6.js";import{T as H}from"./TileWMS-Wnr0cw94.js";const J={class:"vector-layer-container"},K={class:"content"},Q={class:"footer"},X=O({__name:"Cesium3DTilesLayer",props:{fileOption:{type:Object,required:!0},layer:{type:Object,required:!0}},emits:["cancle"],setup(c,{emit:Z}){L("layer_type");const e=c,_=I("cancle"),y=p([]);u.style.getStyleList({pageNum:1,pageSize:1e6}).then(n=>{y.value=n.data.data?.map(t=>({label:t.name,value:t.name}))||[]});const s=p({name:e.layer.name,dataSourceId:e.fileOption.id,type:e.layer.geometryType,filePath:e.fileOption.filePath,bbox:e.layer.bbox,crs:e.layer.crs,style:"",attributes:[],fileType:e.fileOption.type,isTerrain:e.layer.isTerrain}),b=p();let i;k(()=>{i=new A({target:b.value,view:new Y({zoom:1,center:[0,0],projection:"EPSG:4326"})})});const E=async()=>{let n;e.layer.crs=="EPSG:4326"?n=e.layer.bbox:n=await u.tools.postToolsTransformExtent({destCrs:"EPSG:4326",sourceCrs:e.layer.crs,extent:e.layer.bbox}).then(o=>o.data.data);const t=U(n,"EPSG:4326",i.getView().getProjection());i.getLayers().clear(),i.addLayer(new W({source:new H({url:"/mapserver/wms/overview",params:{LAYERS:s.value.name,FORMAT:"image/png",VERSION:"1.3.0",datasourceId:e.fileOption.id,STYLES:s.value.style},projection:"EPSG:4326"})})),i.getView().fit(t,{padding:[10,10,10,10]})},w=()=>{u.layer.addLayer(s.value).then(()=>{N.success("图层发布成功"),_?.()})};return(n,t)=>{const o=M,S=z,x=F,g=D,m=h,T=q,V=R;return P(),j("div",J,[d("div",K,[a(V,null,{default:l(()=>[a(T,{"label-width":"90px",inline:""},{default:l(()=>[a(o,{label:"图层名称"},{default:l(()=>[r(f(s.value.name),1)]),_:1}),a(o,{label:"坐标参考"},{default:l(()=>[r(f(c.layer.crs),1)]),_:1}),a(x,null,{default:l(()=>[a(S,{span:24},{default:l(()=>[a(o,{label:"数据范围"},{default:l(()=>[r(f(c.layer.bbox?.join(",")),1)]),_:1})]),_:1})]),_:1}),a(o,{label:"样式"},{default:l(()=>[a(g,{filterable:"",options:y.value,modelValue:s.value.style,"onUpdate:modelValue":t[0]||(t[0]=C=>s.value.style=C)},null,8,["options","modelValue"])]),_:1}),a(o,{label:" "},{default:l(()=>[a(m,{onClick:E,icon:v(G)},{default:l(()=>[...t[1]||(t[1]=[r("预览",-1)])]),_:1},8,["icon"])]),_:1}),d("div",{class:"map",ref_key:"mapRef",ref:b},null,512)]),_:1})]),_:1})]),d("div",Q,[a(m,{onClick:w},{default:l(()=>[...t[2]||(t[2]=[r("提交",-1)])]),_:1}),a(m,{type:"info",onClick:v(_)},{default:l(()=>[...t[3]||(t[3]=[r("取消",-1)])]),_:1},8,["onClick"])])])}}}),oe=B(X,[["__scopeId","data-v-78613609"]]);export{oe as default};
