@zykjcommon/questions 0.0.24 → 0.0.26

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.
@@ -0,0 +1,600 @@
1
+ $greenItemFontSize:0.14rem;
2
+ .zykjcommon-question{
3
+ .editor-content{
4
+ margin-top: 10px;
5
+ width: 100%;
6
+ overflow: auto;
7
+ &.editor-content-bor{
8
+ height: 300px;
9
+ /*border: 1px solid #666;*/
10
+ padding:5px;
11
+ }
12
+ img{
13
+ display: block;
14
+ cursor: pointer;
15
+ }
16
+ }
17
+ .question-type{
18
+ font-size: 18px;
19
+ font-family: PingFang-SC-Medium, PingFang-SC;
20
+ font-weight: bold;
21
+ color: #000000;
22
+ margin-bottom: 20px;
23
+ .score{
24
+ font-size: 14px;
25
+ color: #666666;
26
+ font-weight: normal;
27
+ }
28
+ }
29
+ .question-box{
30
+ padding-left: 30px;
31
+ }
32
+ .bcdt-btn{
33
+ margin-top: 30px;
34
+ padding:8px 11px;
35
+ border-radius: 4px;
36
+ color:#fff;
37
+ background: #FFBC00;
38
+ font-size: 12px;
39
+ }
40
+ .question-option-list{
41
+ margin-top: 30px;
42
+ .question-option{
43
+ display: flex;
44
+ margin-bottom:20px;
45
+ font-size: 14px;
46
+ color:#000;
47
+ }
48
+ }
49
+ .question-stem{
50
+ color: #333333;
51
+ }
52
+ .radio-box{
53
+ margin-right:2px;
54
+ position: relative;display: inline-block;
55
+ span{
56
+ vertical-align: 3px;
57
+ margin-left:5px;
58
+ }
59
+ .radio{
60
+ position: absolute;left:0;top:0;
61
+ opacity: 0;
62
+ width: 100%;
63
+ height: 18px;
64
+ cursor: pointer;
65
+ }
66
+ .radio-bg{
67
+ display: inline-block;
68
+ width: 16px;
69
+ height: 16px;
70
+ background: url("../../img/radio.png") no-repeat center;
71
+ background-size: 100% 100%;
72
+ }
73
+ &.checked{
74
+ .radio-bg{
75
+ background: url("../../img/radio-cur.png") no-repeat center;
76
+ background-size: 100% 100%;
77
+ }
78
+ }
79
+ }
80
+ .checkbox-box{
81
+ margin-right:2px;
82
+ position: relative;display: inline-block;
83
+ /*span{
84
+ vertical-align: 3px;
85
+ margin-left:5px;
86
+ }*/
87
+ .checkbox{
88
+ height: 18px;
89
+ position: absolute;left:0;top:0;opacity: 0;
90
+ cursor: pointer;
91
+ }
92
+ .checkbox-bg{
93
+ width: 16px;height: 16px;display: inline-block;
94
+ background: url("../../img/checkbox.png") no-repeat center;
95
+ background-size: 100% 100%;
96
+ }
97
+ &.checked{
98
+ .checkbox-bg{
99
+ background: url("../../img/checkbox-cur.png") no-repeat center;
100
+ background-size: 100% 100%;
101
+ }
102
+ }
103
+ }
104
+ .label-box{
105
+ word-break: break-all;
106
+ margin-top: -2px;
107
+ margin-left:5px;
108
+ flex:1;
109
+ label{
110
+ cursor: pointer;
111
+ display: flex;
112
+ .img-box{
113
+ flex: 1;
114
+ margin-top: 2px;
115
+ img{
116
+ max-width: 100%;
117
+ }
118
+ }
119
+ span{margin-right: 5px;}
120
+ }
121
+ }
122
+ .editor-tit{
123
+ font-size: 16px;
124
+ font-family: PingFang-SC-Medium, PingFang-SC;
125
+ font-weight: bold;
126
+ color: #000000;
127
+ }
128
+ .editor-output{
129
+ margin-top: 15px;
130
+ background: #F7F7F7;
131
+ border-radius: 6px;
132
+ padding:15px;
133
+ color:#333;
134
+ font-size: 14px;
135
+ .output-main{
136
+ margin-top: 10px;
137
+ }
138
+ }
139
+ .question-analysis{
140
+ position: relative;
141
+ margin-top: 16px;
142
+ border-radius: 8px;
143
+ padding:21px 15px 16px;
144
+ background: #F7F7F7;
145
+ width: 100%;
146
+ .question-analysis-item{
147
+ display: flex;
148
+ margin-top: 16px;
149
+ }
150
+ .question-analysis-item:nth-child(2){
151
+ margin-top: 0;
152
+ }
153
+ .txt{
154
+ vertical-align: top;
155
+ font-size: 16px;
156
+ font-family: PingFang-SC-Medium, PingFang-SC;
157
+ font-weight: bold;
158
+ color: #333333;
159
+ width: 112px;
160
+ }
161
+ .img-box{
162
+ cursor: pointer;
163
+ display: inline-block;
164
+ position: relative;
165
+ width: 134px;
166
+ height: 134px;
167
+ img{
168
+ width: 100%;
169
+ height: 100%;
170
+ position: absolute;
171
+ left:0;
172
+ top:0;
173
+ }
174
+ .mask-text-box{
175
+ width: 100%;
176
+ height: 30px;
177
+ position: absolute;
178
+ bottom: 0;
179
+ left:0;
180
+ z-index:2;
181
+ .mask{
182
+ background: #000;
183
+ opacity: 0.4;
184
+ width: 100%;
185
+ height: 100%;
186
+ position: absolute;
187
+ left:0;
188
+ top:0;
189
+ z-index:1;
190
+ }
191
+ .mask-text{
192
+ width: 100%;
193
+ height: 100%;
194
+ position: absolute;
195
+ left:0;
196
+ top:0;
197
+ z-index:2;
198
+ line-height: 30px;
199
+ color:#fff;
200
+ text-align: center;
201
+ font-size: 14px;
202
+ }
203
+ }
204
+ }
205
+ .txt-box{
206
+ flex:1;
207
+ display: inline-block;
208
+ span{
209
+ color:#333;
210
+ }
211
+ .right{
212
+ color:#44BE57;
213
+ }
214
+ .wrong{
215
+ color:#E02020;
216
+ }
217
+ .analysis-txt{
218
+ color:#666;
219
+ }
220
+ }
221
+ }
222
+ .reading-question-item{
223
+ margin-top: 30px;
224
+ padding:30px;
225
+ background: #f6f6f6;
226
+ border-radius: 8px;
227
+ .question-box{
228
+ padding-left: 0;
229
+ }
230
+ .question-option-list{
231
+ margin-left: 25px;
232
+ .question-option{
233
+ &:last-child{
234
+ margin-bottom: 0;
235
+ }
236
+ }
237
+ }
238
+ }
239
+ .fill-blank{
240
+ display: inline;
241
+ border-bottom: 1px solid #FFA833;
242
+ outline: none;
243
+ word-break: break-all;
244
+ min-width: 80px;
245
+ margin-right:5px;
246
+ }
247
+
248
+ .question-tabs{
249
+ margin-top: 20px;
250
+ display: flex;
251
+ flex-wrap: wrap;
252
+ width: 100%;
253
+ margin-bottom: -15px;
254
+ .question-tab-item{
255
+ cursor: pointer;
256
+ border-radius: 6px;
257
+ width: 80px;
258
+ height: 36px;
259
+ line-height: 36px;
260
+ text-align: center;
261
+ border:1px solid #999;
262
+ position: relative;
263
+ margin-right: 5px;
264
+ margin-bottom: 10px;
265
+ &:hover{
266
+ border:1px solid #FF7D30;
267
+ }
268
+ &.cur{
269
+ border:1px solid #ddd;
270
+ background: #ddd;
271
+ &:before{
272
+ content:' ';
273
+ display: inline-block;
274
+ border-top:8px solid #ddd;
275
+ border-left:8px solid transparent;
276
+ border-right:8px solid transparent;
277
+ width: 0;
278
+ height: 0;
279
+ position:absolute;
280
+ bottom: -6px;
281
+ }
282
+ &:hover{
283
+ border:1px solid #ddd;
284
+ }
285
+ }
286
+ .tab-mark{
287
+ position: absolute;
288
+ width: 20px;
289
+ height: 20px;
290
+ background:url("../../img/tab-mark.png") no-repeat center;
291
+ background-size: 100% 100%;
292
+ right: -3px;
293
+ top: -5px;
294
+ }
295
+ }
296
+ }
297
+ .editor-textarea{
298
+ margin-top: 15px;
299
+ position: relative;
300
+ display: inline-block;
301
+ width: 100%;
302
+ textarea{
303
+ font-size: 14px;
304
+ min-width: 100%;max-width: 100%;min-height: 107px;
305
+ padding: 15px;
306
+ outline-color: #FFBC00;
307
+ border-radius: 6px;
308
+ border: 1px solid #DFDFDF;
309
+ color:#000;
310
+ }
311
+ .len{
312
+ right: 10px;
313
+ bottom: 10px;
314
+ position: absolute;
315
+ color:#999999;
316
+ font-size: 12px;
317
+ }
318
+ }
319
+
320
+ .iframeBox{
321
+ z-index:100;
322
+ width: 100%;
323
+ height: 100%;
324
+ position: fixed;
325
+ left: 0;
326
+ top: 0;
327
+ iframe{
328
+ width: 100%;
329
+ height: 100%;
330
+ }
331
+ }
332
+
333
+ .loading{
334
+ width: 50px;
335
+ height: 50px;
336
+ display: block;
337
+ position: fixed;
338
+ left:50%;
339
+ top:50%;
340
+ margin-left:-25px;
341
+ margin-top: -25px;
342
+ z-index:99999;
343
+ }
344
+
345
+
346
+ .question-classify{
347
+ margin: 0 auto;
348
+ width: 10rem;
349
+ height: 100%;
350
+ position: relative;
351
+ /*background: url("../../img/classify-bg-seaworld.png") no-repeat center;*/
352
+ /*background-size: 100% 100%;*/
353
+ overflow: auto;
354
+ .box{
355
+ padding: 0 0.8rem;
356
+ width: 100%;
357
+ display: flex;
358
+ justify-content: space-between;
359
+ margin-top: 0.72rem;
360
+ }
361
+ .box-item{
362
+ width: 4rem;
363
+ height: 4.4rem;
364
+ display: flex;
365
+ flex-direction: column;
366
+ /*background: url("../../img/classify-boxitem-bg.png") no-repeat center;*/
367
+ /*background-size: 100% 100%;*/
368
+ }
369
+ .main-block{
370
+ margin:0.38rem auto 0;
371
+ width: 1.1rem;
372
+ height: 1.1rem;
373
+ background: #76d2ff;
374
+ border: 1px dashed #ffffff;
375
+ border-radius: 0.11rem;
376
+ flex-shrink: 0;
377
+ img{
378
+ width: 100%;
379
+ height: 100%;
380
+ border-radius: 0.11rem;
381
+ }
382
+ }
383
+ .main-content{
384
+ padding: 0 0.28rem 0.15rem 0.35rem;
385
+ flex: 1;
386
+ .main-append{
387
+ /*height: 2.72rem;*/
388
+ height: 2.9rem;
389
+ overflow: auto;
390
+ display: flex;
391
+ flex-wrap: wrap;
392
+ justify-content: space-between;
393
+ align-content: start;
394
+ }
395
+ }
396
+ .append-item{
397
+ /*background: url("../../img/classify-green-item.png") no-repeat center;
398
+ background-size: 100% 100%;*/
399
+ width: 1.3rem;
400
+ height: 1.3rem;
401
+ margin-right: 0.1rem;
402
+ flex-shrink: 0;
403
+ cursor: move;
404
+ text-align: center;
405
+ font-size: $greenItemFontSize;
406
+ color:rgb(238,252,149);
407
+ padding:0 0.2rem;
408
+ display: flex;
409
+ justify-content: center;
410
+ align-items: center;
411
+ line-height: 1.2em;
412
+ /*letter-spacing: 0.8px;*/
413
+ .list-item-text{
414
+ margin-top: 0.1rem;
415
+ display: inline-block;
416
+ }
417
+ &:nth-child(2n+1){
418
+ margin-left: 0.2rem;
419
+ }
420
+ &:nth-child(2n){
421
+ margin-right: 0.2rem;
422
+ }
423
+ }
424
+ .list-outter{
425
+ padding: 0 0.33rem;
426
+ height: 1.5rem;
427
+ position: absolute;
428
+ bottom: 0.2rem;
429
+ left:50%;
430
+ margin-left: -4.5rem;
431
+ width: 9rem;
432
+ /*background: url("../../img/classify-list-bg.png") no-repeat center;*/
433
+ /*background-size: 100% 100%;*/
434
+ .list{
435
+ height: 1.5rem;
436
+ display: flex;
437
+ align-items: center;
438
+ overflow-x: auto;
439
+ width: 100%;
440
+ }
441
+ .prev,.next{
442
+ width: 0.24rem;
443
+ height: 100%;
444
+ display: flex;
445
+ align-items: center;
446
+ position: absolute;
447
+ top:0;
448
+ cursor: pointer;
449
+ }
450
+ .prev{
451
+ left:5px;
452
+ }
453
+ .next{
454
+ right:5px;
455
+ }
456
+ .prev-main,.next-main{
457
+ width: 0.24rem;
458
+ height: 0.28rem;
459
+ top:50%;
460
+ }
461
+ .prev-main{
462
+ background: url("../../img/classify-arrow-left.png") no-repeat center;
463
+ background-size: 100% 100%;
464
+ }
465
+ .next-main{
466
+ background: url("../../img/classify-arrow-right.png") no-repeat center;
467
+ background-size: 100% 100%;
468
+ }
469
+ }
470
+ .list-item{
471
+ /*background: url("../../img/classify-green-item.png") no-repeat center;
472
+ background-size: 100% 100%;*/
473
+ width: 1.3rem;
474
+ height: 1.3rem;
475
+ margin-right: 0.1rem;
476
+ flex-shrink: 0;
477
+ cursor: move;
478
+ text-align: center;
479
+ font-size: $greenItemFontSize;
480
+ color:rgb(238,252,149);
481
+ padding:0 0.2rem;
482
+ display: flex;
483
+ justify-content: center;
484
+ align-items: center;
485
+ line-height: 1.2em;
486
+ /*letter-spacing: 0.8px;*/
487
+ .list-item-text{
488
+ margin-top: 0.1rem;
489
+ display: inline-block;
490
+ }
491
+ }
492
+ .list-item.drag{
493
+ border:1px dashed #ddd;
494
+ }
495
+ .append-item.drag{
496
+ border:1px dashed #ddd;
497
+ }
498
+
499
+ }
500
+ }
501
+
502
+ .imgLookerDialog{
503
+ .mask{
504
+ z-index:1001;
505
+ position: fixed;
506
+ left: 0;
507
+ top: 0;
508
+ width: 100%;
509
+ height: 100%;
510
+ background: #000;
511
+ opacity: 0.6;
512
+ }
513
+ .prev,.next{
514
+ position: fixed;z-index: 1003;top:50%;
515
+ width: 50px;
516
+ height: 50px;
517
+ cursor: pointer;
518
+ }
519
+ .prev{
520
+ left:10px;
521
+ background: url("../../img/big-pre.png") no-repeat center;
522
+ background-size: cover;
523
+ }
524
+ .next{
525
+ right:10px;
526
+ background: url("../../img/big-next.png") no-repeat center;
527
+ background-size: cover;
528
+ }
529
+ .close{
530
+ position: fixed;
531
+ z-index:1003;
532
+ top:10px;
533
+ right:30px;
534
+ color:#fff;
535
+ cursor: pointer;
536
+ border-radius: 50%;
537
+ width: 50px;
538
+ height: 50px;
539
+ img{
540
+ width: 100%;
541
+ height: 100%;
542
+ }
543
+ &:hover {
544
+ background: rgba(0, 0, 0, 0.2);
545
+ }
546
+ }
547
+ .imgLooker{
548
+ width: 100%;
549
+ height: 100%;
550
+ z-index:1002;
551
+ position: fixed;
552
+ left: 0;
553
+ top: 0;
554
+ text-align: center;
555
+ overflow: auto;
556
+ display: flex;
557
+ justify-content: center;
558
+ align-items: center;
559
+ &.out {
560
+ display: inherit;
561
+ text-align: center;
562
+ overflow: auto;
563
+ cursor: zoom-out;
564
+ }
565
+ &.in {
566
+ cursor: zoom-in;
567
+ }
568
+ }
569
+ }
570
+ /*定义滑块颜色、内阴影及圆角*/
571
+ .imgLooker::-webkit-scrollbar-thumb {
572
+ border-radius: 6px;
573
+ background-color: #fff;
574
+ &:hover {
575
+ background-color: #fff;
576
+ }
577
+ }
578
+ .question-classify-moveDiv{
579
+ position: fixed;
580
+ /*background: url("../../img/classify-green-item.png") no-repeat center;
581
+ background-size: 100% 100%;*/
582
+ width: 1.3rem;
583
+ height: 1.3rem;
584
+ margin-right: 0.1rem;
585
+ flex-shrink: 0;
586
+ cursor: move;
587
+ text-align: center;
588
+ font-size: $greenItemFontSize;
589
+ color:rgb(238,252,149);
590
+ padding:0 0.2rem;
591
+ display: flex;
592
+ justify-content: center;
593
+ align-items: center;
594
+ line-height: 1.2em;
595
+ /*letter-spacing: 0.8px;*/
596
+ .list-item-text{
597
+ display: inline-block;
598
+ margin-top: 0.1rem;
599
+ }
600
+ }
@@ -64,8 +64,8 @@ export default {
64
64
  }
65
65
  },
66
66
  created() {
67
- this.setRootFontSize()
68
- window.addEventListener('resize',this.setRootFontSize)
67
+ // this.setRootFontSize()
68
+ // window.addEventListener('resize',this.setRootFontSize)
69
69
  },
70
70
  unmounted() {
71
71
  this.unmountedDo()
@@ -74,6 +74,8 @@ export default {
74
74
  this.unmountedDo()
75
75
  },
76
76
  mounted() {
77
+ this.setRootFontSize()
78
+ window.addEventListener('resize',this.setRootFontSize)
77
79
  this.init()
78
80
  this.$watch('optionList',(nv)=>{
79
81
  if(nv && nv.length){
@@ -88,6 +90,7 @@ export default {
88
90
  },
89
91
  data() {
90
92
  return {
93
+ animationing:false,
91
94
  analyCorrectAnswer:'',
92
95
  classify_question_info:{},
93
96
  answerMap:{},
@@ -268,7 +271,8 @@ export default {
268
271
  let idx = self.listItem.attr('idx')
269
272
  self.moveDiv = $(`<div class="question-classify-moveDiv" idx="${idx}" style="${self.listItemBgCss}"><div class="list-item-text">${self.listItem.find('.list-item-text').text()}</div></div>`)
270
273
  self.moveDiv.css({left:`${self.p1.moveX}px`,top:`${self.p1.moveY}px`})
271
- $('body').append(self.moveDiv)
274
+ $(self.$el).append(self.moveDiv)
275
+ // $('body').append(self.moveDiv)
272
276
  $(document).on(self.mousemove,function(e2){
273
277
  // e2.preventDefault()
274
278
  e2.stopPropagation()
@@ -296,6 +300,7 @@ export default {
296
300
  let appendLeft = appendItem.offset().left
297
301
  let appendTop = appendItem.offset().top
298
302
  //transitionend事件会执行2次,所以使用标记避免
303
+ self.animationing = true
299
304
  self.moveDiv.css({
300
305
  transition:'all 0.5s',
301
306
  left:appendLeft,
@@ -308,6 +313,7 @@ export default {
308
313
  appendItem.css({opacity:1})
309
314
  self.answeredNotify()
310
315
  self.bindDragDomEvent(appendItem,options.op)
316
+ self.animationing = false
311
317
  }
312
318
  self.flag = true
313
319
  })
@@ -332,6 +338,9 @@ export default {
332
338
  }
333
339
  self.bindDragDomEvent($(this.$el).find('.question-classify .list-item'),'go')
334
340
  $(document).on(self.mouseup,function(e){
341
+ if(self.animationing){
342
+ return
343
+ }
335
344
  // e.preventDefault()
336
345
  if(self.dragWay === 'go'){
337
346
  $(document).off(self.mousemove)
@@ -389,8 +398,6 @@ export default {
389
398
 
390
399
  console.log(specArr.length);
391
400
  }
392
-
393
-
394
401
  }
395
402
  })
396
403
  self.bindNextPrevEvent('next')
package/src/main.ts CHANGED
@@ -181,6 +181,7 @@ import ZYKJQuestionsPlugin from "@src/components/questions/developmentEntry.js"
181
181
  vueInstance.use((ZYKJQuestionsPlugin as any)(store))
182
182
  // import '@zykjcommon/questions/src/assets/scss/questions/zykjcommon-questions.scss';
183
183
  import '@src/assets/scss/questions/zykjcommon-questions.scss';
184
+ // import '@src/assets/scss/questions/zykjcommon-questions.scss';
184
185
 
185
186
 
186
187
  // console.log(ZYKJQuestionsPlugin,111);