<template>
  <div class="search-group">
    <Select class="sel" v-model="useStatus"
            >
      <Option v-for="item in getUseStatus"
              :value="item.value"
              :key="item.value">{{ item.label }}</Option>
    </Select>
    <Input class="ipt" v-model.trim="userName"
           placeholder="请输入用户姓名" clearable
            />
    <Button type="primary"
            style='margin-right:20px'
            @click='searchList(false)'>搜索</Button>
    <Button @click='searchList(true)'>重置</Button>

  </div>
</template>
<script>
export default {
  data() {
    return {
      useStatus: -1,
      userName: '',
      getUseStatus: [
        {
          value: -1,
          label: '全部'
        },
        {
          value: 0,
          label: '正常'
        },
        {
          value: 1,
          label: '禁用'
        },
        {
          value: 2,
          label: '未注册'
        }
      ]
    }
  },
  methods: {
    searchList(fresh) {
      this.useStatus = fresh ? -1 : this.useStatus
      this.userName = fresh ? '' : this.userName
      this.$emit('searchList', {
        useStatus: this.useStatus,
        userName: this.userName
      })
    }
  }
}
</script>
