<template>
        <div class="tabList">
        <div class="tabList-header">
          <p style="margin-right: 20px">数据列表</p>
          <el-input
            v-model="searchQuery"
            placeholder="请输入风场名称"
            @input="handleSearch"
            clearable
            style="width: 200px"
            size="small"
          ></el-input>
          <el-button
            size="small"
            type="danger"
            @click="clearAllData"
            style="margin-left: auto"
          >
            清空所有数据
          </el-button>
        </div>

        <el-table
          :data="filteredTableData"
          style="width: 100%; margin-bottom: 20px"
          row-key="id"
          border
          default-expand-all
          :span-method="mergeCells"
          max-height="640"
        >
          <!-- <el-table-column fixed="left" prop="date" label="风场" width="180" /> -->
          <el-table-column fixed="left" label="风场" width="180">
            <template #default="{ row }">
              <!-- 如果有子节点，显示风场名称 -->
              <template v-if="row.children && row.children.length > 0">
                <span>{{ row.date }}</span>
              </template>
            </template>
          </el-table-column>

          <el-table-column prop="name" label="风机" width="70" />
          <el-table-column prop="yepian" label="叶片编号" width="150">
          </el-table-column>
          <el-table-column prop="bladeBrand" label="叶片品牌" width="100" />
          <el-table-column prop="bladeLength" label="叶片长度/m" width="100" />
          <el-table-column prop="ratedPower" label="最大弦长/m" width="100" />
          <el-table-column prop="material" label="材料" width="150" />
          <el-table-column prop="address" label="分析时间" width="160">
          </el-table-column>
          <el-table-column fixed="right" label="操作" width="170">
            <template #default="{ row }">
              <!-- 仅叶片级行显示操作 -->
              <template v-if="!row.children || row.children.length === 0">
                <el-button
                  link
                  type="primary"
                  size="small"
                  @click="handleClick(row)"
                >
                  查看
                </el-button>
                <el-button
                  link
                  type="primary"
                  size="small"
                  @click="viewPaths(row)"
                >
                  查看路径
                </el-button>
                <el-button
                  link
                  type="danger"
                  size="small"
                  @click="deleteRow(row)"
                >
                  删除
                </el-button>
              </template>
            </template>
          </el-table-column>
        </el-table>
      </div>
</template>