useCanvasHeaderMachineStore.js 2 KB
import { defineStore } from 'pinia';
import { onMounted, reactive, ref } from 'vue';

import FASTPRINTIO from '@/views/assets/images/header-machine/fastprint.io.png';
import ILUX3PLUS from '@/views/assets/images/header-machine/ilux3+.png';

export const useCanvasHeaderMachineStore = defineStore('canvas-header-machine', () => {
    const items = reactive([
        {
            key: 'iluxprodental',
            name: 'iLux Pro Dental',
            size: '192*108*200',
            image: FASTPRINTIO,
            enabled: true,
            x: 192,
            y: 108,
            z: 200,
            interval: 5,
            lengthBound: 5,
            distanceWidth: 1,
            distanceLength: 4
        },
        {
            key: 'fastprintio',
            name: 'fastprint.io',
            size: '153.6*86.4*200',
            image: FASTPRINTIO,
            enabled: true,
            x: 153.6,
            y: 86.4,
            z: 200,
            interval: 5,
            lengthBound: 0,
            distanceWidth: 1.8,
            distanceLength: 3.2
        },
        {
            key: 'Quantum',
            name: 'Quantum Pro Lite Pro',
            size: '192*120*200',
            image: ILUX3PLUS,
            enabled: true
        },
        {
            key: 'lux3+',
            name: 'Lux 3+',
            size: '192*120*200',
            image: ILUX3PLUS,
            enabled: true
        },
        {
            key: 'lux3+',
            name: 'Lux 3+',
            size: '192*120*200',
            image: ILUX3PLUS,
            enabled: true
        },
        {
            key: 'lux3+',
            name: 'Lux 3+',
            size: '192*120*200',
            image: ILUX3PLUS,
            enabled: true
        }
    ]);

    const selecteditem = ref(items[0]);

    const handleSelect = (val) => {
        const item = items.find((el) => el.key === val);
        if (item) {
            selecteditem.value = item;
        }
    };

    return {
        items,
        selecteditem,
        handleSelect
    };
});