ソースを参照

首页Card数据显示异常BUG修复。

DESKTOP-6LTVLN7\Liumouren 2 年 前
コミット
c6986b8275

+ 39 - 83
src/components/common/BottomMenus.vue

@@ -1,39 +1,21 @@
 <template>
   <div id="bottomMenus">
     <!-- 底部菜单动态SVG底座 -->
-    <BottomMenuSvg
-      id="svgBox"
-      @changeShowBottomMenusStatus="changeShowBottomMenusStatus()"
-    />
+    <BottomMenuSvg id="svgBox" @changeShowBottomMenusStatus="changeShowBottomMenusStatus()" />
     <!-- 申请任务弹窗 -->
-    <CreateTaskForm
-      ref="sqrw"
-      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
-    />
+    <CreateTaskForm ref="sqrw" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
     <!-- 我的任务弹窗 -->
-    <MyMission
-      ref="wdrw"
-      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
-    />
+    <MyMission ref="wdrw" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
     <!-- 同屏对比弹窗 -->
-    <SameScreenComparison
-      ref="tpdb"
-      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
-    />
+    <SameScreenComparison ref="tpdb" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
     <!-- 上传数据弹窗 -->
     <!-- <UploadingData
       ref="scsj"
       @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
     /> -->
-    <UploadingDataShp
-      ref="scsj"
-      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
-    />
+    <UploadingDataShp ref="scsj" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
     <!-- 报告输出弹窗 -->
-    <ReportOutput
-      ref="ReportOutput"
-      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
-    />
+    <ReportOutput ref="ReportOutput" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
     <!-- 自定义模型 -->
     <CustomModelDialog />
     <!-- 底部菜单主体 -->
@@ -42,7 +24,7 @@
       :style="{
         width: showBottomMenusStatus ? '981px' : '0px',
         height: showBottomMenusStatus ? '200px' : '0px',
-        border: showBottomMenusStatus ? '1px solid #00aaff' : 'none',
+        border: showBottomMenusStatus ? '1px solid #00aaff' : 'none'
       }"
     >
       <!-- 模块遍历渲染也是menus对象的第一层数组 -->
@@ -65,21 +47,11 @@
             :key="subIndex"
           >
             <!-- 选中状态的背景高亮(舍弃) -->
-            <div
-              :class="
-                ifMenuIndex(item.index, subItem) ? 'colBtuMenuShadow' : ''
-              "
-            ></div>
+            <div :class="ifMenuIndex(item.index, subItem) ? 'colBtuMenuShadow' : ''"></div>
 
             <!-- 子菜单图标的选择性渲染 -->
-            <el-image
-              class="BtuMenu_hover"
-              :src="returnBgImage(subItem.bgImage + '-a')"
-            ></el-image>
-            <el-image
-              class="BtuMenu"
-              :src="returnBgImage(subItem.bgImage)"
-            ></el-image>
+            <el-image class="BtuMenu_hover" :src="returnBgImage(subItem.bgImage + '-a')"></el-image>
+            <el-image class="BtuMenu" :src="returnBgImage(subItem.bgImage)"></el-image>
             <!-- 子菜单标题 -->
             <div class="BtuMenu_title">
               {{ subItem.title }}
@@ -115,7 +87,7 @@ export default {
     UploadingData,
     UploadingDataShp,
     CustomModelDialog,
-    ReportOutput,
+    ReportOutput
   },
   data() {
     return {
@@ -131,8 +103,8 @@ export default {
           title: "任务申请",
           subMenu: [
             { index: 0, title: "申请任务", bgImage: "sqrw", clickRef: "sqrw" },
-            { index: 1, title: "我的任务", bgImage: "wdrw", clickRef: "wdrw" },
-          ],
+            { index: 1, title: "我的任务", bgImage: "wdrw", clickRef: "wdrw" }
+          ]
         },
         {
           index: 1,
@@ -144,13 +116,13 @@ export default {
               title: "疑点审计",
               bgImage: "ydsj",
               clickEmit: "caseAuditEvent",
-              isForbidden: false,
+              isForbidden: false
             },
             {
               index: 1,
               title: "标记疑点",
               bgImage: "bjyd",
-              isForbidden: false,
+              isForbidden: false
               // clickEmit: "labelCaseEvent"
             },
             {
@@ -158,7 +130,7 @@ export default {
               title: "同屏对比",
               bgImage: "tpdb",
               clickRef: "tpdb",
-              isForbidden: false,
+              isForbidden: false
             },
             {
               index: 3,
@@ -166,7 +138,7 @@ export default {
               bgImage: "jldb",
               clickEmit: "JLControl",
               stateKey: "jlActiveState",
-              isForbidden: false,
+              isForbidden: false
             },
             { index: 4, title: "上传数据", bgImage: "scsj", clickRef: "scsj" },
             {
@@ -174,9 +146,9 @@ export default {
               title: "自定义模型",
               bgImage: "zdymx",
               clickEmit: "customModelEvent",
-              isForbidden: false,
-            },
-          ],
+              isForbidden: false
+            }
+          ]
         },
         {
           index: 2,
@@ -187,9 +159,9 @@ export default {
               index: 0,
               title: "报告输出",
               bgImage: "bgsc",
-              clickRef: "ReportOutput",
-            },
-          ],
+              clickRef: "ReportOutput"
+            }
+          ]
         },
         {
           index: 3,
@@ -200,11 +172,11 @@ export default {
               index: 0,
               title: "发到手机",
               bgImage: "fdsj",
-              clickEmit: "notFound",
-            },
-          ],
-        },
-      ],
+              clickEmit: "notFound"
+            }
+          ]
+        }
+      ]
     };
   },
   mounted() {
@@ -227,8 +199,7 @@ export default {
       } else if (index == 1) {
         if (subItem.index === 0 || subItem.index === 1) {
           return (
-            this.$store.state.bottomMenuIndexs.index == index &&
-            this.$store.state.bottomMenuIndexs.subIndex == subItem.index
+            this.$store.state.bottomMenuIndexs.index == index && this.$store.state.bottomMenuIndexs.subIndex == subItem.index
           );
         }
       }
@@ -237,17 +208,14 @@ export default {
     changeBottomMenu(index, item) {
       // 该逻辑可能会舍弃
       if (item.stateKey != undefined) {
-        this.$store.commit(
-          "changeJlActiveState",
-          !this.$store.state[item.stateKey]
-        );
+        this.$store.commit("changeJlActiveState", !this.$store.state[item.stateKey]);
       } else {
         // 疑点审计按钮禁止点击事件
         if (item.title === "疑点审计") {
           if (!item.isForbidden) {
             this.$store.commit("changeBottomMenu", {
               index: index,
-              subIndex: item.index,
+              subIndex: item.index
             });
           }
           if (item.isForbidden) {
@@ -256,7 +224,7 @@ export default {
         } else {
           this.$store.commit("changeBottomMenu", {
             index: index,
-            subIndex: item.index,
+            subIndex: item.index
           });
         }
       }
@@ -264,20 +232,14 @@ export default {
         // 调用全局事件总线中的指定事件
         this.$bus.$emit(item.clickEmit);
       }
-      if (
-        (item.clickEmit ? item.clickEmit != "notFound" : true) &&
-        item.clickRef
-      ) {
+      if ((item.clickEmit ? item.clickEmit != "notFound" : true) && item.clickRef) {
         // 调用全局事件总线中的指定事件
         this.$refs[item.clickRef].changeShowBottomMenusStatus();
       }
     },
     // 根据菜单参数bgImage,菜单父级index和子菜单index,判断全局变量已选中底部菜单的index对比,返回不同状态下的icon图标地址。
     returnBgImage(bgImage, index, subIndex) {
-      if (
-        this.$store.state.bottomMenuIndexs.index == index &&
-        this.$store.state.bottomMenuIndexs.subIndex == subIndex
-      ) {
+      if (this.$store.state.bottomMenuIndexs.index == index && this.$store.state.bottomMenuIndexs.subIndex == subIndex) {
         return "/static/images/bottomMenuIcon/" + bgImage + "-a.png";
       } else {
         return "/static/images/bottomMenuIcon/" + bgImage + ".png";
@@ -295,21 +257,20 @@ export default {
         // 否则直接切换底部菜单显示隐藏状态
         this.showBottomMenusStatus = !this.showBottomMenusStatus;
       }
-    },
+    }
   },
   watch: {
     "$store.state.preModelLayerMap": {
       handler(val) {
-        console.log(val);
         if (val.length === 1) {
           this.menus[1].subMenu[0].isForbidden = false;
         }
         if (val.length > 1) {
           this.menus[1].subMenu[0].isForbidden = true;
         }
-      },
-    },
-  },
+      }
+    }
+  }
 };
 </script>
 
@@ -397,12 +358,7 @@ export default {
       display: flex;
       justify-content: center;
       align-items: center;
-      background-image: linear-gradient(
-        to left,
-        @topTitleMinLeft,
-        @borderColor,
-        @topTitleMinLeft
-      );
+      background-image: linear-gradient(to left, @topTitleMinLeft, @borderColor, @topTitleMinLeft);
       font-size: 16px;
       font-family: pingfangSC;
       font-weight: 300;

+ 1 - 2
src/components/layout/MenuCard.vue

@@ -515,7 +515,7 @@ export default {
       params.append("paramJson", JSON.stringify(paramJson));
       let sortparam = [{ field: "c_years", orderByType: 1 }];
       params.append("orderBy", JSON.stringify(sortparam));
-      let resData = [];
+      let resData = Object.assign([], this.menuData.topSolt.commonData);
       this.$Post(this.menuCardData.getUrl, params).then(
         res => {
           if (res.code === 200 && res.content !== "数据为空" && res.content.data.length > 0) {
@@ -546,7 +546,6 @@ export default {
                 resData.push(itemData);
               }
             });
-            console.log(resData);
             this.menuData.topSolt.commonData = resData;
           }
           this.dataInitLoading = false;

+ 41 - 54
src/components/map/Map.vue

@@ -9,7 +9,7 @@ export default {
     return {
       map: "",
       layers: "",
-      polygon: [],
+      polygon: []
     };
   },
   mounted() {
@@ -17,14 +17,14 @@ export default {
     this.$nextTick(() => {
       this.mapInit();
       let that = this;
-      this.map.on("move", (e) => {
+      this.map.on("move", e => {
         if (that.index == that.mouseIndex) {
           let center = that.map.getCenter();
           let zoom = that.map.getZoom();
           this.$emit("changeCenterZoom", {
             center: [center.lat, center.lng],
             zoom: zoom,
-            index: that.index,
+            index: that.index
           });
         }
       });
@@ -36,41 +36,35 @@ export default {
     addSinglePolygon(state) {
       this.$nextTick(() => {
         if (!state && this.polygon) {
-          this.polygon.forEach((item) => {
+          this.polygon.forEach(item => {
             this.map.removeLayer(item);
           });
           this.addSinglePolygon(true);
-        } else if (
-          this.$store.state.selectSelectDataMap &&
-          this.$store.state.selectSelectDataMap.singlePolygon
-        ) {
-          for (let item in this.$store.state.selectSelectDataMap
-            .singlePolygon) {
-            this.$store.state.selectSelectDataMap.singlePolygon[item].forEach(
-              (v) => {
-                // 叠置分析后的图层
-                if (v.uniqueId.indexOf("overlay") > -1) {
-                  let geometry = JSON.parse(v.geometry);
-                  this.readGeojson(geometry, v.color);
-                } else {
-                  // 常规图层
-                  let geometry = v.geometry;
-                  // 经纬度等上海2000转为经纬度坐标后再重新修改
-                  let coord = JSON.parse(geometry).geometry.coordinates[0];
-                  let correctCoord = publicFun.latLngsCorrection(coord);
-                  let coordinates = publicFun.latLngsToReverse(correctCoord);
-                  console.log(coord, correctCoord, coordinates);
-                  let polygon = L.polygon(coordinates, {
-                    color: v.color,
-                    weight: 3,
-                    fillColor: v.color,
-                    opacity: 1,
-                    fillOpacity: 0,
-                  }).addTo(this.map);
-                  this.polygon.push(polygon);
-                }
+        } else if (this.$store.state.selectSelectDataMap && this.$store.state.selectSelectDataMap.singlePolygon) {
+          for (let item in this.$store.state.selectSelectDataMap.singlePolygon) {
+            this.$store.state.selectSelectDataMap.singlePolygon[item].forEach(v => {
+              console.log("map>:v", v);
+              // 叠置分析后的图层
+              if (v.uniqueId.indexOf("overlay") > -1) {
+                let geometry = JSON.parse(v.geometry);
+                this.readGeojson(geometry, v.color);
+              } else {
+                // 常规图层
+                let geometry = v.geometry;
+                // 经纬度等上海2000转为经纬度坐标后再重新修改
+                let coord = JSON.parse(geometry).geometry.coordinates[0];
+                let correctCoord = publicFun.latLngsCorrection(coord);
+                let coordinates = publicFun.latLngsToReverse(correctCoord);
+                let polygon = L.polygon(coordinates, {
+                  color: v.color,
+                  weight: 3,
+                  fillColor: v.color,
+                  opacity: 1,
+                  fillOpacity: 0
+                }).addTo(this.map);
+                this.polygon.push(polygon);
               }
-            );
+            });
           }
         }
       });
@@ -83,7 +77,7 @@ export default {
       let geojsonData = L.geoJSON(states, {
         style: function (feature) {
           return { color: color };
-        },
+        }
       }).addTo(this.map);
       this.polygon.push(geojsonData);
     },
@@ -93,14 +87,12 @@ export default {
         "+proj=tmerc +lat_0=0 +lon_0=121.2751921 +k=1 +x_0=0 +y_0=-3457147.81 +ellps=krass +units=m +no_defs",
         {
           resolutions: [
-            132.2919312505292, 52.91677250021167, 26.458386250105836,
-            13.229193125052918, 5.291677250021167, 2.6458386250105836,
-            1.3229193125052918, 0.5291677250021167, 0.26458386250105836,
-            0.13229193125052918, 0.0529167725002, 0.0264583862501,
-            0.0132291931251, 0.00529167725, 0.002645838625, 0.0013229193125,
+            132.2919312505292, 52.91677250021167, 26.458386250105836, 13.229193125052918, 5.291677250021167, 2.6458386250105836,
+            1.3229193125052918, 0.5291677250021167, 0.26458386250105836, 0.13229193125052918, 0.0529167725002, 0.0264583862501,
+            0.0132291931251, 0.00529167725, 0.002645838625, 0.0013229193125
           ],
           origin: [-66000, 75000],
-          bounds: L.bounds([-65000, -76000], [75000, 72000]),
+          bounds: L.bounds([-65000, -76000], [75000, 72000])
         }
       );
       this.map = L.map(this.$refs.map, {
@@ -109,13 +101,11 @@ export default {
         minZoom: 0,
         maxZoom: 14,
         attributionControl: false,
-        zoomControl: false,
+        zoomControl: false
       }).setView(map2DViewer.map.getCenter(), map2DViewer.map.getZoom());
 
       //添加默认图层
-      let layer = this.$store.state.mapMethodsCollection
-        .get("RENDER")
-        .addTiledMapLayer(this.mapUrl);
+      let layer = this.$store.state.mapMethodsCollection.get("RENDER").addTiledMapLayer(this.mapUrl);
       this.layers = layer;
     },
     setView: function (coord, zoom) {
@@ -129,15 +119,12 @@ export default {
       this.$nextTick(() => {
         if (this.map) {
           this.map.removeLayer(this.layers);
-          let layer = this.$store.state.mapMethodsCollection
-            .get("RENDER")
-            .addTiledMapLayer(this.mapUrl)
-            .addTo(this.map);
+          let layer = this.$store.state.mapMethodsCollection.get("RENDER").addTiledMapLayer(this.mapUrl).addTo(this.map);
           this.layers = layer;
           this.map.invalidateSize(true);
         }
       });
-    },
+    }
   },
   watch: {
     centerZoom: {
@@ -146,7 +133,7 @@ export default {
           this.setView(newValue.center, newValue.zoom);
         }
       },
-      deep: true,
+      deep: true
     },
     centerZoomInit: {
       handler(newValue, oldValue) {
@@ -155,9 +142,9 @@ export default {
           this.map.setView(center, newValue.zoom);
         }
       },
-      deep: true,
-    },
-  },
+      deep: true
+    }
+  }
 };
 </script>
 <style scoped>

+ 16 - 16
src/config/common.js

@@ -584,35 +584,35 @@ export const menuOnLine = {
         // commonDataGetUrl: "layout_land.json",
         commonData: [
           {
-            title: "基本农田面积",
+            title: "永久基本农田",
             unit: "km²",
-            categoryData: [],
-            valueData: [],
+            categoryData: [0],
+            valueData: [0],
           },
           {
             title: "带征地",
             unit: "km²",
-            categoryData: [],
-            valueData: [],
+            categoryData: [0],
+            valueData: [0],
           },
           {
-            title: "减量化面积",
+            title: "减量化",
             unit: "km²",
-            categoryData: [],
-            valueData: [],
+            categoryData: [0],
+            valueData: [0],
           },
           {
             title: "设施农用地",
             unit: "km²",
-            categoryData: [],
-            valueData: [],
+            categoryData: [0],
+            valueData: [0],
           },
           {
             type: "tb",
             title: "土地资源面积",
             unit: "km²",
-            valueData: [],
-            categoryData: [],
+            valueData: [0],
+            categoryData: [0],
           },
         ],
       },
@@ -653,14 +653,14 @@ export const menuOnLine = {
           },
           {
             type: "tb",
-            title: "区管河道数量",
+            title: "区管河道",
             unit: "条",
             categoryData: [],
             valueData: [],
           },
           {
             type: "tb",
-            title: "镇管河道数量",
+            title: "镇管河道",
             unit: "条",
             categoryData: [],
             valueData: [],
@@ -697,14 +697,14 @@ export const menuOnLine = {
         commonData: [
           {
             type: "lr",
-            title: "林地面积",
+            title: "林",
             unit: "km²",
             categoryData: [],
             valueData: [],
           },
           {
             type: "lr",
-            title: "公益林面积",
+            title: "项目化造林",
             unit: "km²",
             categoryData: [],
             valueData: [],