Agriculture-front-end/dist/assets/index.8dbb3b2a.js
2023-07-11 08:43:34 +08:00

3 lines
13 KiB
JavaScript

import{H as E,_ as Se,r as n,A as xe,V as ke,W as De,J as Ce,d as g,o as A,c as J,l as o,m as M,x as N,f as l,e as i,w as f,B as Te,k as Le,g as X,G as w,C as O,D as j,p as Me,q as He}from"./index.afd881ee.js";import{_ as ze}from"./dow.2a8d74cb.js";import{L as _,i as Ye,_ as Ie,a as Ve}from"./mark.80cfbbca.js";import"./index.6098b0aa.js";import{u as Ae}from"./useEcharts.a1c5140e.js";import{V as Ne}from"./video.f22e9bb9.js";import{h as P}from"./moment.9709ab41.js";import{d as Pe}from"./download.5dddc0da.js";import{e as Ee}from"./element-resize-detector.d8720798.js";import{i as se}from"./install.6cb28b74.js";function Fe(v){return E({url:"equipment/meteorological",method:"get",params:v})}function qe(v){return E({url:"equipment/meteorologyFtb",method:"get",params:v})}function re(v){return E({url:"equipment/meteorologicals",method:"get",params:v})}function $e(v){return E({url:"equipment/meteorologyTb",method:"get",params:v})}const F=v=>(Me("data-v-2721e228"),v=v(),He(),v),Re={class:"fatherDiv"},Ue={class:"tabulation"},Be={class:"tabulationCente"},We={class:"left"},Ze={style:{color:"rgba(100, 195, 164, 1)"}},Ge={class:"freckle"},Je={class:"searchDiv"},Xe=F(()=>o("img",{src:ze,alt:""},null,-1)),Oe={class:"chartModeFather"},je={class:"tableBox"},Ke={class:"example-pagination-block"},Qe={class:"chartMode"},et={class:"depth"},tt={class:"centent"},at={key:0},ot=F(()=>o("img",{style:{width:"300%"},src:Ie},null,-1)),lt=[ot],it={key:1},st=F(()=>o("img",{style:{width:"300%"},src:Ve},null,-1)),rt=[st],nt={class:"cesiumContainersDiv"},dt=F(()=>o("div",{id:"cesiumContainers",class:"detailed"},null,-1)),ct=[dt],ut={class:"myVideo"},pt={__name:"index",setup(v){let b=_.Map,x=n([]);n({});let K=n([]);n("");let T=n("\u5168\u90E8"),q=n([]);const H=n(null),Q=n(!1);let p=n(""),$=n({yearMonth:"",flag:"",divisions:""}),L=n(!1),k=n(1),S=n(9),z=null,t=n({airTemperature:[],airHumidity:[],windSpeed:[],windDirection:[],rainfall:[],atmosphericPressure:[],evaporation:[],lightIntensity:[],sunlightHours:[],photosyntheticEffectiveRadiation:[],dataTimeArr:[]}),R=n(""),D=n(!0);n(!0);let h=n("1");const ne=xe({videoSrc:"http://cmgw-vpc.lechange.com:8888/LCO/9C023C5FACFE48F/0/1/20230530T033445/a44e6e04b0608347f0209ab2b25aa258.m3u8"});ke(()=>{ce(),de(),U(),ee()}),De(()=>{document.querySelector(".mode").style.display="none",window.document.querySelector("#screenfull").style.display="none"});const de=()=>{b=_.map("cesiumContainers",{center:[36.4,119.166326],zoom:7,zoomControl:!1,doubleClickZoom:!1,attributionControl:!1}),_.tileLayer("http://t0.tianditu.com/DataServer?T=img_w&tk=5956e6519f2bb0ae8e57bc834298c9f1&x={x}&y={y}&l={z}").addTo(b),_.tileLayer("http://t0.tianditu.com/DataServer?T=cia_w&tk=5956e6519f2bb0ae8e57bc834298c9f1&x={x}&y={y}&l={z}").addTo(b),b._onResize()},ce=()=>{Fe().then(a=>{console.log(a.data),a.data.forEach(e=>{K.value.push(e)})})},U=()=>{qe({name:R.value,whetherToDownload:!1,startTime:p.value[0]?P(p.value[0]).format("YYYY-MM-DD HH:mm:ss"):null,endTime:p.value[1]?P(p.value[1]).format("YYYY-MM-DD HH:mm:ss"):null}).then(a=>{x.value=a.data,q.value=a.data.slice((k.value-1)*S.value,(k.value-1)*S.value+S.value)}),re().then(a=>{console.log(a.data),a.data.forEach(e=>{z=_.latLng(e.msLatitude,e.msLongitude),b.setView(z,17),_.marker([e.msLatitude,e.msLongitude],{icon:te}).addTo(b).bindPopup(`<b>${e.msName}</b><br><br>\u7ECF\u5EA6:${e.msLongitude}<br><br>\u7EAC\u5EA6:${e.msLatitude}`).openPopup()})})},ee=()=>{t.value.airTemperature=[],t.value.airHumidity=[],t.value.windSpeed=[],t.value.windDirection=[],t.value.rainfall=[],t.value.atmosphericPressure=[],t.value.evaporation=[],t.value.lightIntensity=[],t.value.sunlightHours=[],t.value.photosyntheticEffectiveRadiation=[],t.value.dataTimeArr=[],$e({name:R.value,whetherToDownload:!1,startTime:p.value[0]?P(p.value[0]).format("YYYY-MM-DD HH:mm:ss"):null,endTime:p.value[1]?P(p.value[1]).format("YYYY-MM-DD HH:mm:ss"):null}).then(a=>{a.data.forEach(e=>{t.value.airTemperature.push(e.airTemperature),t.value.airHumidity.push(e.airHumidity),t.value.windSpeed.push(e.windSpeed),t.value.windDirection.push(e.windDirection),t.value.rainfall.push(e.rainfall),t.value.atmosphericPressure.push(e.atmosphericPressure),t.value.evaporation.push(e.evaporation),t.value.lightIntensity.push(e.lightIntensity),t.value.sunlightHours.push(e.sunlightHours),t.value.photosyntheticEffectiveRadiation.push(e.photosyntheticEffectiveRadiation),t.value.dataTimeArr.push(e.dataTime)}),B()})},ue=(a,e,c,u)=>{T.value=a.label,$.value.flag="",console.log(T.value),R.value=T.value,re().then(r=>{console.log(r.data),r.data.forEach(s=>{s.msName==T.value&&(z=_.latLng(s.msLatitude,s.msLongitude),b.setView(z,17),_.marker([s.msLatitude,s.msLongitude],{icon:te}).addTo(b).bindPopup(`<b>${s.msName}</b><br><br>\u7ECF\u5EA6:${s.msLongitude}<br><br>\u7EAC\u5EA6:${s.msLatitude}`).openPopup())})})},pe=a=>{U(),ee(),B()};var me=_.Icon.extend({options:{iconSize:[50,50],shadowSize:[50,64],iconAnchor:[22,94],shadowAnchor:[4,62],popupAnchor:[0,-86]}}),te=new me({iconUrl:Ye});const ve=()=>{D.value=!D.value,B()},B=()=>{const a=H.value;a.style.width=document.querySelector(".chartModeFather").offsetWidth+"px",a.style.height=document.querySelector(".chartModeFather").offsetHeight-100+"px",console.log(document.querySelector(".chartModeFather").offsetWidth);const e=se(a);window.addEventListener("resize",()=>{a.style.width=document.querySelector(".chartModeFather").offsetWidth+"px",a.style.height=document.querySelector(".chartModeFather").offsetHeight-100+"px",e.resize()}),ae()},he=()=>{L.value=!L.value},ge=a=>{k.value=a,q.value=x.value.slice((k.value-1)*S.value,(k.value-1)*S.value+S.value)},fe=a=>{var e=new Date(a),c=e.getFullYear()+"-",u=(e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1)+"-",r=e.getDate()<10?"0"+e.getDate():e.getDate();return c+u+r},_e=a=>{var e=new Date(a),c=(e.getHours()<10?"0"+e.getHours():e.getHours())+":",u=(e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes())+":",r=e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds();return c+u+r},be=()=>{p.value="",$.value.flag="",U()},C=a=>{h.value=a,ae()},ye=()=>{Pe(x.value[x.value.length-1].excelPath)};function ae(){const a=se(H.value);let e="\u6E29\u5EA6(\u2103)",c="\u6E7F\u5EA6(%)",u=t.value.airTemperature,r=t.value.airHumidity,s="rgba(255, 235, 59, 1)";switch(console.log(h.value),h.value){case 1:e="\u6E29\u5EA6(\u2103)",c="\u6E7F\u5EA6(%)",u=t.value.airTemperature,r=t.value.airHumidity,s="rgba(0, 209, 195, 1)";break;case 2:e="\u98CE\u901F(m/s)",c="\u98CE\u5411(\xB0)",u=t.value.windSpeed,r=t.value.windDirection,s="rgba(201, 255, 148, 1)";break;case 3:e="\u5149\u7167\u5F3A\u5EA6(LUX)",c="\u5149\u5408\u6709\u6548(umol)",u=t.value.lightIntensity,r=t.value.photosyntheticEffectiveRadiation,s="rgba(0, 209, 195, 1)";break;case 4:e="\u65E5\u7167\u65F6\u6570\uFF08h\uFF09",c="",u=t.value.sunlightHours,r=[],s="rgba(201, 255, 148, 1)";break;case 5:e="\u96E8\u91CF(mm)",c="\u84B8\u53D1\u91CF(mm)",u=t.value.rainfall,r=t.value.evaporation,s="rgba(0, 209, 195, 1)";break;case 6:e="\u5927\u6C14\u538B\u529B(hpa)",c="",u=t.value.atmosphericPressure,r=[],s="rgba(9, 187, 222, 0.8)";break}var Y=t.value.dataTimeArr;console.log(u),console.log(r);let m=7/Y.length*100;Ae(a,{color:[s,"rgba(199, 125, 231, 1)"],tooltip:{trigger:"axis"},grid:{top:"15%",left:"5%",right:"7%",bottom:"15%",containLabel:!0},legend:{show:!0,top:"7%",x:"center",textStyle:{color:"black"},itemWidth:20,itemHeight:12.5,icon:"rect",backgroundColor:"transparent"},dataZoom:[{type:"slider",width:"40%",zoomLock:!0,top:"90%",start:0,end:m,showDataShadow:!1,showDetail:!1,fillerColor:"rgba(64, 158, 255)",borderRadius:"50%",moveHandleSize:0,moveHandleStyle:{},left:"35%",height:12,handleSize:"80%",handleIcon:"path://M512,512m-448,0a448,448,0,1,0,896,0a448,448,0,1,0,-896,0Z",handleStyle:{borderWidth:0,color:"rgba(64, 158, 255)"}},{type:"inside"}],xAxis:[{type:"category",data:Y,axisLine:{show:!1},axisLabel:{textStyle:{color:"rgba(102, 102, 102, 1)"},interval:0,formatter:function(y){var d="",W=y.length,I=10,ie=Math.ceil(W/I);if(W>I)for(var V=0;V<ie;V++){var Z="",G=V*I,we=G+I;V==ie-1?Z=y.substring(G,W):Z=y.substring(G,we)+`
`,d+=Z}else d=y;return d}},boundaryGap:!1,axisTick:{show:!1}}],yAxis:[{name:e,type:"value",axisLine:{show:!1,lineStyle:{color:"rgba(102, 102, 102, 1)"}},axisTick:{show:!1},axisLabel:{textStyle:{color:"rgba(102, 102, 102, 1)"}},splitLine:{show:!0,lineStyle:{color:"#ccc",type:"solid",opacity:1}}},{name:c,type:"value",axisLine:{show:!1,lineStyle:{color:"rgba(102, 102, 102, 1)"}},position:"right",axisTick:{show:!1},axisLabel:{textStyle:{color:"rgba(102, 102, 102, 1)"},formatter:"{value}"},splitLine:{show:!1}}],series:[{name:e,type:"line",data:u,symbolSize:10,itemStyle:{},smooth:!0,yAxisIndex:0,showSymbol:!0,symbol:"circle",lineStyle:{width:3,color:s}},{name:c,type:"line",data:r,symbolSize:10,yAxisIndex:1,itemStyle:{},label:{color:y=>y.color},smooth:!0,showSymbol:!0,symbol:"circle",lineStyle:{width:3,color:"rgba(199, 125, 231, 1)"}}]}),Ee().listenTo(H.value,()=>{Ce(()=>{a.resize()})})}return(a,e)=>{const c=g("el-tree"),u=g("el-date-picker"),r=g("el-form-item"),s=g("el-button"),Y=g("el-form"),m=g("el-table-column"),oe=g("el-table"),le=g("el-pagination"),y=g("el-dialog");return A(),J("div",Re,[o("div",Ue,[o("div",Be,[o("div",We,[o("p",null,[M(" \u5F53\u524D\u9009\u62E9 \uFF1A "),o("span",Ze,N(l(T)),1)]),i(c,{data:l(K),props:a.defaultProps,onNodeClick:ue},null,8,["data","props"])]),o("div",Ge,[o("div",Je,[i(Y,{inline:!0,model:l($),class:"demo-form-inline"},{default:f(()=>[i(r,{style:{width:"300px"},label:"\u76D1\u6D4B\u65F6\u95F4:"},{default:f(()=>[i(u,{modelValue:l(p),"onUpdate:modelValue":e[0]||(e[0]=d=>Te(p)?p.value=d:p=d),type:"daterange","range-separator":"\u27A1\uFE0F","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F"},null,8,["modelValue"])]),_:1}),i(r,null,{default:f(()=>[i(s,{type:"primary",onClick:pe},{default:f(()=>[M("\u67E5\u8BE2")]),_:1}),i(s,{plain:"",onClick:be},{default:f(()=>[M("\u91CD\u7F6E")]),_:1}),a.operate?X("v-if",!0):(A(),Le(s,{key:0,type:"primary",text:"",onClick:ye},{default:f(()=>[Xe,M(" \u4E0B\u8F7D ")]),_:1}))]),_:1})]),_:1},8,["model"]),o("div",{class:"modeDiv",onClick:ve},[o("div",{class:w(l(D)?"Selected":"")},"\u8868\u683C\u6A21\u5F0F",2),o("div",{class:w(l(D)?"":"Selecteds")},"\u56FE\u8868\u6A21\u5F0F",2)])]),o("div",Oe,[O(o("div",je,[i(oe,{data:l(q),"header-cell-style":{"text-align":"center"},"cell-style":{"text-align":"center"},"header-row-class-name":"tabth",height:"80%","highlight-current-row":""},{default:f(()=>[i(m,{prop:"dataTime",label:"\u65E5\u671F",width:"150"},{default:f(d=>[o("div",null,N(fe(d.row.dataTime)),1),o("div",null,N(_e(d.row.dataTime)),1)]),_:1}),i(m,{prop:"airTemperature",label:"\u7A7A\u6C14\u6E29\u5EA6(\u2103)"}),i(m,{prop:"airHumidity",label:"\u7A7A\u6C14\u6E7F\u5EA6(%)"}),i(m,{prop:"windSpeed",label:"\u98CE\u901F(m/s)"}),i(m,{prop:"windDirection",label:"\u98CE\u5411(\xB0)"}),i(m,{prop:"rainfall",label:"\u96E8\u91CF(mm)"}),i(m,{prop:"atmosphericPressure",label:"\u5927\u6C14\u538B\u529B(hpa)"}),i(m,{prop:"evaporation",label:"\u84B8\u53D1(mm)"}),i(m,{prop:"lightIntensity",label:"\u5149\u7167\u5F3A\u5EA6(LUX)"}),i(m,{prop:"sunlightHours",label:"\u65E5\u7167\u65F6\u6570\uFF08h\uFF09"}),i(m,{prop:"photosyntheticEffectiveRadiation",label:"\u5149\u5408\u6709\u6548(umol)"})]),_:1},8,["data"]),o("div",Ke,[M(" \u5171"+N(l(x).length)+"\u6761 ",1),i(le,{background:"",layout:"prev, pager, next",total:l(x).length,"current-page":l(k),"page-size":l(S),onCurrentChange:ge},null,8,["total","current-page","page-size"])])],512),[[j,l(D)]]),O(o("div",Qe,[o("div",et,[o("p",{class:w(l(h)=="1"?"SelectedDiv":""),onClick:e[1]||(e[1]=d=>C(1))}," \u6E29\u5EA6/\u6E7F\u5EA6 ",2),o("p",{class:w(l(h)=="2"?"SelectedDiv":""),onClick:e[2]||(e[2]=d=>C(2))}," \u98CE\u901F/\u98CE\u5411 ",2),o("p",{class:w(l(h)=="3"?"SelectedDiv":""),onClick:e[3]||(e[3]=d=>C(3))}," \u5149\u7167\u5F3A\u5EA6/\u5149\u5408\u6709\u6548 ",2),o("p",{class:w(l(h)=="4"?"SelectedDiv":""),onClick:e[4]||(e[4]=d=>C(4))}," \u65E5\u7167\u65F6\u6570 ",2),o("p",{class:w(l(h)=="5"?"SelectedDiv":""),onClick:e[5]||(e[5]=d=>C(5))}," \u96E8\u91CF/\u84B8\u53D1\u91CF ",2),o("p",{class:w(l(h)=="6"?"SelectedDiv":""),onClick:e[6]||(e[6]=d=>C(6))}," \u5927\u6C14\u538B\u529B ",2)]),o("div",{ref_key:"chartDiv",ref:H,class:"chartDiv"},null,512)],512),[[j,!l(D)]])])]),o("div",tt,[o("div",{class:"arrow",onClick:he},[l(L)?X("v-if",!0):(A(),J("p",at,lt)),l(L)?(A(),J("p",it,rt)):X("v-if",!0)])]),O(o("div",nt,ct,512),[[j,!l(L)]])]),i(y,{modelValue:Q.value,"onUpdate:modelValue":e[7]||(e[7]=d=>Q.value=d),"append-to-body":"",class:"video","destroy-on-close":"",title:"\u5B9E\u65F6\u76D1\u63A7",width:"30%","before-close":a.handleClose},{default:f(()=>[o("div",ut,[i(Ne,{videoSrc:ne.videoSrc,autoPlay:""},null,8,["videoSrc"])])]),_:1},8,["modelValue","before-close"])])])}}},xt=Se(pt,[["__scopeId","data-v-2721e228"],["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/meteorological/monitor/information/index.vue"]]);export{xt as default};