import{_ as e,a}from"./zhankaiss.6870329f.js";import{m as l,s as t,g as s,p as n,a as o,b as i,h as r,c,j as u,d,k as g,z as v,l as A}from"./information.2f37efab.js";import"./linesGL.76a64914.js";import{_ as m,r as p,I as y,x as h,H as w,a8 as f,d as b,o as S,c as C,l as I,n as E,e as V,w as k,O as R,A as U,m as x,V as T,W as Y,k as N,J as q,f as G,N as W,q as H,s as D}from"./index.e5c8b0d6.js";import"./linkSeriesData.e74eae00.js";const Z=e=>(H("data-v-9e68befe"),e=e(),D(),e),O={class:"center"},J=Z((()=>I("div",{style:{width:"100%",height:"100%"},class:"cesiumContainer",id:"cesiumContainer"},null,-1))),Q={class:"rightWra"},M={class:"farmlandHeader"},P={class:"text"},F={key:0,class:"holiday"},L={class:"rightTop"},X=Z((()=>I("div",{class:"title"},[I("div",{style:{width:"3px",height:"19px",opacity:"1",background:"rgba(100, 195, 164, 1)","margin-right":"12px"}}),I("span",null,"预警信息发布")],-1))),z={class:"farmlandDiv"},j={class:"radioDiv"},B={class:"radioDiv"},K={class:"selectDiv"},_={class:"selectDiv",style:{"margin-top":"10px"}},$={class:"btws"},ee=Z((()=>I("img",{src:e},null,-1))),ae=Z((()=>I("img",{src:a},null,-1))),le={class:"mt-4"},te={class:"tuli"},se=Z((()=>I("span",null," 是否确认发送预警短信? ",-1))),ne={class:"dialog-footer"},oe=m({__name:"index",setup(e){const a=p();p({name:"",value:""});let m=p(!1),H=p(!1),D=window.localStorage.getItem("deptName");p("");let Z=p([]),oe=y({lat:"",lan:"",name:""}),ie=p([]);const re=p([]),ce=p(5e3),ue=p(),de=p([]),ge=p([]),ve=p([]),Ae=p([]);let me={"无预警":{color:"rgba(49, 235, 7, 1)",disabled:!1},"轻度冻害":{color:"rgba(9, 187, 222, 1)",disabled:!1},"中度冻害":{color:"rgba(255, 235, 59, 1)",disabled:!1},"重度冻害":{color:"rgba(234, 165, 93, 1)",disabled:!1}};const pe=p(),ye=p([]),he=({dayjs:e})=>ye.value.includes(e.format("YYYY-MM-DD"));function we(){Ne()}const fe=e=>{const a=new Date;return a.setHours(0,0,0,0),e.getTime()>a.getTime()&&{disabled:!0,style:{color:"red",textDecoration:"line-through"}}};function be(){ce.value=5e3,Ye.value="",pe.value="",Ne(),Ge()}const Se=[{label:"轻度冻害",flag:1},{label:"中度冻害",flag:2},{label:"重度冻害",flag:3}];y({power:[{required:!0,message:"Please select Activity zone",trigger:"change"}],count:[{required:!0,message:"Please select Activity count",trigger:"change"}],date1:[{type:"date",required:!0,message:"Please pick a date",trigger:"change"}],date2:[{type:"date",required:!0,message:"Please pick a time",trigger:"change"}],type:[{type:"array",required:!0,message:"Please select at least one activity type",trigger:"change"}],resource:[{required:!0,message:"Please select activity resource",trigger:"change"}],desc:[{required:!0,message:"Please input activity form",trigger:"blur"}]});const Ce=p(1),Ie=p(6),Ee=p([]);function Ve(e){Ce.value=e,ke()}function ke(){const e=(Ce.value-1)*Ie.value,a=Ce.value*Ie.value;Ee.value=re.value.slice(e,a)}let Re=p(null);let Ue=p(null);h((()=>{qe(),a.value=(()=>{let e=new Date;return e.setDate(e.getDate()-1),e})().toJSON().substr(0,10),Ne(),Oe(),Ze(),function(){var e=document.querySelector(".center"),a=document.getElementById("cesiumContainer");Re=new ol.Map({target:"cesiumContainer",controls:[],view:new ol.View({center:[119.86763411957472,35.88435182141938],zoom:11,projection:"EPSG:4326"}),layers:[new ol.layer.Tile({source:new ol.source.XYZ({url:`${serverAPI.tiandituLayers}`,projection:serverAPI.flag?"EPSG:4326":"EPSG:3857"}),preload:20})]}),Ue=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:serverAPI.geoserverUrl+"/map-huangdaoqu_bianjie/rest/maps/CJQY3702112019WGS84%40huangdaoqu_bianjie",cacheEnabled:!1}),name:"CJQY3702112019WGS84",projection:"EPSG:4326",zIndex:9999}),Re.addLayer(Ue),l=new ol.layer.Tile({source:new ol.source.TileSuperMapRest({url:serverAPI.geoserverUrl+"/map-huangdaoqu_bianjie/rest/maps/XJQY3702112019WGS84%40huangdaoqu_bianjie",cacheEnabled:!1}),name:"XJQY3702112019WGS84",projection:"EPSG:4326",zIndex:9999}),Re.addLayer(l);var l;const t=new ol.Overlay({element:document.createElement("div"),className:"overlay1",positioning:"bottom-center",offset:[0,-10],stopEvent:!0});Re.on("moveend",(function(){Re.getView().getZoom()>=13?Ue.setVisible(!0):Ue.setVisible(!1)})),Re.on("singleclick",(function(e){p([]);const a=Re.getEventPixel(e.originalEvent);var l=e.coordinate,r=l[0],c=l[1],u=Re.getView();u.animate({center:[r,c],duration:1e3}),xe.value.forEach((a=>{layersDic[a]?QueryData(e,layersDic[a].setOf,`http://192.168.0.113:8090/iserver/services/${layersDic[a].name}/rest/maps/${layersDic[a].setOf}`,a):layersGbz[a]&&QueryData(e,layersGbz[a].setOf,`http://192.168.0.113:8090/iserver/services/${layersGbz[a].name}/rest/maps/${layersGbz[a].setOf}`,a)})),Re.forEachFeatureAtPixel(a,(e=>{u.animate({center:[r,c],duration:1e3});const a=e.get("id"),l=e.get("type");if(Re.addOverlay(t),"1"===l){for(const e in Z.value)a===Z.value[e].msName&&(oe.name=a,oe.lon=Z.value[e].msLongitude,oe.lat=Z.value[e].msLatitude);t.setPosition(e.getGeometry().getCoordinates()),t.getElement().innerHTML=`\n
\n
站点信息
\n
\n
名称:
${oe.name}
\n
经度:
${oe.lon}
\n
纬度:
${oe.lat}
\n
\n
\n `;const l=t.getElement().querySelector(".close-btn");l&&l.addEventListener("click",(()=>{t.setPosition(void 0)}))}else if("0"===l){for(const e in ie.value)a===ie.value[e].contacts&&(oe.name=a,oe.phone=ie.value[e].phone,oe.region=ie.value[e].region);t.setPosition(e.getGeometry().getCoordinates()),t.getElement().innerHTML=`\n
\n
种粮大户信息
\n
\n
姓名:
${oe.name}
\n
手机:
${oe.phone}
\n
位置:
${oe.region}
\n
\n
\n `,e.setStyle(new ol.style.Style({image:new ol.style.Icon({src:n,scale:.5})})),Re.getLayers().forEach((function(a){if(a instanceof ol.layer.Vector){let l=a.getSource().getFeatures()[0];"0"===l.get("type")&&l!==e&&("0"===l.get("warning")?l.setStyle(new ol.style.Style({image:new ol.style.Icon({src:o,scale:.5})})):"1"===l.get("warning")&&l.setStyle(new ol.style.Style({image:new ol.style.Icon({src:i,scale:.5})})))}}));const l=t.getElement().querySelector(".close-btn");l&&l.addEventListener("click",(()=>{t.setPosition(void 0),Re.getLayers().forEach((function(e){if(e instanceof ol.layer.Vector){let a=e.getSource().getFeatures()[0];"0"===a.get("type")&&("0"===a.get("warning")?a.setStyle(new ol.style.Style({image:new ol.style.Icon({src:o,scale:.5})})):"1"===a.get("warning")&&a.setStyle(new ol.style.Style({image:new ol.style.Icon({src:i,scale:.5})})))}}))}))}}))})),new ResizeObserver((function(e){e.forEach((function(e){var l=e.contentRect.width,t=e.contentRect.height;a.style.width=l+"px",a.style.height=t+"px",Re.updateSize()}))})).observe(e)}(),Ge(),document.querySelector(".rightWra").style.transform="translate(101%,0)"})),w((()=>{document.querySelector(".mode").style.display="none",window.document.querySelector("#screenfull").style.display="block"})),p([]);let xe=p([]);const Te=p([]),Ye=p("");function Ne(){l({data:a.value,alertRange:ce.value,flag:2,msName:Ye.value,warning:pe.value,divisions:D}).then((e=>{re.value=e.data,ke()}))}const qe=()=>{t().then((e=>{ue.value=Number(e.data[0].flag)}))};v({divisions:D}).then((e=>{Te.value=e.data}));const Ge=()=>{for(const e in ge.value)Re.removeLayer(ge.value[e]);ge.value=[];for(const e in ve.value)Re.removeLayer(ve.value[e]);ve.value=[];for(const e in Ae.value)Re.removeLayer(Ae.value[e]);Ae.value=[],r({flag:2,data:a.value,divisions:D}).then((e=>{Z.value=e.data;for(const l in Z.value){const e=[parseFloat(Z.value[l].msLongitude),parseFloat(Z.value[l].msLatitude)],t=128,s=[];for(let a=0;a{ie.value=e.data;for(const a in ie.value){const e=[parseFloat(ie.value[a].latitude),parseFloat(ie.value[a].longitude)],l=new ol.geom.Point(e),t=new ol.Feature({geometry:l,id:ie.value[a].contacts,type:ie.value[a].flag,warning:ie.value[a].earlyWarning});"0"===ie.value[a].earlyWarning?(t.setStyle(new ol.style.Style({image:new ol.style.Icon({src:o,scale:.5})})),Ae.value[a]=new ol.layer.Vector({source:new ol.source.Vector({features:[t]})}),Re.addLayer(Ae.value[a])):"1"===ie.value[a].earlyWarning&&(t.setStyle(new ol.style.Style({image:new ol.style.Icon({src:i,scale:.5})})),Ae.value[a]=new ol.layer.Vector({source:new ol.source.Vector({features:[t]})}),Re.addLayer(Ae.value[a]))}}))},We=()=>{Ge(),l({data:a.value,alertRange:ce.value,flag:2,divisions:D}).then((e=>{re.value=e.data,ke()}))},He=()=>{m.value=!1,A(de.value).then((e=>{"200"==e.code?f({message:"预警短信已成功发送",type:"success"}):f.error("发送失败")}))},De=e=>{de.value=e},Ze=()=>{u({flag:2,divisions:D}).then((e=>{e.data.length<1?f({message:"近1周暂无预警",type:"success"}):f({message:`近1周${e.data.length}次预警`,type:"warning"})}))},Oe=()=>{let e=[];d({flag:2,divisions:D}).then((a=>{e=[],a.data.forEach((a=>{e.push(a.dataTime)})),ye.value=e}))};return(e,t)=>{const s=b("el-date-picker"),n=b("el-radio"),o=b("el-radio-group"),i=b("el-option"),r=b("el-select"),c=b("el-button"),u=b("el-table-column"),d=b("el-table"),v=b("el-pagination"),A=b("el-icon"),p=b("el-tooltip"),y=b("el-collapse-item"),h=b("el-collapse"),w=b("el-dialog");return S(),C("div",O,[J,I("div",Q,[I("div",M,[E(" 监测日期:  "),V(s,{"popper-class":"date_poper",class:"m-2",modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),onChange:We,format:"YYYY 年 MM 月 DD 日","value-format":"YYYY-MM-DD",type:"date",placeholder:"选择日期",disabledDate:fe},{default:k((e=>[I("div",{class:R(["cell",{current:e.isCurrent}])},[I("span",P,U(e.text),1),he(e)?(S(),C("span",F)):x("",!0)],2)])),_:1},8,["modelValue"])]),I("div",L,[X,I("div",z,[I("div",j,[E(" 自动发送预警短信: "),V(o,{onChange:t[1]||(t[1]=e=>{g({flag:ue.value}).then((e=>{f({message:e.msg,type:"success"})}))}),modelValue:ue.value,"onUpdate:modelValue":t[2]||(t[2]=e=>ue.value=e),class:"ml-4"},{default:k((()=>[V(n,{label:0,size:"large"},{default:k((()=>[E("是")])),_:1}),V(n,{label:1,size:"large"},{default:k((()=>[E("否")])),_:1})])),_:1},8,["modelValue"])]),I("div",B,[E(" 预警范围: "),V(o,{onChange:t[3]||(t[3]=e=>(Ge(),void l({data:a.value,alertRange:ce.value,flag:2,divisions:D}).then((e=>{re.value=e.data,ke()})))),modelValue:ce.value,"onUpdate:modelValue":t[4]||(t[4]=e=>ce.value=e),class:"ml-4"},{default:k((()=>[V(n,{label:5e3,size:"large"},{default:k((()=>[E("5km")])),_:1}),V(n,{label:1e4,size:"large"},{default:k((()=>[E(" 10km ")])),_:1})])),_:1},8,["modelValue"])]),I("div",K,[E(" 站点名称: "),V(r,{"popper-class":"select_city",modelValue:Ye.value,"onUpdate:modelValue":t[5]||(t[5]=e=>Ye.value=e),placeholder:"请选择",style:{width:"76%"},teleported:"false"},{default:k((()=>[(S(!0),C(T,null,Y(Te.value,(e=>(S(),N(i,{key:e.msName,label:e.msName,value:e.msName,title:e.msName},null,8,["label","value","title"])))),128))])),_:1},8,["modelValue"])]),I("div",_,[E(" 预警情况: "),V(r,{"popper-class":"select_city",modelValue:pe.value,"onUpdate:modelValue":t[6]||(t[6]=e=>pe.value=e),placeholder:"请选择",style:{width:"76%"}},{default:k((()=>[(S(),C(T,null,Y(Se,(e=>V(i,{key:e.flag,label:e.label,value:e.label},null,8,["label","value"]))),64))])),_:1},8,["modelValue"])]),I("div",$,[V(c,{class:"bt1",onClick:we},{default:k((()=>[E("查询")])),_:1}),V(c,{class:"bt2",onClick:be},{default:k((()=>[E("重置")])),_:1})]),V(d,{"cell-style":{textAlign:"center"},"header-cell-style":{"text-align":"center",color:"rgba(102, 102, 102, 1)"},data:Ee.value,style:{width:"100%"},onSelectionChange:De},{default:k((()=>[V(u,{type:"selection",width:"20"}),V(u,{prop:"msName",width:"80",label:"站点名称"}),V(u,{prop:"warning",label:"预警情况"}),V(u,{prop:"name",width:"80",label:"联系人"}),V(u,{prop:"telephone",label:"联系电话"})])),_:1},8,["header-cell-style","data"]),V(v,{small:"",style:{display:"flex","justify-content":"center","margin-top":"10px"},onCurrentChange:Ve,"current-page":Ce.value,"page-size":Ie.value,layout:" prev, pager, next",total:re.value.length},null,8,["current-page","page-size","total"]),V(c,{class:"but",type:"primary",disabled:de.value.length<1||0==ue.value,onClick:t[7]||(t[7]=e=>q(m)?m.value=!0:m=!0)},{default:k((()=>[E(" 发布预警短信 ")])),_:1},8,["disabled"])])]),I("div",{class:"rightFoldDiv",onClick:t[8]||(t[8]=e=>(H.value=!H.value,void(H.value?document.querySelector(".rightWra").style.transform="translate(0,0)":document.querySelector(".rightWra").style.transform="translate(101%,0)")))},[V(p,{disabled:!G(H),"hide-after":"0","show-arrow":!1,"show-after":"200",class:"box-item",effect:"dark",content:"收起",placement:"top"},{default:k((()=>[G(H)?(S(),N(A,{key:0},{default:k((()=>[ee])),_:1})):x("",!0)])),_:1},8,["disabled"]),V(p,{disabled:G(H),"hide-after":"0","show-arrow":!1,"show-after":"200",class:"box-item",effect:"dark",content:"展开",placement:"top"},{default:k((()=>[G(H)?x("",!0):(S(),N(A,{key:0},{default:k((()=>[ae])),_:1}))])),_:1},8,["disabled"])])]),V(h,{class:"legend",accordion:""},{default:k((()=>[V(y,{name:"1"},{title:k((()=>[E("图例")])),default:k((()=>[I("div",le,[I("div",te,[(S(!0),C(T,null,Y(G(me),((e,a,l)=>(S(),C("div",{key:l,style:W({backgroundColor:e.color,border:"1px solid value.color",width:"100%",height:"25px",marginTop:"5px",textAlign:"center"})},U(a),5)))),128))])])])),_:1})])),_:1}),V(w,{modelValue:G(m),"onUpdate:modelValue":t[10]||(t[10]=e=>q(m)?m.value=e:m=e),title:"系统提示",width:"30%",center:""},{footer:k((()=>[I("span",ne,[V(c,{onClick:t[9]||(t[9]=e=>q(m)?m.value=!1:m=!1)},{default:k((()=>[E("取消")])),_:1}),V(c,{type:"primary",onClick:He},{default:k((()=>[E(" 确定 ")])),_:1})])])),default:k((()=>[se])),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-9e68befe"]]);export{oe as default};