|
@@ -49,6 +49,10 @@
|
|
|
<img :src="checkImg" alt="" v-if="checkArray.indexOf(item.id) == -1">
|
|
|
<img :src="checkIsImg" alt="" v-else>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="copy_file_url" @click.stop="copyFileUrl(item.file)">
|
|
|
+ <svg t="1755826807777" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5640" width="200" height="200"><path d="M949.992727 74.472727l-4.096-4.096a241.850182 241.850182 0 0 0-340.992 0L387.537455 287.650909a241.943273 241.943273 0 0 0 0 341.085091l4.002909 4.002909c7.819636 7.726545 16.197818 14.801455 24.669091 21.410909l79.499636-79.592727c-9.309091-5.399273-18.059636-12.101818-25.972364-20.014546l-4.002909-3.909818a130.792727 130.792727 0 0 1 0-184.785454l217.460364-217.367273a130.606545 130.606545 0 0 1 184.599273 0l4.002909 4.002909a130.699636 130.699636 0 0 1 0 184.692364L773.585455 435.665455c17.035636 42.263273 25.134545 87.133091 24.296727 131.909818l152.110545-152.017455a241.757091 241.757091 0 0 0 0-340.992z m-321.163636 313.157818a238.685091 238.685091 0 0 0-24.762182-21.410909l-79.499636 79.499637c9.309091 5.585455 18.152727 12.101818 26.065454 20.107636l4.096 4.002909a130.699636 130.699636 0 0 1 0 184.692364L337.361455 871.889455a130.885818 130.885818 0 0 1-184.785455 0l-4.002909-4.096a130.699636 130.699636 0 0 1 0-184.692364l98.304-98.210909a336.989091 336.989091 0 0 1-24.389818-131.909818L70.376727 604.811636a241.943273 241.943273 0 0 0 0 341.178182l4.002909 4.096a242.036364 242.036364 0 0 0 341.085091 0L632.832 732.625455a242.036364 242.036364 0 0 0 0-341.085091l-4.002909-4.002909z" fill="#000" p-id="5641"></path></svg>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="f_box_file_list" v-else-if="stype == '2' && fileArray.length" v-loading.body="isLoading">
|
|
@@ -805,6 +809,41 @@ export default {
|
|
|
}
|
|
|
this.$emit('addFile', file)
|
|
|
this.checkArray = []
|
|
|
+ },
|
|
|
+ copyFileUrl(url){
|
|
|
+ // 复制文件链接到剪切板
|
|
|
+ if (!url) {
|
|
|
+ this.$message.error('无效的文件链接');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 兼容不同浏览器
|
|
|
+ if (navigator && navigator.clipboard && window.isSecureContext) {
|
|
|
+ navigator.clipboard.writeText(url).then(() => {
|
|
|
+ this.$message.success('文件链接已复制到剪切板');
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('复制失败,请手动复制');
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 创建临时textarea
|
|
|
+ let textarea = document.createElement('textarea');
|
|
|
+ textarea.value = url;
|
|
|
+ textarea.style.position = 'fixed';
|
|
|
+ textarea.style.top = '-9999px';
|
|
|
+ document.body.appendChild(textarea);
|
|
|
+ textarea.focus();
|
|
|
+ textarea.select();
|
|
|
+ try {
|
|
|
+ let successful = document.execCommand('copy');
|
|
|
+ if (successful) {
|
|
|
+ this.$message.success('文件链接已复制到剪切板');
|
|
|
+ } else {
|
|
|
+ this.$message.error('复制失败,请手动复制');
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ this.$message.error('复制失败,请手动复制');
|
|
|
+ }
|
|
|
+ document.body.removeChild(textarea);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -1323,4 +1362,19 @@ export default {
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|
|
|
}
|
|
|
-</style>
|
|
|
+
|
|
|
+.copy_file_url{
|
|
|
+ width:15px;
|
|
|
+ height:15px;
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ top: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.copy_file_url>svg{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ object-fit: cover;
|
|
|
+}
|
|
|
+</style>
|