zydx-plus 1.32.228 → 1.32.229

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.32.228",
3
+ "version": "1.32.229",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -241,3 +241,12 @@ input[name='check'] {
241
241
  .choice-red{
242
242
  color: red;
243
243
  }
244
+ .task {
245
+ display: flex;
246
+ justify-content: center;
247
+ }
248
+ .task>span{
249
+ font-size: 16px;
250
+ font-weight: 700;
251
+ flex: 1;
252
+ }
@@ -52,7 +52,7 @@
52
52
  <div class="choice-box" v-for="(ts,ind) in item.testKey">
53
53
  <label>
54
54
  <input class="choice-input" v-if="chooseAnswer" :disabled="disabled" :checked="ts.checked" @change="answerChange($event,item,`${id}${index}`)" :type="ques(item.quesType)?'radio':'checkbox'" :name="`${id}${index}`" />
55
- <span :class="{'choice-span': chooseAnswer,'choice-color': disabled&&ts.checked&&!item.red,'choice-red': disabled&&ts.checked&&item.red}">{{ ts.index }}. {{ ts.content[0] }}</span>
55
+ <span :class="{'choice-span': chooseAnswer,'choice-color': disabled&&ts.checked&&!item.error,'choice-red': disabled&&ts.checked&&item.error}">{{ ts.index }}. {{ ts.content[0] }}</span>
56
56
  </label>
57
57
  </div>
58
58
  </div>
@@ -195,53 +195,7 @@ export default {
195
195
  data: {
196
196
  handler: function (val, oldVal) {
197
197
  if(this.state) return
198
- this.value = JSON.parse(JSON.stringify(val))
199
- this.value.map((item,index) => { // 转换html
200
- item.choice = true
201
- item.right = 0
202
- item.top = 0
203
- item.open = item.open? item.open: true
204
- item.replace = item.replace? item.replace: true
205
- item.reasoning = item.reasoning? item.reasoning: true
206
- item.review = item.review? item.review: true
207
- item.subject = item.subject? item.subject: true
208
- item.red = item.red? item.red: false
209
- if(item.alist) {
210
- item.alist.map(x => {
211
- x.annexContent = json2html({node: "root",child: JSON.parse(x.annexContent)})
212
- return x
213
- })
214
- }
215
- if(item.testKey) {
216
- item.testKey = typeof item.testKey === 'string'? JSON.parse(item.testKey): item.testKey
217
- item.testKey = item.testKey.map(x => {
218
- if(this.ques(item.quesType)) { // 判断是否单选
219
- x.checked = x.index === item?.judgeAnswer; //答案
220
- }else {
221
- for(let i=0; i<item?.judgeAnswer?.length; i++) {
222
- if(x.index === item.judgeAnswer[i]) {
223
- x.checked = true
224
- break
225
- }else {
226
- x.checked = false
227
- }
228
- }
229
- }
230
- return x
231
- })
232
- }
233
- console.log(item)
234
- return item
235
- })
236
- this.$nextTick(() => { // 保证所有的数据都渲染完毕
237
- const w = this.$refs.parer.offsetWidth // 获取父级宽度
238
- for(let i = 0; i< this.$refs?.subject?.length; i++) {
239
- this.value[i].right = w - this.$refs.subject[i].offsetLeft
240
- if(this.$refs.b && this.$refs.b.length > 0) {
241
- if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25 // 判断是否换行
242
- }
243
- }
244
- })
198
+ this.init()
245
199
  },
246
200
  immediate: true,
247
201
  },
@@ -261,55 +215,60 @@ export default {
261
215
  mounted() {
262
216
  this.id = this.randomId()
263
217
  if(!this.state) return
264
- this.value = JSON.parse(JSON.stringify(this.data))
265
- this.value.map((item,index) => { // 转换html
266
- item.choice = true
267
- item.right = 0
268
- item.top = 0
269
- item.open = item.open? item.open: true
270
- item.replace = item.replace? item.replace: true
271
- item.reasoning = item.reasoning? item.reasoning: true
272
- item.review = item.review? item.review: true
273
- item.subject = item.subject? item.subject: true
274
- item.red = item.red? item.red: false
275
- if(item.alist) {
276
- item.alist.map(x => {
277
- x.annexContent = json2html({node: "root",child: JSON.parse(x.annexContent)})
278
- return x
279
- })
280
- }
281
- if(item.testKey) {
282
- item.testKey = typeof item.testKey === 'string'? JSON.parse(item.testKey): item.testKey
283
- item.testKey = item.testKey.map(x => {
284
- if(this.ques(item.quesType)) { // 判断是否单选
285
- x.checked = x.index === item?.judgeAnswer; //答案
286
- }else {
287
- for(let i=0; i<item?.judgeAnswer?.length; i++) {
288
- if(x.index === item.judgeAnswer[i]) {
289
- x.checked = true
290
- break
291
- }else {
292
- x.checked = false
218
+ this.init()
219
+ },
220
+ emits: ['change','modify','del','changeAll','replaceData','choiceData','judgeAnswer','openReasoning','review','subject'],
221
+ methods: {
222
+ init() {
223
+ this.value = JSON.parse(JSON.stringify(this.data))
224
+ this.value.map((item,index) => { // 转换html
225
+ item.choice = true
226
+ item.right = 0
227
+ item.top = 0
228
+ item.open = item.open !== undefined? item.open: true
229
+ item.replace = item.replace !== undefined? item.replace: true
230
+ item.reasoning = item.reasoning !== undefined? item.reasoning: true
231
+ item.review = item.review !== undefined? item.review: true
232
+ item.subject = item.subject !== undefined? item.subject: true
233
+ item.error = item.error !== undefined? item.error: false
234
+ if(item.alist) {
235
+ item.alist.map(x => {
236
+ x.annexContent = json2html({node: "root",child: JSON.parse(x.annexContent)})
237
+ return x
238
+ })
239
+ }
240
+ if(item.testKey) {
241
+ item.testKey = typeof item.testKey === 'string'? JSON.parse(item.testKey): item.testKey
242
+ let judge = item?.judgeAnswer
243
+ if(item.stuAnswer) judge = item.stuAnswer?.answer
244
+ item.testKey = item.testKey.map(x => {
245
+ if(this.ques(item.quesType)) { // 判断是否单选
246
+ x.checked = x.index === judge; //答案
247
+ }else {
248
+ for(let i=0; i<judge?.length; i++) {
249
+ if(x.index === judge[i]) {
250
+ x.checked = true
251
+ break
252
+ }else {
253
+ x.checked = false
254
+ }
293
255
  }
294
256
  }
257
+ return x
258
+ })
259
+ }
260
+ return item
261
+ })
262
+ this.$nextTick(() => { // 保证所有的数据都渲染完毕
263
+ const w = this.$refs.parer.offsetWidth // 获取父级宽度
264
+ for(let i = 0; i< this.$refs?.subject?.length; i++) {
265
+ this.value[i].right = w - this.$refs.subject[i].offsetLeft
266
+ if(this.$refs.b && this.$refs.b.length > 0) {
267
+ if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25 // 判断是否换行
295
268
  }
296
- return x
297
- })
298
- }
299
- return item
300
- })
301
- this.$nextTick(() => { // 保证所有的数据都渲染完毕
302
- const w = this.$refs.parer.offsetWidth // 获取父级宽度
303
- for(let i = 0; i< this.$refs?.subject?.length; i++) {
304
- this.value[i].right = w - this.$refs.subject[i].offsetLeft
305
- if(this.$refs.b && this.$refs.b.length > 0) {
306
- if(this.value[i].right < this.$refs.b[i].offsetWidth) this.value[i].top = 25 // 判断是否换行
307
269
  }
308
- }
309
- })
310
- },
311
- emits: ['change','modify','del','changeAll','replaceData','choiceData','judgeAnswer','openReasoning','review','subject'],
312
- methods: {
270
+ })
271
+ },
313
272
  randomId() { // 生成随机id
314
273
  const id = Math.random().toString(36).substr(2)
315
274
  return id.replace(/[0-9]/g, '')
package/src/index.js CHANGED
@@ -79,7 +79,7 @@ function install(app) {
79
79
  }
80
80
 
81
81
  export default {
82
- version: '1.32.228',
82
+ version: '1.32.229',
83
83
  install,
84
84
  Calendar,
85
85
  Message,