Pārlūkot izejas kodu

综合分析 -- 疑点问题

Bella 2 gadi atpakaļ
vecāks
revīzija
6f85f0f38d
1 mainītis faili ar 69 papildinājumiem un 20 dzēšanām
  1. 69 20
      src/views/ComprehensiveAnalysis.vue

+ 69 - 20
src/views/ComprehensiveAnalysis.vue

@@ -120,7 +120,9 @@
                   v-if="
                     node.data.mainType === '所有图层' ||
                     node.data.mainType === '我的模型' ||
-                    node.data.mainType === '预设模型'
+                    node.data.mainType === '预设模型' ||
+                    node.data.mainType === '疑点问题' ||
+                    node.data.mainType === '我的图层'
                   "
                 >
                   <el-checkbox
@@ -320,7 +322,7 @@ export default {
       // 所有图层 -- 根据镇域划分的数据集合
       allLayersByTownMap: new Map(),
       labelAllVisibleChecked: true,
-      townSelectVal: "",
+      townSelectVal: "老港镇",
       townOptions: [],
       enteredPanelId: "",
       enteredColumnId: "",
@@ -426,6 +428,12 @@ export default {
     },
   },
   watch: {
+    townSelectVal: {
+      handler(val) {
+        console.log(val, "综合分析当前选中的值");
+      },
+      immediate: true,
+    },
     // 控制全选的显示或隐藏
     labelAllVisibleChecked(val) {
       if (this.rightLabelData.length > 0) {
@@ -449,6 +457,11 @@ export default {
         }
 
         if (val.index === "3") {
+          console.log("进入综合分析页面 -- 默认展开老港镇数据");
+          setTimeout(() => {
+            this.changeTownEvent(this.townSelectVal);
+          }, 1000);
+
           // 如果没有初始化设置
           if (!map2DViewer.groups["我的标记图层组"]) {
             this.getUserMarkers();
@@ -605,14 +618,13 @@ export default {
       console.log(
         `监听到用户点击任务!任务类型Code:${data[0]},所属街道Code:${data[1]}!`
       );
-      this.classTextToIndex["浦东新区行政区划"].forEach((v,i)=>{
-        if(v === data[1]){
-          console.log(i,"当前所属街镇选中");
-          this.townSelectVal = i
-          this.changeTownEvent(i)
+      this.classTextToIndex["浦东新区行政区划"].forEach((v, i) => {
+        if (v === data[1]) {
+          console.log(i, "当前所属街镇选中");
+          this.townSelectVal = i;
+          this.changeTownEvent(i);
         }
-      })
-      
+      });
     });
   },
   destroy() {
@@ -1102,6 +1114,35 @@ export default {
                 label: item1.title,
               };
             }
+
+            if (item1.title === "疑点问题" || item1.title === "我的图层") {
+              this.firstLevelIdMap.set(item1.title, {
+                id: `${item1.title}_${item1.id}`,
+                label: item1.title,
+              });
+              return {
+                id: `${item1.title}_${item1.id}`,
+                label: item1.title,
+                children:
+                  !item1.columnList || item1.columnList.length === 0
+                    ? []
+                    : item1.columnList.map((item2) => {
+                        this.randomColor.set(
+                          `${item2.title}_${item2.id}`,
+                          publicFun.getRGBColor()
+                        );
+                        return {
+                          id: `${item2.title}_${item2.id}`,
+                          label: item2.title,
+                          mainType: item1.title,
+                          columnId: item2.id,
+                          modelId: item2.modelId,
+                          sourceType: "土地资源",
+                          children: [],
+                        };
+                      }),
+              };
+            }
           });
 
           data.forEach((v) => {
@@ -1110,12 +1151,6 @@ export default {
             }
           });
 
-          this.modelData.push({
-            id: "我的图层",
-            label: "我的图层",
-            children: [],
-          });
-
           // 获取我的模型数据
           let oldOptions = [];
           this.getMyModelData();
@@ -1139,15 +1174,18 @@ export default {
           });
 
           let arrTown1 = oldOptions.filter((v) => {
-            if (
-              v.value.indexOf("镇") > -1 &&
-              (v.value === "老港镇" || v.value === "泥城镇")
-            ) {
+            if (v.value.indexOf("镇") > -1 && v.value === "老港镇") {
               return v;
             }
           });
 
           let arrTown2 = oldOptions.filter((v) => {
+            if (v.value.indexOf("镇") > -1 && v.value === "泥城镇") {
+              return v;
+            }
+          });
+
+          let arrTown3 = oldOptions.filter((v) => {
             if (
               v.value.indexOf("镇") > -1 &&
               v.value !== "老港镇" &&
@@ -1156,7 +1194,6 @@ export default {
               return v;
             }
           });
-
           let arrStreet = oldOptions.filter((v) => {
             if (v.value.indexOf("道") > -1) {
               return v;
@@ -1167,6 +1204,7 @@ export default {
             ...arrDistrict,
             ...arrTown1,
             ...arrTown2,
+            ...arrTown3,
             ...arrStreet,
           ];
         }
@@ -1436,6 +1474,17 @@ export default {
               data.sourceType ? data.sourceType : ""
             );
           }
+          // 第一级菜单是疑点问题
+          if (data.mainType === "疑点问题") {
+            layerAuthorityMap.set(data.id, "有权限");
+            this.rightPanelTitle = data.id;
+            this.displaySingleLayer(
+              data.columnId,
+              data.id,
+              data.mainType,
+              data.sourceType ? data.sourceType : ""
+            );
+          }
         } else {
           if (
             this.$store.state.selectSelectDataMap["singlePolygon"] &&