Browse Source

页面调整

shuhao 4 months ago
parent
commit
82ab75cab2
2 changed files with 16 additions and 2 deletions
  1. 8 1
      src/components/navigation.vue
  2. 8 1
      src/views/home/index.vue

+ 8 - 1
src/components/navigation.vue

@@ -35,9 +35,12 @@
             <el-checkbox label="指标对比" value="1">
                 指标对比
             </el-checkbox>
+            <el-checkbox label="作物分布" value="2">
+                作物分布
+            </el-checkbox>
         </el-checkbox-group>
 
-        <div class="compare-tips" v-show="checkedCompareChildren.length">
+        <div class="compare-tips" v-show="checkedCompareChildren.length && !checkedCompareChildren.includes('2')">>
             <span>提示:</span>请在底图上点选 <span>两棵树</span>,才可以进行对比
         </div>
     </div>
@@ -181,6 +184,10 @@ const toPage = () => {
 // 对比
 const checkedCompareChildren = ref([]);
 function handleCompareChange(v) {
+    if(v == 2){
+      eventBus.emit("showGspgjdfbt", v == 2)
+      return
+    }
     eventBus.emit("compareTree", checkedCompareChildren.value.length > 0 ? true : false)
 }
 

+ 8 - 1
src/views/home/index.vue

@@ -204,10 +204,17 @@ onMounted(() => {
     // regionLayer = new RegionLayer(homeMap.kmap.map, currentFarm, currentRegion)
     samplePointLayer = new SamplePointLayer(homeMap.kmap);
     VE_API.warning.fetchWarningLayer({
-      k: "feiniao_static_map",
+      k: "gspgjdfbt",
       resultType: "json",
     }).then(({data}) => {
       staticMapLayers = new StaticMapLayers(homeMap.kmap, data)
+      eventBus.on("showGspgjdfbt",function(v){
+        if(v){
+          staticMapLayers.showSingle("聚类结果3", true)
+        }else{
+          staticMapLayers.hideAll()
+        }
+      })
     })
     blueRegionLayer = new BlueRegionLayer(homeMap.kmap);
     function changeStaticMapLayers(e){