zydx-plus 1.32.187 → 1.32.188
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 +1 -1
- package/src/components/choice/src/choice.vue +11 -3
- package/src/components/editor/src/butJson.js +7 -6
- package/src/components/editor/src/editor.vue +7 -4
- package/src/components/editor2/src/editor.vue +11 -2
- package/src/components/editor2/src/title-id.js +33 -0
- package/src/components/question/src/question.vue +1 -1
- package/src/components/word/src/word.css +3 -0
- package/src/components/word/src/word.vue +2 -2
- package/src/components/word2/src/word.vue +4 -13
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -67,7 +67,7 @@ export default {
|
|
|
67
67
|
type: String,
|
|
68
68
|
default: '每道多选题至少有两个正确项, 所有选项需给出至少一个答案'
|
|
69
69
|
},
|
|
70
|
-
isShow: {
|
|
70
|
+
isShow: {
|
|
71
71
|
type: Boolean,
|
|
72
72
|
default: true
|
|
73
73
|
},
|
|
@@ -96,6 +96,12 @@ export default {
|
|
|
96
96
|
letter: this.letter[index],
|
|
97
97
|
value: ''
|
|
98
98
|
})
|
|
99
|
+
this.option()
|
|
100
|
+
},
|
|
101
|
+
option() {
|
|
102
|
+
this.list.map((x, i) => {
|
|
103
|
+
x.letter = this.letter[i]
|
|
104
|
+
})
|
|
99
105
|
},
|
|
100
106
|
// 整理数据
|
|
101
107
|
organize(v) {
|
|
@@ -161,7 +167,6 @@ export default {
|
|
|
161
167
|
}
|
|
162
168
|
}else {
|
|
163
169
|
this.list.forEach(x => {
|
|
164
|
-
console.log(x.value)
|
|
165
170
|
arr.push({
|
|
166
171
|
index: x.letter,
|
|
167
172
|
content: [x.value]
|
|
@@ -182,15 +187,18 @@ export default {
|
|
|
182
187
|
title: (str === 'correct')? '正确选项' : '干扰选项',
|
|
183
188
|
list: [{value: ''}]
|
|
184
189
|
})
|
|
190
|
+
this.option()
|
|
185
191
|
},
|
|
186
192
|
alternative(index) { // 切换选项
|
|
187
193
|
this.list[index].list.push({value: ''})
|
|
188
194
|
},
|
|
189
195
|
del(index,ins) { // 删除选项
|
|
190
196
|
this.list[index].list.splice(ins, 1)
|
|
197
|
+
this.option()
|
|
191
198
|
},
|
|
192
199
|
delOption(index) { // 删除选项
|
|
193
200
|
this.list.splice(index, 1)
|
|
201
|
+
this.option()
|
|
194
202
|
}
|
|
195
203
|
}
|
|
196
204
|
}
|
|
@@ -240,7 +248,7 @@ export default {
|
|
|
240
248
|
color: #FF0000;
|
|
241
249
|
}
|
|
242
250
|
.list-title{
|
|
243
|
-
padding: 2px 0
|
|
251
|
+
padding: 2px 0;
|
|
244
252
|
display: flex;
|
|
245
253
|
justify-content: center;
|
|
246
254
|
}
|
|
@@ -18,10 +18,10 @@ export function butJson (editor,data) {
|
|
|
18
18
|
{name: '(左)黑体5号', key: 'blackLeft5'},
|
|
19
19
|
],
|
|
20
20
|
html: {
|
|
21
|
-
blackCenter4: `<p data-signId="title-1"
|
|
22
|
-
blackLeft4: `<p data-signId="title-2"
|
|
23
|
-
blackCenter5: `<p data-signId="title-3"
|
|
24
|
-
blackLeft5: `<p data-signId="title-4"
|
|
21
|
+
blackCenter4: `<p data-signId="title-1" class="${randomId()}" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data,'titleMenu').text}</span></p>`,
|
|
22
|
+
blackLeft4: `<p data-signId="title-2" class="${randomId()}" style="text-align: left;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data,'titleMenu').text}</span></p>`,
|
|
23
|
+
blackCenter5: `<p data-signId="title-3" class="${randomId()}" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 14px;font-family: SimHei">${menusData(data,'titleMenu').text}</span></p>`,
|
|
24
|
+
blackLeft5: `<p data-signId="title-4" class="${randomId()}" style="text-align: left;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 14px;font-family: SimHei">${menusData(data,'titleMenu').text}</span></p>`,
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
textMenu: {
|
|
@@ -142,9 +142,10 @@ function menusData(data,key) {
|
|
|
142
142
|
return arr
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
// 随机
|
|
145
|
+
// 随机
|
|
146
146
|
function randomId() {
|
|
147
|
-
|
|
147
|
+
const id = Math.random().toString(36).substr(2)
|
|
148
|
+
return id.replace(/[0-9]/g, '')
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
// 时间
|
|
@@ -224,7 +224,7 @@ export default {
|
|
|
224
224
|
readOnlyPage() {
|
|
225
225
|
this.htmlArr = []
|
|
226
226
|
const data = document.querySelectorAll('.editing-cont')[0].childNodes[0].childNodes
|
|
227
|
-
let max =
|
|
227
|
+
let max = 1110
|
|
228
228
|
let pHeight = 0
|
|
229
229
|
let html = ''
|
|
230
230
|
for (let i = 0; i < data.length; i++) {
|
|
@@ -235,10 +235,13 @@ export default {
|
|
|
235
235
|
html = ''
|
|
236
236
|
}
|
|
237
237
|
if((pHeight + text) > max) {
|
|
238
|
-
|
|
238
|
+
console.log(this.rows(data[i],(pHeight + text) - max))
|
|
239
|
+
const {start,end} = this.rows(data[i],pHeight - max)
|
|
240
|
+
html += `<p>${start}</p>`
|
|
239
241
|
this.htmlArr.push(html)
|
|
240
242
|
pHeight = 0
|
|
241
243
|
html = ''
|
|
244
|
+
html += `<p>${end}</p>`
|
|
242
245
|
}
|
|
243
246
|
pHeight += text + 5
|
|
244
247
|
html += data[i].outerHTML
|
|
@@ -603,7 +606,7 @@ export default {
|
|
|
603
606
|
height: 100%;
|
|
604
607
|
}
|
|
605
608
|
:deep(.read-only-p p) {
|
|
606
|
-
|
|
609
|
+
line-height: 25px;
|
|
607
610
|
}
|
|
608
611
|
.read-only-a{
|
|
609
612
|
position: absolute;
|
|
@@ -692,7 +695,7 @@ label{
|
|
|
692
695
|
margin: 10px 0;
|
|
693
696
|
}
|
|
694
697
|
.editing-cont :deep(p) {
|
|
695
|
-
|
|
698
|
+
line-height: 25px;
|
|
696
699
|
}
|
|
697
700
|
li{
|
|
698
701
|
list-style: none;
|
|
@@ -85,6 +85,7 @@ import Color from '@tiptap/extension-color'
|
|
|
85
85
|
import textStyle from '@tiptap/extension-text-style'
|
|
86
86
|
import { sid } from "./sign-id";
|
|
87
87
|
import { FontSize } from "./font-size";
|
|
88
|
+
import { titleId } from "./title-id";
|
|
88
89
|
export default {
|
|
89
90
|
name: 'zydx-xiao-editor',
|
|
90
91
|
components: {
|
|
@@ -184,7 +185,7 @@ export default {
|
|
|
184
185
|
},
|
|
185
186
|
placeholder: {
|
|
186
187
|
type: String,
|
|
187
|
-
default: ''
|
|
188
|
+
default: '请输入内容'
|
|
188
189
|
}
|
|
189
190
|
},
|
|
190
191
|
emits: ['see','del','complete','update:data','enclosureSuccess','download','updateData'],
|
|
@@ -220,6 +221,7 @@ export default {
|
|
|
220
221
|
StarterKit,
|
|
221
222
|
textStyle,
|
|
222
223
|
FontSize,
|
|
224
|
+
titleId,
|
|
223
225
|
Color.configure({
|
|
224
226
|
types: ['textStyle'],
|
|
225
227
|
}),
|
|
@@ -405,7 +407,7 @@ export default {
|
|
|
405
407
|
if(v === 'center' || v === 'left' || v === 'right') this.editor.chain().focus().setTextAlign(v).run()
|
|
406
408
|
if(v === 'add') {
|
|
407
409
|
let html = this.editor.getHTML()
|
|
408
|
-
html += '<p style="text-align: right;"><span
|
|
410
|
+
html += '<p class="source" style="text-align: right;"><span></span></p>'
|
|
409
411
|
this.editor.commands.setContent(html)
|
|
410
412
|
}
|
|
411
413
|
if(v === 'centerH2') this.editor.chain().focus().setFontSize('16px').setBold().setTextAlign('center').run()
|
|
@@ -441,6 +443,13 @@ export default {
|
|
|
441
443
|
pointer-events: none;
|
|
442
444
|
height: 0;
|
|
443
445
|
}
|
|
446
|
+
:deep(.source).is-empty::before {
|
|
447
|
+
color: #adb5bd;
|
|
448
|
+
content: '添加来源';
|
|
449
|
+
float: right;
|
|
450
|
+
height: 0;
|
|
451
|
+
pointer-events: none;
|
|
452
|
+
}
|
|
444
453
|
:deep(.editor-img){
|
|
445
454
|
max-width: 100%;
|
|
446
455
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core'
|
|
2
|
+
|
|
3
|
+
export const titleId = Extension.create({
|
|
4
|
+
name: 'titleId',
|
|
5
|
+
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
types: ['heading', 'paragraph'],
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
addGlobalAttributes() {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
types: this.options.types,
|
|
16
|
+
attributes: {
|
|
17
|
+
titleId: {
|
|
18
|
+
default: null,
|
|
19
|
+
parseHTML: element => element.getAttribute('class'),
|
|
20
|
+
renderHTML: attributes => {
|
|
21
|
+
if (!attributes.titleId) {
|
|
22
|
+
return {}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
'class': attributes.titleId,
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
})
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
116
116
|
const w = this.$refs.parer.offsetWidth
|
|
117
117
|
for(let i = 0; i< this.$refs.subject.length; i++) {
|
|
118
118
|
this.value[i].right = w - this.$refs.subject[i].offsetLeft
|
|
119
|
-
if(this.$refs.b) {
|
|
119
|
+
if(this.$refs.b && this.$refs.b.length > 0) {
|
|
120
120
|
if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -151,7 +151,7 @@ export default {
|
|
|
151
151
|
return v.indexOf('101') > -1
|
|
152
152
|
},
|
|
153
153
|
styleText(v) {
|
|
154
|
-
if(!v) return
|
|
154
|
+
if(!v || v === 'null') return
|
|
155
155
|
const data = JSON.parse(v)
|
|
156
156
|
for(let i=0; i< data.length; i++) {
|
|
157
157
|
if(data[i].content[0].length > 20) {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<script>
|
|
16
16
|
import exportWord from 'js-export-word'
|
|
17
17
|
|
|
18
|
+
|
|
18
19
|
export default {
|
|
19
20
|
name: "zydx-paper",
|
|
20
21
|
data() {
|
|
@@ -48,6 +49,9 @@ export default {
|
|
|
48
49
|
},
|
|
49
50
|
methods: {
|
|
50
51
|
init() {
|
|
52
|
+
this.htmlArr = []
|
|
53
|
+
this.pHeight = 0
|
|
54
|
+
this.html = ''
|
|
51
55
|
setTimeout(() => {
|
|
52
56
|
const data = document.getElementById('test').children[0].childNodes
|
|
53
57
|
this.children(data)
|
|
@@ -89,19 +93,6 @@ export default {
|
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
},
|
|
92
|
-
propsClass2(data) {
|
|
93
|
-
for (let i = 0; i < data.length; i++) {
|
|
94
|
-
let text = data[i].offsetHeight
|
|
95
|
-
console.log(data[i])
|
|
96
|
-
if((this.pHeight + text) > this.max) {
|
|
97
|
-
this.htmlArr.push(this.html)
|
|
98
|
-
this.pHeight = 0
|
|
99
|
-
this.html = ''
|
|
100
|
-
}
|
|
101
|
-
this.pHeight += text
|
|
102
|
-
this.html += data[i].outerHTML
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
96
|
exportToWord() {
|
|
106
97
|
const wrap = document.getElementById('test')
|
|
107
98
|
const config = {
|