lilei 2 gadi atpakaļ
vecāks
revīzija
05435fe300

+ 1 - 1
src/store/modules/setting.js

@@ -19,7 +19,7 @@ export default {
             singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
             waitTime: 3000 // 单步运动停止的时间(默认值1000ms)
           },
-          echartsAutoTime:90000,//echarts 图自动请求接口时间
+          echartsAutoTime:600000,//echarts 图自动请求接口时间
     }),
     getters: {
         //根据菜单路径获取 菜单信息

+ 22 - 3
src/views/bigScreen/realTimeSalesReport/center-map.vue

@@ -12,7 +12,6 @@
         <div class="quanguo" @click="getData('china')" v-if="code !== 'china'">
           返回
         </div>
-
         <Echart id="CenterMap" :options="options" ref="CenterMap" />
       </dv-border-box-12>
     </div>
@@ -32,15 +31,34 @@ export default {
       code: 'china', // china 代表中国 其他地市是行政编码
       echartBindClick: false,
       isSouthChinaSea: false, // 是否要展示南海群岛  修改此值请刷新页面
-      pageflag: true
+      pageflag: true,
+      timer: null
     }
   },
   created () {},
-
   mounted () {
     this.getData('china')
   },
+  beforeDestroy () {
+    this.clearData()
+  },
   methods: {
+    clearData () {
+      if (this.timer) {
+        clearInterval(this.timer)
+        this.timer = null
+      }
+    },
+    // 轮询
+    switper () {
+      if (this.timer) {
+        return
+      }
+      const looper = (a) => {
+        this.getData('china')
+      }
+      this.timer = setInterval(looper, this.$store.state.setting.echartsAutoTime)
+    },
     getData (code) {
       queryMapSaleData().then((res) => {
         console.log('地图', res)
@@ -48,6 +66,7 @@ export default {
           this.getGeojson('china', res.data.dataList)
           // this.mapclick()
           this.$emit('onData', res.data)
+          this.switper()
         } else {
           this.$Message.warning(res.msg)
         }

+ 1 - 1
vue.config.js

@@ -107,7 +107,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.182/ocs-admin',
+        target: 'http://192.168.0.215/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
         // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,