askbot-dragon 1.3.34 → 1.3.36

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.34",
3
+ "version": "1.3.36",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -24,6 +24,9 @@
24
24
  <div class="onload_btn" @click="downLoad">
25
25
  下载
26
26
  </div>
27
+ <div id="text">
28
+ {{ copy }}
29
+ </div>
27
30
  </div>
28
31
  </template>
29
32
 
@@ -35,7 +38,8 @@ export default {
35
38
  data () {
36
39
  return {
37
40
  previewShowPopup: false,
38
- title:'工单附件'
41
+ title:'工单附件',
42
+ copy:''
39
43
  }
40
44
  },
41
45
  props: {
@@ -105,12 +109,26 @@ export default {
105
109
  }
106
110
  const fileType = url.substring(url.lastIndexOf('.'));
107
111
  this.$http.post('/knowledge-api/temporary-certificate/or-origin?expired=10', url, {
108
- "Content-Type": "application/json",
112
+ headers:{
113
+ "Content-Type": "application/json",
114
+ }
109
115
  }).then(res => {
110
116
  if (res.data) {
111
117
  if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
118
+ this.copy = res.data
112
119
  if(isMobile()) {
113
- Toast('下载地址已复制,请前往Safari浏览器访问下载');
120
+ setTimeout(() =>{
121
+ const range = document.createRange();
122
+ range.selectNode(document.getElementById('text'));
123
+ const selection = window.getSelection();
124
+ //移除之前选中内容
125
+ if (selection.rangeCount > 0) selection.removeAllRanges();
126
+ selection.addRange(range);
127
+ document.execCommand('copy');
128
+ selection.removeAllRanges()
129
+ Toast('下载地址已复制,请前往Safari浏览器访问下载');
130
+ this.close()
131
+ },100)
114
132
  } else {
115
133
  navigator.clipboard.writeText(res.data)
116
134
  this.$message.success({
@@ -123,6 +141,7 @@ export default {
123
141
  a.href = res.data
124
142
  a.download = (this.title) + fileType
125
143
  a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
144
+ this.close()
126
145
  }
127
146
  }
128
147
  })