import {defineStore} from "pinia";
import {ref} from "vue";

import {getCounterPartListInterface} from "@/api/autoCounterPart.js";


export const useAutoCounterPart = defineStore("AutoCounterPart", () => {
    const counterPartList = ref([
        {
            id: 1,
            name: '啵咕'
        },
        {
            id: 2,
            name: '蚂蚁'
        },
        {
            id: 3,
            name: '小鸡'
        },
    ])
    const counterPartTable = ref([
        {
            id: 1,
            name: '啵咕',
            count: 15
        },
        {
            id: 2,
            name: '蚂蚁',
            count: 30
        },
        {
            id: 3,
            name: '小鸡',
            count: 6
        },
    ])

    const counterPartItem = ref([
        {
            id: 1,
            fight: true
        },
        {
            id: 2,
            fight: false
        },
        {
            id: 3,
            fight: false
        },
        {
            id: 4,
            fight: true
        }
    ])

    const users = ref([
        {
            id: 1,
            name: '张三'
        },
        {
            id: 2,
            name: '李四'
        },
        {
            id: 3,
            name: '王二麻子'
        },
        {
            id: 4,
            name: '约翰'
        },
        {
            id: 5,
            name: '杰克'
        },
        {
            id: 6,
            name: '奥特曼'
        },
    ])


    const getCounterPartList = async () => {
        return
        // const res = await getCounterPartList(counterPartList)
        // counterPartList.value = res.data
    }

    return {
        counterPartTable, counterPartList, counterPartItem, users,
        getCounterPartList,
    }
})
