@zykjcommon/questions 0.0.49 → 0.0.51
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/dist/zykjcommon-questions.common.js +216 -140
- package/dist/zykjcommon-questions.css +1 -1
- package/dist/zykjcommon-questions.umd.js +216 -140
- package/dist/zykjcommon-questions.umd.min.js +4 -4
- package/package.json +1 -1
- package/readme +2 -0
- package/src/assets/img/lookBigImgBtn.png +0 -0
- package/src/assets/scss/questions/zykjcommon-questions.scss +16 -2
- package/src/components/common/MediaLooker.vue +3 -7
- package/src/components/questions/Question_Classify.vue +51 -6
- package/src/components/questions/Question_MultipleChoice.vue +1 -1
- package/src/components/questions/Question_Programming.vue +20 -0
package/package.json
CHANGED
package/readme
CHANGED
|
Binary file
|
|
@@ -406,8 +406,8 @@ $greenItemFontSize:0.13em;
|
|
|
406
406
|
//justify-content: space-between;
|
|
407
407
|
align-content: start;
|
|
408
408
|
&::-webkit-scrollbar {
|
|
409
|
-
width:
|
|
410
|
-
height:
|
|
409
|
+
width: 17px;
|
|
410
|
+
height: 17px;
|
|
411
411
|
}
|
|
412
412
|
&.noScrollBar::-webkit-scrollbar {
|
|
413
413
|
width: 0;
|
|
@@ -512,6 +512,7 @@ $greenItemFontSize:0.13em;
|
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
.list-item{
|
|
515
|
+
position: relative;
|
|
515
516
|
/*background: url("../../img/classify-green-item.png") no-repeat center;*/
|
|
516
517
|
background-repeat: no-repeat;
|
|
517
518
|
background-position: center;
|
|
@@ -624,6 +625,7 @@ $greenItemFontSize:0.13em;
|
|
|
624
625
|
img{
|
|
625
626
|
width: 100%;
|
|
626
627
|
height: 100%;
|
|
628
|
+
display: block;
|
|
627
629
|
}
|
|
628
630
|
&:hover {
|
|
629
631
|
background: rgba(0, 0, 0, 0.2);
|
|
@@ -659,4 +661,16 @@ $greenItemFontSize:0.13em;
|
|
|
659
661
|
&:hover {
|
|
660
662
|
background-color: #fff;
|
|
661
663
|
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.look-big-img-btn{
|
|
667
|
+
z-index:2;
|
|
668
|
+
cursor: pointer;
|
|
669
|
+
width: 0.16em;
|
|
670
|
+
height: 0.16em;
|
|
671
|
+
background: url("../../img/lookBigImgBtn.png") no-repeat center;
|
|
672
|
+
background-size: 100% 100%;
|
|
673
|
+
position: absolute;
|
|
674
|
+
right:0;
|
|
675
|
+
top:0;
|
|
662
676
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<div class="close" @click="cancel">
|
|
5
5
|
<img src="../../assets/img/big-close.png" alt="" />
|
|
6
6
|
</div>
|
|
7
|
-
<div class="prev" @click="prev"></div>
|
|
8
|
-
<div class="next" @click="next"></div>
|
|
7
|
+
<div class="prev" @click="prev" v-if="mediaLookerList.length > 1"></div>
|
|
8
|
+
<div class="next" @click="next" v-if="mediaLookerList.length > 1"></div>
|
|
9
9
|
<!-- <button style="position: fixed;z-index: 9999;top:0;left:0" @click="fn">click</button>-->
|
|
10
10
|
<div class="imgLooker" v-if="curMediaObj.mediaType == 1"
|
|
11
11
|
@click="enlarge"
|
|
@@ -56,11 +56,7 @@ export default {
|
|
|
56
56
|
mediaLookerList:{
|
|
57
57
|
handler(nv,ov){
|
|
58
58
|
if(nv && nv.length){
|
|
59
|
-
|
|
60
|
-
// console.log(nv,3333);
|
|
61
|
-
this.getCurMedia(this.mediaCount)
|
|
62
|
-
// console.log(props.mediaCount,11113);
|
|
63
|
-
}
|
|
59
|
+
this.getCurMedia(this.mediaCount)
|
|
64
60
|
}
|
|
65
61
|
},
|
|
66
62
|
immediate:true,
|
|
@@ -29,15 +29,24 @@
|
|
|
29
29
|
v-for="(item,index) in optionList"
|
|
30
30
|
:key="index">
|
|
31
31
|
<div class="list-item-text" v-show="item.content_type!=2">{{item.content}}</div>
|
|
32
|
+
<div class="look-big-img-btn"></div>
|
|
32
33
|
</div>
|
|
33
34
|
</div>
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
37
|
+
|
|
38
|
+
<MediaLooker :visible.sync="visible"
|
|
39
|
+
v-model:visible="visible"
|
|
40
|
+
v-if="visible"
|
|
41
|
+
:mediaCount="curMediaCount"
|
|
42
|
+
:mediaLookerList="mediaLookerList"></MediaLooker>
|
|
36
43
|
</div>
|
|
37
44
|
</template>
|
|
38
45
|
<script>
|
|
39
46
|
import fun from "../../assets/js/fun";
|
|
40
47
|
import {setRemFixedHeight} from "../../assets/js/rem";
|
|
48
|
+
import {commonData} from './mixin'
|
|
49
|
+
import MediaLooker from '../common/MediaLooker.vue'
|
|
41
50
|
let env = fun.getDeviceEnv()
|
|
42
51
|
export default {
|
|
43
52
|
name: 'Question_Classify',
|
|
@@ -114,7 +123,8 @@ export default {
|
|
|
114
123
|
flag : false,
|
|
115
124
|
scrollDistance : 3000,//设置一个死的滚动距离,保证能滚到底,目前够用
|
|
116
125
|
lazyDragTimer:null,
|
|
117
|
-
dragingStart:false
|
|
126
|
+
dragingStart:false,
|
|
127
|
+
...JSON.parse(commonData)
|
|
118
128
|
};
|
|
119
129
|
},
|
|
120
130
|
watch: {
|
|
@@ -163,9 +173,20 @@ export default {
|
|
|
163
173
|
}
|
|
164
174
|
},
|
|
165
175
|
isAnswered(){
|
|
166
|
-
let len = $(this.$el).find('.list .list-item').length
|
|
167
|
-
let answerd = len === 0
|
|
168
|
-
|
|
176
|
+
// let len = $(this.$el).find('.list .list-item').length
|
|
177
|
+
// let answerd = len === 0
|
|
178
|
+
//每个选中框至少要有一个选项才是已答
|
|
179
|
+
let arr = []
|
|
180
|
+
let mainAppend = $(this.$el).find('.main-append')
|
|
181
|
+
mainAppend.each((index,item)=>{
|
|
182
|
+
let appendItem = $(item).find('.append-item')
|
|
183
|
+
arr.push(appendItem.length)
|
|
184
|
+
})
|
|
185
|
+
if(arr.length === 2){
|
|
186
|
+
return arr[0] && arr[1]
|
|
187
|
+
}else{
|
|
188
|
+
return false
|
|
189
|
+
}
|
|
169
190
|
},
|
|
170
191
|
isCorrect(){
|
|
171
192
|
let correct = this.questionInfo.answerMap.is_correct === '1' ? true : false
|
|
@@ -261,6 +282,21 @@ export default {
|
|
|
261
282
|
})
|
|
262
283
|
return specArr
|
|
263
284
|
},
|
|
285
|
+
lookBigImg(e){
|
|
286
|
+
let self = this
|
|
287
|
+
let bgStr = $(e.target).parent('.list-item').css('background-image')
|
|
288
|
+
let bgStrReg = /url\(["'](.+)["']\)/
|
|
289
|
+
let matchArr = bgStr.match(bgStrReg)
|
|
290
|
+
if(matchArr && matchArr.length > 1){
|
|
291
|
+
let bgUrl = matchArr[1].replace(/^\s+/ig,'').replace(/\s+$/ig,'')
|
|
292
|
+
self.mediaLookerList = []
|
|
293
|
+
self.mediaLookerList.push({
|
|
294
|
+
url:bgUrl,
|
|
295
|
+
mediaType:1
|
|
296
|
+
})
|
|
297
|
+
self.visible = true
|
|
298
|
+
}
|
|
299
|
+
},
|
|
264
300
|
//移动端为了解决拖动事件和原生滚动条事件冲突,设置延迟100毫秒拖动(PC端不变)
|
|
265
301
|
bindDragDomEvent(appendItem,way){
|
|
266
302
|
let self = this
|
|
@@ -302,6 +338,13 @@ export default {
|
|
|
302
338
|
}
|
|
303
339
|
appendItem.off(this.mousedown)
|
|
304
340
|
appendItem.on(this.mousedown,function(e){
|
|
341
|
+
e.stopPropagation()
|
|
342
|
+
let curClassName = e.target.className
|
|
343
|
+
if(curClassName.indexOf('look-big-img-btn') > -1){
|
|
344
|
+
self.lookBigImg(e)
|
|
345
|
+
return
|
|
346
|
+
}
|
|
347
|
+
console.log(123);
|
|
305
348
|
if(env === 'mobile'){
|
|
306
349
|
self.lazyDragTimer = setTimeout(()=>{
|
|
307
350
|
dragDomEventFn(e,this)
|
|
@@ -318,7 +361,8 @@ export default {
|
|
|
318
361
|
let itemBgCss = `${self.moveDiv.get(0).style.backgroundImage}`
|
|
319
362
|
let itemColorCss = `${self.moveDiv.get(0).style.color}`
|
|
320
363
|
let textDisplayCss = self.moveDiv.find('.list-item-text').get(0).style.display
|
|
321
|
-
let
|
|
364
|
+
let lookBigImgBtnStr = options.appendItemClassName === 'list-item' ? '<div class="look-big-img-btn"></div>' : ''
|
|
365
|
+
let appendItem = $(`<div class="${options.appendItemClassName}" idx="${idx}"><div class="list-item-text" style="${textDisplayCss?'display:'+textDisplayCss:''}">${self.moveDiv.find('.list-item-text').text()}</div>${lookBigImgBtnStr}</div>`)
|
|
322
366
|
appendItem.css({opacity:0,backgroundImage:itemBgCss,color:itemColorCss})
|
|
323
367
|
options.targetList.append(appendItem)
|
|
324
368
|
options.targetList[options.scrollDirection](self.scrollDistance)
|
|
@@ -370,6 +414,7 @@ export default {
|
|
|
370
414
|
return
|
|
371
415
|
}
|
|
372
416
|
// e.preventDefault()
|
|
417
|
+
console.log(self.dragWay,7788);
|
|
373
418
|
if(self.dragWay === 'go'){
|
|
374
419
|
$(document).off(self.mousemove)
|
|
375
420
|
self.listItem && self.listItem.removeClass('drag')
|
|
@@ -509,7 +554,7 @@ export default {
|
|
|
509
554
|
}
|
|
510
555
|
},
|
|
511
556
|
components:{
|
|
512
|
-
|
|
557
|
+
MediaLooker
|
|
513
558
|
}
|
|
514
559
|
};
|
|
515
560
|
</script>
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
@saveCodeOnly="saveCodeOnly"
|
|
71
71
|
@iframeLoaded="iframeLoaded"
|
|
72
72
|
@getQuestionInfo="getQuestionInfo"
|
|
73
|
+
@menuBarloaded="menuBarloaded"
|
|
73
74
|
v-if="showFrame"></IframeComponent>
|
|
74
75
|
<Loading :loading="loading"></Loading>
|
|
75
76
|
</div>
|
|
@@ -153,6 +154,7 @@ export default {
|
|
|
153
154
|
},
|
|
154
155
|
data() {
|
|
155
156
|
return {
|
|
157
|
+
findIframeTimer:null,
|
|
156
158
|
iframe:null,
|
|
157
159
|
showFrame:false,
|
|
158
160
|
analyCorrectAnswer:'',
|
|
@@ -199,6 +201,24 @@ export default {
|
|
|
199
201
|
},
|
|
200
202
|
methods: {
|
|
201
203
|
...mapActions('zykjcommonQuestions',['getEditorUrlActions']),
|
|
204
|
+
menuBarloaded(){
|
|
205
|
+
this.$emit('menuBarloaded')
|
|
206
|
+
},
|
|
207
|
+
getIframeContentWindow(){
|
|
208
|
+
return new Promise((resolve,reject)=>{
|
|
209
|
+
if(this.iframe){
|
|
210
|
+
resolve(this.iframe.contentWindow)
|
|
211
|
+
}else{
|
|
212
|
+
this.findIframeTimer = setInterval(()=>{
|
|
213
|
+
if(this.iframe){
|
|
214
|
+
this.findIframeTimer && clearInterval(this.findIframeTimer)
|
|
215
|
+
this.findIframeTimer = null
|
|
216
|
+
resolve(this.iframe.contentWindow)
|
|
217
|
+
}
|
|
218
|
+
},200)
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
},
|
|
202
222
|
getAnswer(){
|
|
203
223
|
return {
|
|
204
224
|
code_file_oss_temp_path:this.code_file_oss_temp_path,
|