| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 | <!-- eslint-disable vue/multi-word-component-names --><template>  <CostumeHeader>    <template #select>      <!-- 填写空的div以覆盖默认的选择框 -->      <div></div>    </template>    <div class="w-200px flex flex-items-center">      <RightCircleOutlined class="w-30px" />      <div class="flex-grow-1">        网络断开        <span> {{ warns.length }}条 </span>      </div>    </div>  </CostumeHeader>  <div>    <div v-for="(item, i) in warns" :key="`svvhccdw-${i}`" class="flex items-center timeline-item">      <div class="timeline-item__icon" :class="`timeline-item__icon_${item.color}`"></div>      <div class="timeline-item__dot"></div>      <div class="timeline-item__label">{{ item.label }}</div>      <div :class="`timeline-item__value_${item.color}`">{{ item.count }}</div>    </div>  </div></template><script lang="ts" setup>  import { onMounted, ref } from 'vue';  // import { list as cfgList } from '@/views/vent/deviceManager/configurationTable/configuration.api';  // import { list } from '@/views/vent/deviceManager/deviceTable/device.api';  import CostumeHeader from './CostumeHeader.vue';  import { RightCircleOutlined } from '@ant-design/icons-vue';  // import MiniBoard from './MiniBoard.vue';  // import mapComponent from './components/3Dmap/index.vue';  // 设备类别,是个枚举 TODO: 将手动换为自动获取类别  // const devicekind = 'fanlocal';  // const configs = ref<{ prop: string; label: string }[]>([]);  // function fetchConfig() {  //   cfgList({  //     deviceType: 'devicekind',  //   }).then(({ records }) => {  //     const moduleData = JSON.parse(records[0]?.moduleData);  //     configs.value = Object.keys(moduleData).map((k) => {  //       return {  //         prop: k,  //         label: moduleData[k],  //       };  //     });  //   });  // }  const warns = ref([    {      label: 'test',      count: 0,      color: 'red',    },    {      label: 'test',      count: 0,      color: 'yellow',    },    {      label: 'test',      count: 0,      color: 'green',    },    {      label: 'test',      count: 0,      color: 'blue',    },  ]);  // 获取全部局扇的数据,并以选项格式返回给 Header 消费  // function fetchOptions() {  //   return list({  //     devicekind,  //   }).then(({ records }) => {  //     devices.value = records;  //     selectDeviceByID(records[0]?.id);  //     return records.map((e) => {  //       return {  //         label: e.strinstallpos,  //         key: e.id,  //       };  //     });  //   });  // }  onMounted(() => {    // fetchConfig();  });</script><style lang="less" scoped>  @import '@/design/vent/color.less';  .timeline-item {    height: 60px;  }  .timeline-item__icon_red {    background-image: url('@/assets/images/home-container/warn-icon.png');  }  .timeline-item__icon_yellow {    background-image: url('@/assets/images/home-container/warn-icon1.png');  }  .timeline-item__icon_green {    background-image: url('@/assets/images/home-container/warn-icon2.png');  }  .timeline-item__icon_blue {    background-image: url('@/assets/images/home-container/warn-icon3.png');  }  .timeline-item__icon {    width: 54px;    height: 45px;    margin: 0 50px 0 50px;  }  .timeline-item__dot {    width: 10px;    height: 10px;    margin: 0 50px 0 0;    background-color: @vent-gas-primary-bg;    border-radius: 5px;    position: relative;  }  .timeline-item__dot::before {    content: '';    position: absolute;    top: -3px;    left: -3px;    width: 16px;    height: 16px;    border-radius: 8px;    border: 1px solid @vent-gas-tab-border;  }  .timeline-item__label {    width: 150px;  }  .timeline-item__value_red {    color: red;  }  .timeline-item__value_yellow {    color: yellow;  }  .timeline-item__value_green {    color: green;  }  .timeline-item__value_blue {    color: blue;  }</style>
 |