DeviceWarning.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <CostumeHeader>
  4. <template #select>
  5. <!-- 填写空的div以覆盖默认的选择框 -->
  6. <div></div>
  7. </template>
  8. <div class="w-200px flex flex-items-center">
  9. <RightCircleOutlined class="w-30px" />
  10. <div class="flex-grow-1">
  11. 网络断开
  12. <span> {{ warns.length }}条 </span>
  13. </div>
  14. </div>
  15. </CostumeHeader>
  16. <div>
  17. <div v-for="(item, i) in warns" :key="`svvhccdw-${i}`" class="flex items-center timeline-item">
  18. <div class="timeline-item__icon" :class="`timeline-item__icon_${item.color}`"></div>
  19. <div class="timeline-item__dot"></div>
  20. <div class="timeline-item__label">{{ item.label }}</div>
  21. <div :class="`timeline-item__value_${item.color}`">{{ item.count }}</div>
  22. </div>
  23. </div>
  24. </template>
  25. <script lang="ts" setup>
  26. import { onMounted, ref } from 'vue';
  27. // import { list as cfgList } from '@/views/vent/deviceManager/configurationTable/configuration.api';
  28. // import { list } from '@/views/vent/deviceManager/deviceTable/device.api';
  29. import CostumeHeader from './CostumeHeader.vue';
  30. import { RightCircleOutlined } from '@ant-design/icons-vue';
  31. // import MiniBoard from './MiniBoard.vue';
  32. // import mapComponent from './components/3Dmap/index.vue';
  33. // 设备类别,是个枚举 TODO: 将手动换为自动获取类别
  34. // const devicekind = 'fanlocal';
  35. // const configs = ref<{ prop: string; label: string }[]>([]);
  36. // function fetchConfig() {
  37. // cfgList({
  38. // deviceType: 'devicekind',
  39. // }).then(({ records }) => {
  40. // const moduleData = JSON.parse(records[0]?.moduleData);
  41. // configs.value = Object.keys(moduleData).map((k) => {
  42. // return {
  43. // prop: k,
  44. // label: moduleData[k],
  45. // };
  46. // });
  47. // });
  48. // }
  49. const warns = ref([
  50. {
  51. label: 'test',
  52. count: 0,
  53. color: 'red',
  54. },
  55. {
  56. label: 'test',
  57. count: 0,
  58. color: 'yellow',
  59. },
  60. {
  61. label: 'test',
  62. count: 0,
  63. color: 'green',
  64. },
  65. {
  66. label: 'test',
  67. count: 0,
  68. color: 'blue',
  69. },
  70. ]);
  71. // 获取全部局扇的数据,并以选项格式返回给 Header 消费
  72. // function fetchOptions() {
  73. // return list({
  74. // devicekind,
  75. // }).then(({ records }) => {
  76. // devices.value = records;
  77. // selectDeviceByID(records[0]?.id);
  78. // return records.map((e) => {
  79. // return {
  80. // label: e.strinstallpos,
  81. // key: e.id,
  82. // };
  83. // });
  84. // });
  85. // }
  86. onMounted(() => {
  87. // fetchConfig();
  88. });
  89. </script>
  90. <style lang="less" scoped>
  91. @import '@/design/vent/color.less';
  92. .timeline-item {
  93. height: 60px;
  94. }
  95. .timeline-item__icon_red {
  96. background-image: url('@/assets/images/home-container/warn-icon.png');
  97. }
  98. .timeline-item__icon_yellow {
  99. background-image: url('@/assets/images/home-container/warn-icon1.png');
  100. }
  101. .timeline-item__icon_green {
  102. background-image: url('@/assets/images/home-container/warn-icon2.png');
  103. }
  104. .timeline-item__icon_blue {
  105. background-image: url('@/assets/images/home-container/warn-icon3.png');
  106. }
  107. .timeline-item__icon {
  108. width: 54px;
  109. height: 45px;
  110. margin: 0 50px 0 50px;
  111. }
  112. .timeline-item__dot {
  113. width: 10px;
  114. height: 10px;
  115. margin: 0 50px 0 0;
  116. background-color: @vent-gas-primary-bg;
  117. border-radius: 5px;
  118. position: relative;
  119. }
  120. .timeline-item__dot::before {
  121. content: '';
  122. position: absolute;
  123. top: -3px;
  124. left: -3px;
  125. width: 16px;
  126. height: 16px;
  127. border-radius: 8px;
  128. border: 1px solid @vent-gas-tab-border;
  129. }
  130. .timeline-item__label {
  131. width: 150px;
  132. }
  133. .timeline-item__value_red {
  134. color: red;
  135. }
  136. .timeline-item__value_yellow {
  137. color: yellow;
  138. }
  139. .timeline-item__value_green {
  140. color: green;
  141. }
  142. .timeline-item__value_blue {
  143. color: blue;
  144. }
  145. </style>