zhouwx
2 天以前 75d3320bd3496b980953d79935373a17ece37823
src/views/bigScreen/components/screen.vue
@@ -274,7 +274,7 @@
import AMapLoader from '@amap/amap-jsapi-loader'
import { shallowRef } from '@vue/reactivity'
import { storeToRefs } from 'pinia';
import Map from './map.vue'
import Map from './newMap.vue'
import {BaiduMap, BmMapType, BmNavigation, BmPolygon, BmGround} from 'vue-baidu-map-3x'
import { useUserInfo } from '/@/stores/userInfo';
import {bigScreenApi} from "/@/api/bigScreen";
@@ -863,10 +863,7 @@
                  let newArr = JSON.parse(JSON.stringify(state.gasData))
                  if(Array.isArray(newArr)){
                    state.gasTotal = newArr.length
                  }else{
                    state.gasTotal = 0
                  }
                  const weather = newArr.map((item)=>{
                    const weather = newArr.map((item)=>{
                      return {
                        time: item.dataReceivingTime?item.dataReceivingTime.slice(11,19):'--',
                        temp: item.temp?item.temp:'--',
@@ -875,8 +872,12 @@
                        windDirection: item.windDirection?item.windDirection:'--',
                        pressure: item.pressure?item.pressure:'--'
                      }
                  })
                  state.weatherData = [...weather].reverse().slice(0, 4);
                    })
                    state.weatherData = [...weather].reverse().slice(0, 4);
                  }else{
                    // state.gasTotal = 0
                    getGasNdData()
                  }
                  for(let key in newArr[0]){
                    if(newArr[0][key] == state.gasSearch && key.indexOf("gasName") !== -1){
                      gasNum = key.substring(7)
@@ -901,7 +902,6 @@
                  }else{
                    state.tlTotal = 0
                  }
                  console.log(state.gasTotal,'获取结束')
                  const gasTime = newArr.map(i=>i.dataReceivingTime?.slice(11,19))
                  const gasTlTime = [...new Set(gasTime)]
                  let areaData = state.areaOptions.map((item)=>{
@@ -945,7 +945,9 @@
              }
              state.socket.onclose=()=>{
                console.log("socket已经关闭")
                getGasNdData()
                getGasTlData()
                getWindData()
              }
            }
        }
@@ -2031,4 +2033,4 @@
    }
  }
}
</style>
</style>