global.ts 586 B

123456789101112131415161718192021222324252627282930
  1. // import { getPayListApi } from "@/pages/pay/API/pos";
  2. import { observable, runInAction } from "mobx";
  3. /**
  4. * 全局需要的搜索条件列表
  5. * */
  6. const globaStore: {
  7. data: {
  8. /**cp列表*/
  9. cpList: any[];
  10. };
  11. /**初始化操作*/
  12. init(): Promise<void>;
  13. } = {
  14. data: {
  15. cpList: [],
  16. },
  17. /**初始化操作*/
  18. async init() {
  19. /**cp列表*/
  20. // let cpList = await getCpChoiceListApi();
  21. runInAction(() => {
  22. this.data = {
  23. ...this.data,
  24. // cpList: cpList?.data || [],
  25. };
  26. });
  27. },
  28. };
  29. export default observable(globaStore);