zydx-plus 1.19.103 → 1.19.105
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
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<button class="but" @click="complete">{{ butText }}</button>
|
|
22
22
|
</div>
|
|
23
23
|
<div class="enclosure" v-if="uploadAttData.length > 0 && enclosureShow">
|
|
24
|
-
<p
|
|
24
|
+
<p :style="enclosureStyle">{{ enclosureText }}</p>
|
|
25
25
|
<div class="enclosure-list" v-for="(item,index) in uploadAttData">
|
|
26
26
|
<div class="enclosure-item">
|
|
27
27
|
<span>{{ index + 1 }}. {{ (item.name)? item.name : item.annexName }}</span>
|
|
@@ -122,8 +122,8 @@ export default {
|
|
|
122
122
|
enclosureStyle: {
|
|
123
123
|
type: Object,
|
|
124
124
|
default: {
|
|
125
|
-
'font-size': '
|
|
126
|
-
'font-weight': '
|
|
125
|
+
'font-size': '14px',
|
|
126
|
+
'font-weight': 'normal',
|
|
127
127
|
'color': '#000'
|
|
128
128
|
}
|
|
129
129
|
},
|
|
@@ -178,9 +178,13 @@ export default {
|
|
|
178
178
|
},
|
|
179
179
|
emits: ['see','del','complete','update:data','enclosureSuccess'],
|
|
180
180
|
watch:{
|
|
181
|
-
data
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
// 强制监听data变化
|
|
182
|
+
data: {
|
|
183
|
+
handler: function (e, oldVal) {
|
|
184
|
+
this.editor.commands.setContent(json2html({node: "root",child: (e.html === undefined)? [] : e.html}))
|
|
185
|
+
this.uploadAttData = (e.enclosure === undefined)? [] : this.enclosureAction(e.enclosure)
|
|
186
|
+
},
|
|
187
|
+
deep: true
|
|
184
188
|
}
|
|
185
189
|
},
|
|
186
190
|
mounted() {
|
|
@@ -387,15 +391,33 @@ export default {
|
|
|
387
391
|
line-height: 22px;
|
|
388
392
|
}
|
|
389
393
|
.enclosure-list{
|
|
390
|
-
display: flex;
|
|
391
|
-
justify-content: space-between;
|
|
392
|
-
align-items: center;
|
|
393
394
|
margin: 5px 20px 0 20px;
|
|
394
395
|
height: 22px;
|
|
395
396
|
line-height: 22px;
|
|
396
397
|
}
|
|
398
|
+
.enclosure-list:after{
|
|
399
|
+
content: "";
|
|
400
|
+
clear: left;
|
|
401
|
+
display: block;
|
|
402
|
+
}
|
|
403
|
+
.enclosure-item:first-child{
|
|
404
|
+
width: calc(100% - 210px);
|
|
405
|
+
}
|
|
406
|
+
.enclosure-item:last-child{
|
|
407
|
+
width: 210px;
|
|
408
|
+
}
|
|
397
409
|
.enclosure-item{
|
|
398
|
-
|
|
410
|
+
height: 22px;
|
|
411
|
+
float: left;
|
|
412
|
+
}
|
|
413
|
+
.enclosure-item>span{
|
|
414
|
+
display: inline-block;
|
|
415
|
+
overflow: hidden;
|
|
416
|
+
text-overflow: ellipsis;
|
|
417
|
+
white-space: nowrap;
|
|
418
|
+
max-width: 100%;
|
|
419
|
+
box-sizing: border-box;
|
|
420
|
+
padding-right: 20px;
|
|
399
421
|
}
|
|
400
422
|
.en-but{
|
|
401
423
|
text-align: right;
|
|
@@ -123,7 +123,7 @@ export default {
|
|
|
123
123
|
pdf.getPage(that.pageIndex).then(function (page) {
|
|
124
124
|
let canvas = document.getElementById(that.id)
|
|
125
125
|
let ctx = canvas.getContext('2d');
|
|
126
|
-
let viewport = page.getViewport({scale: 1})
|
|
126
|
+
let viewport = page.getViewport({scale: 1.2})
|
|
127
127
|
canvas.width = viewport.width * 2
|
|
128
128
|
canvas.height = viewport.height * 2
|
|
129
129
|
canvas.style.width = viewport.width + 'px'
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="textarea">
|
|
3
|
+
<div class="text" :style="{'min-height': height + 'px'}" @input="event => checkLength(event, maxLength)" :contenteditable="true" ref="textarea"></div>
|
|
4
|
+
<span class="num" v-if="maxLength !== 0">{{ num }}/{{ maxLength }}</span>
|
|
5
|
+
</div>
|
|
3
6
|
</template>
|
|
4
7
|
|
|
5
8
|
<script>
|
|
@@ -8,6 +11,11 @@ import Textarea from "@/App.vue";
|
|
|
8
11
|
export default {
|
|
9
12
|
name: "zydx-textarea",
|
|
10
13
|
components: {Textarea},
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
num: 0
|
|
17
|
+
}
|
|
18
|
+
},
|
|
11
19
|
props: {
|
|
12
20
|
value: {
|
|
13
21
|
type: String,
|
|
@@ -16,6 +24,10 @@ export default {
|
|
|
16
24
|
height: {
|
|
17
25
|
type: Number,
|
|
18
26
|
default: 200
|
|
27
|
+
},
|
|
28
|
+
maxLength: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0
|
|
19
31
|
}
|
|
20
32
|
},
|
|
21
33
|
watch: {
|
|
@@ -27,6 +39,16 @@ export default {
|
|
|
27
39
|
this.$refs.textarea.innerHTML = this.value
|
|
28
40
|
},
|
|
29
41
|
methods: {
|
|
42
|
+
checkLength(event, maxLength) {
|
|
43
|
+
if(maxLength === 0) return
|
|
44
|
+
const text = event.target.innerText;
|
|
45
|
+
this.num = text.length
|
|
46
|
+
if (text.length >= maxLength) {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
event.target.innerText = text.substr(0, maxLength);
|
|
49
|
+
event.target.blur();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
30
52
|
getContent() {
|
|
31
53
|
const html = this.$refs.textarea.innerHTML
|
|
32
54
|
return html.replace(/<div>/g, '<br>').replace(/<\/div>/g, '').replace(/<p>/g, '<br>').replace(/<\/p>/g, '')
|
|
@@ -36,10 +58,20 @@ export default {
|
|
|
36
58
|
</script>
|
|
37
59
|
|
|
38
60
|
<style scoped>
|
|
61
|
+
.textarea{
|
|
62
|
+
position: relative;
|
|
63
|
+
}
|
|
64
|
+
.num{
|
|
65
|
+
position: absolute;
|
|
66
|
+
bottom: 10px;
|
|
67
|
+
right: 10px;
|
|
68
|
+
z-index: 1;
|
|
69
|
+
}
|
|
39
70
|
.text{
|
|
40
71
|
width: 100%;
|
|
41
72
|
border: 1px solid #ccc;
|
|
42
73
|
padding: 10px;
|
|
43
74
|
box-sizing: border-box;
|
|
75
|
+
background-color: #fff;
|
|
44
76
|
}
|
|
45
77
|
</style>
|