<!--pages/filter/index.wxml-->
<view class="sg-container sg-index-bg">
  <view class="sg-pad sg-white">
    <view class="sg-flex sg-align-center sg-bold sg-font-lg">
      <van-icon name="notes-o" class="sg-icon sg-margin-right" />
      <view>数据筛选选择</view>
    </view>
    <view class="sg-pad-tb sg-font-small">请根据你需要查看的数据，选择筛选条件</view>
  </view>
  <view class="sg-search-tabs sg-white-bg">
    <van-tabs active="{{ active }}" bind:change="onChange" class="sg-tabs">
      <van-tab title="项目名称">
        <view class="sg-list sg-pad sg-light-gray-bg">
          <view class="sg-bold sg-text-center sg-center sg-margin-tb">- 请选择筛选项目 - </view>
          <view>
            <view wx:for="{{project_ids}}" wx:key="index" class="sg-flex sg-align-center">
              <van-dropdown-menu class="sg-flex-grow sg-margin-tb-sm sg-margin-right" active-color="#5992fd">
                <van-dropdown-item value="{{ item }}" options="{{ projects }}" bind:change="onDropChange"
                  data-name="project_ids" data-index="{{index}}" />
              </van-dropdown-menu>
              <van-button icon="cross" color="#5992fd" type="danger" bindtap="delete" data-name="project_ids"
                data-index="{{index}}" disabled="{{index == 0}}"></van-button>
            </view>
          </view>
          <view class="sg-margin-tb">
            <van-button  color="#5992fd" block icon="plus" bindtap="add" data-name="project_ids">新增</van-button>
          </view>
        </view>
      </van-tab>
      <!-- <van-tab title="需求工点">
        <view class="sg-list sg-pad sg-light-gray-bg">
          <view class="sg-bold sg-text-center sg-center sg-margin-tb">- 请选择所需工点 - </view>
          <view>
            <view wx:for="{{work_point_ids}}" wx:key="index" class="sg-flex sg-align-center">
              <van-dropdown-menu class="sg-flex-grow sg-margin-tb-sm sg-margin-right">
                <van-dropdown-item value="{{ item }}" options="{{ work_points }}" bind:change="onDropChange"
                  data-name="work_point_ids" data-index="{{index}}" />
              </van-dropdown-menu>
              <van-button icon="cross" type="danger" bindtap="delete"
                data-name="work_point_ids" data-index="{{index}}"></van-button>
            </view>
          </view>
          <view class="sg-margin-tb">
            <van-button type="primary" block icon="plus" bindtap="add" data-name="work_point_ids">新增</van-button>
          </view>
        </view>
      </van-tab> -->
      <van-tab title="设备详情">
        <view class="sg-list sg-pad sg-light-gray-bg">
          <view class="sg-bold sg-text-center sg-center sg-margin-tb">- 请选择筛选设备 - </view>
          <!-- <view class="sg-pad-tb-sm">
            <van-dropdown-menu>
              <van-dropdown-item value="{{ device_id }}" options="{{ device_types }}" bind:change="onChange"
                data-name="device_id" />
            </van-dropdown-menu>
          </view> -->
          <view class="sg-pad-tb-sm">
            <van-dropdown-menu active-color="#5992fd">
              <van-dropdown-item value="{{ device_name_id }}" options="{{ names }}" bind:change="onChange" data-name="device_name_id" />
            </van-dropdown-menu>
          </view>
          <!-- <view class="sg-pad-tb-sm">
            <van-dropdown-menu active-color="#5992fd">
              <van-dropdown-item value="{{ spec_id }}" options="{{ specs }}" bind:change="onChange" data-name="spec_id" />
            </van-dropdown-menu>
          </view> -->
        </view>
      </van-tab>
    </van-tabs>
  </view>
  <view class="sg-fix-bottom">
    <van-button type="info" block bindtap="confirm">点击确认</van-button>
  </view>
</view>