askbot-dragon 1.3.35 → 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
|
@@ -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: {
|
|
@@ -111,8 +115,20 @@ export default {
|
|
|
111
115
|
}).then(res => {
|
|
112
116
|
if (res.data) {
|
|
113
117
|
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
|
|
118
|
+
this.copy = res.data
|
|
114
119
|
if(isMobile()) {
|
|
115
|
-
|
|
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)
|
|
116
132
|
} else {
|
|
117
133
|
navigator.clipboard.writeText(res.data)
|
|
118
134
|
this.$message.success({
|
|
@@ -125,6 +141,7 @@ export default {
|
|
|
125
141
|
a.href = res.data
|
|
126
142
|
a.download = (this.title) + fileType
|
|
127
143
|
a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
|
|
144
|
+
this.close()
|
|
128
145
|
}
|
|
129
146
|
}
|
|
130
147
|
})
|