fix 插入图片
This commit is contained in:
@@ -86,6 +86,7 @@ export default {
|
|||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
|
imageIpUrl: '', // 用IP的图片,给onlyoffice的
|
||||||
plainOptions,
|
plainOptions,
|
||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
@@ -432,7 +433,7 @@ export default {
|
|||||||
handleOk () {
|
handleOk () {
|
||||||
console.log('图片上传和了')
|
console.log('图片上传和了')
|
||||||
this.visible = false
|
this.visible = false
|
||||||
window.Asc.scope.imageUrl = this.imageUrl
|
window.Asc.scope.imageUrl = this.imageIpUrl
|
||||||
window.Asc.scope.title = this.form.title
|
window.Asc.scope.title = this.form.title
|
||||||
window.Asc.scope.imgSize = this.form.size
|
window.Asc.scope.imgSize = this.form.size
|
||||||
const width = pxConversionMm(this.imgOrigin.width)
|
const width = pxConversionMm(this.imgOrigin.width)
|
||||||
@@ -467,6 +468,7 @@ export default {
|
|||||||
imgSize.height = 89.3
|
imgSize.height = 89.3
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
console.log('创建文档图片的地址', Asc.scope.imageUrl)
|
||||||
const oDrawing = Api.CreateImage(Asc.scope.imageUrl, imgSize.width * 36000, imgSize.height * 36000)
|
const oDrawing = Api.CreateImage(Asc.scope.imageUrl, imgSize.width * 36000, imgSize.height * 36000)
|
||||||
imgOParagraph.AddDrawing(oDrawing)
|
imgOParagraph.AddDrawing(oDrawing)
|
||||||
// const allElement = oDocument.GetElementsCount()
|
// const allElement = oDocument.GetElementsCount()
|
||||||
@@ -523,6 +525,7 @@ export default {
|
|||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.form = {}
|
this.form = {}
|
||||||
|
this.imageIpUrl = ''
|
||||||
this.imageUrl = ''
|
this.imageUrl = ''
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
@@ -566,10 +569,13 @@ export default {
|
|||||||
data: _data
|
data: _data
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(res)
|
this.imageUrl = this.staticFilePath + '?path=' + res.result.url
|
||||||
this.imageUrl = this.downloadFilePath + '?path=' + res.result.url
|
this.imageIpUrl = this.downloadFilePath + '?path=' + res.result.url
|
||||||
const img = new Image()
|
const img = new Image()
|
||||||
img.src = this.downloadFilePath + '?path=' + res.result.url
|
img.src = this.staticFilePath + '?path=' + res.result.url
|
||||||
|
console.log('给onlyoffice的', this.imageIpUrl)
|
||||||
|
console.log('页面显示的', img.src)
|
||||||
|
console.log('页面显示的true', this.imageUrl)
|
||||||
if (img.complete) {
|
if (img.complete) {
|
||||||
this.imgOrigin = {
|
this.imgOrigin = {
|
||||||
width: img.width,
|
width: img.width,
|
||||||
|
|||||||
Reference in New Issue
Block a user