<!-- 数据种类选择标题 -->
<view class="picker-title">数据集种类：</view>

<!-- 数据种类选择下拉框 -->
<picker mode="selector" range="{{types}}" range-key="name" bindchange="onTypeChange">
  <view class="picker-container">
    <view class="picker">
      {{currentType === 'all' ? '全部数据' : currentType}}
    </view>
    <view class="picker-arrow"></view> <!-- 三角形样式 -->
  </view>
</picker>

<!-- 滚动区域 -->
<scroll-view class="table-container" scroll-x="true" scroll-with-animation="true">
  <!-- 数据加载中 -->
  <view wx:if="{{loading}}" class="loading">数据加载中，请稍候...</view>

  <!-- 无数据提示 -->
  <view wx:if="{{!loading && filteredRows.length === 0}}" class="no-data">暂无数据</view>

  <!-- 表格 -->
  <view class="table-body">
    <view class="table-header">
      <!-- 添加单选框 -->
      <view class="table-cell"></view>
      <view class="table-cell" wx:for="{{tableHeaders}}" wx:key="index">{{item}}</view>
    </view>

    <block wx:for="{{filteredRows}}" wx:key="index">
      <view class="table-row" bindtap="onRowClick" data-index="{{index}}">
        <!-- 单选框列 -->
        <view class="table-cell">
          <radio 
            value="{{index}}" checked="{{currentRow && currentRow.index === index}}" 
            class="{{currentRow && currentRow.index === index ? 'radio-checked' : 'radio-unchecked'}}"
            />
        </view>
        <!-- 数据列 -->
        <view class="table-cell">{{item.name}}</view>
        <view class="table-cell">{{item.description}}</view>
        <view class="table-cell">{{item.type}}</view>
        <view class="table-cell">{{item.count}}</view>
        <view class="table-cell">{{item.status}}</view>
        <view class="table-cell">{{item.uploadTime}}</view>
      </view>
    </block>
  </view>
</scroll-view>

<view class="button-container">
  <button bindtap="trainModel">训练</button>
</view>