<view class="all">
  <image mode="scaleToFill" catchTap="onClose" class="close" src="../../../image/close.png"></image>
  <view class="search flex-box flex-v-ce">
    <image mode="scaleToFill" src="../../../image/ss.png"></image>
    <input placeholder="请输入姓名搜索" onInput="bindKeyInput"></input>
  </view>
  <view class="content">
    <view a:if="{{terr.length>1}}" class="flex-box flex-v-ce shu">
      <view a:for="{{terr}}" class="flex-box flex-v-ce" data-index="{{index}}" catchTap="activeItem" data-item="{{item}}">
        <image a:if="{{index!=0}}" mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;"></image>
        {{item.name}}
      </view>
    </view>
    <scroll-view class="staff-ul" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 390rpx);':'height: calc(100vh - 320rpx);'}}">
      <block a:if="{{isItem}}">
        <view class="ul2">
          <view a:for="{{rule_tree}}" class="flex-box flex-v-ce li">
            <view class="flex-box flex-v-ce flex-1" data-item="{{item}}" catchTap="changeSection">
              <image mode="scaleToFill" style="width:50rpx;height:50rpx; margin:0 10rpx;" src="../../../image/BM.png"></image>
              {{item.name}}
            </view>
            <view a:if="{{item._child.length>0}}" class="xia" data-item="{{item}}" catchTap="openDown">| 下级</view>
          </view>
        </view>
        <view class="flex-box flex-v-ce staff-all">
          <view class="flex-1"></view>
          <label a:if="{{isAll}}">
            <text class="rule-all-text">全选</text>
            <checkbox onChange="ruleActiveAll" disabled="{{item.disabled}}" checked="{{isAllChecked}}"></checkbox>
          </label>
        </view>
        <view a:if="{{userList.length>0}}" a:for="{{userList}}"  class="flex-box flex-v-ce userItem">
          <label class="flex-box flex-v-ce flex-1">
            <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
            <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
            <checkbox onChange="radioChange" data-index="{{index}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}"></checkbox>
          </label>
        </view>
        <view a:if="{{userList.length==0}}">
          <view class="fontColorF" style="margin-top:200rpx;text-align: center;">
              <view>您当前部门没有可管理人员，请联系公司管理员</view>
              <view>设置对应管理范围</view>
          </view>
        </view>
      </block>
      <view a:else a:for="{{searchVal}}" class="flex-box flex-v-ce userItem">
        <label class="flex-box flex-v-ce flex-1">
          <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
          <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
          <checkbox onChange="radioChange" data-index="{{index}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}"></checkbox>
        </label>
      </view>
    </scroll-view>
  </view>
  <view class="StaffFooter flex-box flex-v-ce">
    <view class="flex-1 f-left flex-box flex-v-ce">
      <view a:for="{{selectUserId}}" style="margin-right:10rpx;">
        <image a:if="{{item.img_url}}" class="img-url" style="width:70rpx;height:70rpx;display: inline-block;  position: relative;top: 6rpx;" src="{{item.img_url}}"></image>
        <view a:else style="width: 70rpx;height: 70rpx;border-radius: 100%;background: #26A2FF;color: #fff;text-align: center;line-height: 70rpx;font-size: 24rpx;">{{item.name.substr(item.name.length-2)}}</view>
      </view>
    </view>
    <view class="staffBtn" onTap="onConfirm">确定</view>
  </view>
</view>