Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite

This commit is contained in:
zhangyh
2025-09-22 15:30:30 +08:00
26 changed files with 297 additions and 131 deletions

View File

@@ -870,7 +870,7 @@ export class ExportManager {
const clipObject = this.canvas?.clipPath;
if (!clipObject) {
console.warn("未找到可用的裁剪对象");
return null;
return null;
}
// 克隆对象作为裁剪路径
@@ -878,7 +878,6 @@ export class ExportManager {
clipObject,
false,
false
);
if (!clonedClipPath) {

View File

@@ -759,13 +759,13 @@ export class ToolManager {
* @private
*/
_showRasterizeConfirmModal(isGroup, layerId) {
const title = "栅格化图层";
const content = "需要先栅格化才能进行液化操作,是否立即栅格化?";
const title = this.t("Canvas.RasterizedLayer");
const content = this.t("Canvas.rasterizeImmediately");
Modal.confirm({
title,
content,
okText: "确定栅格化",
okText: this.t("Canvas.ConfirmRasterization"),
cancelText: "取消",
centered: true,
icon: h("span", { style: "color: #faad14;" }, "⚠️"),
@@ -800,8 +800,8 @@ export class ToolManager {
if (!this.commandManager || !this.layerManager) return;
// 显示加载Modal
const loadingModal = Modal.info({
title: "正在栅格化",
content: "正在栅格化图层,请稍候...",
title: this.t('Canvas.beingRasterized'),
content: this.t('Canvas.waitRasterizing'),
okButtonProps: { style: { display: "none" } },
centered: true,
closable: false,
@@ -823,16 +823,16 @@ export class ToolManager {
if (result) {
// 栅格化成功,启动液化
message.success("图层已成功栅格化,可以进行液化操作");
message.success(this.t('Canvas.successRasterizing'));
this._startLiquify(result);
this.setTool(OperationType.LIQUIFY); // 切换到液化工具
} else {
// 栅格化失败
Modal.error({
title: "栅格化失败",
content: "栅格化失败,无法进行液化操作",
okText: "确定",
title: this.t('Canvas.gridingFailed'),
content: this.t('Canvas.gridingFailedNoOperation'),
okText: this.t('Canvas.ok'),
centered: true,
});
}
@@ -840,9 +840,9 @@ export class ToolManager {
console.error("栅格化图层失败:", error);
Modal.error({
title: "栅格化错误",
content: `栅格化失败${error.message}`,
okText: "确定",
title: this.t('Canvas.gridingError'),
content: `${this.t('Canvas.gridingFailed')}${error.message}`,
okText: this.t('Canvas.ok'),
centered: true,
});
} finally {
@@ -866,9 +866,9 @@ export class ToolManager {
);
if (!layer) {
Modal.error({
title: "图层错误",
content: "图层不存在",
okText: "确定",
title: this.t('Canvas.LayerError'),
content: this.t('Canvas.LayerDoesNotExist'),
okText: this.t('Canvas.ok'),
centered: true,
});
return;
@@ -880,9 +880,9 @@ export class ToolManager {
// 背景图层使用 fabricObject (单数)
if (!layer.fabricObject) {
Modal.warning({
title: "背景图层为空",
content: "背景图层为空,无法进行液化操作",
okText: "确定",
title: this.t('Canvas.backgroundEmpty'),
content: this.t('Canvas.backgroundEmptyNoLiquidation'),
okText: this.t('Canvas.ok'),
centered: true,
});
return;
@@ -892,9 +892,9 @@ export class ToolManager {
// 普通图层使用 fabricObjects (复数)
if (!layer.fabricObjects || layer.fabricObjects.length === 0) {
Modal.warning({
title: "图层为空",
content: "图层为空,无法进行液化操作",
okText: "确定",
title: this.t('Canvas.layerEmpty'),
content: this.t('Canvas.layerEmptyNoLiquidation'),
okText: this.t('Canvas.ok'),
centered: true,
});
return;
@@ -906,9 +906,9 @@ export class ToolManager {
const liquifyManager = this.canvasManager?.liquifyManager;
if (!liquifyManager) {
Modal.error({
title: "液化管理器错误",
content: "液化管理器未初始化",
okText: "确定",
title: this.t('Canvas.liqueficationManagerError'),
content: this.t('Canvas.liqueficationManagerErrorInitialized'),
okText: this.t('Canvas.ok'),
centered: true,
});
return;
@@ -917,8 +917,8 @@ export class ToolManager {
try {
// 显示准备中的Modal
const preparingModal = Modal.info({
title: "准备液化环境",
content: "正在准备液化环境,请稍候...",
title: this.t('Canvas.liquefactionEnvironment'),
content: this.t('Canvas.liquefactionEnvironmentLoading'),
okButtonProps: { style: { display: "none" } },
centered: true,
closable: false,
@@ -963,9 +963,9 @@ export class ToolManager {
} catch (error) {
console.error("启动液化工具失败:", error);
Modal.error({
title: "液化工具启动失败",
content: `启动液化工具失败:${error.message}`,
okText: "确定",
title: this.t('Canvas.LiqueficationFailed'),
content: `${this.t('Canvas.LiqueficationFailed')}:${error.message}`,
okText: this.t('Canvas.ok'),
centered: true,
});
}
@@ -1041,7 +1041,7 @@ export class ToolManager {
_createTextDirect(x, y, options = {}) {
// 默认文本属性
const defaultOptions = {
text: "双击编辑文本",
text: this.t('Canvas.DoubleClickText'),
fontFamily: "Arial",
fontSize: 24,
fontWeight: "normal",

View File

@@ -12,6 +12,7 @@
:enabledRedGreenMode="true"
:clothingImageUrl="imageUrls.baseImage"
:redGreenImageUrl="imageUrls.maskImage"
@trigger-red-green-mouseup="frontBackChange"
:clothingImageOpts="{ imageMode: 'contains' }"
/>
</div>
@@ -51,6 +52,9 @@ const loadJSON = () => {
const changeFixedImage = () => {
canvasEditor.value.changeFixedImage(changeImageUrl);
};
const frontBackChange = (value) =>{
console.log(value)
}
// 组件挂载时绑定键盘事件
onMounted(() => {});