1234567891011121314151617181920212223242526272829 |
- import { Exception } from "queenjs";
- import { EditorModule } from "..";
- import { DesignTemp } from "../defines/DesignTemp";
- import { editActions } from "./edit";
- import { EditorMode } from "../typings";
- export const initActions = EditorModule.action({
- // 模块初始化
- init() {
- const { historyCtrl } = this.controls;
- historyCtrl.proxyActions(Object.keys(editActions));
- // createProxyEffect(this.store, (type, paths, value) => {
- // historyCtrl.onChange(this.store, type, paths, value);
- // });
- this.actions.initInputEvent();
- },
- // 初始化数据
- async initDesign(id: string) {
- const ret = await this.https.getDesignDetail(id);
- this.store.initDesignData(ret.result);
- },
- // 切换模式
- switchMode(v: EditorMode) {
- this.store.setMode(v);
- },
- });
|