zydx-plus 1.32.197 → 1.32.199
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
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
.subject-title{
|
|
90
90
|
flex: 1;
|
|
91
91
|
position: relative;
|
|
92
|
+
line-height: 26px;
|
|
92
93
|
}
|
|
93
94
|
.subject-title label{
|
|
94
95
|
display: inline-block;
|
|
@@ -171,7 +172,10 @@ input[name='check'] {
|
|
|
171
172
|
text-indent: 2em;
|
|
172
173
|
font-weight: bold;
|
|
173
174
|
font-size: 14px;
|
|
175
|
+
line-height: 26px;
|
|
174
176
|
}
|
|
175
177
|
.subject-html-cont{
|
|
176
178
|
text-align: justify;
|
|
179
|
+
line-height: 26px;
|
|
180
|
+
text-indent: 2em;
|
|
177
181
|
}
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
37
|
<div class="choice" v-if="item.testKey">
|
|
38
|
-
<div class="choice-box" v-for="(ts,ind) in
|
|
38
|
+
<div class="choice-box" v-for="(ts,ind) in item.testKey">
|
|
39
39
|
<label>
|
|
40
|
-
<input :disabled="disabled" @change="
|
|
40
|
+
<input :disabled="disabled" :checked="ts.checked" @change="answerChange($event,item,index)" :type="ques(item.quesType)?'radio':'checkbox'" :name="index" />
|
|
41
41
|
<span>{{ ts.index }}. {{ ts.content[0] }}</span>
|
|
42
42
|
</label>
|
|
43
43
|
</div>
|
|
@@ -100,7 +100,7 @@ export default {
|
|
|
100
100
|
data: {
|
|
101
101
|
handler: function (val, oldVal) {
|
|
102
102
|
this.value = val
|
|
103
|
-
this.value.map((item,index) => {
|
|
103
|
+
this.value.map((item,index) => { // 转换html
|
|
104
104
|
item.choice = true
|
|
105
105
|
item.right = 0
|
|
106
106
|
item.top = 0
|
|
@@ -110,14 +110,31 @@ export default {
|
|
|
110
110
|
return x
|
|
111
111
|
})
|
|
112
112
|
}
|
|
113
|
+
if(item.testKey) {
|
|
114
|
+
item.testKey = JSON.parse(item.testKey).map(x => {
|
|
115
|
+
if(this.ques(item.quesType)) { // 判断是否单选
|
|
116
|
+
x.checked = x.index === item.answer;
|
|
117
|
+
}else {
|
|
118
|
+
for(let i=0; i<item.answer.length; i++) {
|
|
119
|
+
if(x.index === item.answer[i]) {
|
|
120
|
+
x.checked = true
|
|
121
|
+
break
|
|
122
|
+
}else {
|
|
123
|
+
x.checked = false
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return x
|
|
128
|
+
})
|
|
129
|
+
}
|
|
113
130
|
return item
|
|
114
131
|
})
|
|
115
|
-
this.$nextTick(() => {
|
|
116
|
-
const w = this.$refs.parer.offsetWidth
|
|
132
|
+
this.$nextTick(() => { // 保证所有的数据都渲染完毕
|
|
133
|
+
const w = this.$refs.parer.offsetWidth // 获取父级宽度
|
|
117
134
|
for(let i = 0; i< this.$refs.subject.length; i++) {
|
|
118
135
|
this.value[i].right = w - this.$refs.subject[i].offsetLeft
|
|
119
136
|
if(this.$refs.b && this.$refs.b.length > 0) {
|
|
120
|
-
if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25
|
|
137
|
+
if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25 // 判断是否换行
|
|
121
138
|
}
|
|
122
139
|
}
|
|
123
140
|
})
|
|
@@ -131,8 +148,21 @@ export default {
|
|
|
131
148
|
deep: true
|
|
132
149
|
}
|
|
133
150
|
},
|
|
134
|
-
emits: ['change','modify','del','changeAll','replaceData','choiceData'],
|
|
151
|
+
emits: ['change','modify','del','changeAll','replaceData','choiceData','answer'],
|
|
135
152
|
methods: {
|
|
153
|
+
answerChange(e,v,id) {
|
|
154
|
+
let answerArr = []
|
|
155
|
+
const ids = document.getElementsByName(id)
|
|
156
|
+
ids.forEach((x,index) => {
|
|
157
|
+
if(x.checked) {
|
|
158
|
+
answerArr.push(v.testKey[index].index)
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
this.$emit('answer',{
|
|
162
|
+
...v,
|
|
163
|
+
answer: this.ques(v.quesType)? answerArr[0]: answerArr
|
|
164
|
+
})
|
|
165
|
+
},
|
|
136
166
|
checkboxChange(e,index) {
|
|
137
167
|
this.value[index].checked = e.target.checked
|
|
138
168
|
this.$emit('change', {
|
|
@@ -152,9 +182,8 @@ export default {
|
|
|
152
182
|
},
|
|
153
183
|
styleText(v) {
|
|
154
184
|
if(!v || v === 'null') return
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if(data[i].content[0].length > 20) {
|
|
185
|
+
for(let i=0; i< v.length; i++) {
|
|
186
|
+
if(v[i].content[0].length > 20) {
|
|
158
187
|
return true
|
|
159
188
|
}
|
|
160
189
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
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" :key="index">
|
|
8
|
-
<div class="page-cont-html" v-html="item"></div>
|
|
7
|
+
<div class="page-cont" v-for="(item,index) in htmlArr" :key="index" :style="{'z-index': zIndex}">
|
|
8
|
+
<div class="page-cont-html" v-html="item" :style="{padding: padding?'100px':'100px 0', 'padding-top': index === 0?'10px': '100px'}"></div>
|
|
9
9
|
<div class="page-cont-num">{{ index + 1 }}/{{ htmlArr.length }}</div>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
@@ -34,6 +34,14 @@ export default {
|
|
|
34
34
|
fileName: {
|
|
35
35
|
type: String,
|
|
36
36
|
default: '试卷'
|
|
37
|
+
},
|
|
38
|
+
padding: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
zIndex: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 1
|
|
37
45
|
}
|
|
38
46
|
},
|
|
39
47
|
computed: {
|
|
@@ -49,6 +57,7 @@ export default {
|
|
|
49
57
|
},
|
|
50
58
|
methods: {
|
|
51
59
|
init() {
|
|
60
|
+
if(!this.page) return
|
|
52
61
|
this.htmlArr = []
|
|
53
62
|
this.pHeight = 0
|
|
54
63
|
this.html = ''
|