12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { store } from "@/store";
- import { defineStore } from "pinia";
- export const useDictionaryStore = defineStore("dictionaryStore", {
- state: () => ({
- /**
- * 需要后端返回的type
- */
- types: [
- "station_type",
- "station_operate_type",
- "applicable_platforms",
- "material_properties",
- "quality_testing_plan",
- "material_level",
- "packaging_method",
- "quality_grade",
- "selection_type",
- "stage",
- "danwei_type",
- "process_type",
- "workshop_section",
- "skill_requirements",
- "station_type",
- "danwei_type",
- ],
- dicts: [],
- }),
- persist: {
- enabled: true,
- strategies: [
- {
- key: "dicts",
- storage: localStorage,
- paths: ["dicts"],
- },
- ],
- },
- });
- export function useDictionaryStoreHook() {
- return useDictionaryStore(store);
- }
|