Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite
This commit is contained in:
@@ -114,6 +114,10 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
hideCanvas: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false, // 是否隐藏画布-隐藏关闭部分功能
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// 引用和状态
|
// 引用和状态
|
||||||
@@ -171,6 +175,15 @@ function toggleShortcutHelp() {
|
|||||||
showShortcutHelp.value = !showShortcutHelp.value;
|
showShortcutHelp.value = !showShortcutHelp.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(()=>props.hideCanvas, (newVal)=>{
|
||||||
|
console.log("==========是否隐藏画布",newVal)
|
||||||
|
if(newVal){
|
||||||
|
keyboardManager?.removeEvents()
|
||||||
|
}else {
|
||||||
|
keyboardManager?.init()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 工具选择处理
|
// 工具选择处理
|
||||||
function handleToolSelect(tool) {
|
function handleToolSelect(tool) {
|
||||||
activeTool.value = tool;
|
activeTool.value = tool;
|
||||||
|
|||||||
@@ -215,6 +215,25 @@ export class KeyboardManager {
|
|||||||
console.log(`键盘管理器已初始化,平台: ${this.platform}, 触摸设备: ${this.isTouchDevice}`);
|
console.log(`键盘管理器已初始化,平台: ${this.platform}, 触摸设备: ${this.isTouchDevice}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hide模式下,关闭快捷键
|
||||||
|
*/
|
||||||
|
removeEvents() {
|
||||||
|
// 移除键盘事件监听
|
||||||
|
this.container.removeEventListener("keydown", this._handleKeyDown);
|
||||||
|
this.container.removeEventListener("keyup", this._handleKeyUp);
|
||||||
|
|
||||||
|
// 如果是触摸设备,移除触摸事件监听
|
||||||
|
if (this.isTouchDevice) {
|
||||||
|
this.container.removeEventListener("touchstart", this._handleTouchStart);
|
||||||
|
this.container.removeEventListener("touchmove", this._handleTouchMove);
|
||||||
|
this.container.removeEventListener("touchend", this._handleTouchEnd);
|
||||||
|
this.container.removeEventListener("touchcancel", this._handleTouchEnd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理键盘按下事件
|
* 处理键盘按下事件
|
||||||
* @param {KeyboardEvent} event 键盘事件
|
* @param {KeyboardEvent} event 键盘事件
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ onUnmounted(() => {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tool-tooltip:before {
|
.tool-tooltip:before {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
@changeCanvas="changeCanvas"
|
@changeCanvas="changeCanvas"
|
||||||
@trigger-library="triggerLibrary"
|
@trigger-library="triggerLibrary"
|
||||||
:canvasJSON="canvasJSON"
|
:canvasJSON="canvasJSON"
|
||||||
|
:hideCanvas="hideCanvas"
|
||||||
ref="editCanvas">
|
ref="editCanvas">
|
||||||
<template #existsImageList>
|
<template #existsImageList>
|
||||||
<ExistsImageList :list="canvasSelectList" @select="handleImageSelect" />
|
<ExistsImageList :list="canvasSelectList" @select="handleImageSelect" />
|
||||||
@@ -100,6 +101,7 @@ import JSZip, { forEach } from "jszip";
|
|||||||
import publish from "@/component/WorksPage/publish.vue";
|
import publish from "@/component/WorksPage/publish.vue";
|
||||||
import canvasAA from '@/component/Canvas/canvasExample.vue'
|
import canvasAA from '@/component/Canvas/canvasExample.vue'
|
||||||
import SelectImages from '@/component/common/SelectImages.vue'
|
import SelectImages from '@/component/common/SelectImages.vue'
|
||||||
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -117,12 +119,14 @@ export default defineComponent({
|
|||||||
const store = useStore();
|
const store = useStore();
|
||||||
let locale = null as any;
|
let locale = null as any;
|
||||||
let t = null as any;
|
let t = null as any;
|
||||||
|
const route = useRoute()
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
designTools:false,
|
designTools:false,
|
||||||
isShowMark:false,
|
isShowMark:false,
|
||||||
openType:'',
|
openType:'',
|
||||||
selectObject:computed(()=>store.state.Workspace.probjects),//选择的项目
|
selectObject:computed(()=>store.state.Workspace.probjects),//选择的项目
|
||||||
canvasJSON:computed(()=>store.state.HomeStoreModule.canvasData.canvas),
|
canvasJSON:computed(()=>store.state.HomeStoreModule.canvasData.canvas),
|
||||||
|
hideCanvas: computed(()=>store.state.Workspace.projectPath !== route.fullPath),
|
||||||
createProbject:inject('createProbject',()=>{}) as any,
|
createProbject:inject('createProbject',()=>{}) as any,
|
||||||
likeDesignList:[],
|
likeDesignList:[],
|
||||||
canvasSelectList:[] as any,
|
canvasSelectList:[] as any,
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ export default defineComponent({
|
|||||||
const selectImgItem = (item:any,)=>{
|
const selectImgItem = (item:any,)=>{
|
||||||
if(item.isChecked){
|
if(item.isChecked){
|
||||||
item.isChecked = !item.isChecked
|
item.isChecked = !item.isChecked
|
||||||
|
data.selectImg = {};
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data.selectImg = item
|
data.selectImg = item
|
||||||
|
|||||||
Reference in New Issue
Block a user