Quellcode durchsuchen

统计数据详情带区域属性

gcz vor 2 Jahren
Ursprung
Commit
d4e1c94635
1 geänderte Dateien mit 17 neuen und 11 gelöschten Zeilen
  1. 17 11
      src/components/numerical.vue

+ 17 - 11
src/components/numerical.vue

@@ -1,5 +1,5 @@
 <!--
- * @LastEditors: wangcc
+ * @LastEditors: gcz
 -->
 <template>
   <div class="numerical" ref="numericalRef">
@@ -36,6 +36,7 @@
       <el-table
         :key="hotKey"
         :data="detailsData"
+        empty-text="该区域暂无数据"
         style="width: 100%;overflow-y: auto;"
         height="240"
       >
@@ -96,6 +97,11 @@ export default {
   methods: {
     showDetails(item) {
       // console.log('pageName',this.pageName);
+      let param={
+        cityId: this.$store.state.addr.selectCity.areaId,
+        countyId: this.$store.state.addr.selectDistrict.areaId,
+        townId: this.$store.state.addr.selectStreet.areaId
+      };
 
       //排除触发字段
       let excludeArr = ['优势树种'];
@@ -108,46 +114,46 @@ export default {
         treeSpecies: this.getTreeSpeciesData,
         economics: this.getEconomicsData
       };
-      page[this.pageName] && page[this.pageName]();
+      page[this.pageName] && page[this.pageName](param);
     },
     unShowDetails() {
       this.isShowDetails = false;
     },
-    getForestData() {
+    getForestData(param) {
       this.isShowDetails = true;
-      forestFarmDetail()
+      forestFarmDetail(param)
         .then((res) => {
           let resData = res.rows;
           this.detailsData = resData;
           // console.log('forestFarmDetail res',this.detailsData);
 
-          this.getHeaderList(resData);
+          resData.length>0 ? this.getHeaderList(resData):this.headerList=[];
         })
         .catch((err) => {
           console.log('forestFarmDetail err', err);
         });
     },
-    getTreeSpeciesData() {
+    getTreeSpeciesData(param) {
       this.isShowDetails = true;
-      treeListDetail()
+      treeListDetail(param)
         .then((res) => {
           let resData = res.data;
           this.detailsData = resData;
           // console.log('treeListDetail res',this.detailsData);
-          this.getHeaderList(resData);
+         resData.length>0 ? this.getHeaderList(resData):this.headerList=[];
         })
         .catch((err) => {
           console.log('treeListDetail err', err);
         });
     },
-    getEconomicsData() {
+    getEconomicsData(param) {
       this.isShowDetails = true;
-      baseItemDetail()
+      baseItemDetail(param)
         .then((res) => {
           let resData = res.rows;
           this.detailsData = resData;
           console.log('baseItemDetail res', this.detailsData);
-          this.getHeaderList(resData);
+          resData.length>0 ? this.getHeaderList(resData):this.headerList=[];
         })
         .catch((err) => {
           console.log('baseItemDetail err', err);