<template>

  <div class="table-main">
    <el-collapse v-model="activeName" accordion style="width: 100%;height:335px">
      <el-collapse-item v-for="(item, index) in tableData" :key="index+1" :title="'通道'+ (index+1)" :name="'通道'+ (index+1)">

        <el-table :data="item.rawDataItems" stripe border :header-cell-style="{ textAlign: 'center' } "
                  :cell-style="{ textAlign: 'center' }" height="335px" style="width: 100%;max-height: 250px;overflow-y: auto;">
          <el-table-column type="index" fixed="left" label="序号" width="70"/>
          <el-table-column prop="updateTime" label="数据时间"/>
          <el-table-column prop="L1" label="L1（V）"/>
          <el-table-column prop="L2" label="L2（V）"/>
          <el-table-column prop="L3" label="L3（V）"/>
        </el-table>

      </el-collapse-item>
    </el-collapse>
  </div>

</template>

<script lang="tsx" setup>

import type {RawData} from "@/api/check/interface";

const {tableData} = defineProps<{
  tableData:RawData[]
}>()

const activeName = ref('通道1')

// 清空数据
const clear = () => {
  activeName.value = '通道1'
}

defineExpose({
  clear
})
</script>

<style scoped>

</style>