diff --git a/src/pinia/design/control/index.ts b/src/pinia/design/control/index.ts new file mode 100644 index 0000000..aa2caf3 --- /dev/null +++ b/src/pinia/design/control/index.ts @@ -0,0 +1,56 @@ +import { defineStore } from "pinia"; + +type TControlState = { + /** 是否正在移动组件 */ + dMoving: boolean + /** 是否正在抓取组件 */ + dDraging: boolean + /** 是否正在调整组件宽高 */ + dResizeing: boolean + /** 是否显示参考线 */ + dShowRefLine: boolean + /** 全局控制选择框的显示 */ + showMoveable: boolean + /** 是否显示moveable的旋转按钮 */ + showRotatable: boolean +} + +type TControlAction = { + +} + +export default defineStore<"controlStore", TControlState, {}, TControlAction>("controlStore", { + state: () => ({ + dMoving: false, // 是否正在移动组件 + dDraging: false, // 是否正在抓取组件 + dResizeing: false, // 是否正在调整组件宽高 + dShowRefLine: true, // 是否显示参考线 + showMoveable: false, // 全局控制选择框的显示 + showRotatable: true, // 是否显示moveable的旋转按钮 + }), + getters: {}, + actions: { + setdMoving(bool: boolean) { + this.dMoving = bool + }, + setDraging(drag: boolean) { + this.dDraging = drag + }, + setdResizeing(bool: boolean) { + this.dResizeing = bool + }, + showRefLine(show: boolean) { + this.dShowRefLine = show + }, + setShowMoveable(show: boolean) { + this.showMoveable = show + // if (!show) { + // // TODO: 失焦时设置面板也失去关联,但会导致某些失焦状态出错(如裁剪) + // state.dActiveElement = state.dPage + // } + }, + setShowRotatable(e: boolean) { + this.showRotatable = e + }, + } +}) \ No newline at end of file diff --git a/src/pinia/design/history/index.ts b/src/pinia/design/history/index.ts new file mode 100644 index 0000000..031554e --- /dev/null +++ b/src/pinia/design/history/index.ts @@ -0,0 +1,13 @@ +import { defineStore } from "pinia" + + +type THistoryStore = { + +} + +export default defineStore("historyStore", { + state: () => ({ + + }) +}) + diff --git a/src/store/modules/design/actions.ts b/src/store/modules/design/actions.ts index 90dffd1..cf489b6 100644 --- a/src/store/modules/design/actions.ts +++ b/src/store/modules/design/actions.ts @@ -544,9 +544,9 @@ export default { updateHoverUuid(store, uuid) { store.state.dHoverUuid = uuid }, - showRefLine(store, show) { - store.state.dShowRefLine = show - }, + // showRefLine(store, show) { + // store.state.dShowRefLine = show + // }, updateAlign(store: any, { align, uuid, group }: any) { const widgets = store.state.dWidgets const target = uuid ? widgets.find((item: any) => item.uuid === uuid) : store.state.dActiveElement diff --git a/src/store/modules/design/index.ts b/src/store/modules/design/index.ts index 502677e..12fd48a 100644 --- a/src/store/modules/design/index.ts +++ b/src/store/modules/design/index.ts @@ -12,11 +12,11 @@ const all = { // width: 0, // 网格小格子的宽度 // height: 0, // 网格小格子的高度 // }, - guidelines: { - // moveable 标尺辅助线 - verticalGuidelines: [], - horizontalGuidelines: [], - }, + // guidelines: { + // // moveable 标尺辅助线 + // verticalGuidelines: [], + // horizontalGuidelines: [], + // }, dActiveWidgetXY: { x: 0, // 选中组件的横向初始值 y: 0, // 选中组件的纵向初始值 @@ -165,9 +165,9 @@ const all = { dDropOverUuid(state: any) { return state.dDropOverUuid }, - guidelines(state: any) { - return state.guidelines - }, + // guidelines(state: any) { + // return state.guidelines + // }, dCropUuid(state: any) { return state.dCropUuid }, diff --git a/src/store/modules/design/mutations.ts b/src/store/modules/design/mutations.ts index da65409..5b2a290 100644 --- a/src/store/modules/design/mutations.ts +++ b/src/store/modules/design/mutations.ts @@ -41,13 +41,13 @@ export default { // state.dPage = e // }, - setShowMoveable(state: Type.Object, show: any) { - state.showMoveable = show - // if (!show) { - // // TODO: 失焦时设置面板也失去关联,但会导致某些失焦状态出错(如裁剪) - // state.dActiveElement = state.dPage - // } - }, + // setShowMoveable(state: Type.Object, show: any) { + // state.showMoveable = show + // // if (!show) { + // // // TODO: 失焦时设置面板也失去关联,但会导致某些失焦状态出错(如裁剪) + // // state.dActiveElement = state.dPage + // // } + // }, setShowRotatable(state: Type.Object, e: any) { state.showRotatable = e }, @@ -71,9 +71,9 @@ export default { // 设置正在裁剪or编辑的组件 state.dCropUuid = uuid }, - setDraging(state: Type.Object, drag: boolean) { - state.dDraging = drag - }, + // setDraging(state: Type.Object, drag: boolean) { + // state.dDraging = drag + // }, // setDragInitData(state: Type.Object, data: any) { // state.dDragInitData = data // },