common.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { store } from "@/store";
  2. import { defineStore } from "pinia";
  3. interface CommonState {
  4. [key: string]: any;
  5. }
  6. export const useCommonStore = defineStore("commonStore", {
  7. state: (): CommonState => ({
  8. // 弹出公共Table的弹窗
  9. isShowTable: false,
  10. tableType: 1,
  11. tableTitle: "",
  12. // 大屏显示的组件key值,包含默认值
  13. mainSL001: "OrderInformation",
  14. mainSL002: "MaterialsCondition",
  15. mainSL003: "ProductionScheduleOfHeavyParts",
  16. mainSRT12: "ProductionTaskStatistics",
  17. mainSRT13: "ProductionCapacitySituation",
  18. mainS076: "DailyProductionS",
  19. mainS077: "EquipmentMonitoring",
  20. mainS078: "ProductionSituation",
  21. // ====
  22. qualityTOP01: "DistributionOfUnqualifiedProducts",
  23. qualityTOP02: "ProductionPassThroughRate",
  24. qualityTOP03: "QualityAnomaly",
  25. qualityBottom01: "InspectionTaskOfToday",
  26. qualityBottom02: "DefectDistributionDiagram",
  27. moduleKey: "", // 用于判断修改了哪个模块
  28. isShowSelectModule: false, // 是否显示选择模块中的组件弹窗
  29. }),
  30. persist: true,
  31. });
  32. export function useCommonStoreHook() {
  33. return useCommonStore(store);
  34. }