import { Dict_Apis } from "@/dict"; import { PageListController, UploadController } from "@queenjs/controllers"; import { ModuleRoot } from "queenjs"; import { actions } from "./actions"; import { compoents } from "./components"; import { helper } from "./helper"; import { http } from "./http"; import { store } from "./store"; export class ResourceModule extends ModuleRoot { config = this.setConfig({ httpConfig: { baseURL: Dict_Apis.promotion, }, }); actions = this.createActions(actions); components = this.useComponents(compoents); store = this.createStore([store]); https = this.createHttps(http); helpers = this.createHelper(helper); controls = { uploader: new UploadController({ httpConfig: { baseURL: Dict_Apis.queentree, }, dir: "queenshow", }), promotionListCtrl: new PageListController(this.config?.httpConfig), materialListCtrl: new PageListController(this.config?.httpConfig), matTempListCtrl: new PageListController(this.config?.httpConfig), renderTaskListCtrl: new PageListController(this.config?.httpConfig), }; onReady() { this.controls.promotionListCtrl.setCrudPrefix("/h5"); this.controls.promotionListCtrl.state.size = 12; this.controls.materialListCtrl.setCrudPrefix("/source"); this.controls.materialListCtrl.state.size = 24; this.controls.renderTaskListCtrl.setCrudPrefix("/tpls"); this.controls.renderTaskListCtrl.state.size = 24; this.controls.matTempListCtrl.setCrudPrefix("/tpls"); this.controls.matTempListCtrl.state.size = 20; } } export const { useResource, initResource } = ResourceModule.hook("Resource");