ai-question-pro 0.0.17 → 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.
@@ -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">
@@ -453,128 +453,204 @@ export default {
453
453
  }
454
454
  </script>
455
455
  <style lang="scss" scoped>
456
- ::v-deep.ai_contain {
457
- display: inline-block;
456
+ .ai_contain {
457
+ display: inline-block;
458
458
 
459
- .el-drawer__header {
460
- padding-top: 0;
461
- height: 80px;
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-drawer__body {
467
- padding: 0 20px;
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
- display: flex;
472
- flex-direction: column;
473
- justify-content: space-between;
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
- font-weight: 700;
486
+ font-weight: 700;
478
487
  }
479
488
 
480
489
  .el-input__inner {
481
- padding-right: 0;
490
+ padding-right: 0;
491
+ border-radius: 25px;
482
492
  }
483
493
 
484
494
  .el-cascader {
485
- width: 100%;
495
+ width: 100%;
486
496
  }
487
497
 
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;
498
+ .el-radio__inner {
499
+ width: 24px;
500
+ height: 24px;
497
501
  }
498
502
 
499
- .add_question_title {
500
- display: flex;
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
- .add_question_body {
507
- .remind {
508
- font-size: 14px;
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
- .add_question_footer {
514
- padding: 20px 0;
515
- border-top: 1px solid #E6E6E6;
516
- display: flex;
517
- justify-content: center;
518
- align-items: center;
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
- border-radius: 8px;
537
+ border-radius: 8px;
523
538
  }
539
+ }
524
540
 
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
- }
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
- .question_body {
544
- padding: 10px;
545
- min-height: 500px;
546
- max-height: 500px;
547
- overflow: auto;
551
+ .button-generate-question {
552
+ background: linear-gradient(to bottom, #7050D0, #2828E0);
553
+ }
548
554
 
549
- &::-webkit-scrollbar {
550
- width: 4px;
551
- }
555
+ .button-cancel {
556
+ border: 1px solid #2828E0;
557
+ background: transparent;
558
+ color: #3030C0;
559
+ }
552
560
 
553
- &::-webkit-scrollbar-button {
554
- display: none;
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
- &::-webkit-scrollbar-track-piece {
558
- background-color: transparent;
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
- &::-webkit-scrollbar-thumb {
562
- border-radius: 3px;
563
- background: rgba(0, 0, 0, .5);
564
- }
565
- }
581
+ .add_question_body {
582
+ .remind {
583
+ font-size: 14px;
584
+ color: #9BA1AE;
585
+ }
586
+ }
566
587
 
567
- .question_footer {
568
- display: flex;
569
- justify-content: space-between;
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
- .question_remind {
572
- align-self: flex-end;
573
- font-size: 14px;
574
- color: #9BA1AE;
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