Agriculture-front-end/dist/assets/index.22b985c1.js

2 lines
13 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as e,r as a,I as l,x as t,d as o,o as n,c as s,l as r,e as i,w as d,n as u,f as c,J as m,K as v,A as p,M as g,k as y,m as f,a8 as w,q as h,s as b}from"./index.e5c8b0d6.js";import{_ as V,a as x}from"./zhankaiss.6870329f.js";import{q as S,m as _,g as k,p as C,a as I,b as E,s as G,c as U,d as $,e as L,f as P,i as j,z as D}from"./information.2f37efab.js";import{d as F}from"./download.57166482.js";import"./linesGL.76a64914.js";import"./linkSeriesData.e74eae00.js";const N=e=>(h("data-v-8ac7fbb9"),e=e(),b(),e),A={class:"center"},T=N((()=>r("div",{style:{width:"100%",height:"100%"},class:"cesiumContainer",id:"cesiumContainer"},null,-1))),z={class:"rightWra"},W={class:"rightTop"},q=N((()=>r("div",{class:"title"},[r("div",{style:{width:"3px",height:"19px",opacity:"1",background:"rgba(100, 195, 164, 1)","margin-right":"12px"}}),r("span",null,"大田农户信息管理")],-1))),O={style:{width:"100%"}},R=N((()=>r("img",{src:V},null,-1))),J=N((()=>r("img",{src:x},null,-1))),Q={key:0,class:"positionDiv"},M=e({__name:"index",setup(e){const h=a();a({name:"",value:""});let b=a(!1);a(""),a(!1),a([]);let V=l({lat:"",lan:"",name:""}),x=a([]),N=a([]);const M=a([]),Y=a(5e3),X=a();a([]);const Z=a([]),B=a([]),H=a([]),K=a(),ee=a([]);let ae=a("");const le=a(1),te=a(6),oe=a([]),ne=a([{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"}]),se=a(-1),re=l({contacts:"",phone:"",region:"",latitude:"",longitude:""}),ie=()=>{},de=e=>{ne.value.splice(ne.value.indexOf(e),1),P(e)},ue=()=>{j(re).then((e=>{fe.value=!1,_e()}))},ce=()=>{S({region:window.localStorage.getItem("deptName"),unitOrName:ae.value}).then((e=>{ne.value=e.data}))},me=()=>{ae.value="",S({region:window.localStorage.getItem("deptName")}).then((e=>{ne.value=e.data}))},ve=()=>{S({region:window.localStorage.getItem("deptName"),whetherToDownload:!0}).then((e=>{F(e.data[e.data.length-1].downloadPath)}))},pe=()=>{N.value.length>0?re.latitude=N.value[0].toFixed(6):w("请先在地图上选择位置")},ge=()=>{N.value.length>0?re.longitude=N.value[1].toFixed(6):w("请先在地图上选择位置")},ye=()=>{fe.value=!0,re.contacts="",re.phone="",re.region="",re.latitude="",re.longitude=""};const fe=a(!1);let we=a(null);let he=a(null);t((()=>{_e(),ke(),h.value=(()=>{let e=new Date;return e.setDate(e.getDate()-1),e})().toJSON().substr(0,10),_({data:h.value,alertRange:Y.value,flag:1,msName:xe.value,warning:K.value,divisions:Se}).then((e=>{M.value=e.data,function(){const e=(le.value-1)*te.value,a=le.value*te.value;oe.value=M.value.slice(e,a)}()})),Ie(),function(){var e=document.querySelector(".center"),l=document.getElementById("cesiumContainer");we=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})]}),he=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}),we.addLayer(he),t=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}),we.addLayer(t);var t;const o=new ol.Overlay({element:document.createElement("div"),className:"overlay1",positioning:"bottom-center",offset:[0,-10],stopEvent:!0});we.on("moveend",(function(){we.getView().getZoom()>=13?he.setVisible(!0):he.setVisible(!1)})),we.on("singleclick",(function(e){a([]);const l=we.getEventPixel(e.originalEvent);var t=e.coordinate;N.value=t,ne.value[se.value]&&ne.value[se.value].flag&&(ne.value[se.value].latitude=N.value[0].toFixed(6),ne.value[se.value].longitude=N.value[1].toFixed(6));var n=t[0],s=t[1],r=we.getView();be.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)})),we.forEachFeatureAtPixel(l,(e=>{r.animate({center:[n,s],duration:1e3});const a=e.get("id"),l=e.get("type");if(we.addOverlay(o),"0"===l){for(const e in x.value)a===x.value[e].contacts&&(V.name=a,V.phone=x.value[e].phone,V.region=x.value[e].region);o.setPosition(e.getGeometry().getCoordinates()),o.getElement().innerHTML=`\n <div class="info-window" >\n <div class="close-btn" ><span>种粮大户信息</span><img src="${k}" alt=""/> </div>\n <div class="content" style="color:white;font-size: 16px">\n <div class="line" style="margin-top: 10px"><div class="label">姓名:</div><span>${V.name}</span></div>\n <div class="line" style="margin-top: 10px"><div class="label">手机:</div><span>${V.phone}</span></div>\n <div class="line" style="margin-top: 10px"><div class="label">位置:</div><span>${V.region}</span></div>\n </div>\n </div>\n `,e.setStyle(new ol.style.Style({image:new ol.style.Icon({src:C,scale:.5})})),we.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:I,scale:.5})})):"1"===l.get("warning")&&l.setStyle(new ol.style.Style({image:new ol.style.Icon({src:E,scale:.5})})))}}));const l=o.getElement().querySelector(".close-btn");l&&l.addEventListener("click",(()=>{o.setPosition(void 0),we.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:I,scale:.5})})):"1"===a.get("warning")&&a.setStyle(new ol.style.Style({image:new ol.style.Icon({src:E,scale:.5})})))}}))}))}}))})),new ResizeObserver((function(e){e.forEach((function(e){var a=e.contentRect.width,t=e.contentRect.height;l.style.width=a+"px",l.style.height=t+"px",we.updateSize()}))})).observe(e)}(),Ce(),document.querySelector(".rightWra").style.transform="translate(101%,0)"})),a([]);let be=a([]);const Ve=a([]),xe=a("");let Se=window.localStorage.getItem("deptName");const _e=()=>{S({region:window.localStorage.getItem("deptName")}).then((e=>{ne.value=e.data}))};D({divisions:Se}).then((e=>{Ve.value=e.data}));const ke=()=>{G().then((e=>{X.value=Number(e.data[0].flag)}))},Ce=()=>{for(const e in Z.value)we.removeLayer(Z.value[e]);Z.value=[];for(const e in B.value)we.removeLayer(B.value[e]);B.value=[];for(const e in H.value)we.removeLayer(H.value[e]);H.value=[],U({flag:1,alertRange:Y.value,data:h.value,divisions:Se}).then((e=>{x.value=e.data;for(const a in x.value){const e=[parseFloat(x.value[a].latitude),parseFloat(x.value[a].longitude)],l=new ol.geom.Point(e),t=new ol.Feature({geometry:l,id:x.value[a].contacts,type:x.value[a].flag,warning:x.value[a].earlyWarning});"0"===x.value[a].earlyWarning?(t.setStyle(new ol.style.Style({image:new ol.style.Icon({src:I,scale:.5})})),H.value[a]=new ol.layer.Vector({source:new ol.source.Vector({features:[t]})}),we.addLayer(H.value[a])):"1"===x.value[a].earlyWarning&&(t.setStyle(new ol.style.Style({image:new ol.style.Icon({src:E,scale:.5})})),H.value[a]=new ol.layer.Vector({source:new ol.source.Vector({features:[t]})}),we.addLayer(H.value[a]))}}))},Ie=()=>{let e=[];$({flag:1,divisions:Se}).then((a=>{e=[],a.data.forEach((a=>{e.push(a.dataTime)})),ee.value=e}))};return(e,a)=>{const l=o("el-button"),t=o("el-input"),w=o("el-table-column"),h=o("el-popconfirm"),V=o("el-table"),x=o("el-icon"),S=o("el-tooltip"),_=o("el-form-item"),k=o("el-form"),C=o("el-drawer");return n(),s("div",A,[T,r("div",z,[r("div",W,[q,r("div",O,[r("div",null,[i(l,{type:"primary",style:{"margin-bottom":"10px"},onClick:ye},{default:d((()=>[u("添加")])),_:1}),i(l,{type:"primary",style:{"margin-bottom":"10px"},onClick:ve},{default:d((()=>[u("导出")])),_:1}),u("   "),i(t,{modelValue:c(ae),"onUpdate:modelValue":a[0]||(a[0]=e=>m(ae)?ae.value=e:ae=e),style:{width:"240px","margin-bottom":"10px"},placeholder:"请输入姓名或手机号查询"},null,8,["modelValue"]),u("   "),i(l,{type:"primary",style:{"margin-bottom":"10px"},onClick:ce},{default:d((()=>[u("搜索")])),_:1}),i(l,{type:"primary",style:{"margin-bottom":"10px"},onClick:me},{default:d((()=>[u("重置")])),_:1})]),i(V,{data:ne.value,"header-cell-style":{"text-align":"center",color:"rgba(102, 102, 102, 1)"},border:"",height:"45rem"},{default:d((()=>[i(w,{prop:"contacts",label:"名称"},{default:d((e=>[v(r("span",null,p(e.row.contacts),513),[[g,e.$index!==se.value]]),v(i(t,{modelValue:e.row.contacts,"onUpdate:modelValue":a=>e.row.contacts=a},null,8,["modelValue","onUpdate:modelValue"]),[[g,e.$index===se.value]])])),_:1}),i(w,{prop:"phone",label:"手机号"},{default:d((e=>[v(r("span",null,p(e.row.phone),513),[[g,e.$index!==se.value]]),v(i(t,{modelValue:e.row.phone,"onUpdate:modelValue":a=>e.row.phone=a},null,8,["modelValue","onUpdate:modelValue"]),[[g,e.$index===se.value]])])),_:1}),i(w,{prop:"region",label:"位置"},{default:d((e=>[v(r("span",null,p(e.row.region),513),[[g,e.$index!==se.value]]),v(i(t,{modelValue:e.row.region,"onUpdate:modelValue":a=>e.row.region=a},null,8,["modelValue","onUpdate:modelValue"]),[[g,e.$index===se.value]])])),_:1}),i(w,{label:"经度",width:"120"},{default:d((e=>[v(r("span",null,p(e.row.latitude),513),[[g,e.$index!==se.value]]),v(i(t,{modelValue:e.row.latitude,"onUpdate:modelValue":a=>e.row.latitude=a},null,8,["modelValue","onUpdate:modelValue"]),[[g,e.$index===se.value]])])),_:1}),i(w,{label:"纬度",width:"120"},{default:d((e=>[v(r("span",null,p(e.row.longitude),513),[[g,e.$index!==se.value]]),v(i(t,{modelValue:e.row.longitude,"onUpdate:modelValue":a=>e.row.longitude=a},null,8,["modelValue","onUpdate:modelValue"]),[[g,e.$index===se.value]])])),_:1}),i(w,{label:"操作"},{default:d((({row:e})=>[i(l,{type:"primary",link:"",onClick:a=>(e=>{se.value=ne.value.indexOf(e),e.flag=!0})(e)},{default:d((()=>[u("   编辑")])),_:2},1032,["onClick"]),i(l,{type:"primary",link:"",onClick:a=>(e=>{se.value=-1,L(e).then((e=>{})),e.flag=!1})(e)},{default:d((()=>[u("保存")])),_:2},1032,["onClick"]),i(h,{"confirm-button-text":"确定","cancel-button-text":"取消","icon-color":"#626AEF",title:"确定删除?",onConfirm:a=>(e=>{de(e)})(e),onCancel:ie},{reference:d((()=>[i(l,{type:"danger",link:""},{default:d((()=>[u("删除")])),_:1})])),_:2},1032,["onConfirm"])])),_:1})])),_:1},8,["data","header-cell-style"])])]),r("div",{class:"rightFoldDiv",onClick:a[1]||(a[1]=e=>(b.value=!b.value,void(b.value?document.querySelector(".rightWra").style.transform="translate(0,0)":document.querySelector(".rightWra").style.transform="translate(101%,0)")))},[i(S,{disabled:!c(b),"hide-after":"0","show-arrow":!1,"show-after":"200",class:"box-item",effect:"dark",content:"收起",placement:"top"},{default:d((()=>[c(b)?(n(),y(x,{key:0},{default:d((()=>[R])),_:1})):f("",!0)])),_:1},8,["disabled"]),i(S,{disabled:c(b),"hide-after":"0","show-arrow":!1,"show-after":"200",class:"box-item",effect:"dark",content:"展开",placement:"top"},{default:d((()=>[c(b)?f("",!0):(n(),y(x,{key:0},{default:d((()=>[J])),_:1}))])),_:1},8,["disabled"])])]),i(C,{modelValue:fe.value,"onUpdate:modelValue":a[8]||(a[8]=e=>fe.value=e),direction:e.direction,"before-close":e.handleClose,"append-to-body":!0,modal:!1,"modal-class":"AIdrawer",class:"AIdrawerWrapper"},{default:d((()=>[i(k,{"label-position":e.labelPosition,"label-width":"auto",model:re,style:{"max-width":"600px"}},{default:d((()=>[i(_,{label:"名称:"},{default:d((()=>[i(t,{modelValue:re.contacts,"onUpdate:modelValue":a[2]||(a[2]=e=>re.contacts=e)},null,8,["modelValue"])])),_:1}),i(_,{label:"手机号:"},{default:d((()=>[i(t,{modelValue:re.phone,"onUpdate:modelValue":a[3]||(a[3]=e=>re.phone=e)},null,8,["modelValue"])])),_:1}),i(_,{label:"位置:"},{default:d((()=>[i(t,{modelValue:re.region,"onUpdate:modelValue":a[4]||(a[4]=e=>re.region=e)},null,8,["modelValue"])])),_:1}),i(_,{label:"经度:"},{default:d((()=>[i(t,{modelValue:re.latitude,"onUpdate:modelValue":a[5]||(a[5]=e=>re.latitude=e),style:{width:"12rem"}},null,8,["modelValue"]),u(" "),i(l,{type:"primary",onClick:pe},{default:d((()=>[u("坐标拾取")])),_:1})])),_:1}),i(_,{label:"纬度:"},{default:d((()=>[i(t,{modelValue:re.longitude,"onUpdate:modelValue":a[6]||(a[6]=e=>re.longitude=e),style:{width:"12rem"}},null,8,["modelValue"]),u(" "),i(l,{type:"primary",onClick:ge},{default:d((()=>[u("坐标拾取")])),_:1})])),_:1}),i(_,{class:"butDiv"},{default:d((()=>[i(l,{type:"primary",onClick:ue},{default:d((()=>[u("添加")])),_:1}),i(l,{onClick:a[7]||(a[7]=e=>fe.value=!1)},{default:d((()=>[u("取消")])),_:1})])),_:1})])),_:1},8,["label-position","model"])])),_:1},8,["modelValue","direction","before-close"]),c(N)[0]?(n(),s("div",Q," 经纬度:"+p(c(N)[0]?c(N)[0].toFixed(6):"")+" / "+p(c(N)[1]?c(N)[1].toFixed(6):""),1)):f("",!0)])}}},[["__scopeId","data-v-8ac7fbb9"]]);export{M as default};