mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
fix: proxy to object problem
This commit is contained in:
parent
6fb3526a1a
commit
ed41383d8d
@ -331,7 +331,7 @@ async function handleSelection(e: MouseEvent) {
|
|||||||
// this.$store.commit('setMoveable', false)
|
// this.$store.commit('setMoveable', false)
|
||||||
if (showRotatable.value !== false) {
|
if (showRotatable.value !== false) {
|
||||||
widgetStore.selectWidget({
|
widgetStore.selectWidget({
|
||||||
uuid: uuid || " -1",
|
uuid: uuid ?? " -1",
|
||||||
})
|
})
|
||||||
// store.dispatch('selectWidget', {
|
// store.dispatch('selectWidget', {
|
||||||
// uuid: uuid,
|
// uuid: uuid,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { useControlStore, useHistoryStore, usePageStore } from "@/pinia"
|
import { useControlStore, useHistoryStore, usePageStore } from "@/pinia"
|
||||||
import { TWidgetStore } from ".."
|
import { TWidgetStore } from ".."
|
||||||
|
import { proxyToObject } from "@/utils/utils"
|
||||||
|
|
||||||
export type TSelectWidgetData = {
|
export type TSelectWidgetData = {
|
||||||
uuid: string
|
uuid: string
|
||||||
@ -15,9 +16,8 @@ export function selectWidget(store: TWidgetStore, { uuid }: TSelectWidgetData) {
|
|||||||
const selectWidgets = store.dSelectWidgets
|
const selectWidgets = store.dSelectWidgets
|
||||||
const widget = store.dWidgets.find((item) => item.uuid === uuid)
|
const widget = store.dWidgets.find((item) => item.uuid === uuid)
|
||||||
|
|
||||||
|
|
||||||
if (!widget) return
|
|
||||||
if (alt) {
|
if (alt) {
|
||||||
|
if (!widget) return
|
||||||
if (uuid !== '-1' && widget.parent === '-1') {
|
if (uuid !== '-1' && widget.parent === '-1') {
|
||||||
// && !widget.isContainer
|
// && !widget.isContainer
|
||||||
if (selectWidgets.length === 0) {
|
if (selectWidgets.length === 0) {
|
||||||
@ -45,16 +45,19 @@ export function selectWidget(store: TWidgetStore, { uuid }: TSelectWidgetData) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
store.dSelectWidgets = []
|
store.dSelectWidgets = []
|
||||||
|
console.log("uuid", uuid);
|
||||||
|
|
||||||
if (uuid === '-1') {
|
if (uuid === '-1') {
|
||||||
store.dActiveElement = pageStore.dPage
|
store.dActiveElement = pageStore.dPage
|
||||||
const pageHistory = historyStore.dPageHistory
|
const pageHistory = historyStore.dPageHistory
|
||||||
if (pageHistory.length === 0) {
|
if (pageHistory.length === 0) {
|
||||||
pageHistory.push(JSON.stringify(pageStore.dPage))
|
pageHistory.push(JSON.stringify(proxyToObject(pageStore.dPage)))
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
store.dSelectWidgets = []
|
store.dSelectWidgets = []
|
||||||
}, 10)
|
}, 10)
|
||||||
} else {
|
} else {
|
||||||
|
if (!widget) return
|
||||||
// store.state.dActiveElement = {}
|
// store.state.dActiveElement = {}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
store.dActiveElement = widget
|
store.dActiveElement = widget
|
||||||
|
Loading…
x
Reference in New Issue
Block a user