Просмотр исходного кода

Merge pull request #660 from shawn-tangsc/wvp-28181-2.0

前端首页控制台设备在线数显示bug修复
648540858 3 лет назад
Родитель
Сommit
73c7dab47f
1 измененных файлов с 4 добавлено и 8 удалено
  1. 4 8
      web_src/src/components/console/ConsoleResource.vue

+ 4 - 8
web_src/src/components/console/ConsoleResource.vue

@@ -1,32 +1,28 @@
 <template >
   <div id="consoleResource" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
     <div style="width: 50%;height: 50%; float:left; ">
-      <el-progress :width="100" :stroke-width="8" type="circle" v-if="deviceInfo.total === 0" :percentage="0" style="margin-top: 20px; font-size: 18px"></el-progress>
-      <el-progress :width="100" :stroke-width="8" type="circle" v-if="deviceInfo.total > 0" :percentage="(deviceInfo.online/deviceInfo.total*100).toFixed(2)" style="margin-top: 20px; font-size: 18px"></el-progress>
+      <el-progress :width="100" :stroke-width="8" type="circle" :percentage="Math.floor(deviceInfo.online/deviceInfo.total*100)" style="margin-top: 20px; font-size: 18px"></el-progress>
       <div class="resourceInfo">
         设备总数:{{deviceInfo.total}}<br/>
         在线数:{{deviceInfo.online}}
       </div>
     </div>
     <div style="width: 50%;height: 50%; float:left; ">
-      <el-progress :width="100" :stroke-width="10" type="circle" v-if="channelInfo.total === 0" :percentage="0" style="margin-top: 20px"></el-progress>
-      <el-progress :width="100" :stroke-width="10" type="circle" v-if="channelInfo.total > 0" :percentage="(channelInfo.online/channelInfo.total*100).toFixed(2)" style="margin-top: 20px"></el-progress>
+      <el-progress :width="100" :stroke-width="10" type="circle" :percentage="Math.floor(channelInfo.online/channelInfo.total*100)" style="margin-top: 20px"></el-progress>
       <div class="resourceInfo">
         通道总数:{{channelInfo.total}}<br/>
         在线数:{{channelInfo.online}}
       </div>
     </div>
     <div style="width: 50%;height: 50%; float:left; ">
-      <el-progress :width="100" :stroke-width="10" type="circle" v-if="pushInfo.total === 0" :percentage="0" style="margin-top: 20px"></el-progress>
-      <el-progress :width="100" :stroke-width="10" type="circle" v-if="pushInfo.total > 0" :percentage="(pushInfo.online/pushInfo.total*100).toFixed(2)" style="margin-top: 20px"></el-progress>
+      <el-progress :width="100" :stroke-width="10" type="circle" :percentage="Math.floor(pushInfo.online/pushInfo.total*100)" style="margin-top: 20px"></el-progress>
       <div class="resourceInfo">
         推流总数:{{pushInfo.total}}<br/>
         在线数:{{pushInfo.online}}
       </div>
     </div>
     <div style="width: 50%;height: 50%; float:left; ">
-      <el-progress :width="100" :stroke-width="10" type="circle" v-if="proxyInfo.total === 0" :percentage="0" style="margin-top: 20px"></el-progress>
-      <el-progress :width="100" :stroke-width="10" type="circle" v-if="proxyInfo.total > 0" :percentage="(proxyInfo.online/proxyInfo.total*100).toFixed(2)" style="margin-top: 20px"></el-progress>
+      <el-progress :width="100" :stroke-width="10" type="circle" :percentage="Math.floor(proxyInfo.online/proxyInfo.total*100)" style="margin-top: 20px"></el-progress>
       <div class="resourceInfo">
         拉流代理总数:{{proxyInfo.total}}<br/>
         在线数:{{proxyInfo.online}}