askbot-dragon 1.6.74-beta → 1.6.75-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/previewPdf.vue +42 -31
package/package.json
CHANGED
|
@@ -157,24 +157,24 @@ import pdfPosition from './pdfPosition.vue'
|
|
|
157
157
|
import { zoomElement } from '../assets/js/hammer'
|
|
158
158
|
import IntelligentSummary from "./intelligentSummary";
|
|
159
159
|
import { isMobile } from "../assets/js/common";
|
|
160
|
-
import { Toast } from 'vant';
|
|
160
|
+
// import { Toast } from 'vant';
|
|
161
161
|
export default {
|
|
162
162
|
data () {
|
|
163
163
|
return {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
164
|
+
previewShowPopup: false,
|
|
165
|
+
fileText: '',
|
|
166
|
+
fileType: "",
|
|
167
|
+
isPc: false,
|
|
168
|
+
drawer: false,
|
|
169
|
+
tagIds: [],
|
|
170
|
+
// '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
|
|
171
|
+
loading: true,
|
|
172
|
+
fileName:'',
|
|
173
|
+
previewKnowledgeId:"",
|
|
174
|
+
showSummary:true,
|
|
175
|
+
iframeHeight:"100%",
|
|
176
|
+
isDownload: false,
|
|
177
|
+
textWatermarkStr:""
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
180
|
mounted() {
|
|
@@ -430,25 +430,36 @@ export default {
|
|
|
430
430
|
}
|
|
431
431
|
}).then(res => {
|
|
432
432
|
console.log('downLoad 341', res)
|
|
433
|
-
if (res.data) {
|
|
433
|
+
if (res.data|| res.bodyText) {
|
|
434
434
|
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
|
|
435
435
|
if (isMobile()) {
|
|
436
436
|
|
|
437
|
-
|
|
438
|
-
// 在 textarea 中插入需要复制的文本
|
|
439
|
-
textArea.value = res.data;
|
|
440
|
-
// 将 textarea 添加到文档中
|
|
441
|
-
document.body.appendChild(textArea);
|
|
442
|
-
|
|
443
|
-
textArea.select();
|
|
444
|
-
var successful =document.execCommand('copy');
|
|
445
|
-
console.log(successful, 'successful');
|
|
446
|
-
if(successful) {
|
|
447
|
-
Toast('下载地址已复制,请前往Safari浏览器访问下载')} else {
|
|
448
|
-
|
|
449
|
-
}
|
|
450
|
-
// 移除 textarea 元素
|
|
451
|
-
document.body.removeChild(textArea);
|
|
437
|
+
// const textArea = document.createElement("textarea");
|
|
438
|
+
// // 在 textarea 中插入需要复制的文本
|
|
439
|
+
// textArea.value = res.data;
|
|
440
|
+
// // 将 textarea 添加到文档中
|
|
441
|
+
//document.body.appendChild(textArea);
|
|
442
|
+
//// 选中 textarea 的内容
|
|
443
|
+
// textArea.select();
|
|
444
|
+
//var successful =document.execCommand('copy');
|
|
445
|
+
// console.log(successful, 'successful');
|
|
446
|
+
//if(successful) {
|
|
447
|
+
//Toast('下载地址已复制,请前往Safari浏览器访问下载')// } else {
|
|
448
|
+
// Toast('请允许复制内容到剪贴板')
|
|
449
|
+
// }
|
|
450
|
+
// // 移除 textarea 元素
|
|
451
|
+
// document.body.removeChild(textArea);
|
|
452
|
+
const iframe = document.createElement("iframe");
|
|
453
|
+
iframe.setAttribute("hidden", "hidden");
|
|
454
|
+
iframe.onload = () => {
|
|
455
|
+
if (iframe) {
|
|
456
|
+
console.log("iframe onload....")
|
|
457
|
+
iframe.setAttribute('src', 'about:blank');
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
document.body.insertBefore(iframe, null);
|
|
461
|
+
iframe.setAttribute("src", res.data || res.bodyText);
|
|
462
|
+
// Toast('下载地址已复制,请前往Safari浏览器访问下载')
|
|
452
463
|
this.close()
|
|
453
464
|
|
|
454
465
|
} else {
|