<!--
 * @Description:
 * @Author: 王晓颖
 * @Date:
 -->
<template>
  <div class="select-all-left">
    <select-area :btns="areaBtns" v-model="currentSelect.area" title="按区域" btn-style="circle"/>
    <select-area :btns="peopleBtns" v-model="currentSelect.people" title="按人数" btn-style="rectangle"/>
    <select-area :btns="timeBtns" v-model="currentSelect.time" title="按时间" btn-style="circle"/>
    <select-area :btns="levelBtns" v-model="currentSelect.level" title="按级别" btn-style="rectangle"/>
  </div>
</template>

<script>
import SelectArea from '../../../components/SelectTool/selectArea'
export default {
  name: 'SelectAll',
  components: { SelectArea },
  data() {
    return {
      currentSelect: {
        area: '全部',
        time: '全部',
        people: '全部',
        level: '全部'
      },
      areaBtns: [
        { name: '全部', value: '全部' },
        { name: '临汾', value: '临汾' },
        { name: '忻州', value: '忻州' },
        { name: '阳泉', value: '阳泉' },
        { name: '长晋', value: '长晋' },
        { name: '吕梁', value: '吕梁' },
        { name: '晋中', value: '晋中' },
        { name: '运城', value: '运城' }
      ], // 区域按钮
      timeBtns: [
        { name: '全部', value: '全部' },
        { name: '本日', value: '本日' },
        { name: '本周', value: '本周' },
        { name: '本月', value: '本月' },
        { name: '本年', value: '本年' }
      ], // 区域按钮
      peopleBtns: [
        { name: '全部', value: '全部' },
        { name: '10-100', value: '10-100' },
        { name: '101-150', value: '101-150' },
        { name: '151-200', value: '151-200' },
        { name: '200以上', value: '200以上' }
      ], // 人数按钮
      levelBtns: [
        { name: '全部', value: '全部' },
        { name: 'I级', value: 'I级' },
        { name: 'II级', value: 'II级' },
        { name: 'III级', value: 'III级' }
      ] // 人数按钮
    }
  },
  watch: {
    currentSelect: { // 深度监听选区变化并传递给上级
      handler(newval, oldval) {
        this.$emit('change', this.currentSelect)
      },
      deep: true
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .select-all-left{
    position: absolute;
    z-index:100;
    left:2rem;
    top: 5rem;
  }

</style>
