index.ts 754 B

1234567891011121314151617181920212223
  1. import { PageListController } from "@queenjs/controllers";
  2. import { ModuleRoot } from "queenjs";
  3. import { actions } from "./actions";
  4. import { compoents } from "./components";
  5. import { store } from "./store";
  6. export class ResourceModule extends ModuleRoot {
  7. actions = this.createActions(actions);
  8. store = this.createStore([store]);
  9. components = this.useComponents(compoents);
  10. controls = {
  11. materialListCtrl: new PageListController(this.config?.httpConfig),
  12. matTempListCtrl: new PageListController(this.config?.httpConfig),
  13. };
  14. onReady() {
  15. this.controls.materialListCtrl.setCrudPrefix("/");
  16. this.controls.matTempListCtrl.setCrudPrefix("/");
  17. }
  18. }
  19. export const { useResource, initResource } = ResourceModule.hook("Resource");