<script>
import ButtonModal from '@molecules/ButtonModal/ButtonModal.vue'
import Tabulator from "@molecules/VTabulator/VTabulator.vue"

export default {
  name: 'MachinesModal',
  components: {ButtonModal, Tabulator},
  data() {
    return {}
  },
  computed: {
    tabulatorOptions() {
      return {
        dataSource: this.packsData,
        columns:     [
          {
            title: "Нормер пакета",
            field: "pack_number",
            width: 150
          },
          {
            title: "Количество записей",
            field: "count",
            width: 150
          },
          {
            title: "Последняя дата пакета",
            field: "pack_dt",
            width: 150,
            render: "{{ dt_format (dt_shift pack_dt 3 'hour') }}"
          }
        ],
        height: "550px"
      }
    }
  },
  methods: {
  }
}

</script>

<template>
  <ButtonModal
    text="Выбрать машину"
    btnClass="col-span-4"
    containerClass="pt-10 px-4 min-w-[80vw]"
  >
    <Tabulator v-bind="tabulatorOptions" />
  </ButtonModal>
</template>
