Ver Fonte

商服用地,工业用地

zpf há 1 ano atrás
pai
commit
1d938e576a
2 ficheiros alterados com 19 adições e 19 exclusões
  1. 5 1
      src/store/store.js
  2. 14 18
      src/views/cockpit/tdsy.vue

+ 5 - 1
src/store/store.js

@@ -58,7 +58,11 @@ var store2 = {
                 xdata: [],
                 result: [],
             },
-            jt_jg:[]
+            jt_jg:{
+                "商服用地":{},
+                "工业用地":{},
+
+            }
         },
         cockpit_hysy: {//海域使用
             info: {

+ 14 - 18
src/views/cockpit/tdsy.vue

@@ -179,28 +179,24 @@ export default {
         id: params ? params.id : '4602'
       };
       let data = await QueryList(obj);
-      let arr = [];
       data.data.forEach((res) => {
-        arr.push(
-          {
-            type: res.tdyt,
-            data: [{
-              name: "未供应", value: res.ce_crmj
-            },
-            { name: "已供应", value: res.sj_crmj }]
-          }
-        )
+        let obj_echart = {
+          type: res.tdyt,
+          data: [{
+            name: "未供应", value: res.ce_crmj
+          },
+          { name: "已供应", value: res.sj_crmj }]
+        };
 
-      })
-      store.state.cockpit_tdgy.jt_jg = arr;
-      console.log('store.state.cockpit_tdgy.jt_jg: ', store.state.cockpit_tdgy.jt_jg);
+        if (obj_echart.type == "商服用地") {
+          store.state.cockpit_tdgy.jt_jg.商服用地 = obj_echart
+          this.$refs.tdgy_echart_sfyd.setOptions(store.state.cockpit_tdgy.jt_jg.商服用地.data);
 
-      store.state.cockpit_tdgy.jt_jg.forEach((res) => {
-        if (res.type == "商业商服") {
-          this.$refs.tdgy_echart_sfyd.setOptions(res.data);
         }
-        if (res.type == "工业用地") {
-          this.$refs.tdgy_echart_gyyd.setOptions(res.data);
+        if (obj_echart.type == "工业用地") {
+          store.state.cockpit_tdgy.jt_jg.工业用地 = obj_echart
+
+          this.$refs.tdgy_echart_gyyd.setOptions(store.state.cockpit_tdgy.jt_jg.工业用地.data);
 
         }
       })