zydx-plus 1.32.281 → 1.32.283
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
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
</template>
|
|
95
95
|
<script>
|
|
96
96
|
import Recorder from 'js-audio-recorder'
|
|
97
|
-
import zydxTextarea from '../../textarea/src/textarea'
|
|
98
97
|
import {html2json, json2html} from 'html2json'
|
|
99
98
|
import {Editor, EditorContent} from '@tiptap/vue-3'
|
|
100
99
|
import StarterKit from '@tiptap/starter-kit'
|
|
@@ -113,8 +112,7 @@ export default {
|
|
|
113
112
|
name: 'zydx-xiao-editor',
|
|
114
113
|
components: {
|
|
115
114
|
EditorContent,
|
|
116
|
-
svgs
|
|
117
|
-
zydxTextarea
|
|
115
|
+
svgs
|
|
118
116
|
},
|
|
119
117
|
data() {
|
|
120
118
|
return {
|
|
@@ -253,8 +251,8 @@ export default {
|
|
|
253
251
|
// 强制监听data变化
|
|
254
252
|
data: {
|
|
255
253
|
handler: function (e, oldVal) {
|
|
256
|
-
this.editor?.commands.setContent(json2html({node: "root", child: (e.html === undefined || e.html === null) ? [] : e.html}))
|
|
257
|
-
this.uploadAttData = (e.enclosure === undefined || e.enclosure === null) ? [] : this.enclosureAction(e.enclosure)
|
|
254
|
+
this.editor?.commands.setContent(json2html({node: "root", child: (e.html === undefined || e.html === null || e.html === 'null') ? [] : e.html}))
|
|
255
|
+
this.uploadAttData = (e.enclosure === undefined || e.enclosure === null || e.html === 'null') ? [] : this.enclosureAction(e.enclosure)
|
|
258
256
|
},
|
|
259
257
|
deep: true
|
|
260
258
|
},
|
|
@@ -269,12 +267,12 @@ export default {
|
|
|
269
267
|
},
|
|
270
268
|
mounted() {
|
|
271
269
|
let _this = this
|
|
272
|
-
this.uploadAttData = (this.data.enclosure === undefined) ? [] : this.enclosureAction(this.data.enclosure)
|
|
270
|
+
this.uploadAttData = (this.data.enclosure === undefined || this.data.enclosure === null || this.data.enclosure === 'null') ? [] : this.enclosureAction(this.data.enclosure)
|
|
273
271
|
this.heightStyle = (this.height === '100%') ? {height: '100%'} : {'min-height': this.height}
|
|
274
272
|
const height = this.height.split('px')[0] - 44
|
|
275
273
|
this.heightStyleCont = (this.height === '100%') ? {height: 'calc(100% - 44px)'} : {'min-height': `${height}px`}
|
|
276
274
|
this.editor = new Editor({
|
|
277
|
-
content: json2html({node: "root", child: (this.data.html === undefined || null) ? [] : this.data.html}),
|
|
275
|
+
content: json2html({node: "root", child: (this.data.html === undefined || this.data.html === null || this.data.html.html === 'null') ? [] : this.data.html}),
|
|
278
276
|
editable: this.readOnly,
|
|
279
277
|
enablePasteRules: true,
|
|
280
278
|
extensions: [
|
|
@@ -306,12 +304,12 @@ export default {
|
|
|
306
304
|
enclosure: this.uploadAttData
|
|
307
305
|
})
|
|
308
306
|
},
|
|
309
|
-
onBlur: (
|
|
307
|
+
onBlur: () => {
|
|
310
308
|
this.limits = false
|
|
311
309
|
this.close()
|
|
312
310
|
},
|
|
313
311
|
// 获取焦点
|
|
314
|
-
onFocus: (
|
|
312
|
+
onFocus: () => {
|
|
315
313
|
this.limits = true
|
|
316
314
|
},
|
|
317
315
|
})
|
|
@@ -341,7 +339,7 @@ export default {
|
|
|
341
339
|
this.x = event.clientX - this.left;
|
|
342
340
|
this.y = event.clientY - this.top;
|
|
343
341
|
})
|
|
344
|
-
document.addEventListener('click', (
|
|
342
|
+
document.addEventListener('click', () => {
|
|
345
343
|
if(this.limits) return
|
|
346
344
|
this.close()
|
|
347
345
|
})
|
|
@@ -430,7 +428,7 @@ export default {
|
|
|
430
428
|
this.y = this.speech.y + ((this.height === '100%') ? 40 : Number(h) - 10)
|
|
431
429
|
this.voiceShows = this.voiceStatus
|
|
432
430
|
this.appID()
|
|
433
|
-
}, (
|
|
431
|
+
}, () => {
|
|
434
432
|
this.$message({
|
|
435
433
|
type: 'text',
|
|
436
434
|
cancelShow: false,
|
|
@@ -555,7 +553,7 @@ export default {
|
|
|
555
553
|
this.$emit('see', this.uploadAttData[index])
|
|
556
554
|
},
|
|
557
555
|
uploadFile(file, data) {
|
|
558
|
-
return new Promise((rl
|
|
556
|
+
return new Promise((rl) => {
|
|
559
557
|
const meta = data.meta ? Object.keys(data.meta) : []
|
|
560
558
|
const param = new FormData()
|
|
561
559
|
param.append('file', file)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="svg-choice" v-if="radio">
|
|
3
|
+
<div v-if="state === 'default'">
|
|
4
|
+
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" width="14"
|
|
5
|
+
height="14">
|
|
6
|
+
<path :fill="disabled? 'rgba(0, 0, 0, .2)': 'rgba(24, 144, 255, 1)'"
|
|
7
|
+
d="M100,200A100,100,0,1,1,200,100,100,100,0,0,1,100,200Zm0-12.5A87.5,87.5,0,1,0,12.5,100,87.51,87.51,0,0,0,100,187.5Z"/>
|
|
8
|
+
<circle v-if="select" fill="rgba(24, 144, 255, 1)" cx="98.5" cy="98.5" r="62.5"/>
|
|
9
|
+
</svg>
|
|
10
|
+
</div>
|
|
11
|
+
<div v-else>
|
|
12
|
+
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 174.95 174.95" width="14"
|
|
13
|
+
height="14">
|
|
14
|
+
<path :fill="state === 'correct'?'rgba(67, 207, 124, 1)': 'rgba(255, 0, 0, 1)'"
|
|
15
|
+
d="M100.91,12.49A87.48,87.48,0,1,0,188.39,100,87.48,87.48,0,0,0,100.91,12.49Z"
|
|
16
|
+
transform="translate(-13.44 -12.49)"/>
|
|
17
|
+
<path v-if="state === 'correct'" fill="rgba(255, 255, 255, 1)"
|
|
18
|
+
d="M160.36,76.87,97.93,139.3l-.07.08a12.51,12.51,0,0,1-17.68,0l-.08-.08L42.68,101.87A12.49,12.49,0,1,1,60.35,84.2L89,112.86,142.68,59.2a12.5,12.5,0,1,1,17.68,17.67Z"
|
|
19
|
+
transform="translate(-15.01 -10.54)"/>
|
|
20
|
+
<path v-else fill="rgba(255, 255, 255, 1)" d="M151.43,134.15a35.64,35.64,0,0,1,5.81,7.52q1.84,3.41-.61,7.79c-.37.55-.87,1.21-1.51,2s-1.3,1.53-2,2.26a26.89,26.89,0,0,1-2,2,13.1,13.1,0,0,1-1.71,1.3,10.89,10.89,0,0,1-8.07,1.09,16.26,16.26,0,0,1-8.34-4.65l-5.74-5.74L119.57,140l-9-9-9.85-9.84-17.5,17.5q-8.07,8.07-13.12,13.26-5.2,5.19-10.33,6.43A9.56,9.56,0,0,1,50.66,156l-1-1-1.5-1.5-1.5-1.5a5.93,5.93,0,0,1-1-1.1A8.08,8.08,0,0,1,44,147.07a8.74,8.74,0,0,1,.34-3.9,13.88,13.88,0,0,1,1.85-3.69,23.41,23.41,0,0,1,2.73-3.28q1.23-1.09,4.38-4.11l7.38-7.65q4.52-4.38,10-9.85t11.56-11.48q-6.57-6.57-12.52-12.44L59.07,80.14q-4.73-4.65-7.73-7.59l-3.69-3.62c-2.37-2.37-3.57-4.72-3.62-7.05a11.89,11.89,0,0,1,2.39-7,28.65,28.65,0,0,1,3.15-3.21,29.25,29.25,0,0,1,2.87-2.39c2.73-1.83,5.19-2.62,7.38-2.4s4.38,1.49,6.56,3.76l4.24,4.24q3.15,3.15,7.8,7.66T88.88,72.69L101,84.51q5.19-5.19,10.18-10.12t9.3-9.22q4.31-4.32,7.79-7.73t5.82-5.74a16.23,16.23,0,0,1,7.11-4.17,8.12,8.12,0,0,1,7.38,1.71,10.87,10.87,0,0,0,.89.68,18,18,0,0,1,1.5,1.23l1.44,1.3a5.46,5.46,0,0,0,1,.75c2.47,2.37,3.67,4.95,3.63,7.73a11.07,11.07,0,0,1-3.63,7.72q-2.46,2.46-6.08,6.15c-2.42,2.47-5.1,5.16-8.07,8.07s-6.08,6-9.36,9.3l-10.39,10.39q5.06,4.92,9.91,9.64c3.23,3.15,6.24,6.08,9,8.82s5.29,5.24,7.52,7.52,4.08,4.15,5.54,5.61Z"
|
|
21
|
+
transform="translate(14.88 14.81) scale(0.7)"/>
|
|
22
|
+
</svg>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div v-else class="svg-choice">
|
|
26
|
+
<div v-if="state === 'default'">
|
|
27
|
+
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 175 175" width="14" height="14">
|
|
28
|
+
<path :fill="disabled? 'rgba(0, 0, 0, .2)': 'rgba(24, 144, 255, 1)'"
|
|
29
|
+
d="M172.92,12.5H27.08A14.58,14.58,0,0,0,12.5,27.08V172.92A14.58,14.58,0,0,0,27.08,187.5H172.92a14.58,14.58,0,0,0,14.58-14.58V27.08A14.58,14.58,0,0,0,172.92,12.5Zm0,160.42H27.08V27.08H172.92V172.92Z"
|
|
30
|
+
transform="translate(-12.5 -12.5)"/>
|
|
31
|
+
<path v-if="select" fill="rgba(24, 144, 255, 1)"
|
|
32
|
+
d="M45.56,38.76H154.44a6.79,6.79,0,0,1,6.8,6.8h0V154.44a6.79,6.79,0,0,1-6.8,6.8H45.56a6.8,6.8,0,0,1-6.8-6.8h0V45.56a6.8,6.8,0,0,1,6.8-6.8Z"
|
|
33
|
+
transform="translate(-12.5 -12.5)"/>
|
|
34
|
+
</svg>
|
|
35
|
+
</div>
|
|
36
|
+
<div v-else>
|
|
37
|
+
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 175 175" width="19" height="19">
|
|
38
|
+
<path :fill="state === 'correct'?'rgba(67, 207, 124, 1)': 'rgba(255, 0, 0, 1)'"
|
|
39
|
+
d="M45.56,38.76H154.44a6.79,6.79,0,0,1,6.8,6.8h0V154.44a6.79,6.79,0,0,1-6.8,6.8H45.56a6.8,6.8,0,0,1-6.8-6.8h0V45.56a6.8,6.8,0,0,1,6.8-6.8Z"
|
|
40
|
+
transform="translate(-32.5 -12.5)"/>
|
|
41
|
+
<path v-if="state === 'correct'" fill="rgba(255, 255, 255, 1)"
|
|
42
|
+
d="M160.36,76.87,97.93,139.3l-.07.08a12.51,12.51,0,0,1-17.68,0l-.08-.08L42.68,101.87A12.49,12.49,0,1,1,60.35,84.2L89,112.86,142.68,59.2a12.5,12.5,0,1,1,17.68,17.67Z"
|
|
43
|
+
transform="translate(1.01 16.54) scale(0.7)"/>
|
|
44
|
+
<path v-else fill="rgba(255, 255, 255, 1)" d="M151.43,134.15a35.64,35.64,0,0,1,5.81,7.52q1.84,3.41-.61,7.79c-.37.55-.87,1.21-1.51,2s-1.3,1.53-2,2.26a26.89,26.89,0,0,1-2,2,13.1,13.1,0,0,1-1.71,1.3,10.89,10.89,0,0,1-8.07,1.09,16.26,16.26,0,0,1-8.34-4.65l-5.74-5.74L119.57,140l-9-9-9.85-9.84-17.5,17.5q-8.07,8.07-13.12,13.26-5.2,5.19-10.33,6.43A9.56,9.56,0,0,1,50.66,156l-1-1-1.5-1.5-1.5-1.5a5.93,5.93,0,0,1-1-1.1A8.08,8.08,0,0,1,44,147.07a8.74,8.74,0,0,1,.34-3.9,13.88,13.88,0,0,1,1.85-3.69,23.41,23.41,0,0,1,2.73-3.28q1.23-1.09,4.38-4.11l7.38-7.65q4.52-4.38,10-9.85t11.56-11.48q-6.57-6.57-12.52-12.44L59.07,80.14q-4.73-4.65-7.73-7.59l-3.69-3.62c-2.37-2.37-3.57-4.72-3.62-7.05a11.89,11.89,0,0,1,2.39-7,28.65,28.65,0,0,1,3.15-3.21,29.25,29.25,0,0,1,2.87-2.39c2.73-1.83,5.19-2.62,7.38-2.4s4.38,1.49,6.56,3.76l4.24,4.24q3.15,3.15,7.8,7.66T88.88,72.69L101,84.51q5.19-5.19,10.18-10.12t9.3-9.22q4.31-4.32,7.79-7.73t5.82-5.74a16.23,16.23,0,0,1,7.11-4.17,8.12,8.12,0,0,1,7.38,1.71,10.87,10.87,0,0,0,.89.68,18,18,0,0,1,1.5,1.23l1.44,1.3a5.46,5.46,0,0,0,1,.75c2.47,2.37,3.67,4.95,3.63,7.73a11.07,11.07,0,0,1-3.63,7.72q-2.46,2.46-6.08,6.15c-2.42,2.47-5.1,5.16-8.07,8.07s-6.08,6-9.36,9.3l-10.39,10.39q5.06,4.92,9.91,9.64c3.23,3.15,6.24,6.08,9,8.82s5.29,5.24,7.52,7.52,4.08,4.15,5.54,5.61Z"
|
|
45
|
+
transform="translate(6.88 24.81) scale(0.6)"/>
|
|
46
|
+
</svg>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
export default {
|
|
53
|
+
data() {
|
|
54
|
+
return {}
|
|
55
|
+
},
|
|
56
|
+
props: {
|
|
57
|
+
radio: { // 单选
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
select: { // 选中
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
state: { // 状态
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'default'
|
|
68
|
+
},
|
|
69
|
+
disabled: { // 禁用
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
watch: {
|
|
75
|
+
select: {
|
|
76
|
+
handler(val) {
|
|
77
|
+
console.log(val)
|
|
78
|
+
},
|
|
79
|
+
deep: true
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.svg-choice {
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 2px;
|
|
89
|
+
left: 0;
|
|
90
|
+
z-index: 1;
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -241,25 +241,3 @@ input[name='check'] {
|
|
|
241
241
|
font-weight: 700;
|
|
242
242
|
flex: 1;
|
|
243
243
|
}
|
|
244
|
-
.choice-ico{
|
|
245
|
-
width: 15px;
|
|
246
|
-
height: 15px;
|
|
247
|
-
display: inline-block;
|
|
248
|
-
border: 1px solid #666;
|
|
249
|
-
border-radius: 3px;
|
|
250
|
-
position: absolute;
|
|
251
|
-
top: 4px;
|
|
252
|
-
left: 2em;
|
|
253
|
-
z-index: 1;
|
|
254
|
-
}
|
|
255
|
-
.check-active{
|
|
256
|
-
background-color: #007acc;
|
|
257
|
-
border: 1px solid #007acc;
|
|
258
|
-
}
|
|
259
|
-
.check-dis{
|
|
260
|
-
background-color: #d0d0d0;
|
|
261
|
-
border: 1px solid #d0d0d0;
|
|
262
|
-
}
|
|
263
|
-
.check-dis-bor{
|
|
264
|
-
border: 1px solid #d0d0d0;
|
|
265
|
-
}
|
|
@@ -71,22 +71,12 @@
|
|
|
71
71
|
</div>
|
|
72
72
|
<div class="choice" v-if="item.testKey" v-show="item.open">
|
|
73
73
|
<div class="choice-box" v-for="(ts,ind) in item.testKey">
|
|
74
|
-
<label
|
|
75
|
-
<input class="choice-input"
|
|
76
|
-
@change="answerChange($event,item,`${id}${index}`,
|
|
74
|
+
<label>
|
|
75
|
+
<input class="choice-input" style="display: none;" :disabled="disabled" :checked="ts.checked"
|
|
76
|
+
@change="answerChange($event,item,`${id}${index}`,ts)" :type="ques(item.quesType)? 'radio': 'checkbox'"
|
|
77
77
|
:name="`${id}${index}`"/>
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
ts.index
|
|
81
|
-
}}. {{ ts.content[0] }}</span>
|
|
82
|
-
</label>
|
|
83
|
-
<label v-else>
|
|
84
|
-
<input class="choice-input" style="display: none;" v-if="chooseAnswer" :disabled="disabled" :checked="ts.checked"
|
|
85
|
-
@change="answerChange($event,item,`${id}${index}`,ts)" type="checkbox"
|
|
86
|
-
:name="`${id}${index}`"/>
|
|
87
|
-
<i class="choice-ico" :class="{'check-active': ts.checked, 'check-dis': disabled&&ts.checked,'check-dis-bor': disabled&&!ts.checked}"></i>
|
|
88
|
-
<span
|
|
89
|
-
:class="{'choice-span': chooseAnswer,'choice-color': disabled&&ts.checked&&!item.error&&!nothing,'choice-red': disabled&&ts.checked&&item.error&&!nothing}">{{
|
|
78
|
+
<svgs v-if="chooseAnswer" :radio="ques(item.quesType)" :select="ts.checked" :disabled="disabled" :state="stateFun(ts,item)"></svgs>
|
|
79
|
+
<span :class="{'choice-span': chooseAnswer}">{{
|
|
90
80
|
ts.index
|
|
91
81
|
}}. {{ ts.content[0] }}</span>
|
|
92
82
|
</label>
|
|
@@ -140,9 +130,11 @@
|
|
|
140
130
|
|
|
141
131
|
<script>
|
|
142
132
|
import {html2json, json2html} from 'html2json'
|
|
133
|
+
import svgs from './icon.vue'
|
|
143
134
|
|
|
144
135
|
export default {
|
|
145
136
|
name: "zydx-seek",
|
|
137
|
+
components: {svgs},
|
|
146
138
|
data() {
|
|
147
139
|
return {
|
|
148
140
|
value: [],
|
|
@@ -265,6 +257,11 @@ export default {
|
|
|
265
257
|
},
|
|
266
258
|
emits: ['change', 'modify', 'del', 'changeAll', 'replaceData', 'choiceData', 'judgeAnswer', 'openReasoning', 'review', 'subject'],
|
|
267
259
|
methods: {
|
|
260
|
+
stateFun(ts,item) {
|
|
261
|
+
if(this.disabled&&ts.checked&&!item.error&&!this.nothing) return 'correct'
|
|
262
|
+
if(this.disabled&&ts.checked&&item.error&&!this.nothing) return 'error'
|
|
263
|
+
return 'default'
|
|
264
|
+
},
|
|
268
265
|
customButTap(e,d) {
|
|
269
266
|
if(e.key === 'option') d.open = !d.open
|
|
270
267
|
if(e.key === 'modify') {
|
|
@@ -275,7 +272,7 @@ export default {
|
|
|
275
272
|
this.$emit('del', d)
|
|
276
273
|
return
|
|
277
274
|
}
|
|
278
|
-
e.onClick(e)
|
|
275
|
+
e.onClick(e,d)
|
|
279
276
|
},
|
|
280
277
|
init() {
|
|
281
278
|
this.value = JSON.parse(JSON.stringify(this.data))
|
|
@@ -354,7 +351,13 @@ export default {
|
|
|
354
351
|
this.value[i].replace = !this.value[i].replace
|
|
355
352
|
},
|
|
356
353
|
answerChange(e, v, id, check) {
|
|
357
|
-
if(
|
|
354
|
+
if(this.ques(v.quesType)) {
|
|
355
|
+
v.testKey.map(x => {
|
|
356
|
+
x.checked = false
|
|
357
|
+
return x
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
check.checked = e.target.checked
|
|
358
361
|
let answerArr = []
|
|
359
362
|
const ids = document.getElementsByName(id)
|
|
360
363
|
ids.forEach((x, index) => {
|