From 53ff508635b97cab961b03f427e9ad7caba50149 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Wed, 25 Dec 2024 12:04:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=AB=E6=A0=BC=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- .../src/components/grid-pic/index.vue | 26 ++++++++++++------- src/renderer/src/views/prepare/index.vue | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 9c9774e..f27fc00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win-ws", - "version": "2.5.8", + "version": "2.5.9", "description": "", "main": "./out/main/index.js", "author": "上海交大重庆人工智能研究院", diff --git a/src/renderer/src/components/grid-pic/index.vue b/src/renderer/src/components/grid-pic/index.vue index 9725af6..40fdd26 100644 --- a/src/renderer/src/components/grid-pic/index.vue +++ b/src/renderer/src/components/grid-pic/index.vue @@ -53,7 +53,7 @@ const props = defineProps({ showToolbar: { type: Boolean, - default: true + default: false } }) // 获取图片样式 @@ -149,20 +149,26 @@ addPic(src) } // 添加图片 - const addPic = (src) => { - if (gridPicList.value.length >= 9) { + const addPic = (data) => { + let list = Array.isArray(data)?data:[data] + if (gridPicList.value.length + list.length > 9) { console.log("超出九个图片") emits('outIndex') return } - if (!src) { - console.log("图片链接不能为空") - return; + let listArr = []; + for (let i = 0; i < list.length; i++) { + let src = list[i] + if (!src) { + console.log("图片链接不能为空") + return; + } + listArr.push({ + src: src, + backgroundColor: getRandomColor() + }) } - gridPicList.value.push({ - src: src, - backgroundColor: getRandomColor() - }) + gridPicList.value.push(...listArr) inputValue.value = '' } // 清空图片 diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 7ee3ab0..38a6e34 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -10,7 +10,7 @@ 新建文枢课件 AI一键生成 - 打开宫格 + 导入PPT