askbot-dragon 1.3.46 → 1.3.48

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.3.46",
3
+ "version": "1.3.48",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -6,7 +6,7 @@
6
6
  <i class="iconfont guoran-shanchu"></i>
7
7
  </section>
8
8
  </div>
9
- <div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 70px)">
9
+ <!-- <div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 70px)">
10
10
  <video :src="url" controls width="100%;" height="98%"></video>
11
11
  </div>
12
12
  <template v-else-if="url.includes('https://www') || url.includes('http://www')">
@@ -20,13 +20,13 @@
20
20
  </template>
21
21
  <template v-else>
22
22
  <iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
23
- </template>
24
- <!-- <div v-show="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 70px)">
23
+ </template> -->
24
+ <div v-show="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 70px)">
25
25
  <video :src="url" controls width="100%;" height="98%"></video>
26
26
  </div>
27
27
  <div style="width: 100%;height: calc(100% - 70px)" v-show="fileType !== 'VIDEO' && fileType !== 'OTHER' && (url.includes('https://www') || url.includes('http://www'))">
28
28
  <iframe class="preview_iframe"
29
- :src="url"
29
+ :src="fileType !== 'VIDEO' && fileType !== 'OTHER' && (url.includes('https://www') || url.includes('http://www')) ? url : ''"
30
30
  width="100%"
31
31
  height="100%"
32
32
  scrolling="100%"
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
  <div style="width: 100%;height: calc(100% - 70px)" v-show="fileType == 'OTHER' && !url.includes('https://www') && !url.includes('http://www')">
37
37
  <iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
38
- </div> -->
38
+ </div>
39
39
  <div class="onload_btn" @click="downLoad">
40
40
  下载
41
41
  </div>
@@ -156,12 +156,22 @@ export default {
156
156
  // a.href = res.data
157
157
  // a.download = (this.title) + fileType
158
158
  // a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
159
- this.close()
160
159
  Toast('请稍后...');
161
160
  // setTimeout(() =>{
162
161
  // window.open(res.data,'下载', 'noopener')
163
162
  // }, 2000)
164
- window.open(res.data,'下载', 'noopener')
163
+ // window.open(res.data,'下载', 'noopener')
164
+ const iframe = document.createElement("iframe");
165
+ iframe.setAttribute("hidden", "hidden");
166
+ iframe.onload = () => {
167
+ if (iframe) {
168
+ console.log("iframe onload....")
169
+ iframe.setAttribute('src', 'about:blank');
170
+ }
171
+ };
172
+ document.body.insertBefore(iframe, null);
173
+ iframe.setAttribute("src", res.data);
174
+ this.close()
165
175
  }
166
176
  }
167
177
  })