Pārlūkot izejas kodu

疑点审计修改疑点后右侧列表同步更新,并显示合适的排序方式

Bella 2 gadi atpakaļ
vecāks
revīzija
0c1cad76fa
2 mainītis faili ar 54 papildinājumiem un 27 dzēšanām
  1. 9 4
      src/components/map/MapHolder.vue
  2. 45 23
      src/views/ComprehensiveAnalysis.vue

+ 9 - 4
src/components/map/MapHolder.vue

@@ -369,7 +369,6 @@ export default {
       console.log("用户点击了地图中的修改按钮!");
     },
     confirmBtnEvent(str, modelId, columnId) {
-      debugger;
       console.log(str, "str--当前开启的");
       // isTrue
       let selectVal = $(`#${str}_id .center-table-item-special select`).val();
@@ -409,15 +408,22 @@ export default {
           if (res.code === 200) {
             this.$message.success("数据修改成功");
             map2DViewer.map.closePopup();
+
             switch (selectVal) {
               case "isTrue":
+                this.$store.state.mapMethodsCollection
+                  .get("METHODS")
+                  .changeCaseBoolean(str, "疑点");
                 this.$store.state.mapMethodsCollection
                   .get("METHODS")
                   .changeSortMethod("疑点");
                 break;
               case "isFalse":
                 this.$store.state.mapMethodsCollection
-                  .get("RENDER")
+                  .get("METHODS")
+                  .changeCaseBoolean(str, "非疑点");
+                this.$store.state.mapMethodsCollection
+                  .get("METHODS")
                   .changeSortMethod("非疑点");
                 break;
             }
@@ -814,7 +820,6 @@ export default {
       modelId,
       columnId
     ) {
-      
       let uniqueIdList = [];
       if (this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId]) {
         uniqueIdList =
@@ -825,7 +830,7 @@ export default {
         uniqueId: uniqueId,
         geometry: geometry,
         cid: cid,
-        color:color
+        color: color,
       };
       uniqueIdList.push(singlePolygonItem);
       this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId] =

+ 45 - 23
src/views/ComprehensiveAnalysis.vue

@@ -894,6 +894,7 @@ export default {
     // 统计标记的疑点或非疑点数并排序
     this.$store.state.mapMethodsCollection.set("METHODS", {
       changeSortMethod: this.changeSortMethod,
+      changeCaseBoolean: this.changeCaseBoolean,
     });
   },
   destroy() {
@@ -904,6 +905,22 @@ export default {
     this.$bus.$off("caseAuditEvent2");
   },
   methods: {
+    // 修改数据中的疑点
+    changeCaseBoolean(val, status) {
+      if (this.enteredPanelId) {
+        let data = this.originalDataMap.get(this.enteredPanelId);
+        let index;
+        data.forEach((v, i) => {
+          if (v.id === val) {
+            index = i;
+          }
+        });
+        data[index]["c_boolean"] = status;
+        this.originalDataMap.set(this.enteredPanelId, data);
+        console.log(data, "修改疑点布尔值");
+      }
+    },
+    // 选择排序方式
     changeSortMethod(val) {
       if (this.enteredPanelId) {
         let data = this.originalDataMap.get(this.enteredPanelId);
@@ -921,30 +938,35 @@ export default {
 
         switch (val) {
           case "未标记":
-            this.originalData[this.enteredPanelId] = [
+            this.originalDataMap.set(this.enteredPanelId, [
               ...arr1,
               ...arr2,
               ...arr3,
-            ];
+            ]);
             break;
           case "疑点":
-            this.originalData[this.enteredPanelId] = [
+            this.originalDataMap.set(this.enteredPanelId, [
               ...arr2,
-              ...arr1,
               ...arr3,
-            ];
+              ...arr1,
+            ]);
             break;
           case "非疑点":
-            this.originalData[this.enteredPanelId] = [
+            this.originalDataMap.set(this.enteredPanelId, [
               ...arr3,
-              ...arr1,
               ...arr2,
-            ];
+              ...arr1,
+            ]);
             break;
         }
-
-        // 先对所有的数据进行排序
-        console.log(this.originalData[this.enteredPanelId], "已经排序后的数组");
+        this.changeSingleLayer(
+          1,
+          this.currentPageSize,
+          this.enteredColumnId,
+          this.enteredPanelId,
+          this.enteredMainType,
+          this.enteredSourceType
+        );
       }
     },
     // 得到底部菜单疑点审计开启状态
@@ -1106,6 +1128,7 @@ export default {
       };
 
       if (mainType === "预设模型") {
+        this.enteredPanelId = uniqueId;
         let searchParam = [];
         let paramTown = {
           field: "c_xzqh",
@@ -1199,12 +1222,20 @@ export default {
                 let defaultStatus = ele.c_boolean;
                 let modelId = ele.model_id;
                 let columnId = ele.column_id;
+                let color = this.collectColorMap.get(this.collectColorMapIndex);
+                if (defaultStatus === "疑点") {
+                  color = `rgb(${caseColorChange["isPointColor"][0]},${caseColorChange["isPointColor"][1]},${caseColorChange["isPointColor"][2]})`;
+                }
+                if (defaultStatus === "非疑点") {
+                  color = `rgb(${caseColorChange["notPointColor"][0]},${caseColorChange["notPointColor"][1]},${caseColorChange["notPointColor"][2]})`;
+                }
+
                 this.$store.state.mapMethodsCollection
                   .get("RENDER")
                   .addSinglePolygon(
                     geometry,
                     cid,
-                    this.collectColorMap.get(this.collectColorMapIndex),
+                    color,
                     uniqueId,
                     mainType,
                     sourceType,
@@ -1320,6 +1351,7 @@ export default {
         this.activeNames = ["myLabel", uniqueId];
       }
     },
+
     // 数据字典查询 -- 根据内容获取对应的index
     // this.classTextToIndex["任务类型"]
     classDictQuery(type, cName, keyName) {
@@ -1938,7 +1970,7 @@ export default {
                   (coord) => coord.length == 0
                 );
                 if (condition) {
-                  this.$message.info("未发现叠置的几何体!")
+                  this.$message.info("未发现叠置的几何体!");
                 } else {
                   if (map2DViewer.analysisGroups[uniqueId]) {
                     let uniqueIdList = [];
@@ -2088,7 +2120,6 @@ export default {
     },
     // geojson直接读取的坐标顺序是经纬度
     readGeojson(geojson, uniqueId, color) {
-      // debugger;
       // 尽量与所有图层,预设模型读取几何数据的方式一样,
       let states = [];
       states.push(geojson);
@@ -2162,15 +2193,6 @@ export default {
         delete this.targetLayerTotal[data.id];
         delete map2DViewer.analysisGroups[data.id];
       }
-
-      // 如果有叠置分析文件,删除叠置分析图层
-      // if (data.c_dzfx_file) {
-      //   if (map2DViewer.analysisGroups[data.id]) {
-      //     map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
-      //   }
-      // } else {
-      //   // 删除绘制的图层数据
-      // }
     },
     //显示详细信息
     viewDetailsPopup(data) {