浏览代码

fix: 果园档案

刘秀芳 2 周之前
父节点
当前提交
5894a685ee
共有 2 个文件被更改,包括 42 次插入30 次删除
  1. 40 28
      src/views/home/album_compoents/albumCarousel.vue
  2. 2 2
      src/views/home/map/samplePointLayer.js

+ 40 - 28
src/views/home/album_compoents/albumCarousel.vue

@@ -41,34 +41,34 @@
                     </div>
                 </div>
 
-                <div class="overview-file" v-if="images && images.length && images[currentIndex]?.detail1">
+                <div class="overview-file">
                     <div class="box-title">产量详情</div>
                     <div class="box-wrap">
                         <div
                             class="box-item"
-                            v-for="(value, key) in images[currentIndex].detail1"
-                            :key="key"
-                            @click="toggleAcitve(key)"
-                            :class="{ active: activeOuput === key }"
+                            v-for="(item, index) in outputBox"
+                            :key="index"
+                            @click="toggleAcitve(item.name)"
+                            :class="{ active: activeOuput === item.name }"
                         >
-                            <div class="item-name">{{ key }}</div>
-                            <div class="item-val">{{ value }}{{ key !== "总枝条数" ? "%" : "" }}</div>
+                            <div class="item-name">{{ item.name }}</div>
+                            <div class="item-val">{{ item.value }}</div>
                         </div>
                     </div>
                 </div>
 
-                <div class="overview-file" v-if="images && images.length && images[currentIndex]?.detail2">
+                <div class="overview-file">
                     <div class="box-title">质量详情</div>
                     <div class="box-wrap">
                       <div
                             class="box-item"
-                            v-for="(value, key) in images[currentIndex].detail2"
-                            :key="key"
-                            @click="toggleQualityAcitve(key)"
-                            :class="{ active: activeOuput === key }"
+                            v-for="(item, index) in qualityBox"
+                            :key="index"
+                            @click="toggleAcitve(item.name)"
+                            :class="{ active: activeOuput === item.name }"
                         >
-                            <div class="item-name">{{ key }}</div>
-                            <div class="item-val">{{ value }}%</div>
+                            <div class="item-name">{{ item.name }}</div>
+                            <div class="item-val">{{ item.value }}</div>
                         </div>
                     </div>
                 </div>
@@ -100,23 +100,23 @@ startDate.setMonth(currentDate.getMonth() - 1);
 const formattedStartDate = dateFormat(startDate, "YY-mm-dd");
 const formattedEndDate = dateFormat(currentDate, "YY-mm-dd");
 
-eventBus.on("click:point", function ({ farmId, sampleId, geoHash }) {
-    let params = { sampleId, farmId, geoHash };
-    console.log("geoHash", geoHash);
-    getSampleFiles(geoHash);
-    VE_API.miniimage.list(params).then((res) => {
-        if (res.code === 0) {
-            images.value = res.data;
-            dialogVisible.value = true;
-            console.log("images", images.value);
-        }
-    });
-});
 eventBus.on("change:watermark",function(name){
   nameRef.value = name
 })
 
-eventBus.on("click:point",function({farmId,sampleId}){
+const outputBox = ref([
+    { id: 1, name: "花穗率", value: "" },
+    { id: 2, name: "总枝条数", value: "" },
+    { id: 3, name: "开花率", value: "" },
+    { id: 4, name: "雄花比例", value: "" },
+]);
+
+const qualityBox = ref([
+    { id: 5, name: "通风率", value: "" },
+    { id: 6, name: "透光率", value: "" },
+    { id: 7, name: "地形条件", value: "" },
+]);
+eventBus.on("click:point",function({farmId,sampleId, data}){
   let params = {sampleId,farmId}
   VE_API.miniimage.list(params).then(res => {
     if(res.code === 0){
@@ -124,6 +124,18 @@ eventBus.on("click:point",function({farmId,sampleId}){
       dialogVisible.value = true
     }
   })
+  photoBaseData.value[0].value = data.pz;
+  photoBaseData.value[1].value = data.sgbmj + "米";
+  photoBaseData.value[2].value = data.cl + "斤";
+  photoBaseData.value[3].value = data.spgl + "%";
+  outputBox.value[0].value = data.hsl ? (data.hsl + "%") : "--";
+  outputBox.value[1].value = data.zzts? data.zzts : "--";
+  outputBox.value[2].value = data.khl? (data.khl + "%") : "--";
+  outputBox.value[3].value = data.xhl? (data.xhl + "%") : "--";
+  qualityBox.value[0].value = data.tfl? (data.tfl + "%") : "--";
+  qualityBox.value[1].value = data.tgl? (data.tgl + "%") : "--";
+  qualityBox.value[2].value = data.dxtj? (data.dxtj + "%") : "--";
+  console.log('data', data);
 })
 
 eventBus.off("albumCarousel", toggleActiveImg);
@@ -180,7 +192,7 @@ function toggleAcitve(name) {
     } else if (name.indexOf("雄花") > -1) {
         eventBus.emit("change:watermark", "雄花目标框")
     } else if (name.indexOf("枝条数") > -1) {
-        eventBus.emit("change:watermark", "枝条目标框")
+        eventBus.emit("change:watermark", "")
     } else {
         eventBus.emit("change:watermark", "")
     }

+ 2 - 2
src/views/home/map/samplePointLayer.js

@@ -97,7 +97,7 @@ class SamplePointLayer {
     if(regionId===0){
         selectAll = 1
     }
-    VE_API.image.pointByRegionId({farmId,regionId,selectAll}).then(({data})=>{
+    VE_API.variety.pointList({farmId,regionId,selectAll}).then(({data})=>{
       let features = []
       for(let item of data){
         item.iconName='defalut'
@@ -131,7 +131,7 @@ class SamplePointLayer {
           if(that.isUpdatePoint){
             fs.set("iconName", "active");
           }
-          eventBus.emit("click:point",{farmId:fs.get("farmId"),sampleId:fs.get("sampleId"), geoHash:fs.get("geoHash")})
+          eventBus.emit("click:point",{farmId:fs.get("farmId"),sampleId:fs.get("sampleId"), data: fs.getProperties()})
         }
         if (layer instanceof VectorLayer && layer.get("name") === "yellow-block") {
           hasFeature = true