doway-coms 2.10.23 → 2.10.25
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,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div style="display: inline-block">
|
|
2
|
+
<div style="display: inline-block;width:100%" >
|
|
3
|
+
<input type="file" accept style="display: none;" ref="updateLoadContentView"/>
|
|
4
|
+
<!-- <div tabindex="0" style="position:absolute;left:-9999px;" ref="updateLoadContentView"> 黏贴</div> -->
|
|
3
5
|
<div class="file-card" :class="isStyle? 'currentHeight' : ''">
|
|
4
6
|
<div
|
|
5
7
|
class="attach-wrapper"
|
|
@@ -95,31 +97,29 @@
|
|
|
95
97
|
</div>
|
|
96
98
|
</template>
|
|
97
99
|
</div>
|
|
98
|
-
|
|
100
|
+
<div v-show="edit===true" @click="selectClick" ref="updateLoadContentView"
|
|
101
|
+
style="border: 1px solid #d9d9d9; border-radius: 6px"
|
|
102
|
+
:style="{ width: width, height: height, lineHeight: height,borderColor:currentSelectId==='empty'?'blue':null }"
|
|
103
|
+
>
|
|
104
|
+
<span style="cursor: default;"> </span>
|
|
105
|
+
<a-upload
|
|
99
106
|
class="avatar-uploader"
|
|
100
107
|
:headers="uploadHeaders"
|
|
101
108
|
:action="uploadData.picAction"
|
|
102
109
|
:data="uploadData"
|
|
103
|
-
v-if="edit === true"
|
|
104
110
|
@change="handleAvatarSuccess"
|
|
105
111
|
:showUploadList="false"
|
|
106
112
|
:fileList="uploadFileList"
|
|
107
113
|
:before-upload="beforeAvatarUpload"
|
|
108
114
|
>
|
|
109
|
-
<div
|
|
110
|
-
style="border: 1px solid #d9d9d9; border-radius: 6px"
|
|
111
|
-
:style="{ width: width, height: height, lineHeight: height }"
|
|
112
|
-
>
|
|
113
115
|
<a-icon
|
|
114
116
|
type="plus"
|
|
115
117
|
class="avatar-uploader-icon"
|
|
116
|
-
style="text-align: center"
|
|
117
|
-
:style="{ width: width, height: height, lineHeight: height }"
|
|
118
|
+
style="text-align: center;width:50px;height: 50px;line-height:50px;"
|
|
118
119
|
/>
|
|
119
|
-
|
|
120
|
-
</div>
|
|
120
|
+
|
|
121
121
|
</a-upload>
|
|
122
|
-
|
|
122
|
+
</div>
|
|
123
123
|
<div v-if="edit !== true && showEmptyText && internalRows.length === 0">
|
|
124
124
|
没有附件信息哦,请编辑添加附件信息
|
|
125
125
|
</div>
|
|
@@ -167,6 +167,7 @@ export default {
|
|
|
167
167
|
},
|
|
168
168
|
data() {
|
|
169
169
|
return {
|
|
170
|
+
currentSelectId:null,
|
|
170
171
|
uploadFileList:[],
|
|
171
172
|
demo1: "",
|
|
172
173
|
demo2: "",
|
|
@@ -290,6 +291,12 @@ export default {
|
|
|
290
291
|
this.uploadData.resId = this.resId;
|
|
291
292
|
this.uploadData.picAction = this.internalServiceUrl + "/UploadAttach";
|
|
292
293
|
this.getAttachInfo(this.rows);
|
|
294
|
+
|
|
295
|
+
this.$refs.updateLoadContentView.addEventListener('paste', async (e) => {
|
|
296
|
+
e.preventDefault();
|
|
297
|
+
await this.pasteFileClick(e)
|
|
298
|
+
})
|
|
299
|
+
|
|
293
300
|
},
|
|
294
301
|
methods: {
|
|
295
302
|
getCurrentToken() {
|
|
@@ -458,31 +465,41 @@ export default {
|
|
|
458
465
|
/**
|
|
459
466
|
* 黏贴附件
|
|
460
467
|
*/
|
|
461
|
-
async pasteFileClick(){
|
|
462
|
-
console.debug('
|
|
463
|
-
|
|
464
|
-
const items = await navigator.clipboard.read();
|
|
468
|
+
async pasteFileClick(e){
|
|
469
|
+
console.debug('e',e)
|
|
470
|
+
const items = e.clipboardData.files;
|
|
465
471
|
console.debug('items',items)
|
|
466
472
|
for (const item of items) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
}
|
|
473
|
+
// if (item.type.startsWith('image/') || item.type.startsWith('application/')) {
|
|
474
|
+
// this.pasteFile = URL.createObjectURL(item)
|
|
475
|
+
//'复制文件'+this.$store.getters.newId() +'.png'
|
|
476
|
+
// let type = item.type
|
|
477
|
+
this.pasteFile =item //new File([item],`复制文件${this.$store.getters.newId()}.${type.split('/')[1]}` , { type });
|
|
478
|
+
this.uploadPasteFile()
|
|
479
|
+
return
|
|
480
|
+
// console.debug('file',file)
|
|
481
|
+
// this.uploadFileList = [file];
|
|
482
|
+
// const reader = new FileReader();
|
|
483
|
+
// reader.onload = (e) => {
|
|
484
|
+
// console.debug(e)
|
|
485
|
+
// // this.imageSrc = e.target.result;
|
|
486
|
+
// };
|
|
487
|
+
// reader.readAsDataURL(blob);
|
|
488
|
+
// }
|
|
484
489
|
}
|
|
485
490
|
},
|
|
491
|
+
selectClick(event){
|
|
492
|
+
this.currentSelectId = 'empty'
|
|
493
|
+
console.debug('selectClick')
|
|
494
|
+
document.execCommand('paste');
|
|
495
|
+
// this.$refs.updateLoadContentView.focus()
|
|
496
|
+
// console.debug('selectClick',event)
|
|
497
|
+
// event.target.addEventListener('paste', async (e) => {
|
|
498
|
+
// e.preventDefault();
|
|
499
|
+
// await this.pasteFileClick(e)
|
|
500
|
+
// })
|
|
501
|
+
// this.$refs.updateLoadContentView.focus()
|
|
502
|
+
},
|
|
486
503
|
uploadPasteFile(){
|
|
487
504
|
const formData = new FormData();
|
|
488
505
|
formData.append('file', this.pasteFile)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const clickoutsideContext = '@@clickoutsideContext'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
/*
|
|
5
|
+
@param el 指令所绑定的元素
|
|
6
|
+
@param binding {Object}
|
|
7
|
+
@param vnode vue编译生成的虚拟节点
|
|
8
|
+
*/
|
|
9
|
+
bind(el, binding, vnode) {
|
|
10
|
+
const documentHandler = function(e) {
|
|
11
|
+
// console.log(el)
|
|
12
|
+
// console.log(e.target);
|
|
13
|
+
// console.log(vnode);
|
|
14
|
+
// console.log(binding);
|
|
15
|
+
|
|
16
|
+
if (!vnode.context || el.contains(e.target)) {
|
|
17
|
+
return false
|
|
18
|
+
}
|
|
19
|
+
if (binding.expression) {
|
|
20
|
+
vnode.context[el[clickoutsideContext].methodName](e)
|
|
21
|
+
} else {
|
|
22
|
+
el[clickoutsideContext].bindingFn(e)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
el[clickoutsideContext] = {
|
|
26
|
+
documentHandler,
|
|
27
|
+
methodName: binding.expression,
|
|
28
|
+
bindingFn: binding.value
|
|
29
|
+
}
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
document.addEventListener('click', documentHandler)
|
|
32
|
+
}, 0)
|
|
33
|
+
},
|
|
34
|
+
update(el, binding) {
|
|
35
|
+
el[clickoutsideContext].methodName = binding.expression
|
|
36
|
+
el[clickoutsideContext].bindingFn = binding.value
|
|
37
|
+
},
|
|
38
|
+
unbind(el) {
|
|
39
|
+
document.removeEventListener(
|
|
40
|
+
'click',
|
|
41
|
+
el[clickoutsideContext].documentHandler
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
}
|