zpf 1 an în urmă
părinte
comite
19e817aa59
2 a modificat fișierele cu 37 adăugiri și 8 ștergeri
  1. 11 4
      src/views/cockpit/gdbh.vue
  2. 26 4
      src/views/cockpit/wpjg.vue

+ 11 - 4
src/views/cockpit/gdbh.vue

@@ -136,7 +136,7 @@
             </div>
             <div class="text">
               <p>面积变化</p>
-              <span>{{ (zbpg_hz.jcpg.lrgd - zbpg_hz.jcpg.lcgd).toFixed(2) }}</span>km²
+              <span>{{ mjbh }}</span>km²
 
             </div>
           </div>
@@ -208,6 +208,7 @@ export default {
     return {
       sdata: {},
       tab: 'gdxz',
+      mjbh: null,
       options: [
         { value: "gdxz", label: "耕地现状" },
         { value: "zbph", label: "占补平衡" },
@@ -646,7 +647,7 @@ export default {
       store.setCockpit_vector({
         title: "进出平衡",
         tableData: [],
-        word:"地类编码名称",
+        word: "地类编码名称",
         tablejscType: 'jsc_tdgy_gy_zbmx',
         columns: [
           "进出状态",
@@ -680,9 +681,15 @@ export default {
         id: params ? params.id : '4602',
         val0: store.state.cockpit_date[1].slice(0, 4)
       });
-      this.zbpg_hz.jcpg.lrgd = res.data.lrgd == '暂无' ? 0 : res.data.lrgd
-      this.zbpg_hz.jcpg.lcgd = res.data.lcgd == '暂无' ? 0 : res.data.lcgd
+      this.zbpg_hz.jcpg.lrgd = res.data.lrgd == '暂无' || res.data.lrgd == 0 ? '暂无' : res.data.lrgd
+      this.zbpg_hz.jcpg.lcgd = res.data.lcgd == '暂无' || res.data.lcgd == 0 ? '暂无' : res.data.lcgd
+      if (this.zbpg_hz.jcpg.lrgd == '暂无' || this.zbpg_hz.jcpg.lcgd == '暂无') {
+        this.mjbh = '暂无';
 
+      } else {
+        this.mjbh = (zbpg_hz.jcpg.lrgd - zbpg_hz.jcpg.lcgd).toFixed(2);
+
+      }
       this.zbpg_hz.jcpg.lc_st = res.data.lc_st == '暂无' ? 0 : res.data.lc_st
       this.zbpg_hz.jcpg.lc_hd = res.data.lc_hd == '暂无' ? 0 : res.data.lc_hd
       this.zbpg_hz.jcpg.lc_sjd = res.data.lc_sjd == '暂无' ? 0 : res.data.lc_sjd

+ 26 - 4
src/views/cockpit/wpjg.vue

@@ -15,11 +15,11 @@
       </div>
       <div class="item">
         <span class="dlabel">违法占地:</span>
-        <span class="dvalue">{{ (title.wf_mj / 1000).toFixed(2) || 0 }}k㎡</span>
+        <span class="dvalue">{{ wf_mj_computed }}</span>
       </div>
       <div class="item">
         <span class="dlabel"> 违法率:</span>
-        <span class="dvalue">{{ title.wfl || 0 }}%</span>
+        <span class="dvalue">{{ wfl_computed }}</span>
       </div>
     </div>
     <div id="wpjg_echart" v-show="xzqh_flag"></div>
@@ -51,8 +51,7 @@ export default {
       xzqh_flag: true
     };
   },
-  //监听属性 类似于data概念
-  computed: {},
+
   //监控data中的数据变化
   watch: {},
 
@@ -590,6 +589,29 @@ export default {
       });
     },
   },
+  computed: {
+    // 计算属性的 getter  
+    wfl_computed: function () {
+      // `this` 指向 vm 实例
+      if (this.title.wfl != 0) {
+        return this.title.wfl + '%'
+
+      } else {
+        return '暂无'
+
+      }
+    },
+    wf_mj_computed: function () {
+      // `this` 指向 vm 实例
+      if ((this.title.wf_mj / 1000).toFixed(2) > 0) {
+        return (this.title.wf_mj / 1000).toFixed(2) + 'k㎡'
+
+      } else {
+        return '暂无'
+
+      }
+    }
+  },
   mounted() {
     this.$nextTick((res) => {
       this.init_wpjg_title();