quanyawei
2024-02-01 d515dcda54bde1e779df761c23205427a72b18a4
src/views/onlineRate/index.vue
@@ -69,7 +69,7 @@
      </el-form>
    </div>
    <div>
      <p>实时在线率:共<span class="greenClor">{{ tableData.length }}</span>台,在线<span class="greenClor">{{ onlineData }}</span>台,在线率 <span :class=" onlineRate<90 ?'redClor':'greenClor'">{{ onlineRate }}%</span></p>
      <p>实时在线率:共<span class="greenClor">{{ tableData.length }}</span>台,在线<span class="greenClor">{{ onlineData }}</span>台,在线率 <span :class=" onlineRate<90 ?'redClor':'greenClor'">{{ onlineRate.toFixed(2) }}%</span></p>
      <div>
        <el-table
          v-loading="loading"
@@ -259,7 +259,7 @@
      return this.tableData.filter(item => item.state !== '0').length || 0
    },
    onlineRate () {
      return Math.floor((this.onlineData / this.tableData.length) * 100) || 0
      return (this.onlineData / this.tableData.length) * 100 || 0
    }
  },
  watch: {