1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import { Dict_Apis } from "@/dict";
- import { UploadController } from "@queenjs/controllers";
- import { ModuleRoot } from "queenjs";
- import components from "../components";
- import { CompUICtrl } from "../controllers/CompUICtrl";
- import { HistoryCtrl } from "../controllers/HistoryCtrl";
- import { ImagePickController } from "../controllers/ImagePickerController";
- import { TransferCtrl } from "../controllers/TransferCtrl";
- import { createProxy } from "../objects/ProxyStore/create";
- import { editActions } from "./actions/edit";
- import { ImgCompActions } from "./actions/image";
- import { initActions } from "./actions/init";
- import { helpers } from "./helpers";
- import { https } from "./https";
- import { store } from "./stores";
- export class EditorModule extends ModuleRoot {
- config = this.setConfig({
- httpConfig: {
- baseURL: Dict_Apis.promotion,
- },
- });
- components = this.useComponents(components);
- actions = this.createActions([initActions, editActions, ImgCompActions]);
- https = this.createHttps(https);
- store = this.createStore(store, {
- transform: (state) => createProxy(state),
- });
- helper = this.createHelper(helpers);
- controls = {
- uploader: new UploadController({
- httpConfig: {
- baseURL: Dict_Apis.queentree,
- },
- dir: "queenshow",
- }),
- transferCtrl: new TransferCtrl(this),
- streamCardTransferCtrl: new TransferCtrl(this),
- historyCtrl: new HistoryCtrl(this),
- pickCtrl: new ImagePickController(),
- compUICtrl: new CompUICtrl(this),
- };
- onReady() {
- this.actions.init();
- }
- jumpIndexHtml(route = "#/") {
- const _params = new URLSearchParams(decodeURIComponent(location.search));
- const host = _params.get("host");
- let link = `${location.origin}/index.html?host=${host}${route}`;
- if (location.host == "www.infish.cn") {
- link = `${location.origin}/projects/queenshow/index.html?host=${host}${route}`;
- }
- location.href = link;
- }
- }
|