<!--
 * @Description: 储量选择框
 * @Author: 王晓颖
 * @Date: 2021-04-08
 -->
<template>
  <div class="select-all-left">
    <select-area :btns="areaBtns" v-model="currentSelect.area" title="按区域" btn-style="circle"/>
    <select-area :btns="deptBtns" v-model="currentSelect.people" title="按公司" btn-style="rectangle"/>
  </div>
</template>

<script>
import SelectArea from '@/components/SelectTool/selectArea'
export default {
  name: 'SelectAllStorage',
  components: { SelectArea },
  data() {
    return {
      currentSelect: {
        area: '全部',
        dept: '全部'
      },
      areaBtns: [
        { name: '全部', value: '全部' },
        { name: '临汾', value: '临汾' },
        { name: '忻州', value: '忻州' },
        { name: '阳泉', value: '阳泉' },
        { name: '长晋', value: '长晋' },
        { name: '吕梁', value: '吕梁' },
        { name: '晋中', value: '晋中' },
        { name: '运城', value: '运城' }
      ], // 区域按钮
      deptBtns: [
        { name: '集团', value: '全部' },
        { name: '山西煤层气', value: '山西煤层气' },
        { name: '山西天然气', value: '山西天然气' },
        { name: '山西压缩气', value: '山西压缩气' },
        { name: '国新利用', value: '国新利用' }
      ]
    }
  },
  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>
