上传图片
This commit is contained in:
parent
de0a167cf5
commit
a5be937eb3
|
@ -48,6 +48,7 @@ const init = () => {
|
||||||
if(res.rows && res.rows.length){
|
if(res.rows && res.rows.length){
|
||||||
// 过滤出图片和视频
|
// 过滤出图片和视频
|
||||||
list.value = res.rows.filter( item => suffixAry.indexOf(getFileSuffix(item.fileShowName)) != -1)
|
list.value = res.rows.filter( item => suffixAry.indexOf(getFileSuffix(item.fileShowName)) != -1)
|
||||||
|
console.log(list.value)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -64,12 +65,13 @@ const fileUrl = computed(() => (item) =>{
|
||||||
// 插入
|
// 插入
|
||||||
const onInsert = async (item) =>{
|
const onInsert = async (item) =>{
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const res = await fetch(item.fileFullPath)
|
console.log('item', item)
|
||||||
const bolb = await res.blob()
|
// const res = await fetch(item.fileFullPath)
|
||||||
const file = commUtils.blobToFile(bolb, item.fileShowName)
|
// const bolb = await res.blob()
|
||||||
|
// const file = commUtils.blobToFile(bolb, item.fileShowName)
|
||||||
|
const data=item.fileFullPath
|
||||||
try {
|
try {
|
||||||
const data = await PPTApi.toRousrceUrl(file)
|
// const data = await PPTApi.toRousrceUrl(file)
|
||||||
if(videoSuffix.indexOf(getFileSuffix(item.fileShowName)) != -1){
|
if(videoSuffix.indexOf(getFileSuffix(item.fileShowName)) != -1){
|
||||||
emit('insertMaterial',{ type: 'video', data })
|
emit('insertMaterial',{ type: 'video', data })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue