123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import { BusController } from "@/controllers/natsController";
- import { TreeController } from "@/controllers/queentreeController";
- 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);
- helper = 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),
- materialImageListCtrl: new PageListController(this.config?.httpConfig),
- materialVideoListCtrl: new PageListController(this.config?.httpConfig),
- // 用户资源
- matImageListCtrl: new PageListController(this.config?.httpConfig),
- matVideoListCtrl: new PageListController(this.config?.httpConfig),
- // 平台资源
- sysImageListCtrl: new PageListController(this.config?.httpConfig),
- sysVideoListCtrl: new PageListController(this.config?.httpConfig),
- sysSvgListCtrl: new PageListController(this.config?.httpConfig),
- };
- natsBus = new BusController();
- treeController = new TreeController(this.natsBus);
- 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("/sourceGen");
- this.controls.renderTaskListCtrl.state.size = 24;
- this.controls.matTempListCtrl.setCrudPrefix("/tpls");
- this.controls.matTempListCtrl.state.size = 20;
- this.controls.materialImageListCtrl.setCrudPrefix("/source");
- this.controls.materialImageListCtrl.state.size = 18;
- this.controls.materialImageListCtrl.state.query = { fileType: "image" };
- this.controls.materialVideoListCtrl.setCrudPrefix("/source");
- this.controls.materialVideoListCtrl.state.size = 18;
- this.controls.materialVideoListCtrl.state.query = { fileType: "video" };
- this.controls.matImageListCtrl.setCrudPrefix("/source");
- this.controls.matImageListCtrl.state.size = 20;
- this.controls.matImageListCtrl.state.query = { fileType: "image" };
- this.controls.matVideoListCtrl.setCrudPrefix("/source");
- this.controls.matVideoListCtrl.state.size = 20;
- this.controls.matVideoListCtrl.state.query = { fileType: "video" };
- this.controls.sysImageListCtrl.setCrudPrefix("/sys/source");
- this.controls.sysImageListCtrl.state.size = 20;
- this.controls.sysImageListCtrl.state.query = { fileType: "image" };
- this.controls.sysVideoListCtrl.setCrudPrefix("/sys/source");
- this.controls.sysVideoListCtrl.state.size = 20;
- this.controls.sysVideoListCtrl.state.query = { fileType: "video" };
- this.controls.sysSvgListCtrl.setCrudPrefix("/sys/source");
- this.controls.sysSvgListCtrl.state.size = 20;
- this.controls.sysSvgListCtrl.state.query = { fileType: "image" , isSvg: true};
- this.natsBus.init();
- }
- }
- export const { useResource, initResource } = ResourceModule.hook("Resource");
|