Browse Source

feat:数据修改,接口对接

wangsisi 1 month ago
parent
commit
bdae56e670

BIN
src/assets/images/home/01-act.png


BIN
src/assets/images/home/01.png


BIN
src/assets/images/home/02-act.png


BIN
src/assets/images/home/02.png


+ 1 - 1
src/components/charts/options/barOption.js

@@ -192,7 +192,7 @@ const styleName3 = {
       },
     },
     {
-      data: [16, 16, 16, 16],
+      data: [16, 16, 16, 0],
       type: "bar",
       barWidth: 26,
       stack: "total",

+ 5 - 5
src/components/charts/options/oneLineOption.js

@@ -67,7 +67,7 @@ export const oneLine = {
     series: [
         {
             name: "温度",
-            data: [19, 18, 20, 11, 23, 18, 22],
+            data: [19, 18, 11, 20, 23, 18, 22],
             type: 'line',
             smooth: true,
             symbol: "none",
@@ -116,8 +116,8 @@ export const oneLine = {
                     {
                         name: "text",
                         value: "最低",
-                        xAxis: '2/13',
-                        yAxis: 18,
+                        xAxis: '2/14',
+                        yAxis: 11,
                         symbolOffset: [0, "-50%"],
                         label: {
                             offset: [0, 22],
@@ -128,8 +128,8 @@ export const oneLine = {
                     },
                     {
                         name: "mark",
-                        xAxis: '2/13',
-                        yAxis: 18,
+                        xAxis: '2/14',
+                        yAxis: 11,
                         value: "",
                         label: {
                             backgroundColor: "#fff",

+ 0 - 3
src/components/toolList.vue

@@ -30,9 +30,6 @@ const active = ref(0)
 const handleActive = (value,index) =>{
     active.value = index
     emit('handleActive',value)
-    if(index == 0){
-      router.push('/warningHome')
-    }
 }
 </script>
 

+ 3 - 2
src/views/home/components/chartSeting.js

@@ -104,7 +104,8 @@ export const galleryIndicatorLine = {
         itemHeight: 5,
         itemGap: 20,
         textStyle: {
-          align: 'left'
+          align: 'left',
+          color:'#fff'
         },
         data: [
           { name: '褪绿率', textStyle: { color: '#66B9FB' }, itemStyle: {color: "#66B9FB"} },
@@ -117,7 +118,7 @@ export const galleryIndicatorLine = {
     grid: {
         top: 20,
         left: 8,
-        right: 18,
+        right: 8,
         bottom: 20,
         containLabel: true,
     },

+ 1 - 1
src/views/home/components/homePage.vue

@@ -96,7 +96,7 @@ import {useStore} from "vuex";
 let store = useStore()
 
 // 物候调节
-const phenologyXData = ["新梢褪绿", "花芽萌动","花蕾抽出","花穗伸长"]
+const phenologyXData = ["花芽萌动","花蕾抽出","花穗伸长","开花期"]
 const phenologyYData = [{
   startNum:0,
   endNum:16,

File diff suppressed because it is too large
+ 11 - 5
src/views/home/components/indicatorChart.vue


+ 23 - 2
src/views/home/index.vue

@@ -21,7 +21,7 @@
               2月13日,共抽样193棵树,拍摄了193张照片
             </div>
             <div class="chart-wrap">
-              <indicator-chart></indicator-chart>
+              <indicator-chart :key="0 + 'log'" type="feature" :chartData="indicatorChartData"></indicator-chart>
               <!-- <img class="line" src="@/assets/images/home/time1.png" alt=""> -->
               <!-- <img src="@/assets/images/home/text.png" alt=""> -->
             </div>
@@ -46,7 +46,7 @@
             <template v-if="rightIndex===0">
               <img class="tabs" src="@/assets/images/home/ns-tabs.png" alt="">
               <div class="img-box">
-                <img @click="handleAct(item)" v-for="item in 4" :key="item" :src="require(`@/assets/images/home/0${act<=2&&act==item?item+'-act':item}.png`)" alt="">
+                <img @click="handleAct(item)" v-for="item in 2" :key="item" :src="require(`@/assets/images/home/0${act<=2&&act==item?item+'-act':item}.png`)" alt="">
               </div>
             </template>
             <template v-if="rightIndex===1">
@@ -140,8 +140,24 @@ onMounted(() => {
   regionLayer = new RegionLayer(homeMap.kmap.map, currentFarm, currentRegion)
 
   getYellow()
+  getFarmLog()
 });
 
+const indicatorChartData = ref({})
+const blueZone = ref('ws0y1meyhxp4')
+
+const getFarmLog = () =>{
+  const params = {
+    id: null,
+    farmId: 766,
+    blueZone:blueZone.value
+  }
+  VE_API.warning.fetchFarmLog(params).then(({data}) => {
+        indicatorChartData.value = data || {}
+        eventBus.emit('chart:updateOption',data)
+    })
+}
+
 const urls = ref([])
 const urlsIndex = ref(0)
 const getYellow = () =>{
@@ -298,13 +314,18 @@ eventBus.on('click:area',(e)=>{
 })
 
 eventBus.on('click:updateArea',(e)=>{
+  blueZone.value = e.value
   btnName.value=e.name
   regionLayer.selectArea((e.name*1)===0?0: (e.name*1) - 1,"blue")
+  getFarmLog()
 })
 
 const currentComponent = ref("homePage");
 const handleActiveLeft = (e) => {
   currentComponent.value = e.componentName;
+  if(e.title==='首页'){
+    router.push('/warningHome')
+  }
 };
 const leftToolList = [
   {

+ 3 - 2
src/views/home/map/regionLayer.js

@@ -37,7 +37,8 @@ class RegionLayer {
             "red3":["#FF26267a","#FF26267a"],
             "green":["#006f0b94","#006f0b94"],
             "green1":["#32b81a94","#32b81a94"],
-            "green2":["#B7FFAA94","#B7FFAA94"]
+            "green2":["#B7FFAA94","#B7FFAA94"],
+            "red4":["#ff262663","#ff262663"]
         }
 
         this.regionLayer = new KMap.VectorLayer("regionLayer", 99, {
@@ -118,7 +119,7 @@ class RegionLayer {
                     blueZone:"0",
                     dateValue:"",
                     bgName:"defalut",
-                    bgColor:"red3",
+                    bgColor:"red4",
                     wkt:"MULTIPOLYGON (((113.61390710255375 23.586379215663726,113.6140224799741 23.586530760891492,113.61429532483612 23.586727463001182,113.61471252366596 23.587019343551333,113.6151313088028 23.587376262702094,113.61544063873373 23.587220804583183,113.61557230224264 23.58706376015681,113.61544222504097 23.586978099560497,113.6151614486422 23.586913060959716,113.61506827952462 23.586818940057697,113.61491218688275 23.58671519555776,113.61477512992872 23.58657909038834,113.61452195527784 23.586449647709514,113.61430590021848 23.586303072911505,113.61396420961808 23.58621741231542,113.61390710255375 23.586379215663726)))"
                 },"wkt")
             )

+ 32 - 6
src/views/warningHome/map/alarmLayer.js

@@ -27,15 +27,18 @@ class AlarmLayer {
         this.warningLayers = {}
         this.plantLayer = null
         this.warningLayer = null
+        this.nameStr = ''
         // 底图数据
         eventBus.on("alarmList:warningLayers", (data) => {
             this.warningLayers = data
         })
 
         // 预警底图
-        eventBus.on("alarmList:changeMapLayer", function ({url, type}) {
+        eventBus.on("alarmList:changeMapLayer", function ({url, type,name}) {
             that.plantLayer && that.kmap.map.removeLayer(that.plantLayer.layer)
-            that.initWarningLayer(url, type)
+            that.nameStr = name
+            console.log('sdadas',url);
+            that.initWarningLayer(url, type,name)
         })
         // 种植面积,预估产量,底图切换
         eventBus.on("warningHome:toggleMapLayer", function (name) {
@@ -52,16 +55,30 @@ class AlarmLayer {
         })
         // 时间轴
         eventBus.on("weatherTime:changeTime", ({index}) => {
-            console.log('vvv',index);
             that.toggleSmallLayer(index)
         })
     }
 
-    initWarningLayer(layerUrl, type) {
+    initWarningLayer(layerUrl, type,name) {
         this.warningLayer && this.kmap.map.removeLayer(this.warningLayer.layer)
         // 104.3017367175,30.329292136
+        let path = null
+        let text = ''
+        if(name==='日间温度'){
+            text = '从化地块日温'
+            path = this.warningLayers[text]
+        }else if(name==='夜间温度'){
+            text = '从化地块夜温'
+            path = this.warningLayers[text]
+        }else if(name==='土壤水分'){
+            text = '从化地块水分'
+            path = this.warningLayers[text]
+        }else{
+            path = layerUrl
+        }
+        console.log('path',path);
         this.warningLayer = this.kmap.addXYZLayer(
-            layerUrl,
+            path,
             { minZoom: 5, maxZoom: 22 },
             99,
             0.4
@@ -138,7 +155,16 @@ class AlarmLayer {
             // 虚拟果园会播放物候变化
         }
         if (this.areaId === "3186") {
-            let url = "https://birdseye-img.sysuimars.com/map/risk/lby_rjwd/{z}/{x}/{y}.png"
+            let text = '荔博园地块日温'
+            if(this.nameStr === '夜间温度'){
+                text = '荔博园地块夜温'
+            }
+            let path = this.warningLayers[text + index]
+            if(this.nameStr === '土壤水分'){
+                text = '荔博园地块水分0'
+                path = this.warningLayers[text]
+            }
+            let url = path
             // if (index === 0) {
             //     url = "https://birdseye-img.sysuimars.com/map/risk/lby_ghqs/{z}/{x}/{y}.png"
             // } else if (index === 1) {

Some files were not shown because too many files changed in this diff