dictionary.ts 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. "device_type",
  19. "stage",
  20. "danwei_type",
  21. "process_type",
  22. "workshop_section",
  23. "skill_requirements",
  24. "station_type",
  25. "danwei_type",
  26. "trace_type",
  27. "skill_type",
  28. ],
  29. dicts: [],
  30. }),
  31. persist: {
  32. enabled: true,
  33. strategies: [
  34. {
  35. key: "dicts",
  36. storage: localStorage,
  37. paths: ["dicts"],
  38. },
  39. ],
  40. },
  41. });
  42. export function useDictionaryStoreHook() {
  43. // console.log('dicts:',useDictionaryStore(store))
  44. return useDictionaryStore(store);
  45. }