dictionary.ts 883 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { store } from "@/store";
  2. import { defineStore } from "pinia";
  3. export const useDictionaryStore = defineStore("dictionaryStore", {
  4. state: () => ({
  5. /**
  6. * 需要后端返回的type
  7. */
  8. types: [
  9. "station_type",
  10. "station_operate_type",
  11. "applicable_platforms",
  12. "material_properties",
  13. "quality_testing_plan",
  14. "material_level",
  15. "packaging_method",
  16. "quality_grade",
  17. "selection_type",
  18. "stage",
  19. "danwei_type",
  20. "process_type",
  21. "workshop_section",
  22. "skill_requirements",
  23. "station_type",
  24. "danwei_type",
  25. ],
  26. dicts: [],
  27. }),
  28. persist: {
  29. enabled: true,
  30. strategies: [
  31. {
  32. key: "dicts",
  33. storage: localStorage,
  34. paths: ["dicts"],
  35. },
  36. ],
  37. },
  38. });
  39. export function useDictionaryStoreHook() {
  40. return useDictionaryStore(store);
  41. }