瀏覽代碼

首页数据处理

DESKTOP-6LTVLN7\Liumouren 2 年之前
父節點
當前提交
193d9a3a32

+ 7 - 8
public/static/json/home/layout_forest.json

@@ -76,40 +76,39 @@
         ]
     },
     {
-        "name": "万祥镇",
-        "pid": 310115143000,
+        "name": "全部",
         "data": [
             {
                 "year": 2018,
                 "type": "林地面积",
-                "area": 1.44
+                "area": 183.81
             },
             {
                 "year": 2018,
                 "type": "公益林面积",
-                "area": 0.33
+                "area": 12.16
             }
             ,
             {
                 "year": 2019,
                 "type": "林地面积",
-                "area": 1.42
+                "area": 183.82
             },
             {
                 "year": 2019,
                 "type": "公益林面积",
-                "area": 0.37
+                "area": 12.14
             }
             ,
             {
                 "year": 2020,
                 "type": "林地面积",
-                "area": 1.46
+                "area": 183.82
             },
             {
                 "year": 2020,
                 "type": "公益林面积",
-                "area": 0.38
+                "area": 12.15
             }
         ]
     }

+ 1 - 2
src/components/common/TagCard.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 外边框 -->
   <div class="tagMainBox">
-    <div v-if="data" @mousemove="mousemoveEvent(index)" @click.stop="clickStop()">
+    <div @mousemove="mousemoveEvent(index)" @click.stop="clickStop()">
       <!-- 上下布局 -->
       <div v-if="data.type !== 'lr'" class="tbFlx">
         <div class="tagValue">
@@ -27,7 +27,6 @@
         </div>
       </div>
     </div>
-    <el-empty v-else description="暂无数据"></el-empty>
   </div>
 </template>
 

+ 1 - 1
src/components/common/TopCard.vue

@@ -4,7 +4,7 @@
       <div class="Top_box_name">{{ "TOP" + (index + 1) }}</div>
       <div class="Top_box_main">
         <div class="Top_box_main_title">{{ items[columnName] }}</div>
-        <div><el-progress :percentage="items.number" :stroke-width="10" :show-text="false"></el-progress></div>
+        <div><el-progress :percentage="items.number >= 100 ? 100 : items.number" :stroke-width="10" :show-text="false"></el-progress></div>
       </div>
       <div class="Top_box_value">{{ items.number }}</div>
     </div>

+ 49 - 43
src/components/layout/MenuCard.vue

@@ -469,63 +469,69 @@ export default {
     },
     topData(homeSpecialTown) {
       this.dataInitLoading = true;
-      let params = new FormData();
-      params.append("columnId", this.menuData.columnId);
-      if (this.menuData.field) {
-        params.append("field", this.menuData.field);
-      }
-      params.append("states", "2,3");
-      params.append("pageSize", this.menuData.pageSize ? this.menuData.pageSize : 999);
-      params.append("page", 0);
-      if (this.menuData.paramJson) {
+      if (this.menuData.columnId) {
+        let params = new FormData();
+        params.append("columnId", this.menuData.columnId);
+        if (this.menuData.field) {
+          params.append("field", this.menuData.field);
+        }
+        params.append("states", "0,1,2,3,4");
+        params.append("pageSize", this.menuData.pageSize ? this.menuData.pageSize : 999);
+        params.append("page", 0);
         let pramJson = {};
-        if (this.menuData.paramJson.sj_select) {
-          pramJson.sj_select = this.menuData.paramJson.sj_select;
+        if (this.menuData.paramJson) {
+          if (this.menuData.paramJson.sj_select) {
+            pramJson.sj_select = this.menuData.paramJson.sj_select;
+          }
         }
         if (homeSpecialTown !== "全部") {
           let associatedItems = this.$store.state.selectSelectDataMap.associatedItems;
           if (associatedItems.length > 0) {
             associatedItems.forEach(item => {
               if (item.name === homeSpecialTown) {
-                pramJson.bsjz = item.index + "";
+                if (this.menuData.bsjzColumnName) {
+                  pramJson.c_bsjzwt = item.index + "";
+                } else {
+                  pramJson.bsjz = item.index + "";
+                }
               }
             });
           }
         }
         params.append("paramJson", JSON.stringify(pramJson));
-      }
-      if (this.menuData.sortField) {
-        let sortparam = [
-          {
-            field: this.menuData.sortField.field,
-            orderByType: this.menuData.sortField.orderByType
-          }
-        ];
-        params.append("orderBy", JSON.stringify(sortparam));
-      }
-      this.$Post(this.menuData.getUrl ? this.menuData.getUrl : this.urlsCollection.selectContentList, params).then(
-        res => {
-          this.resData = [];
-          if (res.code === 200 && res.content.length > 0) {
-            res.content.forEach((item, index) => {
-              if (this.menuData.pageSize > index) {
-                this.resData.push(item);
-              }
-            });
-            this.menuData.topData = this.resData;
-          } else {
+        if (this.menuData.sortField) {
+          let sortparam = [
+            {
+              field: this.menuData.sortField.field,
+              orderByType: this.menuData.sortField.orderByType
+            }
+          ];
+          params.append("orderBy", JSON.stringify(sortparam));
+        }
+        this.$Post(this.menuData.getUrl ? this.menuData.getUrl : this.urlsCollection.selectContentList, params).then(
+          res => {
+            this.resData = [];
+            if (res.code === 200 && res.content.length > 0) {
+              res.content.forEach((item, index) => {
+                if (this.menuData.pageSize > index) {
+                  this.resData.push(item);
+                }
+              });
+              this.menuData.topData = this.resData;
+            } else {
+              this.resData = [];
+              this.menuData.topData = this.resData;
+            }
+            this.dataInitLoading = false;
+          },
+          error => {
             this.resData = [];
             this.menuData.topData = this.resData;
+            console.log("error:", error, this.menuData);
+            this.dataInitLoading = false;
           }
-          this.dataInitLoading = false;
-        },
-        error => {
-          this.resData = [];
-          this.menuData.topData = this.resData;
-          console.log("error:", error, this.menuData);
-          this.dataInitLoading = false;
-        }
-      );
+        );
+      }
     },
     allListData(homeSpecialTown) {
       this.dataInitLoading = true;
@@ -536,7 +542,7 @@ export default {
           if (this.menuData.field) {
             params.append("field", this.menuData.field);
           }
-          params.append("states", "2,3");
+          params.append("states", "0,1,2,3,4");
           params.append("pageSize", this.menuData.pageSize ? this.menuData.pageSize : 999);
           params.append("page", 0);
           let pramJson = {};

+ 16 - 29
src/config/common.js

@@ -1185,7 +1185,10 @@ export const menuOnLine = {
         columnId: 1127,
         pageSize: 5,
         field: "c_ckwtdxwt",
-        paramJson: {},
+        pramJson: {
+          c_bsjzwt: ""
+        },
+        bsjzColumnName: "c_bsjzwt",
         topData: [
           {
             number: 0,
@@ -1510,32 +1513,13 @@ export const menuOnLine = {
         position: "right",
         minDomWidth: 1200,
         commonName: "TOP",
-        // getUrl: "/dms/content/selectGroupByCountOrderBy",
-        // columnId: 31,
-        // pageSize: 10,
-        // field: "c_zdsjsx",
+        getUrl: "/dms/content/selectGroupByCountOrderBy",
+        columnId: 1133,
+        pageSize: 10,
+        bsjzColumnName: "c_ssjzzjtr",
+        field: "c_kmc",
         paramJson: {},
-        topData: [
-          {
-            number: 0,
-            c_wtflwt: "--"
-          },
-          {
-            number: 0,
-            c_wtflwt: "--"
-          },
-          {
-            number: 0,
-            c_wtflwt: "--"
-          },
-          {
-            number: 0,
-            c_wtflwt: "--"
-          },
-          {
-            number: 0,
-            c_wtflwt: "--"
-          }]
+        topData: []
       },
       {
         type: "card",
@@ -1548,10 +1532,13 @@ export const menuOnLine = {
         minDomWidth: 1200,
         commonName: "TOP",
         getUrl: "/dms/content/selectGroupByCountOrderBy",
-        columnId: 24,
+        columnId: 1127,
         pageSize: 10,
-        field: "c_zdsjsx",
-        paramJson: {},
+        field: "c_ckwtdxwt",
+        pramJson: {
+          c_bsjzwt: ""
+        },
+        bsjzColumnName: "c_bsjzwt",
         topData: []
       }
     ]