Ver código fonte

1. 删除公共数据中不需要的数据;2. 预设模型显示图层构成

Bella 2 anos atrás
pai
commit
8e13671c10
2 arquivos alterados com 88 adições e 279 exclusões
  1. 1 253
      src/config/common.js
  2. 87 26
      src/views/ComprehensiveAnalysis.vue

+ 1 - 253
src/config/common.js

@@ -59,7 +59,7 @@ export const lawType = {
   大气: "大气",
   农业资源: "农业资源",
   其他: "其他",
-  "土地资源":"1-土地资源(已)",
+  土地资源: "1-土地资源(已)",
 };
 
 /**
@@ -301,258 +301,6 @@ export const forestryData = {
   },
 };
 
-/**
- * 综合分析 -- 树状结构图
- */
-export const treeModel = [
-  {
-    id: publicFun.buildGuid(),
-    type: "所有图层",
-    children: [
-      {
-        id: publicFun.buildGuid("defaultLayer"),
-        type: "永久基本农田",
-        cid: "yongjiu",
-        color: "#f99531",
-        children: [],
-      },
-      {
-        id: publicFun.buildGuid("defaultLayer"),
-        type: "一般耕地",
-        cid: "yiban",
-        color: "#f9fb4b",
-        children: [],
-      },
-      {
-        id: publicFun.buildGuid("defaultLayer"),
-        type: "建设用地减量化",
-        cid: "jianshe",
-        color: "#4ac013",
-        children: [],
-      },
-      {
-        id: publicFun.buildGuid("defaultLayer"),
-        type: "带征地",
-        cid: "daizheng",
-        color: "#41ebfa",
-        children: [],
-      },
-    ],
-  },
-  {
-    id: publicFun.buildGuid(),
-    type: "预设模型",
-    children: [
-      {
-        id: publicFun.buildGuid(),
-        type: "土地资源",
-        children: [
-          {
-            id: publicFun.buildGuid("soil"),
-            type: "基本农田被违规占用",
-            children: [
-              {
-                id: publicFun.buildGuid("soil_label"),
-                name: "疑点1",
-              },
-              {
-                id: publicFun.buildGuid("soil_label"),
-                name: "疑点2",
-              },
-              {
-                id: publicFun.buildGuid("soil_label"),
-                name: "疑点3",
-              },
-              {
-                id: publicFun.buildGuid("soil_label"),
-                name: "疑点4",
-              },
-              {
-                id: publicFun.buildGuid("soil_label"),
-                name: "疑点5",
-              },
-            ],
-          },
-          {
-            id: publicFun.buildGuid("soil"),
-            type: "基本农田种林",
-            children: [],
-          },
-          {
-            id: publicFun.buildGuid("soil"),
-            type: "基本农田抛荒",
-            children: [],
-          },
-          {
-            id: publicFun.buildGuid("soil"),
-            type: "一般耕地被违规占用",
-            children: [],
-          },
-        ],
-      },
-      {
-        id: publicFun.buildGuid(),
-        type: "水资源",
-        children: [
-          {
-            id: publicFun.buildGuid("water"),
-            type: "河道被截断或填埋",
-            children: [],
-          },
-          {
-            id: publicFun.buildGuid("water"),
-            type: "河道范围内有施工",
-            children: [],
-          },
-          {
-            id: publicFun.buildGuid("water"),
-            type: "河道周边存在不规范养殖",
-            children: [],
-          },
-          {
-            id: publicFun.buildGuid("water"),
-            type: "渣土堆放",
-            children: [],
-          },
-          {
-            id: publicFun.buildGuid("water"),
-            type: "垃圾倾倒",
-            children: [],
-          },
-          {
-            id: publicFun.buildGuid("water"),
-            type: "违章搭建",
-            children: [],
-          },
-          {
-            id: publicFun.buildGuid("water"),
-            type: "侵占水体",
-            children: [],
-          },
-        ],
-      },
-      {
-        id: publicFun.buildGuid(),
-        type: "生态资源",
-        children: [],
-      },
-    ],
-  },
-  {
-    id: publicFun.buildGuid(),
-    type: "我的模型",
-    children: [],
-  },
-  {
-    id: publicFun.buildGuid(),
-    type: "我的图层",
-    children: [],
-  },
-];
-
-/**
- * 我的标记 -- 用户标记疑点后产生的
- */
-
-export const soilLabelData = {
-  基本农田被违规占用: [
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点1",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点2",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点3",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点4",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点5",
-    },
-  ],
-  基本农田种林: [
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点1",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点2",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点3",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点4",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点5",
-    },
-  ],
-};
-
-export const waterLabelData = {
-  河道被截断或填埋: [
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点1",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点2",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点3",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点4",
-    },
-    {
-      id: publicFun.buildGuid(),
-      name: "疑点5",
-    },
-  ],
-};
-
-/**
- * 默认的所有图层类型
- */
-export const defaultLayers = {
-  永久基本农田: {
-    id: publicFun.buildGuid("defaultLayer"),
-    cid: "yongjiu",
-    color: "#f99531",
-    url: "",
-  },
-  一般耕地: {
-    id: publicFun.buildGuid("defaultLayer"),
-    cid: "yiban",
-    color: "#f9fb4b",
-  },
-  建设用地减量化: {
-    id: publicFun.buildGuid("defaultLayer"),
-    cid: "jianshe",
-    color: "#4ac013",
-  },
-  带征地: {
-    id: publicFun.buildGuid("defaultLayer"),
-    cid: "daizheng",
-    color: "#41ebfa",
-  },
-};
-
 /**
  * 在线菜单配置
  */

+ 87 - 26
src/views/ComprehensiveAnalysis.vue

@@ -193,7 +193,7 @@
                       placement="top-start"
                     >
                       <div class="custom-tree-node-item">
-                        {{ node.label }}
+                        {{ node.data.label }}
                       </div>
                     </el-tooltip>
 
@@ -236,14 +236,13 @@
                     "
                     style="position: relative; width: 100%"
                   >
-                    <el-tooltip
-                      class="item"
-                      effect="light"
-                      :content="node.label"
-                      placement="top-start"
-                    >
+                    <el-tooltip class="item" effect="light" placement="top-end">
+                      <div slot="content">
+                        模型名称:{{ node.data.label }}<br /><br />
+                        图层构成:{{ layerToCompObj[node.data.id] || "--" }}
+                      </div>
                       <div class="custom-tree-node-item">
-                        {{ node.label }} {{ node.id }}
+                        {{ node.data.label }}
                       </div>
                     </el-tooltip>
                     <span
@@ -305,6 +304,7 @@
                   <div class="status-select" @mouseenter="panelMouseEnter(key)">
                     <div class="title">{{ key }}</div>
                     <NewSelect
+                      v-if="isSortCaseObj[key] === '预设模型'"
                       style="width: 100px"
                       :placeholder="'请选择排序方式'"
                       v-model="statusSelectVal"
@@ -442,6 +442,11 @@ export default {
   },
   data() {
     return {
+      // 判断是否显示疑点筛选弹窗
+      isSortCaseObj: {},
+      // 存储图层构成信息
+      preLayerCompMap: new Map(),
+      layerToCompObj: {},
       displaySortSelect: false,
       basemapName: "",
       caseAuditEventStatus: false,
@@ -622,7 +627,6 @@ export default {
     },
     // 监听底部菜单栏
     getJLStatus(val) {
-      console.log("监听底部菜单栏 ----- 卷帘对比", val);
       if (val) {
         this.showJLInfo = true;
       } else {
@@ -811,6 +815,9 @@ export default {
     this.townOptions = [];
     this.classDictQuery("0", "c_task_type", "任务类型");
     this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
+    setTimeout(() => {
+      this.getPreLayerApi();
+    }, 50);
     setTimeout(() => {
       this.getColumnList();
     }, 500);
@@ -901,20 +908,63 @@ export default {
     this.$bus.$off("caseAuditEvent2");
   },
   methods: {
-    // 疑点数据中增加数据来源 -- 以及id
-    addLayerDataSource(data) {
+    /**
+     * 疑点数据中增加数据来源以及id
+     * @data
+     * @mainType 判断是主目录类型
+     * @uniqueId id
+     */
+    addLayerDataSource(data, mainType, uniqueId) {
       let targetGeometry = JSON.parse(data);
       if (targetGeometry) {
         let properties = targetGeometry.properties;
         let id = targetGeometry.id;
         targetGeometry.properties["id"] = id;
-        if (!targetGeometry.properties["数据来源"] || !(targetGeometry.properties["数据来源"]==="农委")) {
+        if (
+          !targetGeometry.properties["数据来源"] ||
+          !(targetGeometry.properties["数据来源"] === "农委")
+        ) {
           targetGeometry.properties["数据来源"] = "规资";
         }
-        console.log(targetGeometry.properties);
+
+        if (
+          mainType === "预设模型" &&
+          uniqueId &&
+          this.layerToCompObj[uniqueId]
+        ) {
+          if (!targetGeometry.properties["图层构成"]) {
+            targetGeometry.properties["图层构成"] =
+              this.layerToCompObj[uniqueId];
+          }
+        }
         return JSON.stringify(targetGeometry);
       }
     },
+    // 获取预设模型图层构成接口数据
+    getPreLayerApi() {
+      let params = new FormData();
+      params.append("columnId", 1403);
+      params.append("states", "0,1,2,3");
+      params.append("pageSize", 1000);
+      params.append("page", 0);
+      this.$Post(this.urlsCollection.selectContentList, params).then((res) => {
+        if (res.code === 200 && res.content.data.length > 0) {
+          res.content.data.forEach((v, i) => {
+            let key = `${v.c_model_name}-${v.c_town}`;
+            if (!this.preLayerCompMap.has(key)) {
+              this.preLayerCompMap.set(key, {
+                c_first_level: v.c_first_level,
+                c_layer_component: v.c_layer_component,
+                c_town: v.c_town,
+                c_model_name: v.c_model_name,
+              });
+            }
+          });
+          // console.log("preLayerCompMap");
+          // console.log(this.preLayerCompMap);
+        }
+      });
+    },
     //设置图层图例 -- 图例名称及对应的id
     setLayerLegend(title, uniqueId) {
       // 生成图例时设置初始化图层颜色 -- 叠置分析的图层
@@ -1100,6 +1150,7 @@ export default {
       this.targetLayerPage = {};
       this.originalDataMap.clear();
       this.originalData = {};
+      this.isSortCaseObj = {};
       map2DViewer.map.off("move");
       // 所有图层或预设模型全部删除
       if (Object.getOwnPropertyNames(map2DViewer.analysisGroups).length > 0) {
@@ -1139,7 +1190,6 @@ export default {
     panelMouseEnter(val) {
       if (this.rightPanelDataMap.has(val)) {
         this.enteredPanelId = val;
-        console.log(this.enteredPanelId, "enteredPanelId");
         this.enteredColumnId = this.rightPanelDataMap.get(val).id;
         this.enteredMainType = this.rightPanelDataMap.get(val).mainType;
         this.enteredSourceType = this.rightPanelDataMap.get(val).sourceType;
@@ -1257,7 +1307,11 @@ export default {
 
               changeCaseStatusArr.forEach((ele) => {
                 let cid = ele.id;
-                let geometry = this.addLayerDataSource(ele.c_content);
+                let geometry = this.addLayerDataSource(
+                  ele.c_content,
+                  mainType,
+                  uniqueId
+                );
                 let defaultStatus = ele.c_boolean;
                 let modelId = ele.model_id;
                 let columnId = ele.column_id;
@@ -1290,6 +1344,7 @@ export default {
               this.activeNames = ["myLabel", uniqueId];
               // 用于分页数据
               this.originalData[uniqueId] = this.originalDataMap.get(uniqueId);
+              this.isSortCaseObj[uniqueId] = mainType;
 
               // 进行分页列表展示
               this.changeSingleLayer(
@@ -1518,6 +1573,15 @@ export default {
             }
           });
 
+          // 将预设模型的图层与图层构成数据进行匹配
+          defaultModelNameMap.forEach((v, i) => {
+            let key = `${i.split("-")[0]}-${i.split("-")[1]}`;
+            if (this.preLayerCompMap.has(key)) {
+              this.layerToCompObj[v] =
+                this.preLayerCompMap.get(key).c_layer_component;
+            }
+          });
+
           // 获取我的模型数据
           let oldOptions = [];
           this.getMyModelData();
@@ -1527,10 +1591,6 @@ export default {
                 value: i,
                 label: i,
               });
-              // this.townOptions.push({
-              //   value: i,
-              //   label: i,
-              // });
             }
           });
 
@@ -2088,7 +2148,11 @@ export default {
                   // 请求到数据后直接渲染点
                   changeCaseStatusArr.forEach((ele) => {
                     let cid = ele.id;
-                    let geometry = this.addLayerDataSource(ele.c_content);
+                    let geometry = this.addLayerDataSource(
+                      ele.c_content,
+                      data.mainType,
+                      uniqueId
+                    );
 
                     let modelId = ele.model_id;
                     let columnId = ele.column_id;
@@ -2113,7 +2177,7 @@ export default {
                 // 我的模型数据进行分页列表展示
                 this.originalData[uniqueId] =
                   this.originalDataMap.get(uniqueId);
-
+                this.isSortCaseObj[uniqueId] = data.mainType;
                 // 进行分页列表展示
                 this.changeSingleLayer(
                   1,
@@ -2163,12 +2227,9 @@ 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];
+          delete this.isSortCaseObj[data.id];
         }
       }