<!--components/tree/index.wxml-->
<view wx:for="{{tree}}" wx:key="id" class="tree_container">
  <!-- 一级菜单 -->
  <view style="margin-left: {{treeListIndex*40}}rpx" class="tree-item">
    <view class="tree-item-onOff" wx:if="{{item.children && item.children.length > 0}}" catchtap="isOpen" data-index="{{index}}">
      <image src="/images/expand.png" class="expand {{item.open ? '' : 'collapse'}}" />
    </view>
    <view class="tree-item-onOff" wx:else></view>
    <view class="tree-item-name" catchtap="select" data-item="{{item}}" data-index="{{index}}">
      <image wx:if="{{item.checked == 1}}" src="/images/checkbox-checked.png" class="check-box"></image>
      <image wx:if="{{item.checked == 0||item.checked==-1}}" src="/images/checkbox.png" class="check-box"></image>
      <text class="tree-item-title {{item.checked === 1 ? 'tree-item-name-select' : '' }}">{{item[pros.key]}}</text>
    </view>
  </view>
  <!-- 二级菜单 -->
  <tree wx:if="{{item.children && item.children.length > 0 && item.open }}" data-parent="{{item}}" dataTree='{{ item.children }}' isOpenAll="{{isOpenAll}}" treeListIndex="{{treeListIndex+1}}" catch:select="handleSelect" pros="{{pros}}" />
</view>