common.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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: "ProductionSituation",
  20. mainS078: "EquipmentMonitoring",
  21. mainLeftTop: "XiaFaGongDanJinDu",
  22. BanZucqtj: "BanZuChuQinTongJi",
  23. ShengChanJHQK: "ShengChanJiHuaQingKuang",
  24. ChengPinRKQKJ: "ChengPinRuKuQingKuang",
  25. WeiDianZCJGG: "WeiDianZiCheJianGongGao",
  26. // ====
  27. qualityTOP01: "DistributionOfUnqualifiedProducts",
  28. qualityTOP02: "ProductionPassThroughRate",
  29. qualityTOP03: "QualityAnomaly",
  30. qualityBottom01: "InspectionTaskOfToday",
  31. qualityBottom02: "DefectDistributionDiagram",
  32. // ====
  33. workTOP01: "ManagementPersons",
  34. workTOP02: "ChanLiangTongJi",
  35. workTOP03: "WeeklyFulfillmentOfProductionOrders",
  36. workBottom01: "CurrentProductionOrderProgress",
  37. workBottom02: "BadTop10",
  38. moduleKey: "", // 用于判断修改了哪个模块
  39. isShowSelectModule: false, // 是否显示选择模块中的组件弹窗
  40. }),
  41. persist: true,
  42. });
  43. export function useCommonStoreHook() {
  44. return useCommonStore(store);
  45. }