<view>
  <view class="header margin-bottom">
  <form onReset="onReset">  
    <view class="search flex-box flex-v-ce">
      <image mode="scaleToFill" src="../../../image/ss.png"/>
      <input placeholder="请输入规则内容" onInput="bindKeyInput" class="flex-1"/>
      <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
    </view>
  </form>
    <view class="flex-box flex-v-ce shu" a:if="{{terr.length>1}}">
      <view a:for="{{terr}}" class="flex-box flex-v-ce" data-index="{{index}}" catchTap="activeItem" data-item="{{item}}">
        <image mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;" a:if="{{index!=0}}"/>{{item.name}}
      </view>
    </view>
  </view>
  <scroll-view a:if="{{isItem}}" class="main" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 206rpx)':'height: calc(100vh - 142rpx)'}}">
    <view a:if="{{rule_tree.length>0||item_list.length>0}}">
      <view class="margin-bottom tree" a:if="{{rule_tree.length}}">
        <view a:for="{{rule_tree}}" class="flex-box flex-v-ce tree-item" data-item="{{item}}" catchTap="activeTree">
          <view class="rule-name flex-1">{{item.name}}</view>
          <image mode="scaleToFill" src="../../../image/right.png" style="width:24rpx;height:24rpx;"/>
        </view>
      </view>
      <view class="item-list">
        <view a:for="{{item_list}}" class="list-items">
          <view class="remark">{{item.remark}}</view>
          <view class="flex-box flex-v-ce">
            <view class="red num flex-1" a:if="{{item.min_point>0}}">+{{(item.range_type == 1 ? item.min_point : item.min_point+'～'+item.max_point)}}
              <text class="fontColorT" style="margin-left:10rpx">{{item.pt_Obj[0].name}}</text>
            </view>
            <view class="green num flex-1" a:if="{{item.min_point<0}}">{{(item.range_type == 1 ? item.min_point : item.min_point+'～'+item.max_point)}}
              <text class="fontColorT" style="margin-left:10rpx">{{item.pt_Obj[0].name}}</text>
            </view>
            <view class="item-type fontColorF num">{{item.typeName.name}}</view>
          </view>
        </view>
      </view>
    </view>
    <no-data a:else content="暂无数据"></no-data>
  </scroll-view>
  <scroll-view a:else class="main" scroll-y="{{true}}" style="height: calc(100vh - 142rpx)">
    <view class="item-list" a:if="{{selectItem.length>0}}">
      <view a:for="{{selectItem}}" class="list-items">
        <view class="remark">{{item.remark}}</view>
        <view class="flex-box flex-v-ce">
          <view class="red num flex-1" a:if="{{item.min_point>0}}">+{{(item.range_type == 1 ? item.min_point : item.min_point+'～'+item.max_point)}}
            <text class="fontColorT" style="margin-left:10rpx">{{item.pt_Obj[0].name}}</text>
          </view>
          <view class="green num flex-1" a:if="{{item.min_point<0}}">{{(item.range_type == 1 ? item.min_point : item.min_point+'～'+item.max_point)}}
            <text class="fontColorT" style="margin-left:10rpx">{{item.pt_Obj[0].name}}</text>
          </view>
          <view class="item-type fontColorF num">{{item.typeName.name}}</view>
        </view>
      </view>
    </view>
    <no-data a:else content="暂无数据"></no-data>
  </scroll-view>
</view>