宫格插件
This commit is contained in:
parent
89e0b2f97c
commit
53ff508635
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "aix-win-ws",
|
||||
"version": "2.5.8",
|
||||
"version": "2.5.9",
|
||||
"description": "",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "上海交大重庆人工智能研究院",
|
||||
|
|
|
@ -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
|
||||
}
|
||||
let listArr = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let src = list[i]
|
||||
if (!src) {
|
||||
console.log("图片链接不能为空")
|
||||
return;
|
||||
}
|
||||
gridPicList.value.push({
|
||||
listArr.push({
|
||||
src: src,
|
||||
backgroundColor: getRandomColor()
|
||||
})
|
||||
}
|
||||
gridPicList.value.push(...listArr)
|
||||
inputValue.value = ''
|
||||
}
|
||||
// 清空图片
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="createAIPPT">新建文枢课件</el-dropdown-item>
|
||||
<el-dropdown-item @click="aiTOPPT">AI一键生成</el-dropdown-item>
|
||||
<el-dropdown-item @click="openGridPic">打开宫格</el-dropdown-item>
|
||||
<!-- <el-dropdown-item @click="openGridPic">打开宫格</el-dropdown-item>-->
|
||||
<el-dropdown-item @click="openFilePicker">导入PPT</el-dropdown-item>
|
||||
<input type="file" ref="fileInput" style="display: none;" @change="handleFileChange" accept="application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation">
|
||||
</el-dropdown-menu>
|
||||
|
|
Loading…
Reference in New Issue