diff --git a/src/component/Account/frontPage.vue b/src/component/Account/frontPage.vue index c735153a..6f004078 100644 --- a/src/component/Account/frontPage.vue +++ b/src/component/Account/frontPage.vue @@ -6,7 +6,7 @@ diff --git a/src/component/Canvas/CanvasEditor/components/CropImage.vue b/src/component/Canvas/CanvasEditor/components/CropImage.vue index c2849e03..6eb5d7b7 100644 --- a/src/component/Canvas/CanvasEditor/components/CropImage.vue +++ b/src/component/Canvas/CanvasEditor/components/CropImage.vue @@ -277,16 +277,6 @@ clipData.left = x; clipData.img_width = elInfo.width; clipData.img_height = elInfo.height; - - if (!el.value) return; - const elh = el.value.offsetHeight; - const elsh = el.value.scrollHeight; - const elst = el.value.scrollTop; - if (y < elst) { - el.value.scrollTop = y; - } else if (y + clipInfo.height > elst + elh) { - el.value.scrollTop = y + clipInfo.height - elh; - } }; const mouseup = () => { window.removeEventListener("mousemove", mousemove); diff --git a/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue b/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue index 2b5d104a..675c9db4 100644 --- a/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue +++ b/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue @@ -21,6 +21,7 @@ const props = defineProps({ type: Boolean, default: true, // 是否显示图层面板 }, + isBackgroundChangeable: Boolean, }); const emit = defineEmits([ @@ -312,7 +313,7 @@ onMounted(() => { " /> -
+
{{ $t("Canvas.color") }}
{ - console.log("========",res); - }); + }) }); }; diff --git a/src/component/Canvas/CanvasEditor/components/TextEditorPanel.vue b/src/component/Canvas/CanvasEditor/components/TextEditorPanel.vue index 33a0c17c..2c01a627 100644 --- a/src/component/Canvas/CanvasEditor/components/TextEditorPanel.vue +++ b/src/component/Canvas/CanvasEditor/components/TextEditorPanel.vue @@ -620,12 +620,19 @@ export default { // 监听显示文本编辑面板事件 document.addEventListener("showTextEditor", showEditor); document.addEventListener("hideTextEditor", close); - + if(props.canvas) { + // props.canvas.on("text:editing:entered", showEditor); + props.canvas.on("text:editing:exited", close); + } }); onUnmounted(() => { document.removeEventListener("showTextEditor", showEditor); document.removeEventListener("hideTextEditor", close); + if(props.canvas) { + // props.canvas.off("text:editing:entered", showEditor); + props.canvas.off("text:editing:exited", close); + } }); // 返回所有需要在模板中使用的数据和方法 diff --git a/src/component/Canvas/CanvasEditor/index.vue b/src/component/Canvas/CanvasEditor/index.vue index bedc9cbb..eecafc6f 100644 --- a/src/component/Canvas/CanvasEditor/index.vue +++ b/src/component/Canvas/CanvasEditor/index.vue @@ -101,7 +101,10 @@ const props = defineProps({ type: Boolean, default: false, // 是否允许擦除背景图层 }, - + isBackgroundChangeable: { + type: Boolean, + default: true, // 是否允许修改背景图层 + }, showFixedLayer: { type: Boolean, default: false, // 是否显示固定图层 @@ -305,6 +308,7 @@ onMounted(async () => { commandManager, layerManager, toolManager, + isRedGreenMode, pasteText: (text) => { // console.log("粘贴的文本:", text); handleAddText(text); @@ -530,15 +534,15 @@ onBeforeUnmount(() => { // return; // 开发环境下不卸载组件 // } console.log("onBeforeUnmount 组件卸载,清理资源..."); - // canvasManager?.dispose?.(); - // commandManager?.dispose?.(); - // layerManager?.dispose?.(); - // keyboardManager?.dispose?.(); - // toolManager?.dispose?.(); - // liquifyManager?.dispose?.(); - // selectionManager?.dispose?.(); - // redGreenModeManager?.dispose?.(); - // minimapManager?.dispose?.(); + canvasManager?.dispose?.(); + commandManager?.dispose?.(); + layerManager?.dispose?.(); + keyboardManager?.dispose?.(); + toolManager?.dispose?.(); + liquifyManager?.dispose?.(); + selectionManager?.dispose?.(); + redGreenModeManager?.dispose?.(); +// minimapManager?.dispose?.(); canvasManager = null; commandManager = null; layerManager = null; @@ -919,6 +923,7 @@ provide("cropImage", cropImage); // 提供给子组件使用 const isDragOver = ref(false); const canvasDragover = (e) => { e.preventDefault(); + if (isRedGreenMode.value) return; const types = e.dataTransfer.types; isDragOver.value = types.includes("Files"); }; @@ -926,12 +931,14 @@ const canvasDragover = (e) => { // 处理画布容器的拖离事件 const canvasDragleave = (e) => { e.preventDefault(); + if (isRedGreenMode.value) return; isDragOver.value = false; }; // 处理画布容器的拖放事件 const canvasDragdrop = (e) => { e.preventDefault(); + if (isRedGreenMode.value) return; isDragOver.value = false; const files = e.dataTransfer.files; for (const file of files) { @@ -1149,6 +1156,7 @@ defineExpose({ :brushSize="brushSize" :enabledRedGreenMode="enabledRedGreenMode" :showLayersPanel="showLayersPanel" + :isBackgroundChangeable="isBackgroundChangeable" @update:canvasWidth="canvasWidth = $event" @update:canvasHeight="canvasHeight = $event" @update:canvasColor="canvasColor = $event" @@ -1209,13 +1217,6 @@ defineExpose({ :activeTool="activeTool" /> - - - + + +
{{ t("Canvas.Scale") }}: {{ currentZoom }}%
diff --git a/src/store/userHabit/userHabit.ts b/src/store/userHabit/userHabit.ts index f6c51186..946d711a 100644 --- a/src/store/userHabit/userHabit.ts +++ b/src/store/userHabit/userHabit.ts @@ -266,7 +266,6 @@ const userHabit : Module = { // data.systemUser = 0 state.userDetail.affiliate = data.affiliate state.userDetail.systemUser = data.systemUser - // state.userDetail.systemUser = 3 // 身份列表1:可以使用aida系统,2:可以使用affiliate页面,3:系统管理员用户 state.userDetail.systemList = [] if(data.systemUser != 0)state.userDetail.systemList.push(1) diff --git a/src/store/workspace/workspace.ts b/src/store/workspace/workspace.ts index e74c9ecf..08e975d2 100644 --- a/src/store/workspace/workspace.ts +++ b/src/store/workspace/workspace.ts @@ -106,6 +106,10 @@ const Workspace: Module = { model: [] //模特 } }, + createProjectPath(state){ + state.projectPath = '' + state.cachedRoutes = [] + }, setProjectPath(state, path) { state.projectPath = path } diff --git a/src/tool/https.js b/src/tool/https.js index c74f825a..3d685414 100644 --- a/src/tool/https.js +++ b/src/tool/https.js @@ -117,6 +117,7 @@ axios.interceptors.response.use((res) =>{ message.warning('Please login and try again~') store.commit('createDetail') store.commit('createProbject') + store.commit('createProjectPath') setTimeout(()=>[ isLoginTime = false ],2000) diff --git a/src/views/HomeMain.vue b/src/views/HomeMain.vue index 1cdd34af..4f25e4e2 100644 --- a/src/views/HomeMain.vue +++ b/src/views/HomeMain.vue @@ -1232,7 +1232,7 @@ export default defineComponent({ this.$router.replace('/') this.store.commit('createDetail') this.store.commit('createProbject') - + this.store.commit('createProjectPath') // WriteCookie("token"); // window.location.reload() }, diff --git a/src/views/HomeView/history.vue b/src/views/HomeView/history.vue index c172b58e..9cecb1af 100644 --- a/src/views/HomeView/history.vue +++ b/src/views/HomeView/history.vue @@ -454,11 +454,7 @@ export default defineComponent({ // router.push(`/home?history=${data.id}`) // if(data.id) if(data.id === this.store.state.Workspace.probjects.id){ - let cachedRoutes = this.store.state.Workspace.cachedRoutes - for (let i = cachedRoutes.length - 1; i >= 0; i--) { - cachedRoutes.splice(i, 1); - } - this.store.commit('setProjectPath','') + this.store.commit('createProjectPath','') } // this.getHistoryList() },