<template>
  <section>
    <article class="group-title">
        <article v-show="showOrder" class="group-title-order">
          <div @click="order(1)" class="group-title-order-item">
            <span>全国</span><img src="../../images/sousuo/sort-down.png"/>
          </div>
          <div @click="order(2)" class="group-title-order-item">
            <span>全部等级</span><img src="../../images/sousuo/sort-down.png"/>
          </div>
          <div @click="order(2)" class="group-title-order-item">
            <span>全部科室</span><img src="../../images/sousuo/sort-down.png"/>
          </div>
        </article>
    </article>
  </section>

</template>
<script>
import { mapGetters } from 'vuex'
export default {
  data() {
      return {
        showOrderIndex: 1
      }
  },
  props: {
    groupTitle: {
      type: String,
      default: '课程'
    },
    isShowNum: {
      type: Boolean,
      default: true
    },
    groupNum: {
      type: String,
      default: "0"
    },
    showTitle: {
      type: Boolean,
      default: true
    },
    showOrder: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    ...mapGetters({
      orderNum: 'orderNum'
    })
  },
  watch: {
    orderNum(val) {
      this.showOrderIndex = 1    
    }
  },
  methods: {
    toggle() {
      this.showTitle = !showTitle
      this.showOrder = !showOrder
    },
    order(index) {
      this.showOrderIndex = index
      this.$emit('order', index)
    },
    // resetShowOrderIndex(){
    //   this.showOrderIndex = 1
    // }
  }
}
</script>

<style lang="scss" scoped>
@import '../../style/mixin.scss';
.group-title {
  margin-left: px2rem(15px);
  display: flex;
  flex-direction: row;
  &-order {
    display: flex;
    flex-direction: row;
    padding: px2rem(10px) 0 px2rem(10px);
    font-size: px2rem(13px);
    &-item {
      display: inline-block;
      // position: relative;
      span {
        // margin-right: px2rem(30px);
      }
      img {
        position: relative;
        top: px2rem(3px);
        left: px2rem(0px);
        // top: px2rem(2px);
        // left: px2rem(51px);
        // padding-top: px2rem(10px);
        height: px2rem(15px);
        width: px2rem(15px);
      }
    }
  }
  .first-name {
    // left: px2rem(63px);
  }
  .course-num {
    left: px2rem(37px);
  }
  .hot-degree {
    left: px2rem(25px);
  }
  .active {
    color: #449284;
  }
  &-title {
    padding: 0 px2rem(15px);
    &-main {
      margin-right: px2rem(6px);
      font-size: px2rem(18px);
      font-weight: 500;
      color: #28344C;
    }
    &-sub {
      font-size: px2rem(15px);
      font-weight: 400;
      color: #999;
    }
  }
}
</style>
