running.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div class="_running">
  3. <HeadlineTag value="电梯设备统计"></HeadlineTag>
  4. <div class="_running_mains">
  5. <div class="_running_mains_left">
  6. <dv-decoration-9 style="width:150px;height:150px;">
  7. <div class="_running_mains_left_conter">
  8. <div class="_running_mains_left_conter_num">{{ resultData.ElevatorCount || 0 }}</div>
  9. <div class="_running_mains_left_conter_text">电梯总量</div>
  10. </div>
  11. </dv-decoration-9>
  12. </div>
  13. <div class="_running_mains_right">
  14. <div class="_running_mains_right_item" v-for="item, index in runningList" :key="index">
  15. <div class="_running_mains_right_item_tuan">
  16. <span class="_running_mains_right_item_tuan_flag"
  17. :style="{ backgroundColor: item.color }"></span>
  18. <el-text class="w-150px mb-2" truncated style="color: #ccc;">
  19. {{ item.name }}
  20. </el-text>
  21. </div>
  22. <div class="_running_mains_right_item__txt">
  23. <span>{{ item.state || 0 }}</span>
  24. <span :style="{ color: item.color, 'font-size': '12px', 'margin-left': '5px' }">
  25. {{ item.unit || 0 }}
  26. </span>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script setup>
  34. import { ref } from "vue";
  35. import HeadlineTag from '@/components/HeadlineTag'
  36. const runningList = ref([
  37. { name: '运行正常', state: 0, color: '#409eff', unit: '台' },
  38. { name: '运行异常', state: 0, color: '#15acaa', unit: '台' },
  39. ])
  40. const props = defineProps({
  41. resultData: {
  42. type: Object,
  43. default: {}
  44. }
  45. })
  46. watch(() => props.resultData, (newVal) => {
  47. if (newVal) {
  48. runningList.value[0].state = newVal.RunningNormally
  49. runningList.value[1].state = newVal.RunningAbnormal
  50. }
  51. }, { deep: true, immediate: true } // 开启深度监听
  52. )
  53. </script>
  54. <style lang="scss" scoped>
  55. ._running {
  56. display: flex;
  57. flex-direction: column;
  58. &_mains {
  59. flex: 1;
  60. margin: 30px;
  61. display: flex;
  62. align-items: center;
  63. &_left {
  64. width: 180px;
  65. height: 180px;
  66. position: relative;
  67. flex-shrink: 0;
  68. &_conter {
  69. position: absolute;
  70. left: 0;
  71. top: 0;
  72. flex-shrink: 0;
  73. width: 100%;
  74. height: 100%;
  75. display: flex;
  76. flex-direction: column;
  77. align-items: center;
  78. justify-content: center;
  79. color: #fff;
  80. &_num {
  81. font-size: 18px;
  82. }
  83. &_text {
  84. font-size: 12px;
  85. }
  86. }
  87. }
  88. &_right {
  89. margin-left: 10px;
  90. flex: 1;
  91. color: #fff;
  92. &_item {
  93. display: flex;
  94. align-items: center;
  95. gap: 40px;
  96. padding: 5px 0;
  97. &_tuan {
  98. display: flex;
  99. align-items: center;
  100. &_flag {
  101. display: block;
  102. width: 7px;
  103. height: 7px;
  104. border-radius: 50%;
  105. margin-right: 10px;
  106. }
  107. }
  108. &__txt {
  109. font-size: 24px;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. @keyframes scanning {
  116. to {
  117. transform: rotate(1turn);
  118. }
  119. }
  120. </style>