ai-question-pro 0.0.17 → 0.0.19

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.
@@ -12,7 +12,6 @@
12
12
  style="width: 100%; "
13
13
  @clear="clear"
14
14
  @visible-change="visibleChange"
15
- :popper-append-to-body="false"
16
15
  >
17
16
  <el-option
18
17
  ref="option"
@@ -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
- <span>AI出题</span>
10
- <!-- <img src="../static/robot.png">-->
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="题型" prop="questionType">
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" size="medium">
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="题目数量" prop="count">
30
- <el-input class="number_input" v-model="form.count" min="1" max="10" type="number"
31
- @input="handleInput" style="width: 20%;"></el-input>
32
- <div class="remind">(为避免您等待时间过长,一次性最多生成10道题)</div>
33
- </el-form-item>
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
- <el-button type="primary" @click="generate">生成题目</el-button>
60
- <el-button @click="addShow = false">取 消</el-button>
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">
@@ -283,7 +283,8 @@ export default {
283
283
  }
284
284
  this.showQues = true
285
285
  this.addShow = !this.addShow
286
- this.sendPost()
286
+ this.sendPost();
287
+ this.$emit("questionCount", this.form.count);
287
288
  }
288
289
  })
289
290
  },
@@ -453,128 +454,204 @@ export default {
453
454
  }
454
455
  </script>
455
456
  <style lang="scss" scoped>
456
- ::v-deep.ai_contain {
457
- display: inline-block;
457
+ .ai_contain {
458
+ display: inline-block;
458
459
 
459
- .el-drawer__header {
460
- padding-top: 0;
461
- height: 80px;
462
- background-image: url('../static/addQuesTitBg.png');
463
- background-size: 100% 100%;
460
+ ::v-deep {
461
+ .el-drawer.rtl {
462
+ border-radius: 15px 0 0 15px;
464
463
  }
465
464
 
466
- .el-drawer__body {
467
- padding: 0 20px;
465
+ .el-icon-close:before {
466
+ color: #0e0e0e;
467
+ font-weight: bold;
468
+ font-size: 16px;
469
+ }
470
+
471
+ .el-drawer__header {
472
+ padding-top: 0;
473
+ height: 64px;
474
+ background:
475
+ linear-gradient(to bottom, rgba(255,255,255,0), white), /* 底部渐变到白色 */
476
+ linear-gradient(to right, #BCB9F4, #D5C6F8, #E6C6F9); /* 从左到右的渐变色带 */
468
477
  }
469
478
 
470
479
  .el-drawer__body {
471
- display: flex;
472
- flex-direction: column;
473
- justify-content: space-between;
480
+ padding: 0 20px;
481
+ display: flex;
482
+ flex-direction: column;
483
+ justify-content: space-between;
474
484
  }
475
485
 
476
486
  .el-form-item__label {
477
- font-weight: 700;
487
+ font-weight: 700;
478
488
  }
479
489
 
480
490
  .el-input__inner {
481
- padding-right: 0;
491
+ padding-right: 0;
492
+ border-radius: 25px;
482
493
  }
483
494
 
484
495
  .el-cascader {
485
- width: 100%;
496
+ width: 100%;
486
497
  }
487
498
 
488
- .ai_button {
489
- cursor: pointer;
490
- user-select: none;
491
- padding: 9px 6px;
492
- position: relative;
493
- color: #fff;
494
- background-color: #456BEA;
495
- border-radius: 4px;
496
- border: 1px solid #456BEA;
499
+ .el-radio__inner {
500
+ width: 24px;
501
+ height: 24px;
497
502
  }
498
503
 
499
- .add_question_title {
500
- display: flex;
501
- align-items: center;
502
- font-size: 23px;
503
- color: #333333;
504
+ .el-radio__input.is-checked+.el-radio__label {
505
+ color: #606266;
504
506
  }
505
507
 
506
- .add_question_body {
507
- .remind {
508
- font-size: 14px;
509
- color: #9BA1AE;
510
- }
508
+ .el-radio__input.is-checked .el-radio__inner {
509
+ border-color: #7050D0;
510
+ background: #7050D0;
511
511
  }
512
512
 
513
- .add_question_footer {
514
- padding: 20px 0;
515
- border-top: 1px solid #E6E6E6;
516
- display: flex;
517
- justify-content: center;
518
- align-items: center;
513
+ .el-radio__input.is-checked .el-radio__inner::after {
514
+ display: none;
515
+ }
516
+
517
+ /* 使用Element UI的对号图标 */
518
+ .el-radio__input.is-checked .el-radio__inner::before {
519
+ font-family: "element-icons", serif;
520
+ content: "\e6da"; /* Element UI check图标的Unicode */
521
+ position: absolute;
522
+ top: 50%;
523
+ left: 50%;
524
+ transform: translate(-50%, -50%);
525
+ font-size: 12px;
526
+ color: #fff;
527
+ }
528
+
529
+ .el-select .el-input__inner {
530
+ border-radius: 25px;
531
+ }
532
+
533
+ .el-textarea__inner {
534
+ border-radius: 16px;
519
535
  }
520
536
 
521
537
  .el-loading-mask {
522
- border-radius: 8px;
538
+ border-radius: 8px;
523
539
  }
540
+ }
524
541
 
525
- .el-dialog {
526
- background: linear-gradient(327deg, #DBECFE 0%, #F9FCFF 100%);
527
- border-radius: 8px;
528
-
529
- .question_title {
530
- display: flex;
531
- align-items: center;
532
- font-weight: 700;
533
- font-size: 23px;
534
- color: #333333;
535
-
536
- img {
537
- margin-right: 10px;
538
- width: 35px;
539
- height: 40px;
540
- }
541
- }
542
+ .button-handle {
543
+ width: 168px;
544
+ height: 48px;
545
+ font-size: 14px;
546
+ border-radius: 25px;
547
+ border: none;
548
+ color: #fff;
549
+ cursor: pointer;
550
+ }
542
551
 
543
- .question_body {
544
- padding: 10px;
545
- min-height: 500px;
546
- max-height: 500px;
547
- overflow: auto;
552
+ .button-generate-question {
553
+ background: linear-gradient(to bottom, #7050D0, #2828E0);
554
+ }
548
555
 
549
- &::-webkit-scrollbar {
550
- width: 4px;
551
- }
556
+ .button-cancel {
557
+ border: 1px solid #2828E0;
558
+ background: transparent;
559
+ color: #3030C0;
560
+ }
552
561
 
553
- &::-webkit-scrollbar-button {
554
- display: none;
555
- }
562
+ .ai_button {
563
+ cursor: pointer;
564
+ user-select: none;
565
+ padding: 9px 6px;
566
+ position: relative;
567
+ color: #fff;
568
+ background-color: #456BEA;
569
+ border-radius: 4px;
570
+ border: 1px solid #456BEA;
571
+ }
556
572
 
557
- &::-webkit-scrollbar-track-piece {
558
- background-color: transparent;
559
- }
573
+ .add_question_title {
574
+ display: flex;
575
+ align-items: center;
576
+ font-size: 18px;
577
+ color: #333333;
578
+ font-weight: bold;
579
+ gap: 5px;
580
+ }
560
581
 
561
- &::-webkit-scrollbar-thumb {
562
- border-radius: 3px;
563
- background: rgba(0, 0, 0, .5);
564
- }
565
- }
582
+ .add_question_body {
583
+ .remind {
584
+ font-size: 14px;
585
+ color: #9BA1AE;
586
+ }
587
+ }
566
588
 
567
- .question_footer {
568
- display: flex;
569
- justify-content: space-between;
589
+ .add_question_footer {
590
+ padding: 20px 0;
591
+ border-top: 1px solid #E6E6E6;
592
+ display: flex;
593
+ justify-content: center;
594
+ align-items: center;
595
+ gap: 30px;
596
+ }
597
+ }
570
598
 
571
- .question_remind {
572
- align-self: flex-end;
573
- font-size: 14px;
574
- color: #9BA1AE;
575
- }
576
- }
599
+ /* 对话框样式需要全局作用域,因为它会脱离当前组件 */
600
+ </style>
601
+
602
+
603
+ <style lang="scss">
604
+ .ai-custom-dialog.el-dialog {
605
+ background: linear-gradient(327deg, #DBECFE 0%, #F9FCFF 100%);
606
+ border-radius: 8px;
607
+
608
+ .question_title {
609
+ display: flex;
610
+ align-items: center;
611
+ font-weight: 700;
612
+ font-size: 23px;
613
+ color: #333333;
614
+
615
+ img {
616
+ margin-right: 10px;
617
+ width: 35px;
618
+ height: 40px;
619
+ }
620
+ }
621
+
622
+ .question_body {
623
+ padding: 10px;
624
+ min-height: 500px;
625
+ max-height: 500px;
626
+ overflow: auto;
627
+
628
+ &::-webkit-scrollbar {
629
+ width: 4px;
630
+ }
631
+
632
+ &::-webkit-scrollbar-button {
633
+ display: none;
634
+ }
635
+
636
+ &::-webkit-scrollbar-track-piece {
637
+ background-color: transparent;
638
+ }
639
+
640
+ &::-webkit-scrollbar-thumb {
641
+ border-radius: 3px;
642
+ background: rgba(0, 0, 0, .5);
643
+ }
644
+ }
645
+
646
+ .question_footer {
647
+ display: flex;
648
+ justify-content: space-between;
577
649
 
650
+ .question_remind {
651
+ align-self: flex-end;
652
+ font-size: 14px;
653
+ color: #9BA1AE;
578
654
  }
655
+ }
579
656
  }
580
657
  </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