<template>
  <DialogCard :title="title" :actions="actions" :handle="handleClick">
    <v-select
      v-model="selected"
      :items="reports"
      hide-details
      single-line
      prepend-icon="fa-print"
      autofocus
      full-width
      solo
    ></v-select>
  </DialogCard>
</template>
<script>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*  Xeslint-disable    */
////////////////////////////////////////////////////////////////////////////////////////////////////////////

export default {
  // overlay: 'default',
  //   asyncData () {
  //         return new Promise(resolve => {
  //           setTimeout(resolve, 3000)
  //         })
  // },
  created() {
    if (this.selectedvalue) {
      this.selected = this.selectedvalue;
    }
  },
  data() {
    return {
      selected: {}
    };
  },
  props: {
    title: String,
    oktext: String,
    canceltext: String,
    reports: Array,
    selectedvalue: Number
  },
  computed: {
    actions() {
      // debugger;
      return {
        cancel: {
          flat: true,
          text: this.canceltext,
          key: "false",
          handle: () => {
            //   debugger;
            return 0;
          }
        },
        ok: {
          flat: true,
          text: this.oktext
        }
      };
    }
  },
  methods: {
    handleClick() {
      this.$emit("submit", this.selected);
      return false;
    }
  }
};
</script>
