zpf пре 1 година
родитељ
комит
c0104ea33f
3 измењених фајлова са 33 додато и 12 уклоњено
  1. 1 0
      src/main.js
  2. 18 2
      src/store/store.js
  3. 14 10
      src/views/cockpitNew1/hysy.vue

+ 1 - 0
src/main.js

@@ -27,6 +27,7 @@ import router from './router'
 import "./common/scss/globe.scss"; //全局样式
 import store2 from "@/store/store.js" // 局部变量状态管理
 window.store = store2;
+Vue.prototype.store = store2;
 
 import store from './store'
 import './utils/rem'

+ 18 - 2
src/store/store.js

@@ -30,11 +30,21 @@ var store2 = {
         vectorlayerlist: [],
         modellayerlist: [],
         chooseLayer: [],
-        flattenNames:[],//存储压平的名称数组
-        S3MList:[],
+        flattenNames: [],//存储压平的名称数组
+        S3MList: [],
         splitType: 'NONE',//分屏类型
         sceneLayerlist: [],
         flattenNames: [],//存储压平的名称数组
+        cockpit_hysy: {
+            text: {
+                xzqhdm_number: 0,
+                zhmj: 0,
+            },
+            echart: {
+                x: [],
+                bar: [],
+            }
+        }
     },
     setisInitViewer(newValue) {
         this.state.isInitViewer = newValue;
@@ -141,6 +151,12 @@ var store2 = {
     setIsEditZ(newValue) {
         this.state.isEditZ = newValue;
     },
+    setCockpitHysyEchart(newValue) {
+        this.state.cockpit_hysy.echart = newValue;
+    },
+    setCockpitHysyText(newValue) {
+        this.state.cockpit_hysy.text = newValue;
+    },
 }
 
 

+ 14 - 10
src/views/cockpitNew1/hysy.vue

@@ -20,13 +20,13 @@
                         <br>
                         出让项目</span>
                     <div class="text_item">
-                        <span class="count1">{{ label_text.xzqhdm_number }}</span>
+                        <span class="count1">{{ store.state.cockpit_hysy.text.xzqhdm_number }}</span>
                         <span class="unit">个</span>
                     </div>
 
                     <div class="text_item1">
                         <span>用海总面积</span>
-                        <span class="count2">{{ label_text.zhmj }}</span>
+                        <span class="count2">{{ store.state.cockpit_hysy.text.zhmj }}</span>
                         <span class="unit">公顷</span>
                     </div>
                 </div>
@@ -168,8 +168,9 @@ export default {
             echarts.graphic.registerShape('CubeRight', CubeRight)
             echarts.graphic.registerShape('CubeTop', CubeTop)
             echarts.graphic.registerShape('CubeBottom', CubeBottom)
-            const dataX = that.label_echart.x;
-            const barData = that.label_echart.bar;
+            const dataX = store.state.cockpit_hysy.echart.x;
+            const barData = store.state.cockpit_hysy.echart.bar;
+
             let option = {
                 //你的代码
                 backgroundColor: 'rgba(0,0,0,0)',
@@ -344,11 +345,15 @@ export default {
                 beginTime: '20240101',
                 endTime: '20240501',
                 jscType: 'jsc_hysyq_ztsh',
-                id: '460204'
+                id: '4602'
             };
             let data = await cockpitInfo(obj);
+
+
             that.label_text.xzqhdm_number = data.data[0].xzqhdm_number
             that.label_text.zhmj = data.data[0].zhmj
+            store.setCockpitHysyText(that.label_text);
+console.log(store.state.cockpit_hysy.text);
 
         },
         async echart_data() {
@@ -357,7 +362,7 @@ export default {
                 beginTime: '20240101',
                 endTime: '20240601',
                 jscType: 'jsc_hysyq_yelx',
-                id: '46'
+                id: '4602'
             }
 
             let data = await cockpitInfo(obj);
@@ -370,12 +375,11 @@ export default {
                 x: xArray,
                 bar: barArray
             }
-            console.log(that.label_echart, "label_echartlabel_echart");
-            this.getRenKou();
 
-            // that.label_text.xzqhdm_number = data.data[0].xzqhdm_number
-            // that.label_text.zhmj = data.data[0].zhmj
+            store.setCockpitHysyEchart(that.label_echart);
 
+            // console.log(that.label_echart, "label_echartlabel_echart");
+            this.getRenKou();
         }
     },
     mounted() {