Agriculture-front-end/dist/assets/index.174d622c.js

11 lines
14 KiB
JavaScript
Raw Normal View History

2024-05-30 09:20:30 +08:00
import{_ as Pe,r as o,G as ee,t as Ue,d as h,o as T,c as te,k as m,e as l,w as n,m as g,f as b,H as We,I as V,y as D,K as x,j as le,l as Q,a2 as ae,p as ze,q as Ne}from"./index.9c864c60.js";import{_ as Ae,a as Te}from"./zhankaiss.dd067ea4.js";import{q,m as qe,g as Oe,p as je,a as B,b as Y,s as Re,c as Me,d as Qe,e as Be,f as Ye,i as Je,z as He}from"./information.ef765d82.js";import{d as Xe}from"./download.71b1811b.js";import"./linesGL.ef5bef0f.js";import"./linkSeriesData.77e8a68a.js";const O=U=>(ze("data-v-d59d92a7"),U=U(),Ne(),U),Ze={class:"center"},Ke=O(()=>m("div",{style:{width:"100%",height:"100%"},class:"cesiumContainer",id:"cesiumContainer"},null,-1)),et={class:"rightWra"},tt={class:"rightTop"},lt=O(()=>m("div",{class:"title"},[m("div",{style:{width:"3px",height:"19px",opacity:"1",background:"rgba(100, 195, 164, 1)","margin-right":"12px"}}),m("span",null,"\u5927\u7530\u519C\u6237\u4FE1\u606F\u7BA1\u7406")],-1)),at={style:{width:"100%"}},ot=O(()=>m("img",{src:Ae},null,-1)),nt=O(()=>m("img",{src:Te},null,-1)),st={key:0,class:"positionDiv"},it={__name:"index",setup(U){const j=o();o({name:"",value:""});let k=o(!1);o(""),o(!1),o([]);let L=ee({lat:"",lan:"",name:""}),f=o([]),y=o([]);const J=o([]),H=o(5e3),oe=o();o([]);const R=o([]),M=o([]),C=o([]),ne=o(),se=o([]);let $=o("");const X=o(1),Z=o(6),ie=o([]),_=o([{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles",value:"1"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles",value:"2"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles",value:"3"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles",value:"4"}]),c=o(-1),r=ee({contacts:"",phone:"",region:"",latitude:"",longitude:""}),re=e=>{c.value=_.value.indexOf(e),e.flag=!0},de=e=>{c.value=-1,Be(e).then(a=>{}),e.flag=!1},ue=e=>{me(e)},ce=()=>{console.log("cancel!")},me=e=>{_.value.splice(_.value.indexOf(e),1),Ye(e)},ve=()=>{Je(r).then(e=>{P.value=!1,K()})},pe=()=>{q({region:window.localStorage.getItem("deptName"),unitOrName:$.value}).then(e=>{_.value=e.data})},ge=()=>{$.value="",q({region:window.localStorage.getItem("deptName")}).then(e=>{_.value=e.data})},fe=()=>{q({region:window.localStorage.getItem("deptName"),whetherToDownload:!0}).then(e=>{Xe(e.data[e.data.length-1].downloadPath)})},ye=()=>{y.value.length>0?r.latitude=y.value[0].toFixed(6):ae("\u8BF7\u5148\u5728\u5730\u56FE\u4E0A\u9009\u62E9\u4F4D\u7F6E")},_e=()=>{y.value.length>0?r.longitude=y.value[1].toFixed(6):ae("\u8BF7\u5148\u5728\u5730\u56FE\u4E0A\u9009\u62E9\u4F4D\u7F6E")},we=()=>{P.value=!0,r.contacts="",r.phone="",r.region="",r.latitude="",r.longitude=""};function he(){const e=(X.value-1)*Z.value,a=X.value*Z.value;ie.value=J.value.slice(e,a)}const P=o(!1),be=()=>{let e=new Date;return e.setDate(e.getDate()-1),e};let d=o(null);const Ve=()=>{W=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}),d.addLayer(W)},xe=()=>{var e=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});d.addLayer(e)};let W=o(null);Ue(()=>{K(),$e(),j.value=be().toJSON().substr(0,10),Ce(),Ge(),De(),Fe();let e=document.querySelector(".rightWra");e.style.transform="translate(101%,0)"}),o([]);let Se=o([]);const Ie=o([]),ke=o("");let z=window.localStorage.getItem("deptName");const K=()=>{q({region:window.localStorage.getItem("deptName")}).then(e=>{_.value=e.data})};function Ce(){qe({data:j.value,alertRange:H.value,flag:1,msName:ke.value,warning:ne.value,divisions:z}).then(e=>{J.value=e.data,he()})}function Ee(){He({divisions:z}).then(e=>{Ie.value=e.data})}Ee();function De(){var e=document.querySelector(".center"),a=document.getElementById("cesiumContainer");d=new ol.Map({target:"cesiumContainer",controls:[],view:new ol.View({center:[119.867634
<div class="info-window" >
<div class="close-btn" ><span>\u79CD\u7CAE\u5927\u6237\u4FE1\u606F</span><img src="${Oe}" alt=""/> </div>
<div class="content" style="color:white;font-size: 16px">
<div class="line" style="margin-top: 10px"><div class="label">\u59D3\u540D:</div><span>${L.name}</span></div>
<div class="line" style="margin-top: 10px"><div class="label">\u624B\u673A:</div><span>${L.phone}</span></div>
<div class="line" style="margin-top: 10px"><div class="label">\u4F4D\u7F6E:</div><span>${L.region}</span></div>
</div>
</div>
`,u.setStyle(new ol.style.Style({image:new ol.style.Icon({src:je,scale:.5})})),d.getLayers().forEach(function(S){if(S instanceof ol.layer.Vector){let w=S.getSource().getFeatures()[0];w.get("type")==="0"&&w!==u&&(w.get("warning")==="0"?w.setStyle(new ol.style.Style({image:new ol.style.Icon({src:B,scale:.5})})):w.get("warning")==="1"&&w.setStyle(new ol.style.Style({image:new ol.style.Icon({src:Y,scale:.5})})))}});const p=s.getElement().querySelector(".close-btn");p&&p.addEventListener("click",()=>{s.setPosition(void 0),d.getLayers().forEach(function(S){if(S instanceof ol.layer.Vector){let w=S.getSource().getFeatures()[0];w.get("type")==="0"&&(w.get("warning")==="0"?w.setStyle(new ol.style.Style({image:new ol.style.Icon({src:B,scale:.5})})):w.get("warning")==="1"&&w.setStyle(new ol.style.Style({image:new ol.style.Icon({src:Y,scale:.5})})))}})})}})});var v=new ResizeObserver(function(i){i.forEach(function(F){var E=F.contentRect.width,G=F.contentRect.height;a.style.width=E+"px",a.style.height=G+"px",d.updateSize()})});v.observe(e)}function Le(){if(k.value=!k.value,k.value){let e=document.querySelector(".rightWra");e.style.transform="translate(0,0)"}else{let e=document.querySelector(".rightWra");e.style.transform="translate(101%,0)"}}const $e=()=>{Re().then(e=>{oe.value=Number(e.data[0].flag)})},Fe=()=>{for(const e in R.value)d.removeLayer(R.value[e]);R.value=[];for(const e in M.value)d.removeLayer(M.value[e]);M.value=[];for(const e in C.value)d.removeLayer(C.value[e]);C.value=[],Me({flag:1,alertRange:H.value,data:j.value,divisions:z}).then(e=>{f.value=e.data;for(const a in f.value){const s=[parseFloat(f.value[a].latitude),parseFloat(f.value[a].longitude)],v=new ol.geom.Point(s),i=new ol.Feature({geometry:v,id:f.value[a].contacts,type:f.value[a].flag,warning:f.value[a].earlyWarning});f.value[a].earlyWarning==="0"?(i.setStyle(new ol.style.Style({image:new ol.style.Icon({src:B,scale:.5})})),C.value[a]=new ol.layer.Vector({source:new ol.source.Vector({features:[i]})}),d.addLayer(C.value[a])):f.value[a].earlyWarning==="1"&&(i.setStyle(new ol.style.Style({image:new ol.style.Icon({src:Y,scale:.5})})),C.value[a]=new ol.layer.Vector({source:new ol.source.Vector({features:[i]})}),d.addLayer(C.value[a]))}})},Ge=()=>{let e=[];Qe({flag:1,divisions:z}).then(a=>{e=[],a.data.forEach(s=>{e.push(s.dataTime)}),se.value=e})};return(e,a)=>{const s=h("el-button"),v=h("el-input"),i=h("el-table-column"),F=h("el-popconfirm"),E=h("el-table"),G=h("el-icon"),N=h("el-tooltip"),I=h("el-form-item"),u=h("el-form"),A=h("el-drawer");return T(),te("div",Ze,[Ke,m("div",et,[m("div",tt,[lt,m("div",at,[m("div",null,[l(s,{type:"primary",style:{"margin-bottom":"10px"},onClick:we},{default:n(()=>[g("\u6DFB\u52A0")]),_:1}),l(s,{type:"primary",style:{"margin-bottom":"10px"},onClick:fe},{default:n(()=>[g("\u5BFC\u51FA")]),_:1}),g(" \xA0 "),l(v,{modelValue:b($),"onUpdate:modelValue":a[0]||(a[0]=t=>We($)?$.value=t:$=t),style:{width:"240px","margin-bottom":"10px"},placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u624B\u673A\u53F7\u67E5\u8BE2"},null,8,["modelValue"]),g(" \xA0 "),l(s,{type:"primary",style:{"margin-bottom":"10px"},onClick:pe},{default:n(()=>[g("\u641C\u7D22")]),_:1}),l(s,{type:"primary",style:{"margin-bottom":"10px"},onClick:ge},{default:n(()=>[g("\u91CD\u7F6E")]),_:1})]),l(E,{data:_.value,"header-cell-style":{"text-align":"center",color:"rgba(102, 102, 102, 1)"},border:"",height:"45rem"},{default:n(()=>[l(i,{prop:"contacts",label:"\u540D\u79F0"},{default:n(t=>[V(m("span",null,D(t.row.contacts),513),[[x,t.$index!==c.value]]),V(l(v,{modelValue:t.row.contacts,"onUpdate:modelValue":p=>t.row.contacts=p},null,8,["modelValue","onUpdate:modelValue"]),[[x,t.$index===c.value]])]),_:1}),l(i,{prop:"phone",label:"\u624B\u673A\u53F7"},{default:n(t=>[V(m("span",null,D(t.row.phone),513),[[x,t.$index!==c.value]]),V(l(v,{modelValue:t.row.phone,"onUpdate:modelValue":p=>t.row.phone=p},null,8,["modelValue","onUpdate:modelValue"]),[[x,t.$index===c.value]])]),_:1}),l(i,{prop:"region",label:"\u4F4D\u7F6E"},{default:n(t=>[V(m("span",null,D(t.row.region),513),[[x,t.$index!==c