<!--pages/data/index.wxml-->
<view class=" sg-index-bg">
  <van-popup show="{{ projectShow }}" safe-area-inset-top position="top" custom-style="height: 20%;">
    <van-dropdown-menu active-color="#5992fd">
      <van-dropdown-item value="{{ project_id }}" options="{{ projects }}" bind:change="onChange"
        data-name="project_id" />
      <van-dropdown-item value="{{ sort_type }}" options="{{ sort_types }}" bind:change="onChange"
        data-name="sort_type" />
    </van-dropdown-menu>
    <view class="sg-pad sg-flex sg-align-center sg-space-between">
      <view class="" style="width:300rpx">
        <van-button size="normal" round type="info" block bind:click="switchShow" data-show="{{false}}"
          data-name="projectShow">确定
        </van-button>
      </view>
      <view class="" style="width:300rpx">
        <van-button size="normal" round block bind:click="popclose" color="#737477">取消</van-button>
      </view>
    </view>
  </van-popup>
  <view class="sg-white sg-bold sg-flex sg-align-center sg-space-around">
    <view class="sg-center">
      <view class="sg-font-lg">{{year_money}}</view>
      <view class="sg-font-xs sg-pad-tb-sm">
        <view style="margin-bottom:10rpx">当年公司租赁设备</view>
        <view>费用总和</view>
      </view>
    </view>
    <view class="sg-center">
      <view class="sg-font-lg">{{month_money}}</view>
      <view class="sg-font-xs sg-pad-tb-sm">
        <view style="margin-bottom:10rpx">当月公司租赁设备</view>
        <view>费用总和</view>
      </view>
    </view>
    <view class="sg-center">
      <sg-date-picker bind:update="updateDate"></sg-date-picker>
      <view class="sg-flex sg-align-center condition">
        <view class="sg-flex sg-align-center" bindtap="navigate" data-url="/pages/data-center/index">
          <van-icon name="search" class=" sg-index-color" style="font-size:1.3rem" bindtap="switchShow"
            data-name="dateShow" data-show="{{true}}"></van-icon>
          <text class="sg-index-color" style="font-size:26rpx">条件查找</text>
        </view>
      </view>
    </view>
  </view>
  <view class="sg-white-bg sg-chart-box">
    <view class="sg-flex sg-pad sg-align-center" style="justify-content: space-between;color: #5693FC;">
      <view class="sg-flex sg-align-center">
        <view hidden="{{chartIndex == 0}}" bindtap="changeChartIndex" data-type="-">
          <van-icon name="arrow-left" class="sg-icon-lg sg-index-color" style="font-size:1.3rem" />
        </view>
        <view class="zlprice" style="margin-left:15rpx">
          <view style="margin-right:15rpx" wx:if="{{chartIndex == 1}}">
            租赁费用
          </view>
          <view style="margin-right:15rpx" wx:elif="{{chartIndex == 0}}">
            租赁金额
          </view>
          <view style="margin-right:15rpx" wx:elif="{{chartIndex == 2}}">
            租赁单价
          </view>
        </view>
        <view hidden="{{chartIndex == 0}}" hidden="{{chartIndex == 2}}" bindtap="changeChartIndex" data-type="+">
          <van-icon name="arrow" class="sg-icon-lg sg-index-color" style="font-size:1.3rem" />
        </view>
      </view>
      <view wx:if="{{projectinfoname!=''&&projectinfoprice!=''}}">
        <view>
          {{projectinfoname}}
        </view>
        <view>
          租赁总费用：￥{{projectinfoprice}}.00
        </view>
      </view>
      <view wx:if="{{chartIndex == 0}}">
        <van-icon name="setting-o" class="sg-icon-lg" bindtap="switchShow" data-name="projectShow"
          data-show="{{true}}" />
      </view>
      <view wx:elif="{{chartIndex == 1}}">
        <van-icon name="ascending" wx:if="{{orderBy == 'asc'}}" class="sg-index-color sg-icon-lg" bindtap="updateValue"
          data-name="orderBy" data-value="desc" />
        <van-icon name="descending" wx:else class="sg-index-color sg-icon-lg" bindtap="updateValue" data-name="orderBy"
          data-value="asc" />
      </view>
      <view wx:elif="{{chartIndex == 2}}">
        <van-icon name="ascending" wx:if="{{orderBy == 'asc'}}" class="sg-index-color sg-icon-lg sg-margin-right"
          bindtap="updateValue" data-name="orderBy" data-value="desc" />
        <van-icon name="descending" wx:else class="sg-index-color sg-icon-lg sg-margin-right" bindtap="updateValue"
          data-name="orderBy" data-value="asc" />
        <van-icon name="filter-o" class="sg-index-color sg-icon-lg" bindtap="navigate"
          data-url="/pages/filter-data/index" />
      </view>
      <!-- <view class="sg-flex sg-align-center">
        <view class="sg-flex sg-align-center" bindtap="navigate" data-url="/pages/data-center/index">
          <van-icon name="search" class="sg-icon-lg sg-index-color" bindtap="switchShow" data-name="dateShow"
            data-show="{{true}}"></van-icon>
          <text class="sg-index-color">条件查找</text>
        </view>
      </view> -->
    </view>
    <view class="sg-chart sg-flex sg-align-center sg-space-between" hidden="{{projectShow}}">
      <!-- <view hidden="{{chartIndex == 0}}" bindtap="changeChartIndex" data-type="-">
        <van-icon name="arrow-left" class="sg-icon-lg sg-index-color" />
      </view> -->
      <ec-canvas id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>
      <!-- <view hidden="{{chartIndex == 0}}" hidden="{{chartIndex == 2}}" bindtap="changeChartIndex" data-type="+">
        <van-icon name="arrow" class="sg-icon-lg sg-index-color" />
      </view> -->
    </view>
  </view>
</view>