<import src="../../../Component/aParse/aParse.axml"></import>
<view>
  <view class="flex-box ts flex-center-center" a:if="{{isSubject}}">
    <image mode="scaleToFill" src="../../../image/tz.png"></image>
    <view class="flex-1">你正在使用个人体验版，如需正式使用，请联系管理员</view>
    <button type="primary" onTap="openGly">联系管理员</button>
  </view>
  <view class="head flex-box flex-center-center" style="top:{{isSubject? '138rpx':'0rpx'}}">
    <view class="flex-1" data-index="1" onTap="openView">
      <view>{{userData.b.month_point}}</view>
      <view>本月B分</view>
    </view>
    <view class="flex-1" data-index="2" onTap="openView">
      <view>{{userData.a.month_point}}</view>
      <view>本月A分</view>
    </view>
  </view>
  <view class="headed margin-bottom">
    <view class="top"></view>
    <view class="menuList flex-box flex-d-wrap">
      <view a:for="{{menuList}}" class="menu-item" data-url="{{item.url}}" onTap="openUrl">
        <image mode="scaleToFill" src="{{item.imgUrl}}"></image>
        <view>{{item.name}}</view>
        <text a:if="{{item.name=='审批'&&total}}" class="menuNum font-flex-word">{{total}}</text>
        <text a:if="{{item.name=='任务'&&workTotal}}" class="menuNum font-flex-word">{{workTotal}}</text>
      </view>
    </view>
  </view>
  <view class="main margin-bottom">
    <view class="main-title flex-box flex-v-ce" onTap="openView" data-index="10">
      <text class="flex-1" style="font-size:32rpx">排行榜</text>
      <text class="fontColorF" style="font-size:28rpx">每小时更新一次</text>
    </view>
    <view a:for="{{rankingList}}" class="flex-box flex-v-ce" style="padding:0.28rem; border-bottom: 1px solid #f1f1f1; " data-item="{{item}}" onTap="openViewRanking">
      <view class="flex-box flex-v-ce flex-1">
        <view class="ranking_name font-flex-word">{{ item.group_name.slice(0,2)}}</view>
        <view class="ranking_num flex-1">
          <view>{{ item.group_name }}</view>
          <block a:if="{{item.rank}}">
            <text a:if="{{getRole_four}}" class="fontColorF">第 {{ item.rank }} 名:{{item.employee_name}}</text>
            <text a:else class="fontColorF">第 {{ item.rank }} 名</text>
          </block>
          <text a:else class="fontColorF">不参与排名</text>
        </view>
        <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
      </view>
    </view>
    <view class="rankingLists" onTap="openView" data-index="10">
      <text>查看所有排行榜</text>
      <image mode="scaleToFill" src="../../../image/right.png" class="img-right2"></image>
    </view>
  </view>
  <!-- 奖扣展示 -->
  <view a:if="{{userData.task&&isAdministrator}}" class="main margin-bottom">
    <view class="main-title flex-box flex-v-ce">
      <text style="font-size:32rpx">本月B分奖扣</text>
      <text class="text2" catchTap="showText">?</text>
    </view>
    <view class="main-main flex-box flex-center-center" data-index="7" catchTap="openView">
      <view class="flex-1">
        <view>{{userData.task.reward.point}}</view>
        <view class="fontColorF" style="font-size:28rpx">奖分</view>
        <view class="font-flex-word numPoint">目标{{userData.task.reward.target_point}}</view>
      </view>
      <view class="flex-1">
        <view>{{userData.task.deduction.point}}</view>
        <view class="fontColorF" style="font-size:28rpx">扣分</view>
        <view class="font-flex-word numPoint">目标{{userData.task.deduction.target_point}}</view>
      </view>
      <view class="flex-1">
        <view>{{userData.ratio.ratio}}</view>
        <view class="fontColorF" style="font-size:28rpx">奖扣比例</view>
        <view class="font-flex-word numPoint">目标{{userData.ratio.target_ratio}}</view>
      </view>
      <view class="flex-1">
        <view>{{userData.task.exec.count}}</view>
        <view class="fontColorF" style="font-size:28rpx">奖扣人次</view>
        <view class="font-flex-word numPoint">目标{{userData.task.exec.target_count}}</view>
      </view>
    </view>
  </view>
  <!-- 管理者奖扣 -->
  <view a:if="{{isAdministrator}}" class="bottom margin-bottom">
    <view class="flex-box flex-v-ce bottom-title">
      <view class="flex-1">管理者奖扣</view>
      <view class="chart-legend__wrap">
        <text class="chart-legend__pink">奖分</text>
        <text class="chart-legend__green">扣分</text>
      </view>
    </view>
    <view a:if="{{pieTotal>0}}" class="f2-chart">
      <f2 onInit="onInitChart3"></f2>
    </view>
    <no-data a:if="{{pieTotal==0}}" content="无数据"></no-data>
    <view a:if="{{pieTotal>0}}" class="rankingLists" onTap="openView" style="border-top:1px solid #f1f1f1" data-index="11">
      <text>查看所有管理者奖扣</text>
      <image mode="scaleToFill" src="../../../image/right.png" class="img-right2"></image>
    </view>
  </view>
  <view class="bottom margin-bottom">
    <view class="bottom-title">近30天B分趋势</view>
    <view class="f2-chart">
      <f2 onInit="onInitChart"></f2>
    </view>
  </view>
  <view class="bottom">
    <view class="bottom-title">积分事件</view>
    <view a:for="{{incidentLsit}}" class="flex-box bottom-time" data-item="{{item}}" data-index="8" onTap="openView">
      <img-box name="{{item.employee_name}}" imgUrl="{{item.employee_img_url}}"></img-box>
      <view class="flex-1 bottom-right">
        <view class="flex-box">
          <text class="flex-1 name">{{item.employee_name}}</text>
          <text a:if="{{item.point>0}}" class="num">+{{item.point}} {{item.ptObj.name}}</text>
          <text a:else class="num green">{{item.point}} {{item.ptObj.name}}</text>
        </view>
        <view class="text">{{item.remark}}</view>
        <view class="date">{{item.event_time}}</view>
      </view>
    </view>
    <no-data a:if="{{incidentLsit.length==0}}"></no-data>
  </view>
  <view a:if="{{incidentLsitTotal>5}}" data-index="9" onTap="openView" class="more">查看更多</view>
  <view a:if="{{isBh}}" class="windows" content="还没有积分事件">
    <view class="windows-box">
      <view class="windows-title">温馨提示</view>
      <view class="windows-content">作为管理者，管理执行力是关键，每月按要求完成奖分和扣分任务</view>
      <view class="windows-btn flex-box flex-v-ce">
        <view class="flex-1" catchTap="showText">我知道了</view>
      </view>
    </view>
  </view>
  <view a:if="{{isUpdate}}" class="windows">
    <view class="windows-box">
      <view class="title font-flex-word">{{title}}</view>
      <view class="windows-content2">
        <!-- <view class="title">{{title}}</view> -->
        <template is="aParse" data="{{aParseData:article.nodes}}"></template>
      </view>
      <view class="btns flex-box flex-v-ce">
        <view class="flex-1" catchTap="colseText">我知道了</view>
        <view class="flex-1" catchTap="openText">查看详情</view>
      </view>
    </view>
  </view>
</view>