<script setup>
import DataView from "~/components/datatable/DataView.vue";
import AddIMEIForm from "~/components/imports/AddIMEIForm.vue";
import ImportData from "~/components/parameter/ImportData.vue";

const props = defineProps({
  variant: Object,
});
const emit = defineEmits(["close"]);
const key = ref(0);
</script>
<template>
  <div class="block">
    <DataView
      :key="key"
      v-bind="{
        api: 'IMEI',
        setting: 'imeis',
        pagename: 'imeis',
        params: {
          values: 'id,code,imei,variant,variant__code,create_time,update_time',
          filter: { variant: variant.id },
          sort: 'id',
        },
      }"
    />
  </div>
  <div class="block">
    <AddIMEIForm
      :variant="variant"
      @created="key++"
    />
  </div>
  <div class="block">
    <ImportData
      code="imeis"
      @close="key++"
    />
  </div>
</template>
