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