zydx-plus 1.32.185 → 1.32.187
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/editor/src/editor.vue +11 -0
- package/src/components/question/src/question.vue +15 -2
- package/src/components/word/src/word.css +5 -0
- package/src/components/word/src/word.vue +17 -5
- package/src/components/word2/src/word.vue +54 -24
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -276,6 +276,17 @@ export default {
|
|
|
276
276
|
}
|
|
277
277
|
this.$emit('confirm', data)
|
|
278
278
|
},
|
|
279
|
+
getConfirm() {
|
|
280
|
+
let data = html2json(this.editor.getHTML()).child
|
|
281
|
+
if(this.signMenuShow) {
|
|
282
|
+
data.unshift({
|
|
283
|
+
node: 'element',
|
|
284
|
+
tag: 'sign',
|
|
285
|
+
child: []
|
|
286
|
+
})
|
|
287
|
+
}
|
|
288
|
+
return data
|
|
289
|
+
},
|
|
279
290
|
// 上传进度
|
|
280
291
|
progressFunction(e) {
|
|
281
292
|
if (e.lengthComputable) {
|
|
@@ -175,15 +175,28 @@ export default {
|
|
|
175
175
|
this.totalScore()
|
|
176
176
|
},
|
|
177
177
|
getContent() {
|
|
178
|
+
let arr = []
|
|
179
|
+
for(let i=0; i< this.question.length; i++) {
|
|
180
|
+
if(this.question[i].allScore === '-' || this.question[i].count === '-') continue;
|
|
181
|
+
arr.push({
|
|
182
|
+
...this.question[i],
|
|
183
|
+
easyScore: this.question[i].easy? this.question[i].easyScore: '',
|
|
184
|
+
hardScore: this.question[i].hard? this.question[i].hardScore: '',
|
|
185
|
+
midScore: this.question[i].mid? this.question[i].midScore: '',
|
|
186
|
+
easy: this.question[i].easyScore? this.question[i].easy: '',
|
|
187
|
+
hard: this.question[i].hardScore? this.question[i].hard: '',
|
|
188
|
+
mid: this.question[i].midScore? this.question[i].mid: ''
|
|
189
|
+
})
|
|
190
|
+
}
|
|
178
191
|
return {
|
|
179
|
-
data:
|
|
192
|
+
data: arr,
|
|
180
193
|
total: this.totalNum,
|
|
181
194
|
}
|
|
182
195
|
},
|
|
183
196
|
// 添加数据
|
|
184
197
|
addData(v,n) {
|
|
185
198
|
const len = this.question.length
|
|
186
|
-
n(len)
|
|
199
|
+
if(n) n(len)
|
|
187
200
|
if(len === 6) return
|
|
188
201
|
if(this.empty) {
|
|
189
202
|
this.empty = false
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div class="subject-title">
|
|
7
7
|
<label>
|
|
8
8
|
<input v-if="multipleShow" type="checkbox" :checked="item.checked" @change="checkboxChange($event,index)" name="check" />
|
|
9
|
-
<span>{{ item.order }}.<em v-html="item.title"></em>
|
|
9
|
+
<span>{{ item.order }}.<em v-html="item.title"></em><em v-if="scoreShow">({{ item.score }}分)</em>
|
|
10
10
|
<i class="subject-but" ref="subject">
|
|
11
11
|
<b :style="{right: -item.right + 'px', top: item.top + 'px'}" v-if="butShow" ref="b">
|
|
12
12
|
<button class="but" @click="modify(item)">修改</button>
|
|
@@ -29,7 +29,10 @@
|
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
<div v-if="item.alist" class="subject-html">
|
|
32
|
-
<div v-for="(item,index) in item.alist"
|
|
32
|
+
<div v-for="(item,index) in item.alist">
|
|
33
|
+
<div class="subject-html-title">{{ titleText }}{{ index + 1 }}</div>
|
|
34
|
+
<div class="subject-html-cont" v-html="item.annexContent"></div>
|
|
35
|
+
</div>
|
|
33
36
|
</div>
|
|
34
37
|
<div class="choice" v-if="item.testKey">
|
|
35
38
|
<div class="choice-box" v-for="(ts,ind) in JSON.parse(item.testKey)">
|
|
@@ -83,6 +86,14 @@ export default {
|
|
|
83
86
|
choice: {
|
|
84
87
|
type: Boolean,
|
|
85
88
|
default: false
|
|
89
|
+
},
|
|
90
|
+
titleText: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: '材料'
|
|
93
|
+
},
|
|
94
|
+
scoreShow: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
86
97
|
}
|
|
87
98
|
},
|
|
88
99
|
watch: {
|
|
@@ -95,7 +106,7 @@ export default {
|
|
|
95
106
|
item.top = 0
|
|
96
107
|
if(item.alist) {
|
|
97
108
|
item.alist.map(x => {
|
|
98
|
-
x.
|
|
109
|
+
x.annexContent = json2html({node: "root",child: JSON.parse(x.annexContent)})
|
|
99
110
|
return x
|
|
100
111
|
})
|
|
101
112
|
}
|
|
@@ -105,10 +116,11 @@ export default {
|
|
|
105
116
|
const w = this.$refs.parer.offsetWidth
|
|
106
117
|
for(let i = 0; i< this.$refs.subject.length; i++) {
|
|
107
118
|
this.value[i].right = w - this.$refs.subject[i].offsetLeft
|
|
108
|
-
if(this
|
|
119
|
+
if(this.$refs.b) {
|
|
120
|
+
if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25
|
|
121
|
+
}
|
|
109
122
|
}
|
|
110
123
|
})
|
|
111
|
-
console.log(this.value)
|
|
112
124
|
},
|
|
113
125
|
immediate: true,
|
|
114
126
|
},
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="word-page" v-if="page">
|
|
7
|
-
<div class="page-cont" v-for="(item,index) in htmlArr">
|
|
7
|
+
<div class="page-cont" v-for="(item,index) in htmlArr" :key="index">
|
|
8
8
|
<div class="page-cont-html" v-html="item"></div>
|
|
9
9
|
<div class="page-cont-num">{{ index + 1 }}/{{ htmlArr.length }}</div>
|
|
10
10
|
</div>
|
|
@@ -19,7 +19,10 @@ export default {
|
|
|
19
19
|
name: "zydx-paper",
|
|
20
20
|
data() {
|
|
21
21
|
return {
|
|
22
|
-
htmlArr: []
|
|
22
|
+
htmlArr: [],
|
|
23
|
+
max: 823,
|
|
24
|
+
pHeight: 0,
|
|
25
|
+
html: ''
|
|
23
26
|
}
|
|
24
27
|
},
|
|
25
28
|
props: {
|
|
@@ -43,35 +46,62 @@ export default {
|
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
},
|
|
46
|
-
mounted() {
|
|
47
|
-
this.$nextTick(() => {
|
|
48
|
-
this.init()
|
|
49
|
-
})
|
|
50
|
-
},
|
|
51
49
|
methods: {
|
|
52
50
|
init() {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
const data = document.getElementById('test').children[0].childNodes
|
|
53
|
+
this.children(data)
|
|
54
|
+
},0)
|
|
55
|
+
},
|
|
56
|
+
children(data) {
|
|
57
|
+
for (let i = 0; i < data.length; i++) {
|
|
58
|
+
let text = data[i].offsetHeight
|
|
59
|
+
if((this.pHeight + text) > this.max) {
|
|
60
|
+
this.propsClass(data[i].children)
|
|
61
|
+
}else {
|
|
62
|
+
this.pHeight += text
|
|
63
|
+
this.html += data[i].outerHTML
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.
|
|
69
|
-
pHeight = 0
|
|
70
|
-
html = ''
|
|
65
|
+
if(i === data.length - 1) {
|
|
66
|
+
this.htmlArr.push(this.html)
|
|
67
|
+
this.pHeight = 0
|
|
68
|
+
this.html = ''
|
|
71
69
|
break
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
72
|
},
|
|
73
|
+
propsClass(data) {
|
|
74
|
+
for (let i = 0; i < data.length; i++) {
|
|
75
|
+
let text = data[i].offsetHeight
|
|
76
|
+
if((this.pHeight + text) > this.max) {
|
|
77
|
+
if(data[i].children.length === 0) {
|
|
78
|
+
this.htmlArr.push(this.html)
|
|
79
|
+
this.pHeight = 0
|
|
80
|
+
this.html = ''
|
|
81
|
+
this.pHeight += text
|
|
82
|
+
this.html += data[i].outerHTML
|
|
83
|
+
}else {
|
|
84
|
+
this.propsClass(data[i].children)
|
|
85
|
+
}
|
|
86
|
+
}else {
|
|
87
|
+
this.pHeight += text
|
|
88
|
+
this.html += data[i].outerHTML
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
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
|
+
},
|
|
75
105
|
exportToWord() {
|
|
76
106
|
const wrap = document.getElementById('test')
|
|
77
107
|
const config = {
|