From da9c2badeffe5b3689804461103e955d660c6b71 Mon Sep 17 00:00:00 2001
From: bighuixiang <472705331@qq.com>
Date: Mon, 23 Jun 2025 16:48:48 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E5=BA=93=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=94=AF=E6=8C=81=E9=80=89?=
=?UTF-8?q?=E6=8B=A9=E5=92=8C=E5=B1=95=E7=A4=BA=E4=B8=8D=E5=90=8C=E7=B1=BB?=
=?UTF-8?q?=E5=88=AB=E7=9A=84=E5=9B=BE=E7=89=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/icons/CImageList.svg | 1 +
.../CanvasEditor/components/HeaderMenu.vue | 7 +
src/component/Canvas/CanvasEditor/index.vue | 7 +-
.../Canvas/ExistsImageList/index.vue | 508 ++++++++++++++++++
src/component/Canvas/canvasExample.vue | 47 +-
5 files changed, 568 insertions(+), 2 deletions(-)
create mode 100644 src/assets/icons/CImageList.svg
create mode 100644 src/component/Canvas/ExistsImageList/index.vue
diff --git a/src/assets/icons/CImageList.svg b/src/assets/icons/CImageList.svg
new file mode 100644
index 00000000..861cf64b
--- /dev/null
+++ b/src/assets/icons/CImageList.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue b/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue
index a26e584d..8df5ab96 100644
--- a/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue
+++ b/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue
@@ -318,6 +318,13 @@ onMounted(() => {
▼
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/component/Canvas/ExistsImageList/index.vue b/src/component/Canvas/ExistsImageList/index.vue
new file mode 100644
index 00000000..514df954
--- /dev/null
+++ b/src/component/Canvas/ExistsImageList/index.vue
@@ -0,0 +1,508 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+ {{ item.name || "未命名" }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/component/Canvas/canvasExample.vue b/src/component/Canvas/canvasExample.vue
index c2873f4d..d3e232fa 100644
--- a/src/component/Canvas/canvasExample.vue
+++ b/src/component/Canvas/canvasExample.vue
@@ -2,6 +2,7 @@
import { ref } from "vue";
import CanvasEditor from "./CanvasEditor/index.vue";
import RedGreenModeExample from "./RedGreenModeExample.vue";
+import ExistsImageList from "@/component/Canvas/ExistsImageList/index.vue";
// 当前显示的组件
const canvasEditor = ref();
@@ -21,6 +22,46 @@ const editorConfig = {
backgroundColor: "#f8f8f8",
};
+const imageData = [
+ {
+ name: "风景照片",
+ type: "风景",
+ imgList: [
+ { url: "/src/assets/work/1.PNG", name: "山景" },
+ { url: "/src/assets/work/2.PNG", name: "海景" },
+ ],
+ },
+ {
+ name: "人物照片",
+ type: "人物",
+ imgList: [
+ { url: "/src/assets/work/3.PNG", name: "肖像1" },
+ { url: "/src/assets/work/5.PNG", name: "肖像2" },
+ ],
+ },
+ {
+ name: "衣服照片",
+ type: "衣服",
+ imgList: [
+ { url: "/src/assets/work/3.PNG", name: "肖像1" },
+ { url: "/src/assets/work/5.PNG", name: "肖像2" },
+ ],
+ },
+ {
+ name: "裤子照片",
+ type: "裤子",
+ imgList: [
+ { url: "/src/assets/work/IMG_0001.PNG", name: "肖像1" },
+ { url: "/src/assets/work/IMG_0008.PNG", name: "肖像2" },
+ ],
+ },
+];
+
+const handleImageSelect = (selectedImage) => {
+ console.log("选中的图片:", selectedImage);
+ // selectedImage 包含:url, name, categoryName, categoryType, originalItem
+};
+
const getJSON = () => {
if (canvasEditor.value) {
const json = canvasEditor.value.getJSON();
@@ -96,7 +137,11 @@ const changeFixedImage = () => {
:clothing-image-opts="{
imageMode: 'contains', // 设置底图包含在画布内
}"
- />
+ >
+
+
+
+