quanyawei
2024-02-02 e635b5b4edab0a000a0af533b6b36f7300c5fa42
fix:断线监控
1 files modified
19 ■■■■■ changed files
src/views/onlineRate/index.vue 19 ●●●●● patch | view | raw | blame | history
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.toFixed(2) }}%</span></p>
      <p>实时在线率:共<span class="greenClor">{{ macOnlineData.sum }}</span>台,在线<span class="greenClor">{{ macOnlineData.online }}</span>台,在线率 <span :class="Number(macOnlineData.onlineRate)<90 ?'redClor':'greenClor'">{{ macOnlineData.onlineRate }}%</span></p>
      <div>
        <el-table
          v-loading="loading"
@@ -216,6 +216,7 @@
      time: '今天',
      selectTime: '',
      macDate: {},
      macOnlineData: {},
      orgData: [],
      tableData: [],
      handleShow: false,
@@ -302,6 +303,7 @@
      this.macDate.endTime = this.formInline.endTime
    },
    handleSearch () {
      this.getOnlineData()
      if (this.formInline.organizationId !== '') {
        if (this.time === '今天') {
          this.formInline.startTime = dayjs().startOf('day').format('YYYY-MM-DD  HH:mm')
@@ -326,6 +328,21 @@
        this.$message.warning('请选择组织或者时间')
      }
    },
    getOnlineData () {
      this.$request({
        url: '/onlineRate/state',
        method: 'get',
        params: {
          organizationId: this.formInline.organizationId
        }
      })
        .then(res => {
          this.macOnlineData = res.data
        })
        .catch(err => {
          console.log(err)
        })
    },
    getOrganizationId () {
      this.$request({
        url: '/organization/getOrganizationId',