doway-coms 2.10.24 → 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: "",
|
|
@@ -291,7 +292,7 @@ export default {
|
|
|
291
292
|
this.uploadData.picAction = this.internalServiceUrl + "/UploadAttach";
|
|
292
293
|
this.getAttachInfo(this.rows);
|
|
293
294
|
|
|
294
|
-
this.$refs.
|
|
295
|
+
this.$refs.updateLoadContentView.addEventListener('paste', async (e) => {
|
|
295
296
|
e.preventDefault();
|
|
296
297
|
await this.pasteFileClick(e)
|
|
297
298
|
})
|
|
@@ -469,11 +470,11 @@ export default {
|
|
|
469
470
|
const items = e.clipboardData.files;
|
|
470
471
|
console.debug('items',items)
|
|
471
472
|
for (const item of items) {
|
|
472
|
-
if (item.type.startsWith('image/') || item.type.startsWith('application/')) {
|
|
473
|
+
// if (item.type.startsWith('image/') || item.type.startsWith('application/')) {
|
|
473
474
|
// this.pasteFile = URL.createObjectURL(item)
|
|
474
475
|
//'复制文件'+this.$store.getters.newId() +'.png'
|
|
475
|
-
let type = item.type
|
|
476
|
-
this.pasteFile = new File([item],`复制文件${this.$store.getters.newId()}.${type.split('/')[1]}` , { type });
|
|
476
|
+
// let type = item.type
|
|
477
|
+
this.pasteFile =item //new File([item],`复制文件${this.$store.getters.newId()}.${type.split('/')[1]}` , { type });
|
|
477
478
|
this.uploadPasteFile()
|
|
478
479
|
return
|
|
479
480
|
// console.debug('file',file)
|
|
@@ -484,9 +485,21 @@ export default {
|
|
|
484
485
|
// // this.imageSrc = e.target.result;
|
|
485
486
|
// };
|
|
486
487
|
// reader.readAsDataURL(blob);
|
|
487
|
-
}
|
|
488
|
+
// }
|
|
488
489
|
}
|
|
489
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
|
+
},
|
|
490
503
|
uploadPasteFile(){
|
|
491
504
|
const formData = new FormData();
|
|
492
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
|
+
}
|