<template>
  <el-select
    v-model="systemId"
    placeholder="请选择系统"
    style="width: 100%"
    clearable
    @change="_selectChange">
    <el-option
      v-for="item in sysList"
      :key="item.id"
      :label="item.name"
      :value="item.id">
    </el-option>
  </el-select>
</template>

<script>
/**
 * 系统的选择
 */
import { sysSystem } from '../../api'
export default {
  data() {
    return {
      sysList: [],
      systemId: ''
    }
  },
  mounted() {
    this._getSystem()
  },
  methods: {
    // 回显
    _open(data) {
      this.systemId = data
    },
    _getSystem: async function() {
      this.sysList = await sysSystem.listIdName()
    },
    _selectChange(data) {
      this.$emit('on-result-change', data)
    }
  }
}
</script>
