zydx-plus 1.28.124 → 1.28.126
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zydx-plus",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.126",
|
|
4
4
|
"description": "Vue.js",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"@tiptap/starter-kit": "^2.0.3",
|
|
33
33
|
"@tiptap/vue-3": "^2.0.3",
|
|
34
34
|
"@tiptap/extension-text-align": "^2.0.3",
|
|
35
|
+
"@tiptap/extension-placeholder": "^2.0.3",
|
|
35
36
|
"@vue-office/docx": "^1.1.3",
|
|
36
37
|
"@vue-office/excel": "^1.1.3"
|
|
37
38
|
},
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
|
+
<button @click="getContent">成功</button>
|
|
28
29
|
</div>
|
|
29
30
|
</template>
|
|
30
31
|
|
|
@@ -37,9 +38,42 @@ export default {
|
|
|
37
38
|
letter: {0:'A',1:'B',2:'C',3:'D',4:'E',5:'F',6:'G',7:'H'},
|
|
38
39
|
}
|
|
39
40
|
},
|
|
41
|
+
props: {
|
|
42
|
+
value: {
|
|
43
|
+
handler: function (val, oldVal) {
|
|
44
|
+
this.list = this.organize(val)
|
|
45
|
+
},
|
|
46
|
+
immediate: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
mounted() {
|
|
50
|
+
this.list = this.organize(this.value)
|
|
51
|
+
},
|
|
40
52
|
methods: {
|
|
53
|
+
// 整理数据
|
|
54
|
+
organize() {
|
|
55
|
+
let arr = []
|
|
56
|
+
this.value.forEach(x => {
|
|
57
|
+
arr.push({
|
|
58
|
+
type: (x.isRight)? 'correct' : 'disturb',
|
|
59
|
+
letter: x.index,
|
|
60
|
+
title: (x.isRight)? '正确选项' : '干扰选项',
|
|
61
|
+
list: x.content.map(y => ({value: y}))
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
return arr
|
|
65
|
+
},
|
|
41
66
|
getContent() {
|
|
42
|
-
|
|
67
|
+
let arr = []
|
|
68
|
+
this.list.forEach(x => {
|
|
69
|
+
arr.push({
|
|
70
|
+
index: x.letter,
|
|
71
|
+
isRight: x.title === '正确选项',
|
|
72
|
+
content: x.list.map(y => y.value)
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
console.log(arr)
|
|
76
|
+
return arr
|
|
43
77
|
},
|
|
44
78
|
add(str) {
|
|
45
79
|
const index = this.list.length
|
|
@@ -81,6 +81,7 @@ import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
|
81
81
|
import StarterKit from '@tiptap/starter-kit'
|
|
82
82
|
import Image from '@tiptap/extension-image'
|
|
83
83
|
import TextAlign from '@tiptap/extension-text-align'
|
|
84
|
+
import Placeholder from '@tiptap/extension-placeholder'
|
|
84
85
|
export default {
|
|
85
86
|
name: 'zydx-xiao-editor',
|
|
86
87
|
components: {
|
|
@@ -177,6 +178,10 @@ export default {
|
|
|
177
178
|
enclosureShow: {
|
|
178
179
|
type: Boolean,
|
|
179
180
|
default: true
|
|
181
|
+
},
|
|
182
|
+
placeholder: {
|
|
183
|
+
type: String,
|
|
184
|
+
default: ''
|
|
180
185
|
}
|
|
181
186
|
},
|
|
182
187
|
emits: ['see','del','complete','update:data','enclosureSuccess','download','updateData'],
|
|
@@ -208,6 +213,9 @@ export default {
|
|
|
208
213
|
editable: this.readOnly,
|
|
209
214
|
extensions: [
|
|
210
215
|
StarterKit,
|
|
216
|
+
Placeholder.configure({
|
|
217
|
+
placeholder: this.placeholder,
|
|
218
|
+
}),
|
|
211
219
|
TextAlign.configure({
|
|
212
220
|
types: ['heading', 'paragraph'],
|
|
213
221
|
}),
|
|
@@ -382,6 +390,13 @@ export default {
|
|
|
382
390
|
</script>
|
|
383
391
|
|
|
384
392
|
<style scoped>
|
|
393
|
+
:deep(.ProseMirror) p.is-editor-empty:first-child::before {
|
|
394
|
+
content: attr(data-placeholder);
|
|
395
|
+
float: left;
|
|
396
|
+
color: #adb5bd;
|
|
397
|
+
pointer-events: none;
|
|
398
|
+
height: 0;
|
|
399
|
+
}
|
|
385
400
|
:deep(.editor-img){
|
|
386
401
|
max-width: 100%;
|
|
387
402
|
}
|
|
@@ -10,14 +10,6 @@
|
|
|
10
10
|
</div>
|
|
11
11
|
<div class="page-but-left" :style="{cursor: pageIndex === 1?'default':'pointer'}" @click="flipLeft(pageIndex-=1,false)"></div>
|
|
12
12
|
<div class="page-but-right" :style="{cursor: pageIndex === pdfPages?'default':'pointer'}" @click="flipRight(pageIndex+=1,false)"></div>
|
|
13
|
-
<!-- <div class="paper z-in" :class="{'data-right': pages}">-->
|
|
14
|
-
<!-- <div class="page page-2" id="canvas-wrap1"></div>-->
|
|
15
|
-
<!-- <div class="page page-2-back" id="canvas-wrap2"></div>-->
|
|
16
|
-
<!-- </div>-->
|
|
17
|
-
<!-- <div class="paper z-in-ac">-->
|
|
18
|
-
<!-- <div class="page page-2" id="canvas-wrap3"></div>-->
|
|
19
|
-
<!-- <div class="page page-2-back" id="canvas-wrap4"></div>-->
|
|
20
|
-
<!-- </div>-->
|
|
21
13
|
</div>
|
|
22
14
|
</div>
|
|
23
15
|
<div class="but-wrap" v-if="butShow">
|
|
@@ -95,6 +87,7 @@ export default {
|
|
|
95
87
|
flipLeft(e,v) {
|
|
96
88
|
if(e <= 1) {
|
|
97
89
|
this.pageIndex = 1
|
|
90
|
+
return
|
|
98
91
|
}else {
|
|
99
92
|
this.pageIndex = e
|
|
100
93
|
}
|
|
@@ -109,6 +102,7 @@ export default {
|
|
|
109
102
|
flipRight(e,v) {
|
|
110
103
|
if(e >= this.pdfPages) {
|
|
111
104
|
this.pageIndex = this.pdfPages
|
|
105
|
+
return
|
|
112
106
|
}else {
|
|
113
107
|
this.pageIndex = e
|
|
114
108
|
}
|
|
@@ -137,7 +131,7 @@ export default {
|
|
|
137
131
|
let renderContext = {
|
|
138
132
|
canvasContext: ctx,
|
|
139
133
|
viewport: viewport,
|
|
140
|
-
transform: [2, 0, 0, 2, 0, 0]//这里会进行放大,解决模糊问题
|
|
134
|
+
transform: [2, 0, 0, 2, 0, 0] //这里会进行放大,解决模糊问题
|
|
141
135
|
}
|
|
142
136
|
page.render(renderContext)
|
|
143
137
|
that.loading = false
|
|
@@ -254,7 +248,7 @@ export default {
|
|
|
254
248
|
|
|
255
249
|
@keyframes loading-animation {
|
|
256
250
|
0% {
|
|
257
|
-
width: 0
|
|
251
|
+
width: 0;
|
|
258
252
|
}
|
|
259
253
|
|
|
260
254
|
100% {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'min-height': height + 'px',
|
|
5
5
|
border: (readable)? '1px solid #ccc': 'none',
|
|
6
6
|
'background-color': (readable)? '#fff': 'transparent'
|
|
7
|
-
}" @input="event => checkLength(event, maxLength)" :contenteditable="readable" ref="textarea"></div>
|
|
7
|
+
}" @input="event => checkLength(event, maxLength)" :placeholder="placeholder" :contenteditable="readable" ref="textarea"></div>
|
|
8
8
|
<span class="num" v-if="maxLength !== 0&&readable">{{ num }}/{{ maxLength }}</span>
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
@@ -17,7 +17,8 @@ export default {
|
|
|
17
17
|
components: {Textarea},
|
|
18
18
|
data() {
|
|
19
19
|
return {
|
|
20
|
-
num: 0
|
|
20
|
+
num: 0,
|
|
21
|
+
placeholder: ''
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
props: {
|
|
@@ -36,6 +37,10 @@ export default {
|
|
|
36
37
|
readable: {
|
|
37
38
|
type: Boolean,
|
|
38
39
|
default: true
|
|
40
|
+
},
|
|
41
|
+
placeholder: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ''
|
|
39
44
|
}
|
|
40
45
|
},
|
|
41
46
|
watch: {
|
|
@@ -88,4 +93,8 @@ export default {
|
|
|
88
93
|
box-sizing: border-box;
|
|
89
94
|
background-color: #fff;
|
|
90
95
|
}
|
|
96
|
+
.text[contenteditable]:empty:before {
|
|
97
|
+
content: attr(placeholder);
|
|
98
|
+
color: gray;
|
|
99
|
+
}
|
|
91
100
|
</style>
|