import { defineStore } from "pinia"
import { reactive } from 'vue'

export const useInspectionListSearchStore = defineStore(
  "inspectionListSearch",
  () => {
    const inspectionListSearch = reactive({
      data: null,
    });

    // 保存
    function setInspectionListSearchData(data) {
      inspectionListSearch.data = data;
    }
    
    // 清空
    function clearInspectionListSearchData() {
      console.log(inspectionListSearch.data)
      inspectionListSearch.data = null;
    }

    return {
      inspectionListSearch,
      setInspectionListSearchData,
      clearInspectionListSearchData,
    };
  },
  {
    unistorage: true, // 开启后对 state 的数据读写都将持久化
  },
);