Newer
Older
smartwell_front / src / views / home / dashboard / fullScreen-components / deviceOnlineMonitor.vue
lyg on 25 Sep 2 KB 事件地图
<!--
  Description: 事件大屏 - 数据展示- 设备在线监控
  Author: 李亚光
  Date: 2024-09-18
 -->
<script lang="ts" setup name="FullScreenDeviceOnlineMonitor">
import layout from './layout.vue'
// 宽高
const height = ref((window.innerHeight - 100 - 50) / 3)
const width = ref((window.innerWidth - (window.innerWidth * 0.6) - 30) / 2)
window.addEventListener('resize', () => {
  height.value = (window.innerHeight - 100 - 50) / 3
  width.value = (window.innerWidth - (window.innerWidth * 0.6) - 30) / 2
})
const data = [
  {
    name: '燃气智能监测终端',
    value: '90',
  },
  {
    name: '云台',
    value: '87',
  },
  {
    name: '防外力破坏',
    value: '64',
  },
  {
    name: '管线哨兵',
    value: '67',
  },
  {
    name: '智能监测桩',
    value: '88',
  },
  {
    name: '井盖状态监测仪',
    value: '56',
  },
  {
    name: '开挖监测仪',
    value: '40',
  },
  {
    name: '液位监测仪',
    value: '38',
  },
]
</script>

<template>
  <layout class="layout" :height="height" :width="width" title="设备在线监控" subtitle="Equipment Online Monitoring">
    <template #content>
      <div class="container">
        <div v-for="item in data" :key="item.name" class="item">
          <el-progress
            type="circle" :percentage="item.value" :striped="true" striped-flow
            :width="(width - width * 0.22) / 4" :title="item.name"
          />
          <span class="value" :title="item.name">{{ item.name }}</span>
        </div>
      </div>
    </template>
  </layout>
</template>

<style lang="scss" scoped>
::v-deep(.el-loading-mask) {
  background-color: rgba($color: #0b0b0f, $alpha: 95%);
}

.layout {
  ::v-deep(.title) {
    padding-left: 8px !important;
    color: #fff;
    font-weight: 700;
    // padding-left: 20px;
    box-sizing: border-box;
  }

  // overflow: hidden;
}

::v-deep(.el-progress__text) {
  color: #fff;
  font-size: 16px !important;
  font-weight: 700;
}

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  overflow: hidden;

  .item {
    width: 21%;
    padding: 8px 0;

    .value {
      color: #fff;
      display: inline-block;
      text-align: center;
      font-size: 12px;
      width: 100%;
      white-space: nowrap;

      /* 确保文本在一行内显示 */
      overflow: hidden;

      /* 超出容器部分隐藏 */
      text-overflow: ellipsis;

      /* 文字溢出显示省略号 */
    }
  }
}
</style>