<% define_admin_breadcrumbs do %>
  <% add_admin_breadcrumb('数据变化报表', admins_school_statistics_path) %>
<% end %>

<div class="box search-form-container school-statistic-list-form">
  <form class="form-inline search-form d-flex" data-grow-form-url="<%= admins_school_statistics_path %>" data-contrast-form-url="<%= contrast_admins_school_statistics_path %>">
    <div class="time-select">
      <!-- 数据对比 -->
      <%= hidden_field_tag :contrast_column, params[:contrast_column] %>

      <div class="form-group grow-date-container" style="<%= params[:data_type] == 'grow' ? '' : 'display: none' %>">
        <div class="input-group input-daterange grow-date-input-daterange">
          <%= text_field_tag :grow_begin_date, params[:grow_begin_date], class: 'form-control start-date mx-0', placeholder: '开始时间' %>
          <div class="input-group-prepend"><span class="input-group-text">到</span></div>
          <%= text_field_tag :grow_end_date, params[:grow_end_date], class: 'form-control end-date mx-0', placeholder: '结束时间' %>
        </div>
      </div>
      <div class="contrast-date-container" style="<%= params[:data_type] == 'contrast' ? '' : 'display: none' %>">
        <div class="input-group input-daterange date-input-daterange">
          <%= text_field_tag :begin_date, params[:begin_date], class: 'form-control start-date mx-0', placeholder: '开始时间' %>
          <div class="input-group-prepend"><span class="input-group-text">到</span></div>
          <%= text_field_tag :end_date, params[:end_date], class: 'form-control end-date mx-0', placeholder: '结束时间' %>
        </div>
        <div class="mx-2 align-middle">VS</div>
        <div class="input-group input-daterange other-date-input-daterange">
          <%= text_field_tag :other_begin_date, params[:other_begin_date], class: 'form-control start-date mx-0', placeholder: '开始时间' %>
          <div class="input-group-prepend"><span class="input-group-text">到</span></div>
          <%= text_field_tag :other_end_date, params[:other_end_date], class: 'form-control end-date mx-0', placeholder: '结束时间' %>
        </div>
      </div>
    </div>

    <div class="type-box ml-3">
      <%= hidden_field_tag :data_type, params[:data_type] || 'grow' %>
      <%= javascript_void_link '时段对比', class: "btn btn-outline-info btn-sm contrast-btn #{params[:data_type] == 'contrast' ? 'active' : ''}",
                               data: { toggle: 'tooltip', trigger: 'hover', title: '请在左侧分别选择需进行对比的两个时段，具体从当日5:00开始计算，下表显示两时段选定指标两时段变化情况对比' } %>
      <%= javascript_void_link '数据变化', class: "btn btn-outline-info btn-sm grow-btn #{params[:data_type] == 'contrast' ? '' : 'active'}",
                               data: { toggle: 'tooltip', trigger: 'hover', title: '请在左侧选择时间段，具体从当日5:00开始计算，下表显示选定时间段内各项指标数据变化情况' } %>
    </div>

    <%= text_field_tag :keyword, params[:keyword], placeholder: 'ID/单位名称检索', class: 'form-control mx-3 search-input' %>

    <%= javascript_void_link '搜索', class: 'btn btn-primary search-btn' %>
  </form>
</div>

<div class="box school-statistic-list-container">
  <%= render partial: 'admins/school_statistics/shared/list', locals: { statistics: @statistics } %>
</div>