|
@@ -34,25 +34,25 @@
|
|
|
<div class="chart-item phenology">
|
|
|
<chart-box name="物候指标">
|
|
|
<template #title-right>
|
|
|
- <tabs :list="phenologyBtnGroup"></tabs>
|
|
|
+ <tabs :list="phenologyObj.btnGroup" keyStr="物候指标" :active="activeKey"></tabs>
|
|
|
</template>
|
|
|
- <bar-chart class="bar-chart" styleName="styleName3" :xData="phenologyXData" :yData="phenologyYData"></bar-chart>
|
|
|
+ <bar-chart class="bar-chart" styleName="styleName1" :xData="phenologyObj.xData" :yData="phenologyObj.yData"></bar-chart>
|
|
|
<div class="tips box-bg">
|
|
|
- <div class="text" v-for="item in 3" :key="item">
|
|
|
- 白点:<span>刚刚露出,占比xx%,分布在2区</span>
|
|
|
+ <div class="text" v-for="(item,index) in phenologyObj.text" :key="index">
|
|
|
+ {{item[0]}}:<span>{{item[1]}}{{item[2]}},占比{{item[3]}}%</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</chart-box>
|
|
|
</div>
|
|
|
<div class="chart-item phenology">
|
|
|
- <chart-box name="病虫测报">
|
|
|
+ <chart-box name="病虫指标">
|
|
|
<template #title-right>
|
|
|
- <tabs :list="diseasesBtnGroup"></tabs>
|
|
|
+ <tabs :list="diseasesObj.btnGroup" keyStr="病虫指标" :active="activeKey"></tabs>
|
|
|
</template>
|
|
|
- <bar-chart class="bar-chart" styleName="styleName2" :xData="phenologyXData1" :yData="phenologyYData1"></bar-chart>
|
|
|
+ <bar-chart class="bar-chart" styleName="styleName1" :xData="diseasesObj.xData" :yData="diseasesObj.yData"></bar-chart>
|
|
|
<div class="tips box-bg">
|
|
|
- <div class="text" v-for="item in 3" :key="item">
|
|
|
- 虫害{{item}}:<span>刚刚露出,占比xx%,分布在2区</span>
|
|
|
+ <div class="text" v-for="(item,index) in diseasesObj.text" :key="index">
|
|
|
+ {{item[0]}}:<span>{{item[1]}}{{item[2]}},占比{{item[3]}}%</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</chart-box>
|
|
@@ -60,31 +60,32 @@
|
|
|
<div class="chart-item evaluate">
|
|
|
<chart-box name="生长指标">
|
|
|
<template #title-right>
|
|
|
- <tabs :list="growList"></tabs>
|
|
|
+ <tabs :list="growObj.btnGroup" keyStr="生长指标" :active="activeKey"></tabs>
|
|
|
</template>
|
|
|
<div class="content">
|
|
|
- <bar-chart styleName="styleName1" :xData="evaluateXData" :yData="evaluateYData"></bar-chart>
|
|
|
- <div class="box-bg text">
|
|
|
- 目前果园跨度异常比例达到<span>2%</span>,需要提供 <span>叶面肥</span>补充营养
|
|
|
- </div>
|
|
|
+ <bar-chart style="width:52%" styleName="styleName1" :xData="growObj.xData" :yData="growObj.yData"></bar-chart>
|
|
|
+ <div class="box-bg text" v-html="growObj.content"></div>
|
|
|
</div>
|
|
|
<div class="text-list box-bg">
|
|
|
- <div class="text-item" v-for="item in 3" :key="item">
|
|
|
+ <div class="text-item" v-for="(item,index) in growObj.text" :key="index">
|
|
|
<div class="circle"></div>
|
|
|
- <div class="txt">肥效比 低 <span>**棵树</span></div>
|
|
|
+ <div class="txt">{{item[0].slice(0,2)}}占比<span>{{item[3]}}%</span></div>
|
|
|
</div>
|
|
|
+ <!-- <div class="text" v-for="(item,index) in growObj.text" :key="index">
|
|
|
+ {{item[0]}}:<span>{{item[1]}}{{item[2]}},占比{{item[3]}}%</span>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</chart-box>
|
|
|
</div>
|
|
|
<div class="chart-item phenology">
|
|
|
<chart-box name="生态指标">
|
|
|
<template #title-right>
|
|
|
- <tabs :list="ecologyList"></tabs>
|
|
|
+ <tabs :list="ecologyObj.btnGroup" keyStr="生态指标" :active="activeKey"></tabs>
|
|
|
</template>
|
|
|
- <bar-chart class="bar-chart" styleName="styleName2" :xData="phenologyXData1" :yData="phenologyYData1"></bar-chart>
|
|
|
+ <bar-chart class="bar-chart" styleName="styleName1" :xData="ecologyObj.xData" :yData="ecologyObj.yData"></bar-chart>
|
|
|
<div class="tips box-bg">
|
|
|
- <div class="text" v-for="item in 3" :key="item">
|
|
|
- 通风正常:<span>通风率80-100%,占比xx%</span>
|
|
|
+ <div class="text" v-for="(item,index) in ecologyObj.text" :key="index">
|
|
|
+ {{item[0]}}:<span>{{item[1]}}{{item[2]}},占比{{item[3]}}%</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</chart-box>
|
|
@@ -93,7 +94,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref,onMounted} from 'vue'
|
|
|
+import {ref,onMounted, onUnmounted} from 'vue'
|
|
|
import chartBox from "@/components/chartBox.vue";
|
|
|
import tabs from "./tabs.vue";
|
|
|
import barChart from "@/components/charts/barChart.vue";
|
|
@@ -105,16 +106,62 @@ const store = useStore()
|
|
|
const router = useRouter()
|
|
|
|
|
|
onMounted(()=>{
|
|
|
- getReoprt()
|
|
|
+
|
|
|
+ //选项子项监听事件
|
|
|
+ eventBus.on('handleTabItem',handleTabItem)
|
|
|
+ eventBus.on('handleActive',handleActive)
|
|
|
+ eventBus.on('area:id',areaId)
|
|
|
+})
|
|
|
+
|
|
|
+onUnmounted(()=>{
|
|
|
+ eventBus.off('handleTabItem',handleTabItem)
|
|
|
+ eventBus.off('handleActive',handleActive)
|
|
|
+ eventBus.off('area:id',areaId)
|
|
|
})
|
|
|
|
|
|
const reportData = ref([])
|
|
|
|
|
|
-// function filterArr(){}
|
|
|
+const curIndex = ref(0)
|
|
|
+const handleActive = ({index,key}) =>{
|
|
|
+ curIndex.value = index
|
|
|
+ if(key==='物候指标'){
|
|
|
+ phenologyObj.value = handleData('物候指标')
|
|
|
+ }
|
|
|
+ if(key==='病虫指标'){
|
|
|
+ diseasesObj.value = handleData('病虫指标')
|
|
|
+ }
|
|
|
+ if(key==='生长指标'){
|
|
|
+ growObj.value = handleData('生长指标')
|
|
|
+ }
|
|
|
+ if(key==='生态指标'){
|
|
|
+ ecologyObj.value = handleData('生态指标')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function handleData(name){
|
|
|
+ const arr = reportData.value.filter(item =>item.key === name)
|
|
|
+ const source = arr[0].obj
|
|
|
+ const obj = {
|
|
|
+ btnGroup : source.titleList,
|
|
|
+ xData : source.blueZoneLegendList[curIndex.value].list.map(item =>item.name),
|
|
|
+ yData : source.list1[curIndex.value].list.map(item => item.val.toFixed(0)),
|
|
|
+ text : source.list2[curIndex.value].list,
|
|
|
+ content : source.text,
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+}
|
|
|
+
|
|
|
+function areaId({areaId,farmId}){
|
|
|
+ getReoprt(areaId,farmId)
|
|
|
+}
|
|
|
|
|
|
-const getReoprt = () =>{
|
|
|
- VE_API.home.farmIndexReport({farmId:766,regionId:2}).then(res =>{
|
|
|
+const getReoprt = (areaId,farmId) =>{
|
|
|
+ VE_API.home.farmIndexReport({farmId,regionId:areaId}).then(res =>{
|
|
|
reportData.value = res.data || []
|
|
|
+ phenologyObj.value = handleData('物候指标')
|
|
|
+ diseasesObj.value = handleData('病虫指标')
|
|
|
+ growObj.value = handleData('生长指标')
|
|
|
+ ecologyObj.value = handleData('生态指标')
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -122,74 +169,31 @@ const handlePage = () =>{
|
|
|
router.push('/variety_map')
|
|
|
}
|
|
|
|
|
|
-const btnWrap = [
|
|
|
- ["树高","冠幅"]
|
|
|
-]
|
|
|
-//选项子项监听事件
|
|
|
-eventBus.on('handleTabItem',handleTabItem)
|
|
|
+const activeKey = ref('')
|
|
|
function handleTabItem(e){
|
|
|
- console.log('e');
|
|
|
+ activeKey.value = e
|
|
|
}
|
|
|
|
|
|
//基本指标
|
|
|
const btnGroup = ["树高","冠幅"]
|
|
|
+
|
|
|
// 物候指标
|
|
|
-const phenologyBtnGroup = ["花穗长度","单数花穗率"]
|
|
|
-const phenologyXData = ["花芽","花蕾","短花穗","中花穗","长花穗","开花"]
|
|
|
-const phenologyYData = [{
|
|
|
- startNum:0,
|
|
|
- endNum:16,
|
|
|
- startColor:"#c6ab6b",
|
|
|
- endColor:"#4e442e"
|
|
|
-},{
|
|
|
- startNum:0,
|
|
|
- endNum:16,
|
|
|
- startColor:"#c6ab6b",
|
|
|
- endColor:"#4e442e"
|
|
|
-},{
|
|
|
- startNum:0,
|
|
|
- endNum:16,
|
|
|
- startColor:"#c6ab6b",
|
|
|
- endColor:"#4e442e"
|
|
|
-},{
|
|
|
- startNum:0,
|
|
|
- endNum:16,
|
|
|
- startColor:"#c6ab6b",
|
|
|
- endColor:"#4e442e"
|
|
|
-}]
|
|
|
+const phenologyObj = ref({})
|
|
|
|
|
|
// 病虫测报
|
|
|
-const diseasesBtnGroup = ["虫害比例","病害比例"]
|
|
|
-const phenologyXData1 = ["炭疽病", "啃食虫害","叶瘿蚊","毛毡病"]
|
|
|
+const diseasesObj = ref({})
|
|
|
const phenologyYData1 = [{
|
|
|
startNum:0,
|
|
|
endNum:0,
|
|
|
startColor:"#c6ab6b",
|
|
|
endColor:"#4e442e"
|
|
|
-},{
|
|
|
- startNum:0,
|
|
|
- endNum:0,
|
|
|
- startColor:"#c6ab6b",
|
|
|
- endColor:"#4e442e"
|
|
|
-},{
|
|
|
- startNum:0,
|
|
|
- endNum:0,
|
|
|
- startColor:"#c6ab6b",
|
|
|
- endColor:"#4e442e"
|
|
|
-},{
|
|
|
- startNum:0,
|
|
|
- endNum:1,
|
|
|
- startColor:"#c6ab6b",
|
|
|
- endColor:"#4e442e"
|
|
|
}]
|
|
|
|
|
|
// 生长指标
|
|
|
-const growList = ["树势","营养","缺水"]
|
|
|
-const evaluateXData = ["低", "中", "高"]
|
|
|
-const evaluateYData = [1, 8, 7]
|
|
|
+const growObj = ref({})
|
|
|
|
|
|
//生态指标
|
|
|
-const ecologyList = ["通风率","清园程度","益草覆盖率"]
|
|
|
+const ecologyObj = ref({})
|
|
|
|
|
|
const gybg= ()=>{
|
|
|
VE_API.farm_files.last({farmId: 766,key:"pdf_report"}).then(({data})=>{
|
|
@@ -269,6 +273,7 @@ const gybg= ()=>{
|
|
|
padding: 3px 6px;
|
|
|
box-sizing: border-box;
|
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
|
+ overflow-y: auto;
|
|
|
background: linear-gradient(180deg, rgb(85, 85, 85,0.4) 0%, rgb(35, 35, 35,1) 100%);
|
|
|
.text{
|
|
|
position: relative;
|