From 71b7cec5609c06b6a179d148374f472adf08d6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Mon, 18 Sep 2023 09:15:15 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=8F=92=E5=85=A5=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/page1/components/InsertImage.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pages/page1/components/InsertImage.vue b/src/pages/page1/components/InsertImage.vue index f210299..6511a10 100644 --- a/src/pages/page1/components/InsertImage.vue +++ b/src/pages/page1/components/InsertImage.vue @@ -86,6 +86,7 @@ export default { }, loading: false, imageUrl: '', + imageIpUrl: '', // 用IP的图片,给onlyoffice的 plainOptions, form: { title: '', @@ -432,7 +433,7 @@ export default { handleOk () { console.log('图片上传和了') 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.imgSize = this.form.size const width = pxConversionMm(this.imgOrigin.width) @@ -467,6 +468,7 @@ export default { imgSize.height = 89.3 break } + console.log('创建文档图片的地址', Asc.scope.imageUrl) const oDrawing = Api.CreateImage(Asc.scope.imageUrl, imgSize.width * 36000, imgSize.height * 36000) imgOParagraph.AddDrawing(oDrawing) // const allElement = oDocument.GetElementsCount() @@ -523,6 +525,7 @@ export default { }) setTimeout(() => { this.form = {} + this.imageIpUrl = '' this.imageUrl = '' }, 200) @@ -566,10 +569,13 @@ export default { data: _data }).then(res => { this.loading = false - console.log(res) - this.imageUrl = this.downloadFilePath + '?path=' + res.result.url + this.imageUrl = this.staticFilePath + '?path=' + res.result.url + this.imageIpUrl = this.downloadFilePath + '?path=' + res.result.url 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) { this.imgOrigin = { width: img.width,