ai-question-pro 0.0.16 → 0.0.18
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/components/demo/src/main.vue +186 -110
- package/components/demo/src/questionItem.vue +4 -2
- package/components/demo/static/logo.png +0 -0
- package/dist/ai-question-pro.common.js +132 -150
- package/dist/ai-question-pro.common.js.map +1 -1
- package/dist/ai-question-pro.umd.js +132 -150
- package/dist/ai-question-pro.umd.js.map +1 -1
- package/dist/ai-question-pro.umd.min.js +4 -4
- package/dist/ai-question-pro.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
<el-drawer :visible.sync="addShow" :direction="direction" :wrapperClosable="false" destroy-on-close>
|
|
7
7
|
<template slot="title">
|
|
8
8
|
<div class="add_question_title">
|
|
9
|
-
<
|
|
10
|
-
|
|
9
|
+
<img src="../static/logo.png" alt="" style="width: 32px; height: 18px;"/>
|
|
10
|
+
<span>出题</span>
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
13
13
|
<div class="add_question_body">
|
|
14
14
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px" label-position="left">
|
|
15
|
-
<el-form-item label="
|
|
15
|
+
<el-form-item label="题目类型" prop="questionType">
|
|
16
16
|
<!-- <el-checkbox-group v-model="form.questionTypes">-->
|
|
17
17
|
<!-- <el-checkbox v-for="item in quesTypeList" :key="item.id" :label="item.id">-->
|
|
18
18
|
<!-- {{ item.name }}-->
|
|
19
19
|
<!-- </el-checkbox>-->
|
|
20
20
|
<!-- </el-checkbox-group>-->
|
|
21
|
-
<el-radio-group v-model="form.questionType"
|
|
21
|
+
<el-radio-group v-model="form.questionType" >
|
|
22
22
|
<!-- <el-radio-button v-for="item in quesTypeList" :key="item.id" :label="item.id">{{ item.name }}</el-radio-button>-->
|
|
23
23
|
<el-radio v-for="item in quesTypeList"
|
|
24
24
|
style="margin-right: 8px; margin-bottom: 8px"
|
|
@@ -26,38 +26,38 @@
|
|
|
26
26
|
:label="item.id">{{ item.name }}</el-radio>
|
|
27
27
|
</el-radio-group>
|
|
28
28
|
</el-form-item>
|
|
29
|
-
<el-form-item label="
|
|
30
|
-
<el-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<el-form-item label="关联知识点" prop="knowledgeIds">
|
|
35
|
-
<!-- <el-cascader v-model="form.knowledgeId" :options="knowledgeList" @change="closeDrowdown"-->
|
|
36
|
-
<!-- :show-all-levels="false" ref="cascader" :props="{ checkStrictly: true, ...propFormat }"-->
|
|
37
|
-
<!-- clearable></el-cascader>-->
|
|
38
|
-
<cy-tree-select v-model="form.knowledgeIds" filterable :data="knowledgeList"></cy-tree-select>
|
|
39
|
-
</el-form-item>
|
|
40
|
-
<el-form-item label="难度" prop="difficulty">
|
|
41
|
-
<!-- <el-checkbox-group v-model="form.difficultys">-->
|
|
42
|
-
<!-- <el-checkbox :label="item.id" v-for="item in difficultyList" :key="item.id">{{ item.name-->
|
|
43
|
-
<!-- }}</el-checkbox>-->
|
|
44
|
-
<!-- </el-checkbox-group>-->
|
|
29
|
+
<el-form-item label="题目难度" prop="difficulty">
|
|
30
|
+
<!-- <el-checkbox-group v-model="form.difficultys">-->
|
|
31
|
+
<!-- <el-checkbox :label="item.id" v-for="item in difficultyList" :key="item.id">{{ item.name-->
|
|
32
|
+
<!-- }}</el-checkbox>-->
|
|
33
|
+
<!-- </el-checkbox-group>-->
|
|
45
34
|
<el-radio-group v-model="form.difficulty" size="medium">
|
|
46
|
-
<!-- <el-radio-button v-for="item in difficultyList" :key="item.id" :label="item.id">{{ item.name }}</el-radio-button>-->
|
|
35
|
+
<!-- <el-radio-button v-for="item in difficultyList" :key="item.id" :label="item.id">{{ item.name }}</el-radio-button>-->
|
|
47
36
|
<el-radio v-for="item in difficultyList"
|
|
48
37
|
style="margin-right: 8px; margin-bottom: 8px"
|
|
49
38
|
:key="item.id"
|
|
50
39
|
:label="item.id">{{ item.name }}</el-radio>
|
|
51
40
|
</el-radio-group>
|
|
52
41
|
</el-form-item>
|
|
42
|
+
<el-form-item label="关联知识点" prop="knowledgeIds">
|
|
43
|
+
<!-- <el-cascader v-model="form.knowledgeId" :options="knowledgeList" @change="closeDrowdown"-->
|
|
44
|
+
<!-- :show-all-levels="false" ref="cascader" :props="{ checkStrictly: true, ...propFormat }"-->
|
|
45
|
+
<!-- clearable></el-cascader>-->
|
|
46
|
+
<cy-tree-select v-model="form.knowledgeIds" filterable :data="knowledgeList"></cy-tree-select>
|
|
47
|
+
</el-form-item>
|
|
48
|
+
<el-form-item label="题目数量" prop="count">
|
|
49
|
+
<el-input class="number_input" v-model="form.count" min="1" max="10" type="number" placeholder="请输入"
|
|
50
|
+
@input="handleInput"></el-input>
|
|
51
|
+
<div class="remind">(为避免您等待时间过长,一次性最多生成10道题)</div>
|
|
52
|
+
</el-form-item>
|
|
53
53
|
<el-form-item label="自定义提示语">
|
|
54
|
-
<el-input v-model="form.prompt" placeholder="这里可以写对于题目的要求和补充,比如:“出题内容请围绕一下知识内容:智能水利物联网是指利用物联网技术和智能化手段,对水利工程设施进行实时监测、数据采集、远程控制和智能分析,以实现对水资源的高效利用、水利设施的智能运营和管理。通过传感器、无线通信技术、云计算平台和大数据分析等技术手段,实现对水利系统各个环节的智能监测和管理,提高水资源利用效率,降低水利工程运行成本,保障水利工程安全稳定运行。”" type="textarea" :autosize="{ minRows: 10, maxRows: 10}"></el-input>
|
|
54
|
+
<el-input v-model="form.prompt" placeholder="这里可以写对于题目的要求和补充,比如:“出题内容请围绕一下知识内容:智能水利物联网是指利用物联网技术和智能化手段,对水利工程设施进行实时监测、数据采集、远程控制和智能分析,以实现对水资源的高效利用、水利设施的智能运营和管理。通过传感器、无线通信技术、云计算平台和大数据分析等技术手段,实现对水利系统各个环节的智能监测和管理,提高水资源利用效率,降低水利工程运行成本,保障水利工程安全稳定运行。”" type="textarea" :autosize="{ minRows: 10, maxRows: 10} " maxlength="200" show-word-limit></el-input>
|
|
55
55
|
</el-form-item>
|
|
56
56
|
</el-form>
|
|
57
57
|
</div>
|
|
58
58
|
<div class="add_question_footer">
|
|
59
|
-
<
|
|
60
|
-
<
|
|
59
|
+
<button class="button-handle button-cancel" @click="addShow = false">取 消</button>
|
|
60
|
+
<button class="button-handle button-generate-question" @click="generate">生成题目</button>
|
|
61
61
|
</div>
|
|
62
62
|
</el-drawer>
|
|
63
63
|
<el-dialog :visible.sync="showQues" :close-on-click-modal="false">
|
|
@@ -453,128 +453,204 @@ export default {
|
|
|
453
453
|
}
|
|
454
454
|
</script>
|
|
455
455
|
<style lang="scss" scoped>
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
.ai_contain {
|
|
457
|
+
display: inline-block;
|
|
458
458
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
background-image: url('../static/addQuesTitBg.png');
|
|
463
|
-
background-size: 100% 100%;
|
|
459
|
+
::v-deep {
|
|
460
|
+
.el-drawer.rtl {
|
|
461
|
+
border-radius: 15px 0 0 15px;
|
|
464
462
|
}
|
|
465
463
|
|
|
466
|
-
.el-
|
|
467
|
-
|
|
464
|
+
.el-icon-close:before {
|
|
465
|
+
color: #0e0e0e;
|
|
466
|
+
font-weight: bold;
|
|
467
|
+
font-size: 16px;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.el-drawer__header {
|
|
471
|
+
padding-top: 0;
|
|
472
|
+
height: 64px;
|
|
473
|
+
background:
|
|
474
|
+
linear-gradient(to bottom, rgba(255,255,255,0), white), /* 底部渐变到白色 */
|
|
475
|
+
linear-gradient(to right, #BCB9F4, #D5C6F8, #E6C6F9); /* 从左到右的渐变色带 */
|
|
468
476
|
}
|
|
469
477
|
|
|
470
478
|
.el-drawer__body {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
479
|
+
padding: 0 20px;
|
|
480
|
+
display: flex;
|
|
481
|
+
flex-direction: column;
|
|
482
|
+
justify-content: space-between;
|
|
474
483
|
}
|
|
475
484
|
|
|
476
485
|
.el-form-item__label {
|
|
477
|
-
|
|
486
|
+
font-weight: 700;
|
|
478
487
|
}
|
|
479
488
|
|
|
480
489
|
.el-input__inner {
|
|
481
|
-
|
|
490
|
+
padding-right: 0;
|
|
491
|
+
border-radius: 25px;
|
|
482
492
|
}
|
|
483
493
|
|
|
484
494
|
.el-cascader {
|
|
485
|
-
|
|
495
|
+
width: 100%;
|
|
486
496
|
}
|
|
487
497
|
|
|
488
|
-
.
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
padding: 9px 6px;
|
|
492
|
-
position: relative;
|
|
493
|
-
color: #fff;
|
|
494
|
-
background-color: #456BEA;
|
|
495
|
-
border-radius: 4px;
|
|
496
|
-
border: 1px solid #456BEA;
|
|
498
|
+
.el-radio__inner {
|
|
499
|
+
width: 24px;
|
|
500
|
+
height: 24px;
|
|
497
501
|
}
|
|
498
502
|
|
|
499
|
-
.
|
|
500
|
-
|
|
501
|
-
align-items: center;
|
|
502
|
-
font-size: 23px;
|
|
503
|
-
color: #333333;
|
|
503
|
+
.el-radio__input.is-checked+.el-radio__label {
|
|
504
|
+
color: #606266;
|
|
504
505
|
}
|
|
505
506
|
|
|
506
|
-
.
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
color: #9BA1AE;
|
|
510
|
-
}
|
|
507
|
+
.el-radio__input.is-checked .el-radio__inner {
|
|
508
|
+
border-color: #7050D0;
|
|
509
|
+
background: #7050D0;
|
|
511
510
|
}
|
|
512
511
|
|
|
513
|
-
.
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
512
|
+
.el-radio__input.is-checked .el-radio__inner::after {
|
|
513
|
+
display: none;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/* 使用Element UI的对号图标 */
|
|
517
|
+
.el-radio__input.is-checked .el-radio__inner::before {
|
|
518
|
+
font-family: "element-icons", serif;
|
|
519
|
+
content: "\e6da"; /* Element UI check图标的Unicode */
|
|
520
|
+
position: absolute;
|
|
521
|
+
top: 50%;
|
|
522
|
+
left: 50%;
|
|
523
|
+
transform: translate(-50%, -50%);
|
|
524
|
+
font-size: 12px;
|
|
525
|
+
color: #fff;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.el-select .el-input__inner {
|
|
529
|
+
border-radius: 25px;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.el-textarea__inner {
|
|
533
|
+
border-radius: 16px;
|
|
519
534
|
}
|
|
520
535
|
|
|
521
536
|
.el-loading-mask {
|
|
522
|
-
|
|
537
|
+
border-radius: 8px;
|
|
523
538
|
}
|
|
539
|
+
}
|
|
524
540
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
color: #333333;
|
|
535
|
-
|
|
536
|
-
img {
|
|
537
|
-
margin-right: 10px;
|
|
538
|
-
width: 35px;
|
|
539
|
-
height: 40px;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
541
|
+
.button-handle {
|
|
542
|
+
width: 168px;
|
|
543
|
+
height: 48px;
|
|
544
|
+
font-size: 14px;
|
|
545
|
+
border-radius: 25px;
|
|
546
|
+
border: none;
|
|
547
|
+
color: #fff;
|
|
548
|
+
cursor: pointer;
|
|
549
|
+
}
|
|
542
550
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
max-height: 500px;
|
|
547
|
-
overflow: auto;
|
|
551
|
+
.button-generate-question {
|
|
552
|
+
background: linear-gradient(to bottom, #7050D0, #2828E0);
|
|
553
|
+
}
|
|
548
554
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
555
|
+
.button-cancel {
|
|
556
|
+
border: 1px solid #2828E0;
|
|
557
|
+
background: transparent;
|
|
558
|
+
color: #3030C0;
|
|
559
|
+
}
|
|
552
560
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
561
|
+
.ai_button {
|
|
562
|
+
cursor: pointer;
|
|
563
|
+
user-select: none;
|
|
564
|
+
padding: 9px 6px;
|
|
565
|
+
position: relative;
|
|
566
|
+
color: #fff;
|
|
567
|
+
background-color: #456BEA;
|
|
568
|
+
border-radius: 4px;
|
|
569
|
+
border: 1px solid #456BEA;
|
|
570
|
+
}
|
|
556
571
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
572
|
+
.add_question_title {
|
|
573
|
+
display: flex;
|
|
574
|
+
align-items: center;
|
|
575
|
+
font-size: 18px;
|
|
576
|
+
color: #333333;
|
|
577
|
+
font-weight: bold;
|
|
578
|
+
gap: 5px;
|
|
579
|
+
}
|
|
560
580
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
581
|
+
.add_question_body {
|
|
582
|
+
.remind {
|
|
583
|
+
font-size: 14px;
|
|
584
|
+
color: #9BA1AE;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
566
587
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
588
|
+
.add_question_footer {
|
|
589
|
+
padding: 20px 0;
|
|
590
|
+
border-top: 1px solid #E6E6E6;
|
|
591
|
+
display: flex;
|
|
592
|
+
justify-content: center;
|
|
593
|
+
align-items: center;
|
|
594
|
+
gap: 30px;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
570
597
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
598
|
+
/* 对话框样式需要全局作用域,因为它会脱离当前组件 */
|
|
599
|
+
</style>
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
<style lang="scss">
|
|
603
|
+
.ai-custom-dialog.el-dialog {
|
|
604
|
+
background: linear-gradient(327deg, #DBECFE 0%, #F9FCFF 100%);
|
|
605
|
+
border-radius: 8px;
|
|
606
|
+
|
|
607
|
+
.question_title {
|
|
608
|
+
display: flex;
|
|
609
|
+
align-items: center;
|
|
610
|
+
font-weight: 700;
|
|
611
|
+
font-size: 23px;
|
|
612
|
+
color: #333333;
|
|
613
|
+
|
|
614
|
+
img {
|
|
615
|
+
margin-right: 10px;
|
|
616
|
+
width: 35px;
|
|
617
|
+
height: 40px;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.question_body {
|
|
622
|
+
padding: 10px;
|
|
623
|
+
min-height: 500px;
|
|
624
|
+
max-height: 500px;
|
|
625
|
+
overflow: auto;
|
|
626
|
+
|
|
627
|
+
&::-webkit-scrollbar {
|
|
628
|
+
width: 4px;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
&::-webkit-scrollbar-button {
|
|
632
|
+
display: none;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
&::-webkit-scrollbar-track-piece {
|
|
636
|
+
background-color: transparent;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
&::-webkit-scrollbar-thumb {
|
|
640
|
+
border-radius: 3px;
|
|
641
|
+
background: rgba(0, 0, 0, .5);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.question_footer {
|
|
646
|
+
display: flex;
|
|
647
|
+
justify-content: space-between;
|
|
577
648
|
|
|
649
|
+
.question_remind {
|
|
650
|
+
align-self: flex-end;
|
|
651
|
+
font-size: 14px;
|
|
652
|
+
color: #9BA1AE;
|
|
578
653
|
}
|
|
654
|
+
}
|
|
579
655
|
}
|
|
580
656
|
</style>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
<div class="question_contain_parse">
|
|
28
28
|
<span class="question_contain_parse_analysis">题目解析: {{ detail.analysis }}</span>
|
|
29
|
-
<span class="join" @click="join">加入题库</span>
|
|
29
|
+
<span v-if="!joined" class="join" @click="join">加入题库</span>
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
32
|
</template>
|
|
@@ -61,7 +61,8 @@ export default {
|
|
|
61
61
|
{ name: 'G', id: 6 },
|
|
62
62
|
{ name: 'H', id: 7 },
|
|
63
63
|
{ name: 'I', id: 8 },
|
|
64
|
-
]
|
|
64
|
+
],
|
|
65
|
+
joined: false
|
|
65
66
|
}
|
|
66
67
|
},
|
|
67
68
|
methods: {
|
|
@@ -70,6 +71,7 @@ export default {
|
|
|
70
71
|
},
|
|
71
72
|
join(e) {
|
|
72
73
|
this.$emit('join', this.detail)
|
|
74
|
+
this.joined = true;
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
}
|
|
Binary file
|