askbot-dragon 1.6.75-beta → 1.6.76-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.6.75-beta",
3
+ "version": "1.6.76-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -5,40 +5,6 @@
5
5
  另外增加了在知识项目中预览当前文件的一些功能
6
6
  -->
7
7
  <template>
8
- <!-- <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}" v-if="previewShowPopup">
9
- <div class="footer">
10
- <span>查看详情</span>
11
- <section @click="close">
12
- <i class="iconfont guoran-shanchu"></i>
13
- </section>
14
- </div>
15
- <template v-if="tagIds && tagIds.length != 0 && previewShowPopup">
16
- <pdfPosition :tagIds="tagIds" ></pdfPosition>
17
- </template>
18
- <template v-else>
19
- <div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 60px)">
20
- <video :src="url" controls width="100%;" height="98%"></video>
21
- </div>
22
- <div v-else-if="fileType == 'HTML'" style="width: 100%;height: calc(100% - 60px)">
23
- <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
24
- </div>
25
- <template v-else-if="url.includes('https://www') || url.includes('http://www')">
26
- <iframe class="preview_iframe"
27
- :src="url"
28
- width="100%"
29
- height="100%"
30
- scrolling="100%"
31
- frameborder="no"
32
- border="0"></iframe>
33
- </template>
34
- <template v-else>
35
- <iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
36
- </template>
37
- </template>
38
- <div class="loading_img" v-show="loading">
39
- <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
40
- </div>
41
- </van-popup> -->
42
8
  <el-drawer title="我是标题" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
43
9
  :modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
44
10
  custom-class="pdf-preview-drawer" v-if="drawer">
@@ -214,7 +180,7 @@ export default {
214
180
  type: String,
215
181
  default: '',
216
182
  },
217
- folderName: {
183
+ folderName: {
218
184
  type: String,
219
185
  default: '',
220
186
  },
@@ -431,68 +397,26 @@ export default {
431
397
  }).then(res => {
432
398
  console.log('downLoad 341', res)
433
399
  if (res.data|| res.bodyText) {
434
- if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
435
- if (isMobile()) {
436
-
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浏览器访问下载')
463
- this.close()
464
-
465
- } else {
466
- navigator.clipboard.writeText(res.data)
467
- this.$message.success({
468
- message: '下载地址已复制,请前往Safari浏览器访问下载',
469
- })
470
- }
471
- return
472
- } else {
473
- // setTimeout(() =>{
474
- // window.open(res.data,'下载', 'noopener')
475
- // }, 2000)
476
- // window.open(res.data,'下载', 'noopener')
477
- if (isMobile()) {
478
- const iframe = document.createElement("iframe");
479
- iframe.setAttribute("hidden", "hidden");
480
- iframe.onload = () => {
481
- if (iframe) {
482
- console.log("iframe onload....")
483
- iframe.setAttribute('src', 'about:blank');
484
- }
485
- };
486
- document.body.insertBefore(iframe, null);
487
- iframe.setAttribute("src", res.data);
400
+ if (isMobile()) {
401
+
402
+ const iframe = document.createElement("iframe");
403
+ iframe.setAttribute("hidden", "hidden");
404
+ iframe.onload = () => {
405
+ if (iframe) {
406
+ console.log("iframe onload....")
407
+ iframe.setAttribute('src', 'about:blank');
408
+ }
409
+ };
410
+ document.body.insertBefore(iframe, null);
411
+ iframe.setAttribute("src", res.data || res.bodyText);
488
412
  } else {
489
413
  let a = document.createElement('a')
490
- a.href = res.data
414
+ a.href = res.data|| res.bodyText
491
415
  a.download = (this.title) + fileType
492
416
  a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
493
417
  }
494
418
  this.close()
495
- }
419
+
496
420
  }
497
421
  })
498
422
  },
@@ -661,6 +585,7 @@ export default {
661
585
  top: -34px;
662
586
  left: 12px;
663
587
  }
588
+
664
589
  .header-btn {
665
590
  display: flex;
666
591
  align-items: center;
@@ -817,8 +742,7 @@ export default {
817
742
  height: calc(100% - 64px) !important;
818
743
  }
819
744
  }
820
- </style>
821
- <style lang="less">
745
+ </style><style lang="less">
822
746
  .pdf-preview-drawer {
823
747
  overflow: visible !important;
824
748
  }