import { defineStore } from "pinia";
import piniaPersistConfig from "@/config/piniaPersist";
import { useSearchInfoObject } from "@/hooks/useSearch";
export const useStatusStore = defineStore({
    id: "wms-status",
    // 修改默认值之后，需清除 localStorage 数据
    state: (): any => ({
        status: {
            outStockType: [], //出库单类型
            moveBoxType: [], //移库单类型
            takeStockType: [], //盘点单结果类型
            instockType: [], //入库单类型
            instockStatus: [], //入库状态
            backRecordType: [], //入口回退类型
            inventoryInOutType: [], //收发明细类型
            orderType: [] //单据类型
        }
    }),
    getters: {},
    actions: {
        // Set GlobalStatus
        setGlobalStatus(data: any) {
            for (let key in data) {
                this.status[key] = useSearchInfoObject(data[key]);
            }
        }
    },
    persist: piniaPersistConfig("wms-status")
});
