Kaynağa Gözat

页面调整

shuhao 6 ay önce
ebeveyn
işleme
dde2877b58

+ 2 - 2
src/api/modules/home.js

@@ -6,8 +6,8 @@ module.exports = {
     type: "get",
   },
   userGarden: {
-    url: config.base_dev_url + "garden/listByUser?key="+config.mini_key,
-    type: "get",
+    url: config.base_url + "farm/list",
+    type: "post",
   },
   farmIndexReport: {
     url: config.base_url + "farm/farmIndexReport2",

+ 20 - 14
src/components/fnHeader.vue

@@ -7,6 +7,7 @@
         </div>
         <div class="focus-farm" v-show="!hideSwitch">
             <el-select
+                filterable
                 v-model="farmVal"
                 placeholder="我的关注农场"
                 style="width: 189px"
@@ -112,21 +113,26 @@ const getGardenList = () => {
       options.value = [{name: "荔枝博览园",organId:766, wkt: "POINT(113.61702297075017 23.584863449735067)"}]
     }else{
       VE_API.home.userGarden(params).then((res) => {
+        let resData = []
+        for(let item of res.data){
+          resData.push({name: item.name,organId:item.id, wkt: item.pointWkt})
+        }
+        options.value = resData
         // options.value = res.data;
-        options.value.push(
-            {name: "增城荔博园第二基地",organId:90954, wkt: "POINT(113.691683 23.249201)"},
-            {name: "增城荔博园",organId:90953, wkt: "POINT(113.706556 23.211292)"},
-            {name: "天水苹果",organId:90888, wkt: "POINT(105.6235893046624 34.72308621489583)"},
-            {name: "汕尾妙荔果园",organId:43318, wkt: "POINT(115.455766 22.883073)"},
-            {name: "湛江湖畔荔庄",organId:90440, wkt: "POINT(110.907297 21.432212)"},
-            {name: "荔枝博览园",organId:766, wkt: "POINT(113.61702297075017 23.584863449735067)"},
-            {name: "柏桥村",organId:80865, wkt: "POINT(111.010804321 21.7759452836)"},
-            {name: "从化凤二基地",organId:90264, wkt: "POINT(113.67884027228604 23.511176408307904)"},
-            {name: "从化井岗基地",organId:90263, wkt: "POINT(113.5081595 23.5320866)"},
-            {name: "湛江荔枝先生",organId:26196, wkt: "POINT(110.4909544 21.4152538)"},
-            {name: "增城北园绿基地",organId:91774, wkt: "POINT(113.78320599711542 23.420720252709344)"},
-            {name: "中山农场",organId:81179, wkt: "POINT(113.544619 22.464267)"},
-        );
+        // options.value.push(
+        //     {name: "增城荔博园第二基地",organId:90954, wkt: "POINT(113.691683 23.249201)"},
+        //     {name: "增城荔博园",organId:90953, wkt: "POINT(113.706556 23.211292)"},
+        //     {name: "天水苹果",organId:90888, wkt: "POINT(105.6235893046624 34.72308621489583)"},
+        //     {name: "汕尾妙荔果园",organId:43318, wkt: "POINT(115.455766 22.883073)"},
+        //     {name: "湛江湖畔荔庄",organId:90440, wkt: "POINT(110.907297 21.432212)"},
+        //     {name: "荔枝博览园",organId:766, wkt: "POINT(113.61702297075017 23.584863449735067)"},
+        //     {name: "柏桥村",organId:80865, wkt: "POINT(111.010804321 21.7759452836)"},
+        //     {name: "从化凤二基地",organId:90264, wkt: "POINT(113.67884027228604 23.511176408307904)"},
+        //     {name: "从化井岗基地",organId:90263, wkt: "POINT(113.5081595 23.5320866)"},
+        //     {name: "湛江荔枝先生",organId:26196, wkt: "POINT(110.4909544 21.4152538)"},
+        //     {name: "增城北园绿基地",organId:91774, wkt: "POINT(113.78320599711542 23.420720252709344)"},
+        //     {name: "中山农场",organId:81179, wkt: "POINT(113.544619 22.464267)"},
+        // );
       });
     }
 };

+ 1 - 1
src/views/Login.vue

@@ -91,7 +91,7 @@ const store = useStore();
 const router = useRouter();
 // 定义两个账号
 const guestAccount = { "pwd": "游客", "userName": "游客" };
-const regularAccount = { "pwd": "", "userName": "13797066447" };
+const regularAccount = { "pwd": "", "userName": "" };
 // const form = reactive({
 //   "pwd": "",
 //   "userName": "13797066447"

+ 14 - 13
src/views/home/components/homeFile - 副本.vue → src/views/home/components/homeFile - 副本副本.vue

@@ -56,7 +56,7 @@
                     <div class="box-wrap">
                         <div
                             class="box-item"
-                            v-for="(item, index) in outputBox"
+                            v-for=" (item, index) in outputBox"
                             :key="index"
                             @click="toggleAcitve(item.name, item.field)"
                             :class="{ active: activeOuput === item.name }"
@@ -69,6 +69,7 @@
                     </div>
                 </div>
 
+
                 <div class="overview-file">
                     <div class="box-title">生态评估</div>
                     <div class="box-wrap">
@@ -95,9 +96,9 @@
 import eventBus from "@/api/eventBus";
 import { onMounted, ref, onBeforeUnmount, reactive } from "vue";
 const outputBox = ref([
-    { id: 1, name: "产量估计", field: "cl", value: "--", unit: "斤/亩" },
-    { id: 2, name: "高质果率", field: "spgl", value: "--", unit: "%" },
-    { id: 3, name: "挂果数", field: "zuoguo_ratio",value: "--", unit: "颗/枝条" },
+    { id: 1, name: "种植面积", field: "area", value: "6800", unit: "亩" },
+    { id: 2, name: "亩产估计", field: "cl", value: "3400", unit: "斤/亩" },
+    { id: 3, name: "产量估计", field: "zuoguo_ratio",value: "1.2", unit: "万吨" },
 ]);
 
 const qualityBox = ref([
@@ -216,15 +217,15 @@ function setFileData(type_id) {
     // if(res.production_info.production){
     //   res.production_info.production = (res.production_info.production * 1.3).toFixed(1)
     // }
-    outputBox.value[0].value = res.production_info.production;
-    outputBox.value[1].value = res.production_info.quality.toFixed(0);
-    if(res.production_info.zuoguo_ratio){
-      outputBox.value[2].name = "坐果率";
-      outputBox.value[2].value = res.production_info.zuoguo_ratio.toFixed(0);
-    }else{
-      outputBox.value[2].name = "雌花率";
-      outputBox.value[2].value = res.production_info.cihua_ratio.toFixed(0);
-    }
+    // outputBox.value[0].value = res.production_info.production;
+    // outputBox.value[1].value = res.production_info.quality.toFixed(0);
+    // if(res.production_info.zuoguo_ratio){
+    //   outputBox.value[2].name = "坐果率";
+    //   outputBox.value[2].value = res.production_info.zuoguo_ratio.toFixed(0);
+    // }else{
+    //   outputBox.value[2].name = "雌花率";
+    //   outputBox.value[2].value = res.production_info.cihua_ratio.toFixed(0);
+    // }
     qualityBox.value[0].value = res.ecology_info.ventilation;
     qualityBox.value[1].value = res.ecology_info.transmittance;
     qualityBox.value[2].value = res.ecology_info.dp_situation;

+ 16 - 14
src/views/home/components/homeFile.vue

@@ -56,7 +56,7 @@
                     <div class="box-wrap">
                         <div
                             class="box-item"
-                            v-for=" (item, index) in outputBox"
+                            v-for="(item, index) in outputBox"
                             :key="index"
                             @click="toggleAcitve(item.name, item.field)"
                             :class="{ active: activeOuput === item.name }"
@@ -69,7 +69,6 @@
                     </div>
                 </div>
 
-
                 <div class="overview-file">
                     <div class="box-title">生态评估</div>
                     <div class="box-wrap">
@@ -96,9 +95,9 @@
 import eventBus from "@/api/eventBus";
 import { onMounted, ref, onBeforeUnmount, reactive } from "vue";
 const outputBox = ref([
-    { id: 1, name: "种植面积", field: "area", value: "6800", unit: "亩" },
-    { id: 2, name: "亩产估计", field: "cl", value: "3400", unit: "斤/亩" },
-    { id: 3, name: "产量估计", field: "zuoguo_ratio",value: "1.2", unit: "万吨" },
+    { id: 1, name: "产量估计", field: "cl", value: "--", unit: "斤/亩" },
+    { id: 2, name: "高质果率", field: "spgl", value: "--", unit: "%" },
+    { id: 3, name: "挂果数", field: "zuoguo_ratio",value: "--", unit: "颗/枝条" },
 ]);
 
 const qualityBox = ref([
@@ -201,6 +200,9 @@ function getFileData(farmId, regionId) {
 }
 
 function setFileData(type_id) {
+  if(!type_id){
+    type_id = "0"
+  }
   const res = allTypeData.value.find((item) => item.type_id == type_id);
 
   photoBaseData.value[1].value = res.meta_info.avg_crown + "平方米";
@@ -217,15 +219,15 @@ function setFileData(type_id) {
     // if(res.production_info.production){
     //   res.production_info.production = (res.production_info.production * 1.3).toFixed(1)
     // }
-    // outputBox.value[0].value = res.production_info.production;
-    // outputBox.value[1].value = res.production_info.quality.toFixed(0);
-    // if(res.production_info.zuoguo_ratio){
-    //   outputBox.value[2].name = "坐果率";
-    //   outputBox.value[2].value = res.production_info.zuoguo_ratio.toFixed(0);
-    // }else{
-    //   outputBox.value[2].name = "雌花率";
-    //   outputBox.value[2].value = res.production_info.cihua_ratio.toFixed(0);
-    // }
+    outputBox.value[0].value = res.production_info.production;
+    outputBox.value[1].value = res.production_info.quality.toFixed(0);
+    if(res.production_info.zuoguo_ratio){
+      outputBox.value[2].name = "坐果率";
+      outputBox.value[2].value = res.production_info.zuoguo_ratio.toFixed(0);
+    }else{
+      outputBox.value[2].name = "雌花率";
+      outputBox.value[2].value = res.production_info.cihua_ratio.toFixed(0);
+    }
     qualityBox.value[0].value = res.ecology_info.ventilation;
     qualityBox.value[1].value = res.ecology_info.transmittance;
     qualityBox.value[2].value = res.ecology_info.dp_situation;

+ 1 - 1
src/views/home/index有认养管理.vue

@@ -139,7 +139,7 @@ import homePage from "./components/homePage.vue";
 import weatherPage from "./components/weatherPage.vue";
 import phenologyPage from "./components/phenologyPage.vue";
 import indicatorChart from "./components/indicatorChart.vue";
-import homeFile from "./components/homeFile.vue";
+import homeFile from "./components/homeFile - 副本副本.vue";
 import { useRouter } from "vue-router";
 import SamplePointLayer from "./map/samplePointLayer";
 import { useStore } from "vuex";

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

@@ -151,7 +151,7 @@ class SamplePointLayer {
       });
       that.clusterSource.setSource(source)
 
-      
+
       const layers = that.mapRef.map.getLayers().getArray();
       const exists = layers.includes(that.treeClusterLayer.layer);
 
@@ -198,10 +198,10 @@ class SamplePointLayer {
     }
     eventBus.emit("resetFileActive", colorObj.key || colorObj.name)
 
-    
+
     // 创建一个映射表:geoHashSample -> color
     const geoHashToColorMap = {};
-    
+
     colorObj.list.forEach(legendItem => {
       const geoHashes = sampleData.obj[legendItem.val] || [];
       geoHashes.forEach(geoHash => {
@@ -293,7 +293,7 @@ class SamplePointLayer {
           if (!that.isCompare) {
             const noImg = fs.get("noImg")
             if (noImg === 1) {
-              VE_API.mini_farm.getSampleFiles({ geoHashSample: fs.get('geoHashSample') }).then(({data}) => {
+              VE_API.mini_farm.getSampleFiles({farmId: fs.get("farmId"), geoHashSample: fs.get('geoHashSample') }).then(({data}) => {
                 // 无照片
                 document.getElementById('file-text').innerHTML = `
                   <div class="list-item">
@@ -354,7 +354,7 @@ class SamplePointLayer {
                   </div>
                   <div class="box-item">
                       <div class="item-name">坐果率</div>
-                      <div class="item-val">${data.production_info.cihua_ratio.toFixed(0)}%</div>
+                      <div class="item-val">${(data.production_info.cihua_ratio || data.production_info.zuoguo_ratio).toFixed(0)}%</div>
                   </div>
                 `;
                 document.getElementById('file-quality').innerHTML = `