Просмотр исходного кода

我的模型查看和叠置分析功能

Bella 2 лет назад
Родитель
Сommit
38a80558b8

+ 5 - 4
src/components/common/BottomForm/CustomModelDialog.vue

@@ -206,9 +206,9 @@ export default {
 
       // console.log(val, "checkedList");
     },
-    filterText(val){
-      this.$refs.transferTree.filter(val)
-    }
+    filterText(val) {
+      this.$refs.transferTree.filter(val);
+    },
   },
   created() {
     this.checkedKeysArr = [];
@@ -635,7 +635,8 @@ export default {
     displayOverlayGeometry(url) {
       // console.log(url);
       this.$Get(url).then((res) => {
-        // console.log(res, "叠置分析的结果数据");
+        console.log(res, "叠置分析的结果数据");
+        debugger;
       });
     },
     // 执行叠置分析

+ 20 - 15
src/components/map/MapHolder.vue

@@ -337,7 +337,6 @@ export default {
      * @geoType -- 几何体类型
      */
     createLabelDiv(str, coord, data, geoType) {
-      // console.log(str, coord, data, geoType, "createLabelDiv");
       // console.log(str, "label - str");
       this.currentLabelHtml = this.$refs.labelRef.$el.innerHTML;
       if (this.currentLabelHtml) {
@@ -376,21 +375,15 @@ export default {
       let selectVal = $(`#${str}_id .center-table-item-special select`).val();
       this.caseStatusMap.set(str, selectVal);
       if (selectVal === "isTrue") {
-        map2DViewer.polygons[str].options.weight = 5;
-        map2DViewer.polygons[
-          str
-        ].options.color = `rgb(${caseColorChange["isPointColor"][0]},${caseColorChange["isPointColor"][1]},${caseColorChange["isPointColor"][2]})`;
-        map2DViewer.polygons[
-          str
-        ].options.fillColor = `rgb(${caseColorChange["isPointColor"][0]},${caseColorChange["isPointColor"][1]},${caseColorChange["isPointColor"][2]})`;
+        map2DViewer.polygons[str].setStyle({
+          color: `rgb(${caseColorChange["isPointColor"][0]},${caseColorChange["isPointColor"][1]},${caseColorChange["isPointColor"][2]})`,
+          weight: 4,
+        });
       } else {
-        map2DViewer.polygons[str].options.weight = 5;
-        map2DViewer.polygons[
-          str
-        ].options.color = `rgb(${caseColorChange["notPointColor"][0]},${caseColorChange["notPointColor"][1]},${caseColorChange["notPointColor"][2]})`;
-        map2DViewer.polygons[
-          str
-        ].options.fillColor = `rgb(${caseColorChange["isPointColor"][0]},${caseColorChange["isPointColor"][1]},${caseColorChange["isPointColor"][2]})`;
+        map2DViewer.polygons[str].setStyle({
+          color: `rgb(${caseColorChange["notPointColor"][0]},${caseColorChange["notPointColor"][1]},${caseColorChange["notPointColor"][2]})`,
+          weight: 4,
+        });
       }
       console.log(map2DViewer.polygons[str]);
 
@@ -416,6 +409,18 @@ export default {
           if (res.code === 200) {
             this.$message.success("数据修改成功");
             map2DViewer.map.closePopup();
+            switch (selectVal) {
+              case "isTrue":
+                this.$store.state.mapMethodsCollection
+                  .get("METHODS")
+                  .changeSortMethod("疑点");
+                break;
+              case "isFalse":
+                this.$store.state.mapMethodsCollection
+                  .get("RENDER")
+                  .changeSortMethod("非疑点");
+                break;
+            }
           }
         }
       );

+ 167 - 48
src/views/ComprehensiveAnalysis.vue

@@ -329,9 +329,24 @@
                     }}
                   </div>
                   <span class="normal-icon">
-                    <span v-if="v.mainType === '预设模型'">{{
-                      v.c_boolean
-                    }}</span>
+                    <span
+                      v-if="v.mainType === '预设模型' && v.c_boolean === '疑点'"
+                      style="color: rgb(0, 230, 255)"
+                      >{{ v.c_boolean }}</span
+                    >
+                    <span
+                      v-else-if="
+                        v.mainType === '预设模型' && v.c_boolean === '非疑点'
+                      "
+                      style="color: rgb(0, 100, 240)"
+                      >{{ v.c_boolean }}</span
+                    >
+                    <span
+                      v-else-if="
+                        v.mainType === '预设模型' && v.c_boolean === '未标记'
+                      "
+                      >{{ v.c_boolean }}</span
+                    >
                     <el-button
                       size="normal"
                       type="text"
@@ -874,6 +889,11 @@ export default {
     this.$bus.$on("caseAuditEvent2", () => {
       this.caseAuditEvent();
     });
+
+    // 统计标记的疑点或非疑点数并排序
+    this.$store.state.mapMethodsCollection.set("METHODS", {
+      changeSortMethod: this.changeSortMethod,
+    });
   },
   destroy() {
     // 当容器销毁时,需要停止监听该事件
@@ -1557,6 +1577,11 @@ export default {
                 column_id: ele.column_id,
                 id: ele.id,
               });
+              this.rightPanelDataMap.set(`${ele.title}`, {
+                id: ele.id,
+                mainType: "我的模型",
+                sourceType: "",
+              });
               return {
                 id: ele.id,
                 label: ele.title,
@@ -1835,11 +1860,7 @@ export default {
             this.currentTotal -= this.originalDataMap.get(data.id).length;
             this.originalDataMap.delete(data.id);
 
-            if (
-              // data.mainType === "所有图层" &&
-              this.originalData &&
-              this.originalData[data.id]
-            ) {
+            if (this.originalData && this.originalData[data.id]) {
               delete this.originalData[data.id];
             }
           }
@@ -1925,25 +1946,25 @@ export default {
                 if (map2DViewer.analysisGroups[uniqueId]) {
                   // 清除当前图层组内所有图层,并读取GeoJSON数据
                   map2DViewer.analysisGroups[uniqueId].clearLayers();
-                  response.features.forEach((v) => {
-                    let geojson = publicFun.standardGeojson(
-                      v.geometry.coordinates
-                    );
-                    // 读取Geojson中的数据
-                    // this.$store.state.mapMethodsCollection
-                    // .get("RENDER")
-                    // .addSinglePolygon(
-                    //   geometry,
-                    //   cid,
-                    //   "#ff0",
-                    //   uniqueId,
-                    //   data.mainType,
-                    //   ""
-                    // );
-                    //等叠置分析有结果后再进行调试
-                    // console.log(geojson, "geojson")
-                    // this.readGeojson(geojson, data.id);
-                  });
+                  // response.features.forEach((v) => {
+                  // let geojson = publicFun.standardGeojson(
+                  //   v.geometry.coordinates
+                  // );
+                  // 读取Geojson中的数据
+                  // this.$store.state.mapMethodsCollection
+                  // .get("RENDER")
+                  // .addSinglePolygon(
+                  //   geometry,
+                  //   cid,
+                  //   "#ff0",
+                  //   uniqueId,
+                  //   data.mainType,
+                  //   ""
+                  // );
+                  //等叠置分析有结果后再进行调试
+                  // console.log(geojson, "geojson")
+                  // this.readGeojson(geojson, data.id);
+                  // });
                 }
               }
             }
@@ -1958,7 +1979,6 @@ export default {
           // 调用我的模型查看接口读取所有图层数据
           this.$Post(this.urlsCollection.getModelCoverAgeInfo, params).then(
             (res) => {
-              debugger;
               if (res.code === 201 && res.message === "未申请任务权限") {
                 this.$message.info("暂无数据!");
               }
@@ -1968,30 +1988,82 @@ export default {
                 map2DViewer.analysisGroups[uniqueId].clearLayers();
                 // 判断能用的数据
                 // 根据column_name或 column_id判断有几个图层
-                res.content.forEach((ele, index) => {
-                  let cid = ele.id;
-                  let geometry = ele.c_content;
-                  this.$store.state.mapMethodsCollection
-                    .get("RENDER")
-                    .addSinglePolygon(
-                      geometry,
-                      cid,
-                      "#ff0",
-                      uniqueId,
-                      data.mainType,
-                      ""
-                    );
+                // 初始化时将请求到的疑点数据中是否疑点全部改为未标记,疑点,非疑点三种状态
+                let changeCaseStatusArr = res.content.map((ele) => {
+                  return {
+                    id: ele.id,
+                    column_name: ele.column_name,
+                    c_boolean: "未标记",
+                    c_xzqh: ele.c_xzqh,
+                    c_content: ele.c_content,
+                    c_date_time: ele.c_date_time,
+                    title: ele.title,
+                    model_id: ele.model_id,
+                    column_id: ele.column_id,
+                    content: ele.content,
+                    secret_level: ele.secret_level,
+                    mainType: data.mainType,
+                  };
                 });
+
+                // 存储请求到的疑点数据
+                this.originalDataMap.set(uniqueId, changeCaseStatusArr);
+
+                // 该图层疑点总数
+                this.targetLayerTotal[uniqueId] = res.content.length;
+
+                // 分页组件total
+                this.paginationData.total =
+                  this.originalDataMap.get(uniqueId).length;
+
+                // 当前图层的id存在
+                if (
+                  map2DViewer.analysisGroups[uniqueId] &&
+                  this.originalDataMap.get(uniqueId).length > 0 &&
+                  changeCaseStatusArr.length > 0
+                ) {
+                  // 统计所有图斑数
+                  this.currentTotal += changeCaseStatusArr.length;
+                  // 请求到数据后直接渲染点
+                  changeCaseStatusArr.forEach((ele) => {
+                    let cid = ele.id;
+                    let geometry = ele.c_content;
+                    let modelId = ele.model_id;
+                    let columnId = ele.column_id;
+                    this.$store.state.mapMethodsCollection
+                      .get("RENDER")
+                      .addSinglePolygon(
+                        geometry,
+                        cid,
+                        "#ff0",
+                        uniqueId,
+                        data.mainType,
+                        "",
+                        "",
+                        modelId,
+                        columnId
+                      );
+                  });
+                }
+
+                // 激活当前展开面板
+                this.activeNames = ["myLabel", uniqueId];
+                // 我的模型数据进行分页列表展示
+                this.originalData[uniqueId] =
+                  this.originalDataMap.get(uniqueId);
+
+                // 进行分页列表展示
+                this.changeSingleLayer(
+                  1,
+                  this.currentPageSize,
+                  uniqueId,
+                  data.columnId
+                );
               }
             }
           );
         }
       }
-
-      // if (map2DViewer.analysisGroups[uniqueId]) {
-      //   // 直接显示移除掉的图层
-      //   map2DViewer.map.addLayer(map2DViewer.analysisGroups[uniqueId]);
-      // }
     },
     readGeojson(geojson, uniqueId) {
       // debugger;
@@ -2005,11 +2077,59 @@ export default {
       // }).addTo(map2DViewer.map);
       // map2DViewer.analysisGroups[uniqueId] = geojsonData;
     },
+    // 我的模型图层取消勾选
     deleteMyModelData(data) {
       // 直接删除图层组中的数据
       if (map2DViewer.analysisGroups[data.id]) {
         map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
       }
+
+      if (
+        this.$store.state.selectSelectDataMap["singlePolygon"] &&
+        this.$store.state.selectSelectDataMap["singlePolygon"][data.id]
+      ) {
+        delete this.$store.state.selectSelectDataMap["singlePolygon"][data.id];
+      }
+
+      // 取消勾选当前图层勾选,图斑数改变, 如果是所有图层数据移除折叠面板
+      if (
+        this.originalDataMap &&
+        this.originalDataMap.has(data.id) &&
+        this.currentTotal > 0
+      ) {
+        this.currentTotal -= this.originalDataMap.get(data.id).length;
+        this.originalDataMap.delete(data.id);
+
+        if (
+          // data.mainType === "所有图层" &&
+          this.originalData &&
+          this.originalData[data.id]
+        ) {
+          delete this.originalData[data.id];
+        }
+      }
+
+      // 统计后小于0改为0
+      if (this.currentTotal < 0) {
+        this.currentTotal = 0;
+      }
+
+      map2DViewer.map.closePopup();
+
+      this.layerIdMap.has(data.id) && this.layerIdMap.delete(data.id);
+
+      // 只激活我的标记
+      this.activeNames = ["myLabel"];
+      this.$store.state.mapMethodsCollection
+        .get("RENDER")
+        .deleteGroupFromMap(data.id);
+
+      // 移除图层id
+      if (map2DViewer.analysisGroups[data.id]) {
+        delete this.targetLayerTotal[data.id];
+        delete map2DViewer.analysisGroups[data.id];
+      }
+
       // 如果有叠置分析文件,删除叠置分析图层
       // if (data.c_dzfx_file) {
       //   if (map2DViewer.analysisGroups[data.id]) {
@@ -2768,8 +2888,7 @@ export default {
             align-items: center;
             justify-content: space-around;
             width: 120px;
-            border: 1px solid palegoldenrod;
-            color: peru;
+            color: #666666;
           }
 
           .operation-icon {