部件选取多语言

This commit is contained in:
李志鹏
2026-01-26 17:07:06 +08:00
parent 44674b5396
commit 8ff7a31e92
4 changed files with 23 additions and 10 deletions

View File

@@ -20,13 +20,13 @@
<img
src="/src/assets/images/canvas/shubiao-l.png"
/>
<span>Left Click: Add</span>
<span>{{ t("Canvas.LeftClickAdd") }}</span>
</div>
<div>
<img
src="/src/assets/images/canvas/shubiao-r.png"
/>
<span>Right Click: Remove</span>
<span>{{ t("Canvas.RightClickRemove") }}</span>
</div>
</div>
</div>
@@ -65,7 +65,7 @@
</div> -->
<div class="action-btn" @click="onReset">
<svg-icon name="CCut" size="26" />
<span class="btn-text">清空当前点位</span>
<span class="btn-text">{{ $t("Canvas.TheClearlySelectedContent") }}</span>
</div>
</div>
</div>
@@ -77,6 +77,8 @@
import { ref, onMounted, watch } from "vue";
import { useI18n } from "vue-i18n";
import { OperationType } from "../utils/layerHelper";
// 国际化
const { t } = useI18n();
const props = defineProps({
canvas: {
type: Object,
@@ -121,32 +123,30 @@
const toolList = [
{
type: OperationType.PART,
label: "Point Selection",
label: t("Canvas.PointSelection"),
icon: "CPoint",
size: "20",
},
{
type: OperationType.PART_RECTANGLE,
label: "Marquee Selection",
label: t("Canvas.MarqueeSelection"),
icon: "CMarquee",
size: "20",
},
{
type: OperationType.PART_BRUSH,
label: "Brush Selection",
label: t("Canvas.BrushSelection"),
icon: "CBrush2",
size: "16",
},
{
type: OperationType.PART_ERASER,
label: "Erase",
label: t("Canvas.Erase"),
icon: "CEraser2",
size: "22",
},
];
// 国际化
const { t } = useI18n();
onMounted(() => {});

View File

@@ -108,6 +108,7 @@ export class PartManager {
}
// 如果从选区工具切换到非选区工具,清理事件和选区
else if (wasActive && !this.isActive) {
this.selectionManager.clearSelection();
this.cleanupEvents();
this.clearPartObject();
this.clearPointData();
@@ -618,7 +619,7 @@ export class PartManager {
selectionManager: this.selectionManager,
toolManager: this.toolManager,
})
this.commandManager.execute(cmd);
this.commandManager.execute(cmd)
}
/** 清空点位 */
clearPart() {