askbot-dragon 1.5.71 → 1.5.72
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 +26 -14
package/package.json
CHANGED
|
@@ -66,6 +66,9 @@
|
|
|
66
66
|
<div class="loading_img" v-show="loading">
|
|
67
67
|
<img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
|
|
68
68
|
</div>
|
|
69
|
+
<div id="text">
|
|
70
|
+
{{ copy }}
|
|
71
|
+
</div>
|
|
69
72
|
</el-drawer>
|
|
70
73
|
</template>
|
|
71
74
|
|
|
@@ -74,7 +77,7 @@ import pdfPosition from './pdfPosition.vue'
|
|
|
74
77
|
import { zoomElement } from '../assets/js/hammer'
|
|
75
78
|
import IntelligentSummary from "./intelligentSummary";
|
|
76
79
|
import { isMobile } from "../assets/js/common";
|
|
77
|
-
|
|
80
|
+
import { Toast } from 'vant';
|
|
78
81
|
export default {
|
|
79
82
|
data () {
|
|
80
83
|
return {
|
|
@@ -90,7 +93,8 @@ export default {
|
|
|
90
93
|
showSummary: true,
|
|
91
94
|
iframeHeight: "100%",
|
|
92
95
|
isDownload: false,
|
|
93
|
-
textWatermarkStr: ""
|
|
96
|
+
textWatermarkStr: "",
|
|
97
|
+
copy:''
|
|
94
98
|
}
|
|
95
99
|
},
|
|
96
100
|
mounted () {
|
|
@@ -323,22 +327,30 @@ export default {
|
|
|
323
327
|
console.log('downLoad 341', res)
|
|
324
328
|
if (res.data || res.bodyText) {
|
|
325
329
|
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
|
|
326
|
-
|
|
330
|
+
this.copy = res.data
|
|
327
331
|
let a = document.createElement('a')
|
|
328
332
|
a.href = res.data
|
|
329
333
|
a.download = (this.title) + fileType
|
|
330
334
|
a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
335
|
+
if (isMobile()) {
|
|
336
|
+
setTimeout(() =>{
|
|
337
|
+
const range = document.createRange();
|
|
338
|
+
range.selectNode(document.getElementById('text'));
|
|
339
|
+
const selection = window.getSelection();
|
|
340
|
+
//移除之前选中内容
|
|
341
|
+
if (selection.rangeCount > 0) selection.removeAllRanges();
|
|
342
|
+
selection.addRange(range);
|
|
343
|
+
document.execCommand('copy');
|
|
344
|
+
selection.removeAllRanges()
|
|
345
|
+
Toast('下载地址已复制,请前往Safari浏览器访问下载');
|
|
346
|
+
this.close()
|
|
347
|
+
},100)
|
|
348
|
+
} else {
|
|
349
|
+
let a = document.createElement('a')
|
|
350
|
+
a.href = res.data
|
|
351
|
+
a.download = (this.title) + fileType
|
|
352
|
+
a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
|
|
353
|
+
}
|
|
342
354
|
return
|
|
343
355
|
} else {
|
|
344
356
|
// setTimeout(() =>{
|