<template>
  <lineMulti :chartData="dataSource" xAxisPropType="strname" :propTypeArr="propTypeArr" height="40vh" width="100%" />
  <MonitorTable columnsType="windrect_monitor" :dataSource="dataSource" design-scope="windrect-monitor" title="测风装置监测" />
</template>

<script setup lang="ts">
  import { onBeforeMount, computed } from 'vue';
  import lineMulti from '/@/components/chart/LineMulti.vue';
  import MonitorTable from '../comment/MonitorTable.vue';
  import { initWebSocket, getRecordList } from '/@/hooks/web/useVentWebSocket';
  const dataSource = computed(() => {
    return [...getRecordList()].reverse() || [];
  });
  const propTypeArr = new Map([
    ['incipientWindSpeed1', 'V1风速'],
    ['incipientWindSpeed2', 'V2风速'],
    ['incipientWindSpeed3', 'V3风速'],
    ['sourcePressure', '气源压力'],
  ]);
  onBeforeMount(() => {
    const sendVal = JSON.stringify({ pagetype: 'normal', devicetype: 'windrect', orgcode: '', ids: '', systemID: '' });
    initWebSocket(sendVal);
  });
</script>
<style scoped lang="scss"></style>
