<template>
  <div>
    <el-select
      v-model="name"
      placeholder="请选择"
      style="width:100%"
      @change="changed"
    >
      <el-option
        v-for='item in options'
        :label="item.fullname"
        :value="item.fullname"
      ></el-option>
    </el-select>
  </div>
</template>
<script>
import basicData from '@/api/basicData.js'
export default {
  data() {
    return {
      name: '',
      options: []
    }
  },
  created() {
    this.getInfo()
  },
  methods: {
    getInfo() {
      const params = {
        querys: []
      }
      this.$http
        .post('${uc}/api/user/v1/users/queryByType', params)
        .then(rep => {
          let res = rep.data.rows
          this.options = res
          if (this.options[0]) {
            this.name = this.options[0].fullname
            this.$emit('defaultValue', this.name)
          } else {
            this.name = ''
          }
        })
    },
    changed(val) {
      this.$emit('changed', val)
    }
  }
}
</script>
<style scoped>
</style>