<template>
  <div class="search-buttons">
    <div class="search __hover" @click="$emit('handleSearch')">查 询</div>
    <div class="reset __hover" @click="$emit('handleReset')">重 置</div>
    <div class="expand __hover" v-if="expandValue !== null" @click="$emit('update:expandValue', !expandValue)">
      {{expandValue ? '收起' : '展开'}}
      <SvgIcon name="arrow_2" size="14" :rotate="expandValue ? 270 : 90"/>
    </div>
  </div>
</template>

<script lang="ts">
import {
  defineComponent,
  computed,
  onMounted,
  ref,
  reactive,
  watch,
  getCurrentInstance,
  nextTick,
  ComponentInternalInstance, toRefs
} from 'vue'
  import {useStore} from 'vuex'
  import {useRouter} from 'vue-router'

  export default defineComponent({
    name: 'CusSearchButtons',
    props: {
      expandValue: {
        default: null
      }
    },
    setup(props, { emit }) {
      const store = useStore();
      const router = useRouter();
      const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
      return {
      }
    },
  })
</script>

<style scoped lang="scss">
  .search-buttons {
    margin-left: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-bottom: 12px;
    >div {
      margin-right: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      box-sizing: border-box;
      &:last-child {
        margin-right: 0;
      }
    }
    .search {
      width: 74px;
      height: 32px;
      background: #0062E9;
      border-radius: 4px;
      color: #FFFFFF;
    }
    .reset {
      width: 74px;
      height: 32px;
      border: 1px solid #0062E9;
      border-radius: 4px;
      color: #3070CF;
    }
    .expand {
      color: #0062E9;
      margin-top: 8px;
      .svg-icon {
        margin-left: 9px;
      }
    }
  }
</style>
