lipenghui 2 ماه پیش
والد
کامیت
574fe6d24d
3فایلهای تغییر یافته به همراه8 افزوده شده و 7 حذف شده
  1. 2 4
      src/views/Home/Index.vue
  2. 5 2
      src/views/pms/device/monitor/TdDeviceInfo.vue
  3. 1 1
      src/views/pms/device/monitor/TdDeviceLabel.vue

+ 2 - 4
src/views/Home/Index.vue

@@ -279,6 +279,7 @@ const getStats = async () => {
   })
   IotStatApi.getDeviceStatusCount().then((res) => {
     typeData.value = res
+    debugger
     initCharts()
   })
   IotStatApi.getSafeCount().then((res) => {
@@ -333,10 +334,7 @@ const initCharts = () => {
         labelLine: {
           show: false
         },
-        data: Object.entries(typeData.value).map(([name, value]) => ({
-          name,
-          value
-        }))
+        data: typeData.value
       }
     ]
   })

+ 5 - 2
src/views/pms/device/monitor/TdDeviceInfo.vue

@@ -158,8 +158,11 @@ const formatTime = timestamp => {
 }
 const result = ref([])
 const getChart = async (range) =>{
-
-  result.value = await IotStatApi.getDeviceInfoChart(params.code, topic.value, range[0], range[1])
+  loading.value = true
+  await IotStatApi.getDeviceInfoChart(params.code, topic.value, range[0], range[1]).then(res=>{
+    result.value = res
+      loading.value = false
+  })
 }
 // 初始化图表
 const renderChart = async () => {

+ 1 - 1
src/views/pms/device/monitor/TdDeviceLabel.vue

@@ -9,7 +9,7 @@
       @click="selectTag(index)"
     >
       <span class="property">{{ tag.modelName }}</span>
-      <span class="value">{{ tag.valueType }}</span>
+      <span class="value">{{ tag.value }}</span>
     </div>
   </div>
 </template>