Bella 2 лет назад
Родитель
Сommit
4b91dc9685

+ 6 - 0
public/static/config/config.js

@@ -39,3 +39,9 @@ townLocationMap.set("全部", [31.105589678244445, 121.72894516017521]);
 
 // 各镇域几何体 -- 方便定位
 var townPolygonMap = new Map()
+
+// 自定义模型id集合
+var customModelIdMap = new Map()
+
+// 上传数据集合
+var uploadDataIdArr = []

+ 2 - 0
src/api/url.js

@@ -24,4 +24,6 @@ export default {
   getColumnList:"/dms/column/getColumnList",
   //   插入数据
   addContent: "/dms/content/addContent",
+  // 删除数据
+  updateAudit:"/dms/content/updateAudit"
 };

+ 136 - 81
src/components/common/BottomForm/CustomModelDialog.vue

@@ -119,9 +119,12 @@
     >
       <div
         class="overlay-container-icon"
-        :class="{ checked: btnChecked }"
+        :class="{ checked: overlayBtnChecked }"
       ></div>
-      <div class="overlay-container-btn" :class="{ checked: btnChecked }">
+      <div
+        class="overlay-container-btn"
+        :class="{ checked: overlayBtnChecked }"
+      >
         叠置分析
       </div>
     </div>
@@ -150,7 +153,7 @@ export default {
   components: {},
   data() {
     return {
-      btnChecked: false,
+      overlayBtnChecked: false,
       outerDialogVisible: false,
       innerDialogVisible: false,
       overlayBtnShow: false,
@@ -164,20 +167,18 @@ export default {
       },
       transferData: [],
       filterText: "",
-      transferTreeIdMap: new Map(),
       createModelParams: {
+        title: "",
         // 叠置分析geojson附件
-        c_dzfx_file: "",
-        // 类型
-        c_level: "公开",
+        // c_dzfx_file: "",
+        // 类型 -- 公开:1; 私人: 0
+        c_level: "1",
         // 是否叠置分析
         c_isOverlay: false,
         // 绑定图层(json图层数组)
         c_bind_layer: "",
         // 用户id
         c_user_id: "",
-        // 模型名称
-        c_model_name: "",
       },
       checkedKeysArr: [],
       isLeftTransferBtn: false,
@@ -237,8 +238,25 @@ export default {
     this.$bus.$on("updateModel", (node) => {
       console.log("监听模型中");
       console.log(node, "节点数据");
+      this.checkedKeysArr = [];
+      this.checkArr = [];
+      this.checkedList = [];
       this.outerDialogVisible = true;
-      this.checkedList = node.data.data;
+      if (node.data.c_bind_layer) {
+        let bindLayerArr = JSON.parse(node.data.c_bind_layer);
+        console.log(bindLayerArr, "c_bind_layer");
+        if (bindLayerArr.length > 0) {
+          this.checkArr = bindLayerArr;
+          this.checkedList = bindLayerArr;
+          this.checkedKeysArr = bindLayerArr;
+          this.$nextTick(() => {
+            if (this.$refs.transferTree) {
+              this.$refs.transferTree.setCheckedKeys(this.checkedList);
+            }
+          });
+        }
+      }
+      // this.checkedList = node.data.data;
       this.inputName = node.data.label;
       this.overlayBtnShow = true;
       this.modelTitle = node.data.label;
@@ -258,10 +276,6 @@ export default {
         if (res.code === 200 && res.content.length > 0) {
           let data = res.content.map((item1) => {
             if (item1.title === "所有图层" && item1.columnList.length > 0) {
-              this.transferTreeIdMap.set(
-                item1.title,
-                `${item1.title}_${item1.id}`
-              );
               return {
                 id: `${item1.title}_${item1.id}`,
                 label: item1.title,
@@ -270,10 +284,6 @@ export default {
                   item1.columnList.length === 0
                     ? []
                     : item1.columnList.map((item2) => {
-                        this.transferTreeIdMap.set(
-                          item2.title,
-                          `${item2.title}_${item2.id}`
-                        );
                         return {
                           id: `${item2.title}_${item2.id}`,
                           label: item2.title,
@@ -282,10 +292,6 @@ export default {
                             item2.columnList.length === 0
                               ? []
                               : item2.columnList.map((item3) => {
-                                  this.transferTreeIdMap.set(
-                                    item3.title,
-                                    `${item3.title}_${item3.id}`
-                                  );
                                   return {
                                     id: `${item3.title}_${item3.id}`,
                                     label: item3.title,
@@ -294,20 +300,6 @@ export default {
                                       item3.columnList.length === 0
                                         ? []
                                         : item3.columnList.map((item4) => {
-                                            this.transferTreeIdMap.set(
-                                              item4.title,
-                                              `${item4.title}_${item4.id}`
-                                            );
-                                            // this.rightPanelDataMap.set(
-                                            //   item4.title,
-                                            //   item4.children
-                                            // );
-
-                                            // this.randomColor.set(
-                                            //   `${item4.title}_${item2.title}`,
-                                            //   publicFun.getRandomColor()
-                                            // );
-
                                             return {
                                               id: `${item4.title}_${item4.id}`,
                                               label: item4.title,
@@ -318,7 +310,7 @@ export default {
                                               tag: item4.tag,
                                               type: item3.title,
                                               town: item2.title,
-                                              // color: publicFun.getRandomColor(),
+                                              mainType: item1.title,
                                             };
                                           }),
                                   };
@@ -328,10 +320,6 @@ export default {
               };
             }
             if (item1.title === "预设模型" && item1.columnList.length > 0) {
-              this.transferTreeIdMap.set(
-                item1.title,
-                `${item1.title}_${item1.id}`
-              );
               return {
                 id: `${item1.title}_${item1.id}`,
                 label: item1.title,
@@ -339,14 +327,11 @@ export default {
                   item1.columnList.length === 0
                     ? []
                     : item1.columnList.map((item2) => {
-                        this.transferTreeIdMap.set(
-                          item2.title,
-                          `${item2.title}_${item2.id}`
-                        );
                         return {
                           id: `${item2.title}_${item2.id}`,
                           label: item2.title,
                           children: [],
+                          mainType: item1.title,
                         };
                       }),
               };
@@ -362,17 +347,102 @@ export default {
       });
     },
     transferCheckChange(data, checked) {
-      if (checked) {
-        this.checkedKeysArr.push(data.id);
-      } else {
-        if (this.checkedKeysArr.includes(data.id)) {
-          this.checkedKeysArr = this.checkedKeysArr.filter((v) => {
-            return v !== data.id;
-          });
+      if (data.mainType === "预设模型" || data.mainType === "所有图层") {
+        if (checked) {
+          if (!this.checkedKeysArr.includes(data.id)) {
+            this.checkedKeysArr.push(data.id);
+          }
+        } else {
+          console.log(data.id);
+          console.log(this.checkedKeysArr, "previous");
+          if (this.checkedKeysArr.includes(data.id)) {
+            this.checkedKeysArr = this.checkedKeysArr.filter((v) => {
+              return v !== data.id;
+            });
+          }
+          console.log(this.checkedKeysArr, "checkedKeysArr");
         }
       }
+
       // console.log(this.$refs.transferTree.getCheckedKeys(),"getCheckedKeys");
     },
+    // 添加模型
+    addModel() {
+      // 设置需要添加的参数
+      this.createModelParams.title = this.inputName;
+      this.createModelParams.c_user_id = localStorage.getItem("USER_ID") || 4;
+
+      this.createModelParams.c_bind_layer = JSON.stringify(this.checkedList);
+      let params = new FormData();
+      params = {
+        columnId: 89,
+        modelId: 94,
+        content: JSON.stringify(this.createModelParams),
+      };
+      this.$Post(this.urlsCollection.addContent, params)
+        .then((res) => {
+          console.log(res, "保存自定义模型的res");
+          if (res.code === 200) {
+            this.$message.success("模型已保存");
+            this.$store.state.customModelsArr.push({
+              name: this.inputName,
+              data: this.checkedList,
+            });
+            this.clearDialogVisible();
+          }
+        })
+        .catch(() => {
+          this.$message.info("模型保存失败");
+        });
+    },
+    // 修改模型 -- 需要先删除当前模型再添加新模型
+    modifyModel() {
+      console.log("这一步是修改模型");
+      let deleteParams = {
+        id: customModelIdMap.get(this.inputName).id,
+        columnId: 89,
+        state: 4,
+      };
+      console.log(deleteParams);
+      this.$Post(this.urlsCollection.updateAudit, deleteParams).then((res) => {
+        if (res.code === 200) {
+          console.log("已删除当前模型");
+          if (this.$store.state.customModelsArr.length > 0) {
+            this.$store.state.customModelsArr.filter((v) => {
+              return v.name !== this.inputName;
+            });
+          }
+
+          // 设置需要添加的参数
+          this.createModelParams.title = this.inputName;
+          this.createModelParams.c_user_id =
+            localStorage.getItem("USER_ID") || 4;
+
+          this.createModelParams.c_bind_layer = JSON.stringify(
+            this.checkedList
+          );
+          let modifyParams = new FormData();
+          modifyParams = {
+            columnId: 89,
+            modelId: 94,
+            content: JSON.stringify(this.createModelParams),
+          };
+
+          this.$Post(this.urlsCollection.addContent, modifyParams).then(
+            (modifyRes) => {
+              if (res.code === 200) {
+                this.$message.success("模型已修改");
+                this.$store.state.customModelsArr.push({
+                  name: this.inputName,
+                  data: this.checkedList,
+                });
+                this.clearDialogVisible();
+              }
+            }
+          );
+        }
+      });
+    },
     deleteCheckList() {
       // console.log("点击左侧按钮");
       if (
@@ -391,8 +461,11 @@ export default {
     addCheckList() {
       this.$nextTick(() => {
         if (this.$refs.transferTree) {
-          this.checkedList = this.$refs.transferTree.getCheckedKeys();
-          this.checkArr = this.$refs.transferTree.getCheckedKeys();
+          console.log(this.checkedKeysArr, "checkedKeysArr");
+          this.checkArr = [];
+          this.checkedList = [];
+          this.checkArr = this.checkedKeysArr;
+          this.checkedList = this.checkedKeysArr;
           console.log("当前选中的keys");
         }
       });
@@ -416,6 +489,11 @@ export default {
     },
     // 底部按钮自定义模型事件
     customModelEvent() {
+      this.$nextTick((e) => {
+        if (this.$refs.transferTree) {
+          this.$refs.transferTree.setCheckedKeys([]);
+        }
+      });
       this.modelTitle = null;
       this.overlayBtnShow = false;
       this.$store.state.modelStatus = "create";
@@ -431,7 +509,6 @@ export default {
         });
         this.$nextTick((e) => {
           console.log(this.$refs.transferTree, "this.$refs.transferTre");
-
           this.$refs.transferTree.setCheckedKeys(this.checkedList);
         });
       }
@@ -453,41 +530,19 @@ export default {
       this.$confirm("确认保存吗?").then(() => {
         // modify -- 改变数组类型
         if (this.$store.state.modelStatus === "modify") {
-          this.$store.state.customModelsArr.map((v) => {
-            if (v.name === this.inputName) {
-              v.data = this.checkedList;
-            }
-          });
+          this.modifyModel();
         }
 
-        console.log(this.$store.state.customModelsArr, "先获取的模型数据");
+        // console.log(this.$store.state.customModelsArr, "先获取的模型数据");
         // create -- 创建新的数组
         if (this.$store.state.modelStatus === "create") {
-          this.$store.state.customModelsArr.push({
-            name: this.inputName,
-            data: this.checkedList,
-          });
-
-          // 设置需要添加的参数
-
-          let params = new FormData();
-          params = {
-            columnId: "",
-            modelId: "",
-            content: JSON.stringify(this.createModelParams),
-          };
-          this.$Post(this.urlsCollection.addContent, params).then((res) => {
-            if (res.code === 200) {
-              this.$message.success("模型以保存");
-              this.clearDialogVisible();
-            }
-          });
+          this.addModel();
         }
       });
     },
     // 执行叠置分析
     executeOverlay() {
-      this.btnChecked = !this.btnChecked;
+      this.overlayBtnChecked = !this.overlayBtnChecked;
       // alert("正在开发中");
       // console.log("execute overlay");
     },

+ 36 - 16
src/components/common/BottomForm/UploadingData.vue

@@ -1,6 +1,11 @@
 <template>
   <!-- 上传数据弹窗 -->
-  <el-dialog title="上传数据" :visible.sync="dialogVisible" :before-close="handleClose" width="400px">
+  <el-dialog
+    title="上传数据"
+    :visible.sync="dialogVisible"
+    :before-close="handleClose"
+    width="400px"
+  >
     <template slot="title">
       <div class="dialogTitle">
         <div class="dialogTitleIcon"></div>
@@ -24,7 +29,9 @@
       >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-        <div class="el-upload__tip" slot="tip">*仅支持Geojson格式文件,且不超过5MB</div>
+        <div class="el-upload__tip" slot="tip">
+          *仅支持Geojson格式文件,且不超过5MB
+        </div>
       </el-upload>
     </div>
     <span slot="footer" class="dialog-footer">
@@ -50,7 +57,7 @@ export default {
       // 上传文件列表
       fileList: [],
       // 上传数据弹窗显示状态
-      dialogVisible: false
+      dialogVisible: false,
     };
   },
   mounted() {
@@ -68,18 +75,18 @@ export default {
   methods: {
     // 当用户点击svg底座时,切换底部菜单显示隐藏状态。
     changeShowBottomMenusStatus() {
-        // 打开弹窗
-        this.dialogVisible = true;
-        this.$emit("changeShowBottomMenusStatus", false);
+      // 打开弹窗
+      this.dialogVisible = true;
+      this.$emit("changeShowBottomMenusStatus", false);
     },
     // 弹窗关闭询问
     handleClose() {
       if (this.dialogVisible) {
         this.$confirm("确认关闭?")
-          .then(_ => {
+          .then((_) => {
             this.clearDialogVisible();
           })
-          .catch(_ => {});
+          .catch((_) => {});
       }
     },
     // 上传数据关闭
@@ -105,12 +112,16 @@ export default {
     // 文件超出个数限制时
     handleExceed(files, fileList) {
       this.$message.warning(
-        `当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`
+        `当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
+          files.length + fileList.length
+        } 个文件`
       );
     },
     // 删除文件之前
     beforeRemove(file, fileList) {
-      this.$store.state.mapMethodsCollection.get("RENDER").deletePolygonLayer("upload_layer");
+      this.$store.state.mapMethodsCollection
+        .get("RENDER")
+        .deletePolygonLayer("upload_layer");
       delete map2DViewer.polygons["upload_layer"];
       this.$message.success(`文件${file.name}移除成功!`);
       return true;
@@ -123,13 +134,22 @@ export default {
     // 根据上传的文件渲染到地图中
     uploadRENDER(geoJson) {
       map2DViewer.polygons[`upload_layer`] = [];
-      let cid = "upload";
-      let color = "#67C23A";
+      // let cid = "upload";
+      // let color = "#67C23A";
+      // let guid = publicFun.buildGuid("myLayer");
+      // uploadDataIdArr.push({
+      //   id: guid,
+
+      // });
       // 地图定位
       let firstPolygon = JSON.parse(JSON.stringify(geoJson[0]));
       let coordinates = firstPolygon.geometry.coordinates[0][0][0];
-      this.$store.state.mapMethodsCollection.get("RENDER").setView(coordinates, 16);
-      this.$store.state.mapMethodsCollection.get("RENDER").addPolygonLayer(geoJson, cid, color);
+      this.$store.state.mapMethodsCollection
+        .get("RENDER")
+        .setView(coordinates, 16);
+      this.$store.state.mapMethodsCollection
+        .get("RENDER")
+        .addPolygonLayer(geoJson, cid, color);
     },
     // 读取file对象内容
     getActionData(file) {
@@ -154,9 +174,9 @@ export default {
         this.$message.error("上传文件大小不能超过 5MB!");
       }
       return isJPG && isLt5M;
-    }
+    },
   },
-  watch: {}
+  watch: {},
 };
 </script>
 <style lang="less" scoped>

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

@@ -81,7 +81,7 @@ export default {
   },
   watch: {
     getLabelCaseBtnStatus(val) {
-      console.log(val, "标记疑点");
+      // console.log(val, "标记疑点");
       if (val.index === 1 && val.subIndex === 1) {
         console.log("激活标记疑点弹窗");
         // 删除地图上所有弹窗
@@ -90,7 +90,7 @@ export default {
         // 删除地图上的所有标记
         if (map2DViewer.myLabels) {
           for (let i in map2DViewer.myLabels) {
-            console.log(i, "图层名");
+            // console.log(i, "图层名");
             this.deleteGeometry(map2DViewer.myLabels[i]);
             map2DViewer.myLabels[i] = null;
           }
@@ -269,7 +269,7 @@ export default {
               this.$Post(this.urlsCollection.selectByUser, paramData).then(
                 (userRes) => {
                   if (userRes.code === 200) {
-                    console.log(userRes, "获取我的标记疑点数据");
+                    // console.log(userRes, "获取我的标记疑点数据");
 
                     if (userRes.content.length > 0) {
                       this.$store.state.myLabelPointsArr = [];
@@ -543,7 +543,15 @@ export default {
       }
     },
     addSinglePolygon(geometry, cid, color) {
-      let coordinates = JSON.parse(`{${geometry}}`).geometry.coordinates[0];
+      console.log(geometry[2], "打印出第一个");
+      let coordinates = null;
+      // console.log(geometry[0], "判断是否为json格式");
+      if (geometry[2] === "g") {
+        coordinates = JSON.parse(geometry).geometry.coordinates[0];
+      } else {
+        coordinates = JSON.parse(`{${geometry}}`).geometry.coordinates[0];
+      }
+
       coordinates = coordinates.map((v) => {
         return [v[1], v[0]];
       });

+ 316 - 249
src/views/ComprehensiveAnalysis.vue

@@ -102,7 +102,11 @@
             >
               <span class="custom-tree-node" slot-scope="{ node }">
                 <template
-                  v-if="node.level < 4 && node.parent.label !== '预设模型'"
+                  v-if="
+                    node.level < 4 &&
+                    node.parent.label !== '预设模型' &&
+                    node.parent.label !== '我的模型'
+                  "
                 >
                   <div
                     :class="{
@@ -128,25 +132,34 @@
                         style="position: absolute; right: -30px; top: -12px"
                       ></el-button
                     ></span>
-                    <span style="position: absolute; right: -85px; top: -8px">
-                      <el-button
-                        v-if="node.parent.label === '我的模型'"
-                        size="small"
-                        type="text"
-                        icon="el-icon-edit"
-                        @click="handleUpdate(node)"
-                      ></el-button>
-                      <el-button
-                        v-if="node.parent.label === '我的模型'"
-                        size="small"
-                        type="text"
-                        icon="el-icon-delete"
-                        @click="handleDelete(node)"
-                      ></el-button>
-                    </span>
                   </el-checkbox>
                 </template>
-                <!-- <template v-else>
+                <template v-else-if="node.parent.label === '我的模型'">
+                  <div
+                    :class="{
+                      'tree-arrow': !node.expanded,
+                      'tree-arrow-expanded': node.expanded,
+                    }"
+                  ></div>
+                  <span
+                    >{{ node.label }}
+                    <el-button
+                      v-if="node.parent.label === '我的模型'"
+                      size="small"
+                      type="text"
+                      icon="el-icon-edit"
+                      @click="handleUpdate(node)"
+                    ></el-button>
+                    <el-button
+                      v-if="node.parent.label === '我的模型'"
+                      size="small"
+                      type="text"
+                      icon="el-icon-delete"
+                      @click="handleDelete(node)"
+                    ></el-button>
+                  </span>
+                </template>
+                <template v-else>
                   <div
                     :class="{
                       'tree-arrow': !node.expanded,
@@ -154,7 +167,7 @@
                     }"
                   ></div>
                   <span>{{ node.label }}</span>
-                </template> -->
+                </template>
               </span>
             </el-tree>
           </div>
@@ -324,8 +337,21 @@ export default {
         this.$store.state.updateCasePopupShow = val;
       },
     },
+    uploadDataArr() {
+      return uploadDataIdArr;
+    },
   },
   watch: {
+    uploadDataArr: {
+      handler(val) {
+        if (val.length > 0) {
+          console.log(val, "uploadDataIdArr");
+        }
+      },
+      immediate: true,
+      deep: true,
+      // console.log(val,"uploadDataIdArr");
+    },
     getLeftMenuTitle: {
       handler(val) {
         this.$nextTick(() => {
@@ -358,6 +384,7 @@ export default {
     getCustomModel: {
       handler(val) {
         console.log(val, "目前存在的自定义模型");
+        this.getMyModelData();
         // let myModelRef = this.$refs.tree.data[2];
         // if (myModelRef.label === "我的模型") {
         //   this.$refs.tree.data[2].children = val.map((ele) => {
@@ -423,6 +450,7 @@ export default {
   },
   beforeDestroy() {
     treeIdMap.clear();
+    uploadDataIdArr = [];
     this.treeCoordMap.clear();
     map2DViewer.map.off("move");
     if (Object.getOwnPropertyNames(map2DViewer.polygons).length > 0) {
@@ -567,7 +595,6 @@ export default {
                           label: item2.title,
                           children: [],
                           mainType: item1.title,
-                          // color: publicFun.getRandomColor(),
                         };
                       }),
               };
@@ -593,13 +620,77 @@ export default {
             }
           });
           this.modelData.push({
-            id:"我的图层",
-            label:"我的图层",
-            children:[]
-          })
+            id: "我的图层",
+            label: "我的图层",
+            children: [],
+          });
+
+          this.getMyModelData();
         }
       });
     },
+    getMyModelData() {
+      // 我的模型栏目信息
+      // {
+      //       "level": 0,
+      //       "modelId": 94,
+      //       "updateTime": 1671432804228,
+      //       "authorId": 4,
+      //       "title": "我的模型",
+      //       "type": 1,
+      //       "content": "浦东审计-我的模型",
+      //       "parentId": -1,
+      //       "modelName": "pdsj_wdmx_m_ysmx_wdmx",
+      //       "createTime": 1671432804228,
+      //       "authorName": "user001",
+      //       "id": 89,
+      //       "state": 0,
+      //       "tag": "pdsj_wdmx"
+      //   },
+      let params = new FormData();
+      params = {
+        columnId: 89,
+        states: "0,1,2,3",
+        pageSize: 10,
+        page: 0,
+      };
+
+      this.$Post(this.urlsCollection.selectContentList, params)
+        .then((res) => {
+          // console.log(res, "判断是否有");
+          if (res.code === 200 && res.content.data.length > 0) {
+            console.log(res.content.data, "我的模型 - 最终数据");
+            let children = res.content.data.map((ele) => {
+              customModelIdMap.set(ele.title, {
+                column_id: ele.column_id,
+                id: ele.id,
+              });
+              return {
+                id: ele.id,
+                label: ele.title,
+                children: [],
+                column_id: ele.column_id,
+                model_name: ele.model_name,
+                model_id: ele.model_id,
+                state: ele.state,
+                mainType: "我的模型",
+                c_bind_layer: ele.c_bind_layer,
+              };
+            });
+            if (this.modelData.length > 0) {
+              this.modelData.forEach((ele) => {
+                if (ele.label == "我的模型") {
+                  console.log(ele, "我的模型");
+                  ele.children = children;
+                }
+              });
+            }
+          }
+        })
+        .catch((err) => {
+          console.log(err, "getMyModelData");
+        });
+    },
     // 调用我的标记接口
     getUserMarkers() {
       if (localStorage.getItem("USER_ID")) {
@@ -690,255 +781,231 @@ export default {
     },
     handleDelete(node) {
       console.log(node, "删除节点");
+      let deleteParams = {
+        id: customModelIdMap.get(node.data.label).id,
+        columnId: 89,
+        state: 4,
+      };
+      this.$Post(this.urlsCollection.updateAudit, deleteParams).then((res) => {
+        if (res.code === 200) {
+          this.$message.info("模型已删除!");
+          this.$store.state.customModelsArr =
+            this.$store.state.customModelsArr =
+              this.$store.state.customModelsArr.filter((v) => {
+                return v.name !== node.data.label;
+              });
+
+          // this.getMyModelData();
+        }
+      });
     },
     handleNodeClick(node) {
       // console.log(node, "node");
     },
     // 节点change事件
     handleCheckChange(data, checked) {
-      let guid = data.id;
-      if (checked) {
-        console.log(data, "选中的数据");
-        this.showRightBox = true;
-        if (data.mainType === "所有图层") {
-          this.rightPanelTitle = data.label;
-          this.originalData[`${data.label}_${data.town}`] =
-            this.rightPanelDataMap.get(data.label);
+      if (data.mainType && data.mainType !== "我的模型") {
+        if (checked) {
+          console.log(data, "选中的数据");
+          this.showRightBox = true;
+          if (data.mainType === "所有图层") {
+            this.rightPanelTitle = data.label;
+            this.originalData[`${data.label}_${data.town}`] =
+              this.rightPanelDataMap.get(data.label);
 
-          let searchParam = [];
-          let targetTown = this.classTextToIndex["浦东新区行政区划"].get(
-            data.town
-          );
-          let targetType = this.classTextToIndex["任务类型"].get(data.type);
+            let searchParam = [];
+            let targetTown = this.classTextToIndex["浦东新区行政区划"].get(
+              data.town
+            );
+            let targetType = this.classTextToIndex["任务类型"].get(data.type);
 
-          let paramUser = {
-            field: "c_user_id",
-            searchType: "2",
-            content: {
-              value: localStorage.getItem("USER_ID"),
-            },
-          };
-          searchParam.push(paramUser);
-          let paramTown = {
-            field: "c_area_code",
-            searchType: "1",
-            content: {
-              value: targetTown,
-            },
-          };
-          searchParam.push(paramTown);
-          let paramType = {
-            field: "c_task_type",
-            searchType: "1",
-            content: {
-              value: targetType,
-            },
-          };
-          searchParam.push(paramType);
+            let paramUser = {
+              field: "c_user_id",
+              searchType: "2",
+              content: {
+                value: localStorage.getItem("USER_ID"),
+              },
+            };
+            searchParam.push(paramUser);
+            let paramTown = {
+              field: "c_area_code",
+              searchType: "1",
+              content: {
+                value: targetTown,
+              },
+            };
+            searchParam.push(paramTown);
+            let paramType = {
+              field: "c_task_type",
+              searchType: "1",
+              content: {
+                value: targetType,
+              },
+            };
+            searchParam.push(paramType);
 
-          let params = new FormData();
-          params = {
-            columnId: 61,
-            states: "2,3",
-            pageSize: 10,
-            page: 0,
-            search: JSON.stringify(searchParam),
-          };
-          console.log(params, "所有图层不显示");
+            let params = new FormData();
+            params = {
+              columnId: 61,
+              states: "2,3",
+              pageSize: 10,
+              page: 0,
+              search: JSON.stringify(searchParam),
+            };
+            console.log(params, "所有图层不显示");
 
-          this.$Post(this.urlsCollection.selectContentList, params).then(
-            (res) => {
-              // console.log(res, "获取数据");
-              // debugger
-              if (res.code === 202 && res.content === "数据不存在") {
-                this.$message.info("当前用户无权限!");
-              }
+            this.$Post(this.urlsCollection.selectContentList, params).then(
+              (res) => {
+                // console.log(res, "获取数据");
+                // debugger
+                if (res.code === 202 && res.content === "数据不存在") {
+                  this.$message.info("当前用户无权限!");
+                }
 
-              if (res.code === 200 && res.content.data.length > 0) {
-                console.log("有权限");
-                console.log(data, "有权限的图层");
-                this.$store.state.treeDataCollection.set(data.id, {
-                  mainType: data.mainType,
-                  town: data.town,
-                  type: data.type,
-                });
+                if (res.code === 200 && res.content.data.length > 0) {
+                  console.log("有权限");
+                  console.log(data, "有权限的图层");
+                  this.$store.state.treeDataCollection.set(data.id, {
+                    mainType: data.mainType,
+                    town: data.town,
+                    type: data.type,
+                  });
 
-                let layerParams = new FormData();
-                layerParams = {
-                  columnId: data.columnId,
-                  states: 3,
-                  pageSize: 10,
-                  page: 0,
-                };
-                this.$Post(
-                  this.urlsCollection.selectContentList,
-                  layerParams
-                ).then((res) => {
-                  if (res.code === 200 && res.content.data.length > 0) {
-                    console.log(res.content, "获取到的数据");
-                    let uniqueId = `${data.label}_${data.town}`;
-                    this.originalData[uniqueId] = res.content.data.map(
-                      (ele) => {
-                        let cid = `${data.label}_${ele.id}`;
+                  let layerParams = new FormData();
+                  layerParams = {
+                    columnId: data.columnId,
+                    states: 3,
+                    pageSize: 10,
+                    page: 0,
+                  };
+                  this.$Post(
+                    this.urlsCollection.selectContentList,
+                    layerParams
+                  ).then((res) => {
+                    if (res.code === 200 && res.content.data.length > 0) {
+                      console.log(res.content, "获取到的数据");
+                      let uniqueId = `${data.label}_${data.town}`;
+                      this.originalData[uniqueId] = res.content.data.map(
+                        (ele) => {
+                          let cid = `${data.label}_${ele.id}`;
 
-                        let geometry = ele.c_geometry;
-                        map2DViewer.polygons[`${cid}_polygon`] = [];
-                        this.layerIdMap.set(data.id, `${cid}_polygon`);
-                        // 激活当前展开面板
-                        this.activeNames = [
-                          "myLabel",
-                          `${data.label}_${data.town}`,
-                        ];
-                        this.$store.state.mapMethodsCollection
-                          .get("RENDER")
-                          .addSinglePolygon(
-                            geometry,
-                            cid,
-                            this.randomColor.get(uniqueId)
-                          );
-                        return {
-                          id: ele.id,
-                          name: ele.c_yichang,
-                          columnName: ele.column_name,
-                          town: data.town,
-                          area: ele.c_c_shui_area,
-                          nature: ele.c_yichang,
-                          // year: ele.c_c_year,
-                        };
-                      }
-                    );
-                  }
-                });
+                          let geometry = ele.c_geometry;
+                          map2DViewer.polygons[`${cid}_polygon`] = [];
+                          this.layerIdMap.set(data.id, `${cid}_polygon`);
+                          // 激活当前展开面板
+                          this.activeNames = [
+                            "myLabel",
+                            `${data.label}_${data.town}`,
+                          ];
+                          this.$store.state.mapMethodsCollection
+                            .get("RENDER")
+                            .addSinglePolygon(
+                              geometry,
+                              cid,
+                              this.randomColor.get(uniqueId)
+                            );
+                          return {
+                            id: ele.id,
+                            name: ele.c_yichang,
+                            columnName: ele.column_name,
+                            town: data.town,
+                            area: ele.c_c_shui_area,
+                            nature: ele.c_yichang,
+                            // year: ele.c_c_year,
+                          };
+                        }
+                      );
+                    }
+                  });
+                }
               }
-            }
-          );
-        }
+            );
+          }
 
-        if (data.mainType === "预设模型") {
-          this.rightPanelTitle = `${data.label}(${data.mainType})`;
-          let params = new FormData();
-          params = {
-            columnId: data.id.split("_")[1],
-            states: "3",
-            pageSize: 10,
-            page: 0,
-          };
+          if (data.mainType === "预设模型") {
+            this.rightPanelTitle = `${data.label}(${data.mainType})`;
+            let params = new FormData();
+            params = {
+              columnId: data.id.split("_")[1],
+              states: "3",
+              pageSize: 10,
+              page: 0,
+            };
 
-          this.$Post(this.urlsCollection.selectContentList, params).then(
-            (res) => {
-              if (res.code === 200 && res.content.data.length > 0) {
-                console.log(res.content.data, "点击预设模型后获取到的数据");
-                this.$store.state.treeDataCollection.set(data.id, {
-                  mainType: data.mainType,
-                });
-                // id: "水资源_88"
-                let uniqueId = data.id;
-                this.originalData[uniqueId] = res.content.data.map((ele) => {
-                  let cid = uniqueId;
-                  let geometry = ele.c_geometry;
-                  map2DViewer.polygons[`${cid}_polygon`] = [];
-                  this.layerIdMap.set(data.id, `${cid}_polygon`);
-                  // 激活当前展开面板
-                  this.activeNames = ["myLabel", data.id];
-                  console.log(this.randomColor.get(uniqueId), "check color");
-                  this.$store.state.mapMethodsCollection
-                    .get("RENDER")
-                    .addSinglePolygon(
-                      geometry,
-                      cid,
-                      this.randomColor.get(uniqueId)
-                    );
+            this.$Post(this.urlsCollection.selectContentList, params).then(
+              (res) => {
+                if (res.code === 200 && res.content.data.length > 0) {
+                  console.log(res.content.data, "点击预设模型后获取到的数据");
+                  this.$store.state.treeDataCollection.set(data.id, {
+                    mainType: data.mainType,
+                  });
+                  // id: "水资源_88"
+                  let uniqueId = data.id;
+                  this.originalData[uniqueId] = res.content.data.map((ele) => {
+                    let cid = uniqueId;
+                    let geometry = ele.c_geometry;
+                    map2DViewer.polygons[`${cid}_polygon`] = [];
+                    this.layerIdMap.set(data.id, `${cid}_polygon`);
+                    // 激活当前展开面板
+                    this.activeNames = ["myLabel", data.id];
+                    console.log(this.randomColor.get(uniqueId), "check color");
+                    this.$store.state.mapMethodsCollection
+                      .get("RENDER")
+                      .addSinglePolygon(
+                        geometry,
+                        cid,
+                        this.randomColor.get(uniqueId)
+                      );
 
-                  return {
-                    id: ele.id,
-                    name: ele.c_yichang,
-                    columnName: ele.column_name,
-                    area: ele.c_c_shui_area,
-                    nature: ele.c_xingzhi,
-                  };
-                });
+                    return {
+                      id: ele.id,
+                      name: ele.c_yichang,
+                      columnName: ele.column_name,
+                      area: ele.c_c_shui_area,
+                      nature: ele.c_xingzhi,
+                    };
+                  });
+                }
               }
-            }
+            );
+          }
+        } else {
+          // 设置右侧折叠面板item数量
+          delete this.originalData[`${data.label}_${data.town}`];
+          this.layerIdMap.delete(data.id);
+          //关联自定义模型
+          this.$store.state.treeDataCollection.delete(data.id);
+          console.log(
+            this.$store.state.treeDataCollection,
+            "treeDataCollection"
           );
-        }
-
-        // 选中所有图层
-        // if (guid.indexOf("defaultLayer") > -1) {
-        //   // 渲染当前模块下的面图层
-        //   let cid = defaultLayers[data.label].cid;
-        //   let color = defaultLayers[data.label].color;
-
-        //   let passData = {
-        //     name: data.label,
-        //     value: cid,
-        //   };
-
-        //   // 存放当前选中的图层,方便关联自定义模型
-        //   this.$store.commit("changeTreeData", passData);
-        //   get(`./static/json/${cid}.json`).then((geoJson) => {
-        //     map2DViewer.polygons[`${cid}_layer`] = [];
-        //     this.originalData[data.label] = geoJson.map((v, index) => {
-        //       return {
-        //         id: publicFun.buildGuid("abnormal"),
-        //         name: v.properties["异常"] + "_" + index,
-        //         geometry: v.geometry,
-        //         properties: v.properties,
-        //       };
-        //     });
-        //     // console.log(this.originalData[data.label], "label");
-
-        //     this.activeNames = ["myLabel", data.label];
-
-        //     // 地图定位
-        //     let firstPolygon = JSON.parse(JSON.stringify(geoJson[0]));
-        //     let coordinates = firstPolygon.geometry.coordinates[0][0][0];
-        //     this.treeCoordMap.set(data.label, coordinates);
-
-        //     this.$store.state.mapMethodsCollection
-        //       .get("RENDER")
-        //       .addPolygonLayer(geoJson, cid, color);
-        //   });
-        // } else {
-        //   let passData = {
-        //     name: data.label,
-        //     value: data.label,
-        //   };
-        //   // 存放当前选中的图层,方便关联自定义模型
-        //   this.$store.commit("changeTreeData", passData);
-        // }
-      } else {
-        // 设置右侧折叠面板item数量
-        delete this.originalData[`${data.label}_${data.town}`];
-        this.layerIdMap.delete(data.id);
-        //关联自定义模型
-        this.$store.state.treeDataCollection.delete(data.id);
-        console.log(this.$store.state.treeDataCollection, "treeDataCollection");
 
-        // 只激活我的标记
-        this.activeNames = ["myLabel"];
+          // 只激活我的标记
+          this.activeNames = ["myLabel"];
 
-        for (let key in map2DViewer.polygons) {
-          console.log(key, "现在的面数据");
-          if (key.indexOf(data.label) > -1) {
-            this.$store.state.mapMethodsCollection
-              .get("RENDER")
-              .deleteSinglePolygon(map2DViewer.polygons[key]);
+          for (let key in map2DViewer.polygons) {
+            console.log(key, "现在的面数据");
+            if (key.indexOf(data.label) > -1) {
+              this.$store.state.mapMethodsCollection
+                .get("RENDER")
+                .deleteSinglePolygon(map2DViewer.polygons[key]);
+            }
           }
         }
-      }
 
-      this.legendTitle = Object.keys(this.originalData).map((v) => {
-        return { name: v, info: v };
-      });
-      console.log(this.legendTitle, "legendTitle");
-      this.legendIcon = this.legendTitle.map((c) => {
-        let a = this.randomColor.get(c.name);
-        console.log(a, "a");
-        return {
-          background: "transparent",
-          border: `1px solid ${this.randomColor.get(c.name)}`,
-        };
-      });
+        this.legendTitle = Object.keys(this.originalData).map((v) => {
+          return { name: v, info: v };
+        });
+        // console.log(this.legendTitle, "legendTitle");
+        this.legendIcon = this.legendTitle.map((c) => {
+          let a = this.randomColor.get(c.name);
+          // console.log(a, "a");
+          return {
+            background: "transparent",
+            border: `1px solid ${this.randomColor.get(c.name)}`,
+          };
+        });
+      }
     },
     // 右侧面板项点击事件
     listItemClick(type, data) {