فهرست منبع

首页资金投入情况添加后台接口调用。

DESKTOP-6LTVLN7\Liumouren 2 سال پیش
والد
کامیت
2590748213
4فایلهای تغییر یافته به همراه67 افزوده شده و 30 حذف شده
  1. 3 28
      src/components/common/TagTableCard.vue
  2. 62 1
      src/components/layout/MenuCard.vue
  3. 1 0
      src/config/common.js
  4. 1 1
      src/views/HomeView.vue

+ 3 - 28
src/components/common/TagTableCard.vue

@@ -60,31 +60,15 @@ export default {
   components: { TagCard },
   data() {
     return {
-      resData: {},
       mousemoveIndex: 0
     };
   },
-  mounted() {
-    if (this.getDataUrl) {
-      this.$Get("/static/json/home/" + this.getDataUrl).then(
-        res => {
-          this.resData = res;
-          console.log("this.data", this.resData);
-        },
-        error => {
-          console.log("error:", error);
-        }
-      );
-    }
-  },
+  mounted() {},
   /**
    * data:TagCard组件参数
    */
-  props: ["echartData", "getDataUrl"],
+  props: ["echartData"],
   methods: {
-    changeHomeSpecialTown(){
-
-    },
     mousemoveEvent(index) {
       if (this.mousemoveIndex != index) {
         this.mousemoveIndex = index;
@@ -95,16 +79,7 @@ export default {
       console.log("预留事件,主要是阻止click冒泡!");
     }
   },
-  watch: {
-    "$store.state.homeSpecialTown": {
-      handler() {
-        this.$nextTick(() => {
-          this.changeHomeSpecialTown();
-        });
-      },
-      deep: true
-    }
-  }
+  watch: {}
 };
 </script>
 

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

@@ -74,7 +74,6 @@
       <div class="menuMainBox_main_top" v-if="menuData.topSolt">
         <TagTableCard
           v-if="menuData.topSolt.commonName == 'TagTableCard'"
-          :getDataUrl="menuData.topSolt.commonDataGetUrl"
           :echartData="menuData.topSolt.commonData"
           @changeMousemoveIndex="changeMousemoveIndex"
         />
@@ -138,6 +137,47 @@ export default {
   },
   mounted() {
     this.$nextTick(() => {
+      if (this.menuData && this.menuData.topSolt && this.menuData.topSolt.commonDataGetUrl) {
+        this.$Get("/static/json/home/" + this.menuData.topSolt.commonDataGetUrl).then(
+          res => {
+            this.resData = res;
+          },
+          error => {
+            console.log("error:", error, this.menuData);
+          }
+        );
+      } else if (this.menuData && this.menuData.topSolt && this.menuData.topSolt.columnId) {
+        let params = new FormData();
+        this.countUser = 0;
+        params.append("columnId", this.menuData.topSolt.columnId);
+        params.append("states", "2,3");
+        params.append("pageSize", 999);
+        params.append("page", 0);
+        this.$Post(this.urlsCollection.selectContentList, params).then(
+          res => {
+            if (res.code === 200 && res.content.data.length > 0) {
+              let listMap = {}
+              let tableData = res.content.data;
+              tableData.forEach(item=>{
+                if(listMap[item.street]){
+                  console.log("添加数据!");
+                }else{
+                  let listMapItem = {};
+                  listMapItem['categoryData'] = item.c_year;
+                  listMapItem['valueData'] = item.c_year;
+                  listMap[item.street] = listMapItem;
+                }
+              })
+              console.log("tableData:", tableData);
+            } else {
+              let tableData = [];
+            }
+          },
+          error => {
+            console.log("error:", error, this.menuData);
+          }
+        );
+      }
       // 只有第一次创建该页面,或刷新页面时。
       if (this.menuData.menuIndex) {
         if (this.$ifMenu(this.menuData.menuIndex, this.menuData.subMenuIndex)) {
@@ -187,6 +227,19 @@ export default {
    */
   props: ["menuData"],
   methods: {
+    // 切换街镇时
+    changeHomeSpecialTown() {
+      if (this.resData) {
+        this.resData.forEach(item => {
+          if (this.$store.state.homeSpecialTown == item.name && item.data.length > 0) {
+            this.$message.info("土地资源数据开始解析!");
+            // item.data.forEach(dataItem=>{
+
+            // })
+          }
+        });
+      }
+    },
     // 当用户使用光标切换交互组件时触发
     changeMousemoveIndex(index) {
       if (this.chartCardDataIndex != index) {
@@ -316,6 +369,14 @@ export default {
         });
       },
       deep: true
+    },
+    "$store.state.homeSpecialTown": {
+      handler() {
+        this.$nextTick(() => {
+          this.changeHomeSpecialTown();
+        });
+      },
+      deep: true
     }
   }
 };

+ 1 - 0
src/config/common.js

@@ -758,6 +758,7 @@ export const menusMap = {
       minDomWidth: 1000,
       topSolt: {
         commonName: "TagCard",
+        columnId: 91,
         commonData: [
           {
             type: "lr",

+ 1 - 1
src/views/HomeView.vue

@@ -327,7 +327,7 @@ export default {
     },
     // home页面下拉框
     homeSelect(val) {
-      console.log(val, "current street");
+      this.$store.commit("changeHomeSpecialTown", val);
       if (val === "全部") {
         this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 10);
       } else {