Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<bind v-if="item.key == 'bind' && activeKey == 'bind'" :ref="item.key"></bind>
|
<bind v-if="item.key == 'bind' && activeKey == 'bind'" :ref="item.key"></bind>
|
||||||
<cancelRenewal v-if="item.key == 'cancelRenewal' && activeKey == 'cancelRenewal'" :ref="item.key"></cancelRenewal>
|
<cancelRenewal v-if="item.key == 'cancelRenewal' && activeKey == 'cancelRenewal'" :ref="item.key"></cancelRenewal>
|
||||||
<template #tab>
|
<template #tab>
|
||||||
<a-badge :count="0" >
|
<a-badge :count="0" v-if="!(item.key == 'cancelRenewal' && [5,6,7,8].includes(userDetail.systemUser))">
|
||||||
<span>{{item.title}}</span>
|
<span>{{item.title}}</span>
|
||||||
</a-badge>
|
</a-badge>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -277,16 +277,6 @@
|
|||||||
clipData.left = x;
|
clipData.left = x;
|
||||||
clipData.img_width = elInfo.width;
|
clipData.img_width = elInfo.width;
|
||||||
clipData.img_height = elInfo.height;
|
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 = () => {
|
const mouseup = () => {
|
||||||
window.removeEventListener("mousemove", mousemove);
|
window.removeEventListener("mousemove", mousemove);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true, // 是否显示图层面板
|
default: true, // 是否显示图层面板
|
||||||
},
|
},
|
||||||
|
isBackgroundChangeable: Boolean,
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
@@ -312,7 +313,7 @@ onMounted(() => {
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-group">
|
<div class="setting-group" v-if="isBackgroundChangeable">
|
||||||
<span class="setting-label">{{ $t("Canvas.color") }}</span>
|
<span class="setting-label">{{ $t("Canvas.color") }}</span>
|
||||||
<div class="color-picker-wrapper">
|
<div class="color-picker-wrapper">
|
||||||
<input
|
<input
|
||||||
|
|||||||
@@ -279,9 +279,7 @@
|
|||||||
layerManager: props.layerManager,
|
layerManager: props.layerManager,
|
||||||
canvas: props.canvas,
|
canvas: props.canvas,
|
||||||
toolManager: props.toolManager,
|
toolManager: props.toolManager,
|
||||||
}).then(res=>{
|
})
|
||||||
console.log("========",res);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -620,12 +620,19 @@ export default {
|
|||||||
// 监听显示文本编辑面板事件
|
// 监听显示文本编辑面板事件
|
||||||
document.addEventListener("showTextEditor", showEditor);
|
document.addEventListener("showTextEditor", showEditor);
|
||||||
document.addEventListener("hideTextEditor", close);
|
document.addEventListener("hideTextEditor", close);
|
||||||
|
if(props.canvas) {
|
||||||
|
// props.canvas.on("text:editing:entered", showEditor);
|
||||||
|
props.canvas.on("text:editing:exited", close);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
document.removeEventListener("showTextEditor", showEditor);
|
document.removeEventListener("showTextEditor", showEditor);
|
||||||
document.removeEventListener("hideTextEditor", close);
|
document.removeEventListener("hideTextEditor", close);
|
||||||
|
if(props.canvas) {
|
||||||
|
// props.canvas.off("text:editing:entered", showEditor);
|
||||||
|
props.canvas.off("text:editing:exited", close);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 返回所有需要在模板中使用的数据和方法
|
// 返回所有需要在模板中使用的数据和方法
|
||||||
|
|||||||
@@ -101,7 +101,10 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false, // 是否允许擦除背景图层
|
default: false, // 是否允许擦除背景图层
|
||||||
},
|
},
|
||||||
|
isBackgroundChangeable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true, // 是否允许修改背景图层
|
||||||
|
},
|
||||||
showFixedLayer: {
|
showFixedLayer: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false, // 是否显示固定图层
|
default: false, // 是否显示固定图层
|
||||||
@@ -305,6 +308,7 @@ onMounted(async () => {
|
|||||||
commandManager,
|
commandManager,
|
||||||
layerManager,
|
layerManager,
|
||||||
toolManager,
|
toolManager,
|
||||||
|
isRedGreenMode,
|
||||||
pasteText: (text) => {
|
pasteText: (text) => {
|
||||||
// console.log("粘贴的文本:", text);
|
// console.log("粘贴的文本:", text);
|
||||||
handleAddText(text);
|
handleAddText(text);
|
||||||
@@ -530,15 +534,15 @@ onBeforeUnmount(() => {
|
|||||||
// return; // 开发环境下不卸载组件
|
// return; // 开发环境下不卸载组件
|
||||||
// }
|
// }
|
||||||
console.log("onBeforeUnmount 组件卸载,清理资源...");
|
console.log("onBeforeUnmount 组件卸载,清理资源...");
|
||||||
// canvasManager?.dispose?.();
|
canvasManager?.dispose?.();
|
||||||
// commandManager?.dispose?.();
|
commandManager?.dispose?.();
|
||||||
// layerManager?.dispose?.();
|
layerManager?.dispose?.();
|
||||||
// keyboardManager?.dispose?.();
|
keyboardManager?.dispose?.();
|
||||||
// toolManager?.dispose?.();
|
toolManager?.dispose?.();
|
||||||
// liquifyManager?.dispose?.();
|
liquifyManager?.dispose?.();
|
||||||
// selectionManager?.dispose?.();
|
selectionManager?.dispose?.();
|
||||||
// redGreenModeManager?.dispose?.();
|
redGreenModeManager?.dispose?.();
|
||||||
// minimapManager?.dispose?.();
|
// minimapManager?.dispose?.();
|
||||||
canvasManager = null;
|
canvasManager = null;
|
||||||
commandManager = null;
|
commandManager = null;
|
||||||
layerManager = null;
|
layerManager = null;
|
||||||
@@ -919,6 +923,7 @@ provide("cropImage", cropImage); // 提供给子组件使用
|
|||||||
const isDragOver = ref(false);
|
const isDragOver = ref(false);
|
||||||
const canvasDragover = (e) => {
|
const canvasDragover = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (isRedGreenMode.value) return;
|
||||||
const types = e.dataTransfer.types;
|
const types = e.dataTransfer.types;
|
||||||
isDragOver.value = types.includes("Files");
|
isDragOver.value = types.includes("Files");
|
||||||
};
|
};
|
||||||
@@ -926,12 +931,14 @@ const canvasDragover = (e) => {
|
|||||||
// 处理画布容器的拖离事件
|
// 处理画布容器的拖离事件
|
||||||
const canvasDragleave = (e) => {
|
const canvasDragleave = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (isRedGreenMode.value) return;
|
||||||
isDragOver.value = false;
|
isDragOver.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理画布容器的拖放事件
|
// 处理画布容器的拖放事件
|
||||||
const canvasDragdrop = (e) => {
|
const canvasDragdrop = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (isRedGreenMode.value) return;
|
||||||
isDragOver.value = false;
|
isDragOver.value = false;
|
||||||
const files = e.dataTransfer.files;
|
const files = e.dataTransfer.files;
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
@@ -1149,6 +1156,7 @@ defineExpose({
|
|||||||
:brushSize="brushSize"
|
:brushSize="brushSize"
|
||||||
:enabledRedGreenMode="enabledRedGreenMode"
|
:enabledRedGreenMode="enabledRedGreenMode"
|
||||||
:showLayersPanel="showLayersPanel"
|
:showLayersPanel="showLayersPanel"
|
||||||
|
:isBackgroundChangeable="isBackgroundChangeable"
|
||||||
@update:canvasWidth="canvasWidth = $event"
|
@update:canvasWidth="canvasWidth = $event"
|
||||||
@update:canvasHeight="canvasHeight = $event"
|
@update:canvasHeight="canvasHeight = $event"
|
||||||
@update:canvasColor="canvasColor = $event"
|
@update:canvasColor="canvasColor = $event"
|
||||||
@@ -1209,13 +1217,6 @@ defineExpose({
|
|||||||
:activeTool="activeTool"
|
:activeTool="activeTool"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 文本编辑面板 -->
|
|
||||||
<TextEditorPanel
|
|
||||||
v-if="canvasManagerLoaded && !enabledRedGreenMode"
|
|
||||||
:canvas="canvasManager && canvasManager.canvas"
|
|
||||||
:commandManager="commandManager"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 液化编辑面板 -->
|
<!-- 液化编辑面板 -->
|
||||||
<LiquifyPanel
|
<LiquifyPanel
|
||||||
v-if="canvasManagerLoaded && !enabledRedGreenMode"
|
v-if="canvasManagerLoaded && !enabledRedGreenMode"
|
||||||
@@ -1248,6 +1249,13 @@ defineExpose({
|
|||||||
:activeTool="activeTool"
|
:activeTool="activeTool"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- 文本编辑面板 -->
|
||||||
|
<TextEditorPanel
|
||||||
|
v-if="canvasManagerLoaded && !enabledRedGreenMode"
|
||||||
|
:canvas="canvasManager && canvasManager.canvas"
|
||||||
|
:commandManager="commandManager"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="zoom-info">
|
<div class="zoom-info">
|
||||||
{{ t("Canvas.Scale") }}: {{ currentZoom }}%
|
{{ t("Canvas.Scale") }}: {{ currentZoom }}%
|
||||||
<button class="reset-zoom" @click="resetZoom">
|
<button class="reset-zoom" @click="resetZoom">
|
||||||
|
|||||||
@@ -2303,9 +2303,9 @@ export class LayerManager {
|
|||||||
*/
|
*/
|
||||||
dispose() {
|
dispose() {
|
||||||
// 清空画布
|
// 清空画布
|
||||||
if (this.canvas) {
|
// if (this.canvas) {
|
||||||
this.canvas.clear();
|
// this.canvas.clear();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 清空图层数据
|
// 清空图层数据
|
||||||
if (this.layers && this.layers.value) {
|
if (this.layers && this.layers.value) {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export class BrushManager {
|
|||||||
description: "基础铅笔工具,适合精细线条绘制",
|
description: "基础铅笔工具,适合精细线条绘制",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/pencil.jpg',
|
imgUrl:'/image/brush/pencil.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 注册材质笔刷
|
// 注册材质笔刷
|
||||||
@@ -74,7 +74,7 @@ export class BrushManager {
|
|||||||
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/texture.jpg',
|
imgUrl:'/image/brush/texture.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 注册集成的笔刷类型
|
// 注册集成的笔刷类型
|
||||||
@@ -83,63 +83,63 @@ export class BrushManager {
|
|||||||
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/crayon.jpg',
|
imgUrl:'/image/brush/crayon.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("fur", FurBrush, {
|
brushRegistry.register("fur", FurBrush, {
|
||||||
name: this.t("Canvas.Fur"),
|
name: this.t("Canvas.Fur"),
|
||||||
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
description: "使用纹理图片作为笔刷,支持缩放和透明度",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/fur.jpg',
|
imgUrl:'/image/brush/fur.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("ink", InkBrush, {
|
brushRegistry.register("ink", InkBrush, {
|
||||||
name: this.t("Canvas.Ink"),
|
name: this.t("Canvas.Ink"),
|
||||||
description: "墨水笔刷,适合书写和绘图",
|
description: "墨水笔刷,适合书写和绘图",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/ink.jpg',
|
imgUrl:'/image/brush/ink.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("", LongfurBrush, {
|
brushRegistry.register("", LongfurBrush, {
|
||||||
name: this.t("Canvas.Longfur"),
|
name: this.t("Canvas.Longfur"),
|
||||||
description: "长毛发笔刷,适合绘制动物毛皮、草或头发",
|
description: "长毛发笔刷,适合绘制动物毛皮、草或头发",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/longFur.jpg',
|
imgUrl:'/image/brush/longFur.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("writing", WritingBrush, {
|
brushRegistry.register("writing", WritingBrush, {
|
||||||
name: this.t("Canvas.Writing"),
|
name: this.t("Canvas.Writing"),
|
||||||
description: "书法笔刷,模拟中国传统书法毛笔效果,具有笔锋和墨色变化",
|
description: "书法笔刷,模拟中国传统书法毛笔效果,具有笔锋和墨色变化",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/writing.jpg',
|
imgUrl:'/image/brush/writing.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("marker", MarkerBrush, {
|
brushRegistry.register("marker", MarkerBrush, {
|
||||||
name: this.t("Canvas.Marker"),
|
name: this.t("Canvas.Marker"),
|
||||||
description: "马克笔笔刷,适合粗线条和填充",
|
description: "马克笔笔刷,适合粗线条和填充",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/marker.jpg',
|
imgUrl:'/image/brush/marker.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("pen", CustomPenBrush, {
|
brushRegistry.register("pen", CustomPenBrush, {
|
||||||
name: this.t("Canvas.Pen"),
|
name: this.t("Canvas.Pen"),
|
||||||
description: "自定义钢笔笔刷,适合书写和绘图",
|
description: "自定义钢笔笔刷,适合书写和绘图",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/pen.jpg',
|
imgUrl:'/image/brush/pen.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("ribbon", RibbonBrush, {
|
brushRegistry.register("ribbon", RibbonBrush, {
|
||||||
name: this.t("Canvas.Ribbon"),
|
name: this.t("Canvas.Ribbon"),
|
||||||
description: "丝带笔刷,适合创建流动的丝带效果",
|
description: "丝带笔刷,适合创建流动的丝带效果",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/ribbon.jpg',
|
imgUrl:'/image/brush/ribbon.jpg',
|
||||||
});
|
});
|
||||||
brushRegistry.register("shaded", ShadedBrush, {
|
brushRegistry.register("shaded", ShadedBrush, {
|
||||||
name: this.t("Canvas.Shaded"),
|
name: this.t("Canvas.Shaded"),
|
||||||
description: "阴影笔刷,适合创建渐变和阴影效果",
|
description: "阴影笔刷,适合创建渐变和阴影效果",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/shaded.jpg',
|
imgUrl:'/image/brush/shaded.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
brushRegistry.register("spray", SprayBrush, {
|
brushRegistry.register("spray", SprayBrush, {
|
||||||
@@ -147,7 +147,7 @@ export class BrushManager {
|
|||||||
description: "模拟喷枪效果,创建散点效果",
|
description: "模拟喷枪效果,创建散点效果",
|
||||||
t:this.t,
|
t:this.t,
|
||||||
category: this.t('Canvas.BasicBrushes'),
|
category: this.t('Canvas.BasicBrushes'),
|
||||||
imgUrl:'./image/brush/spray.jpg',
|
imgUrl:'/image/brush/spray.jpg',
|
||||||
});
|
});
|
||||||
|
|
||||||
// brushRegistry.register("sketchy", SketchyBrush);
|
// brushRegistry.register("sketchy", SketchyBrush);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export class KeyboardManager {
|
|||||||
* @param {Object} options.layerManager 图层管理器实例
|
* @param {Object} options.layerManager 图层管理器实例
|
||||||
* @param {Function} options.pasteText 粘贴文本回调函数
|
* @param {Function} options.pasteText 粘贴文本回调函数
|
||||||
* @param {Function} options.pasteImage 粘贴图片回调函数
|
* @param {Function} options.pasteImage 粘贴图片回调函数
|
||||||
|
* @param {Ref<Boolean>} options.isRedGreenMode 是否为红绿模式
|
||||||
* @param {HTMLElement} options.container 容器元素,用于添加事件监听
|
* @param {HTMLElement} options.container 容器元素,用于添加事件监听
|
||||||
*/
|
*/
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
@@ -21,6 +22,7 @@ export class KeyboardManager {
|
|||||||
this.container = options.container || document;
|
this.container = options.container || document;
|
||||||
this.pasteText = options.pasteText || (() => {});
|
this.pasteText = options.pasteText || (() => {});
|
||||||
this.pasteImage = options.pasteImage || (() => {});
|
this.pasteImage = options.pasteImage || (() => {});
|
||||||
|
this.isRedGreenMode = options.isRedGreenMode;
|
||||||
|
|
||||||
// 检测平台类型
|
// 检测平台类型
|
||||||
this.platform = this.detectPlatform();
|
this.platform = this.detectPlatform();
|
||||||
@@ -207,6 +209,7 @@ export class KeyboardManager {
|
|||||||
*/
|
*/
|
||||||
handlePaste(event) {
|
handlePaste(event) {
|
||||||
event.preventDefault(); // 阻止默认粘贴行为
|
event.preventDefault(); // 阻止默认粘贴行为
|
||||||
|
if(this.isRedGreenMode.value) return;
|
||||||
const text = event.clipboardData?.getData("text/plain") || "";
|
const text = event.clipboardData?.getData("text/plain") || "";
|
||||||
if(/^aida_copy_canvas_layer/.test(text)) return;
|
if(/^aida_copy_canvas_layer/.test(text)) return;
|
||||||
const items = event.clipboardData?.items || [];
|
const items = event.clipboardData?.items || [];
|
||||||
@@ -429,30 +432,35 @@ export class KeyboardManager {
|
|||||||
case "copy":
|
case "copy":
|
||||||
// 复制逻辑
|
// 复制逻辑
|
||||||
console.log("复制当前选中图层");
|
console.log("复制当前选中图层");
|
||||||
|
if(this.isRedGreenMode.value) return;
|
||||||
this.layerManager.copyLayer(this.layerManager.activeLayerId.value);
|
this.layerManager.copyLayer(this.layerManager.activeLayerId.value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "paste":
|
case "paste":
|
||||||
// 粘贴逻辑
|
// 粘贴逻辑
|
||||||
console.log("粘贴");
|
console.log("粘贴");
|
||||||
|
if(this.isRedGreenMode.value) return;
|
||||||
this.layerManager.pasteLayer();
|
this.layerManager.pasteLayer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "cut":
|
case "cut":
|
||||||
// 剪切逻辑
|
// 剪切逻辑
|
||||||
console.log("剪切");
|
console.log("剪切");
|
||||||
|
if(this.isRedGreenMode.value) return;
|
||||||
this.layerManager.cutLayer(this.layerManager.activeLayerId.value);
|
this.layerManager.cutLayer(this.layerManager.activeLayerId.value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "delete":
|
case "delete":
|
||||||
// 删除逻辑
|
// 删除逻辑
|
||||||
console.log("删除");
|
console.log("删除");
|
||||||
|
if(this.isRedGreenMode.value) return;
|
||||||
this.layerManager.removeLayer(this.layerManager.activeLayerId.value);
|
this.layerManager.removeLayer(this.layerManager.activeLayerId.value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "selectAll":
|
case "selectAll":
|
||||||
// 全选逻辑
|
// 全选逻辑
|
||||||
console.log("全选");
|
console.log("全选");
|
||||||
|
if(this.isRedGreenMode.value) return;
|
||||||
// 这里需要实现全选逻辑 TODO: 是否在选择模式下才可以全选?
|
// 这里需要实现全选逻辑 TODO: 是否在选择模式下才可以全选?
|
||||||
if (this.layerManager) {
|
if (this.layerManager) {
|
||||||
this.layerManager.selectAll();
|
this.layerManager.selectAll();
|
||||||
@@ -728,18 +736,7 @@ export class KeyboardManager {
|
|||||||
*/
|
*/
|
||||||
dispose() {
|
dispose() {
|
||||||
// 移除事件监听
|
// 移除事件监听
|
||||||
this.container.removeEventListener("keydown", this._handleKeyDown);
|
this.removeEvents();
|
||||||
this.container.removeEventListener("keyup", this._handleKeyUp);
|
|
||||||
this.container.removeEventListener("paste", this._handlePaste);
|
|
||||||
|
|
||||||
// 如果有触摸事件,也移除它们
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 清除引用
|
// 清除引用
|
||||||
this.toolManager = null;
|
this.toolManager = null;
|
||||||
this.commandManager = null;
|
this.commandManager = null;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
@canvasInit="canvasInit"
|
@canvasInit="canvasInit"
|
||||||
@changeCanvas="changeCanvas"
|
@changeCanvas="changeCanvas"
|
||||||
is-general
|
is-general
|
||||||
|
:isBackgroundChangeable="false"
|
||||||
ref="editCanvas"></editCanvas>
|
ref="editCanvas"></editCanvas>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
|
|||||||
@@ -266,7 +266,6 @@ const userHabit : Module<UserHabit,RootState> = {
|
|||||||
// data.systemUser = 0
|
// data.systemUser = 0
|
||||||
state.userDetail.affiliate = data.affiliate
|
state.userDetail.affiliate = data.affiliate
|
||||||
state.userDetail.systemUser = data.systemUser
|
state.userDetail.systemUser = data.systemUser
|
||||||
// state.userDetail.systemUser = 3
|
|
||||||
// 身份列表1:可以使用aida系统,2:可以使用affiliate页面,3:系统管理员用户
|
// 身份列表1:可以使用aida系统,2:可以使用affiliate页面,3:系统管理员用户
|
||||||
state.userDetail.systemList = []
|
state.userDetail.systemList = []
|
||||||
if(data.systemUser != 0)state.userDetail.systemList.push(1)
|
if(data.systemUser != 0)state.userDetail.systemList.push(1)
|
||||||
|
|||||||
@@ -105,6 +105,10 @@ const Workspace: Module<DesignDetail, RootState> = {
|
|||||||
systemDesignerPercentage: 30,
|
systemDesignerPercentage: 30,
|
||||||
model: [] //模特
|
model: [] //模特
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
createProjectPath(state){
|
||||||
|
state.projectPath = ''
|
||||||
|
state.cachedRoutes = []
|
||||||
},
|
},
|
||||||
setProjectPath(state, path) {
|
setProjectPath(state, path) {
|
||||||
state.projectPath = path
|
state.projectPath = path
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ axios.interceptors.response.use((res) =>{
|
|||||||
message.warning('Please login and try again~')
|
message.warning('Please login and try again~')
|
||||||
store.commit('createDetail')
|
store.commit('createDetail')
|
||||||
store.commit('createProbject')
|
store.commit('createProbject')
|
||||||
|
store.commit('createProjectPath')
|
||||||
setTimeout(()=>[
|
setTimeout(()=>[
|
||||||
isLoginTime = false
|
isLoginTime = false
|
||||||
],2000)
|
],2000)
|
||||||
|
|||||||
@@ -1232,7 +1232,7 @@ export default defineComponent({
|
|||||||
this.$router.replace('/')
|
this.$router.replace('/')
|
||||||
this.store.commit('createDetail')
|
this.store.commit('createDetail')
|
||||||
this.store.commit('createProbject')
|
this.store.commit('createProbject')
|
||||||
|
this.store.commit('createProjectPath')
|
||||||
// WriteCookie("token");
|
// WriteCookie("token");
|
||||||
// window.location.reload()
|
// window.location.reload()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -454,11 +454,7 @@ export default defineComponent({
|
|||||||
// router.push(`/home?history=${data.id}`)
|
// router.push(`/home?history=${data.id}`)
|
||||||
// if(data.id)
|
// if(data.id)
|
||||||
if(data.id === this.store.state.Workspace.probjects.id){
|
if(data.id === this.store.state.Workspace.probjects.id){
|
||||||
let cachedRoutes = this.store.state.Workspace.cachedRoutes
|
this.store.commit('createProjectPath','')
|
||||||
for (let i = cachedRoutes.length - 1; i >= 0; i--) {
|
|
||||||
cachedRoutes.splice(i, 1);
|
|
||||||
}
|
|
||||||
this.store.commit('setProjectPath','')
|
|
||||||
}
|
}
|
||||||
// this.getHistoryList()
|
// this.getHistoryList()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user