Ver Fonte

删除部分文件不需要的代码

Bella há 2 anos atrás
pai
commit
5c2b05734d

+ 7 - 12
src/components/common/BottomForm/CustomModelDialog.vue

@@ -449,13 +449,6 @@ export default {
         }
       }
     },
-    // transferCheckChange1(data, checked) {
-    //   if (data.mainType === "所有图层") {
-    //     if (checked) {
-    //       // if
-    //     }
-    //   }
-    // },
     // 添加模型
     addModel() {
       if (customModelIdMap.has(this.inputName)) {
@@ -467,11 +460,13 @@ export default {
         this.createModelParams.c_user_id = localStorage.getItem("USER_ID") || 4;
         // 获取数组对象
         let treeArr = [];
-        this.customTreeMap.forEach((v, i) => {
-          if (this.checkedList.includes(i)) {
-            treeArr.push(v);
-          }
-        });
+        if (this.customTreeMap.size > 0) {
+          this.customTreeMap.forEach((v, i) => {
+            if (this.checkedList.includes(i)) {
+              treeArr.push(v);
+            }
+          });
+        }
 
         // 转为树结构的数据格式
         let finalData = this.createTree(treeArr);

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

@@ -200,11 +200,11 @@ export default {
           });
         } else {
           // 不需要显示法律法规详细信息的弹窗
-          $(()=>{
-            if($(`#${str}_id a`)){
-              $(`#${str}_id a`).remove()
+          $(() => {
+            if ($(`#${str}_id a`)) {
+              $(`#${str}_id a`).remove();
             }
-          })
+          });
           console.log("呈现我的模型的几何数据");
         }
 
@@ -540,6 +540,7 @@ export default {
         zoomControl: false,
         minZoom: 10,
         maxZoom: 19,
+        preferCanvas: true,
       }).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
 
       //添加默认图层
@@ -715,11 +716,11 @@ export default {
         uniqueIdList;
       let coordinates = "";
 
-      // 经纬度等上海2000转为经纬度坐标后再重新修改
-        let coord = JSON.parse(geometry).geometry.coordinates[0];
-        coordinates = coord.map((v) => {
-          return [v[1], v[0]];
-        });
+      // 当前数据坐标系为WGS84
+      let coord = JSON.parse(geometry).geometry.coordinates[0];
+      coordinates = coord.map((v) => {
+        return [v[1], v[0]];
+      });
       // if (uniqueId === "一般耕地_47") {
       //   let coord = JSON.parse(geometry).geometry.coordinates[0];
       //   coordinates = coord.map((v) => {

+ 20 - 114
src/views/ComprehensiveAnalysis.vue

@@ -570,38 +570,16 @@ export default {
   },
 
   mounted() {
-    // console.log("请求综合分析页面");
-    // 获取我的标记数据
-    // if (this.$store.state.navSelect.index === "3") {
-    // this.activeNames = ["myLabel"];
-    // this.getUserMarkers();
-    // map2DViewer.map.on("move", (e) => {
-    //   if (!this.isLeftLock) {
-    //     this.showLeftBox = false;
-    //     this.leftBoxBtn = true;
-    //   }
-
-    //   if (!this.isRightLock) {
-    //     this.showRightBox = false;
-    //     this.rightBoxBtn = true;
-    //   }
-    // });
-
     this.$bus.$off("viewDetailsPopup");
     this.$bus.$on("viewDetailsPopup", (data) => {
       this.viewDetailsPopup(data);
     });
     // }
   },
-  // beforeDestroy() {
-  //   console.log("组件已销毁");
-  //   this.clearAllData();
-  // },
   methods: {
     // 勾选镇时默认展开当前镇
     changeTownEvent(val) {
       if (this.townSelectTreeMap.has(val)) {
-        // let children = [{ id: 123, label: val, town: val, source: "生态资源" }];
         let children = [];
         let data = this.townSelectTreeMap.get(val).data;
         if (data.length > 0) {
@@ -646,18 +624,11 @@ export default {
           );
           this.expandedKeys.push(this.firstLevelIdMap.get("所有图层").id);
         }
-
-        // this.expandedKeys.push(this.townSelectTreeMap.get(val).id);
-        // console.log(this.expandedKeys);
       }
     },
     // 清除页面所有数据
     clearAllData() {
-      // if (map2DViewer.groups["我的标记图层组"]) {
-      //   delete map2DViewer.groups["我的标记图层组"];
-      // }
-      // uploadDataIdArr = [];
-      // this.treeCoordMap.clear();
+      this.currentTotal = 0
       map2DViewer.map.off("move");
       // 所有图层或预设模型全部删除
       if (Object.getOwnPropertyNames(map2DViewer.analysisGroups).length > 0) {
@@ -666,7 +637,6 @@ export default {
           this.$store.state.mapMethodsCollection
             .get("RENDER")
             .deleteGroupFromMap(group);
-          // map2DViewer.analysisGroups[group].remove();
         }
         this.$refs.tree.setCheckedKeys([]);
       }
@@ -741,7 +711,7 @@ export default {
         layerParams = {
           columnId: columnId,
           states: "0,1,2,3",
-          pageSize: 100,
+          pageSize: 500,
           page: 0,
         };
         this.$Post(this.urlsCollection.selectContentList, layerParams).then(
@@ -882,66 +852,6 @@ export default {
      * @mainType 所有图层/预设模型
      * @sourceType 土地资源,水资源,林地资源,全部
      */
-    changeSingleLayer1(val, columnId, id, mainType, sourceType) {
-      let layerParams = new FormData();
-      layerParams = {
-        columnId: columnId,
-        states: "0,1,2,3",
-        pageSize: 10,
-        page: val - 1,
-      };
-      this.$Post(this.urlsCollection.selectContentList, layerParams).then(
-        (res) => {
-          // console.log(res, "changeSingeLayer");
-          if (res.code === 200 && res.content.data.length > 0) {
-            this.paginationData.currentPage = val;
-            this.paginationData.total = res.content.data.length;
-            let uniqueId = id;
-            if (map2DViewer.analysisGroups[uniqueId]) {
-              this.layerIdMap.set(uniqueId, uniqueId);
-              map2DViewer.analysisGroups[uniqueId].clearLayers();
-              this.originalData[uniqueId] = res.content.data.map((ele) => {
-                let cid = ele.id;
-                let geometry = ele.c_content;
-
-                this.activeNames = ["myLabel", uniqueId];
-                this.$store.state.mapMethodsCollection
-                  .get("RENDER")
-                  .addSinglePolygon(
-                    geometry,
-                    cid,
-                    this.randomColor.get(uniqueId),
-                    uniqueId,
-                    mainType,
-                    sourceType
-                  );
-                return {
-                  id: ele.id,
-                  // "垃圾堆放点"
-                  column_name: ele.column_name,
-                  // 是否疑点
-                  c_boolean: ele.c_boolean ? "是" : "否",
-                  // 行政区划
-                  c_xzqh: ele.c_xzqh,
-                  // 空间信息
-                  c_content: ele.c_content,
-                  // 疑点修改时间
-                  c_date_time: ele.c_date_time,
-                  // 修改人员名称
-                  // c_editor_name: ele.c_editor_name,
-                  // 标题
-                  title: ele.title,
-                  column_id: ele.column_id,
-                  content: ele.content,
-                  secret_level: ele.secret_level,
-                };
-              });
-            }
-          }
-        }
-      );
-    },
-
     changeSingleLayer(
       val,
       currentPageSize,
@@ -950,12 +860,9 @@ export default {
       mainType,
       sourceType
     ) {
-      console.log(val, "页面已切换");
       let uniqueId = id;
       if (map2DViewer.analysisGroups[uniqueId]) {
         this.paginationData.currentPage = val;
-        // this.layerIdMap.set(uniqueId, uniqueId);
-        // map2DViewer.analysisGroups[uniqueId].clearLayers();
         this.originalData[uniqueId] = [];
         let oldData = this.originalDataMap.get(uniqueId);
         if (val * currentPageSize <= oldData.length - 1) {
@@ -988,8 +895,6 @@ export default {
             secret_level: ele.secret_level,
           };
         });
-
-        console.log(uniqueId, this.originalData, "当前页面数据");
         // 激活当前展开面板
         this.activeNames = ["myLabel", uniqueId];
       }
@@ -1008,15 +913,6 @@ export default {
           res.content.forEach((v) => {
             this.classTextToIndex[keyName].set(v.name, v.index + "");
           });
-
-          // if (keyName === "浦东新区行政区划") {
-          //   this.classTextToIndex[keyName].forEach((v, i) => {
-          //     // this.townOptions.push({
-          //     //   value: i,
-          //     //   label: i,
-          //     // });
-          //   });
-          // }
         }
       });
     },
@@ -1033,14 +929,16 @@ export default {
               });
               if (item1.columnList && item1.columnList.length > 0) {
                 item1.columnList.map((item2) => {
-                  //存储所有镇相关的数据
-                  this.townSelectTreeMap.set(item2.title, {
-                    id: item2.id,
-                    data:
-                      !item2.columnList || item2.columnList.length === 0
-                        ? []
-                        : item2.columnList,
-                  });
+                  if (item2.columnList && item2.columnList.length > 0) {
+                    //存储所有镇相关的数据
+                    this.townSelectTreeMap.set(item2.title, {
+                      id: item2.id,
+                      data:
+                        !item2.columnList || item2.columnList.length === 0
+                          ? []
+                          : item2.columnList,
+                    });
+                  }
                 });
               }
 
@@ -1454,6 +1352,11 @@ export default {
     },
     // 显示我的模型数据
     displayMyModelData(data) {
+      this.$nextTick(() => {
+        if (this.$refs.tree) {
+          this.$refs.tree.setCheckedKeys([data.id]);
+        }
+      });
       // debugger;
       let uniqueId = data.id;
       // 我的模型图层组初始化
@@ -1464,12 +1367,15 @@ export default {
         if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
           this.$store.state.selectSelectDataMap["singlePolygon"] = [];
         }
+        debugger;
 
         // 如果有叠置分析文件 -- 呈现叠置分析内容
         if (data.c_dzfx_file) {
           this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(
             (response) => {
               if (response.features.length > 0) {
+                console.log("请求到的叠置分析的数据");
+                console.log(response.features);
                 if (map2DViewer.analysisGroups[uniqueId]) {
                   // 清除当前图层组内所有图层,并读取GeoJSON数据
                   map2DViewer.analysisGroups[uniqueId].clearLayers();

+ 0 - 2
src/views/FrequencyView.vue

@@ -184,8 +184,6 @@ export default {
     // 切换页
     getTableData(val) {
       this.tableData = [];
-      console.log(`当前页: ${val}`);
-
       let searchParam = [];
       // 类别
       if (this.typeSelectVal) {

+ 0 - 1
src/views/LawView.vue

@@ -177,7 +177,6 @@ export default {
     },
     // 切换页
     getTableData(val) {
-      // console.log(`当前页: ${val}`);
       this.tableData = [];
 
       let searchParam = [];