<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,variant__code,variant__product,variant__product__code,variant__product__name,variant__product__manufacturer,variant__product__os,variant__product__battery,variant__product__screen,variant__product__cpu,variant__product__gpu,variant__product__camera_system,variant__product__sim,variant__product__network_technology,variant__product__charging_technology,variant__product__external_storage,variant__product__ip_rating,variant__product__design,variant__product__creator,variant__product__updater,variant__product__deleted,variant__color,variant__color__code,variant__color__name,variant__color__hex_code,variant__color__deleted,variant__ram,variant__ram__code,variant__ram__capacity,variant__ram__deleted,variant__internal_storage,variant__internal_storage__code,variant__internal_storage__capacity,variant__internal_storage__deleted,variant__image,variant__image__code,variant__image__name,variant__image__path,variant__image__is_active,variant__image__deleted,variant__image__create_time,variant__price,variant__note,variant__creator,variant__updater,variant__deleted,variant__create_time,variant__update_time,warehouse,warehouse__code,warehouse__name,warehouse__address,warehouse__deleted,deleted,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>
