aiTips.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div class="at_body">
  3. <div class="at_title">
  4. <span style="color: #00000066;">{{ ttitle }}</span>
  5. <span style="margin: 0 5px;color: #00000066;">></span>
  6. <span>{{ title }}</span>
  7. </div>
  8. <div class="at_text">
  9. <div class="at_text_img">
  10. <div class="at_restart" @click="reset"></div>
  11. <div class="at_edit" @click="edit"></div>
  12. </div>
  13. <div class="at_text_detail">
  14. <span v-if="!edtiPan">{{ detail }}</span>
  15. <textarea v-else rows="5" class="binfo_input binfo_textarea" cols v-model="eDetail"
  16. placeholder="请输入提示词"></textarea>
  17. </div>
  18. <div class="at_btn" v-if="edtiPan">
  19. <el-button type="primary" size="mini" @click="confrim">保存</el-button>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. props: {
  27. ttitle: {
  28. type: String,
  29. default: ''
  30. },
  31. title: {
  32. type: String,
  33. default: ''
  34. },
  35. detail: {
  36. type: String,
  37. default: ''
  38. },
  39. pan: {
  40. type: String,
  41. default: ''
  42. }
  43. },
  44. data() {
  45. return {
  46. aiJson: {
  47. aiDetail: "请根据<课程简要描述>设计一个名为<课程名字>的<课程学科>学科的,面向<面向年级>的项目式学习课程。",
  48. aiOutline: "请根据<课程简要描述>及#补充参考资料为这个名为<课程名字>的<课程学科>学科的,面向<面向年级>的项目式学习课程设计序列教学活动(需要每个任务都需要至少50个token的详细描述),每个教学活动的活动设计(可以直接使用文件内容)以及每个教学活动的评价量规(学生能做到...)。",
  49. aiTask: "请根据<教学任务教案>。",
  50. aiDetail1: "请根据<课程描述>,重新设计该教学任务。任务需要至少50个token的详细描述,包含任务设计,评价标准。",
  51. aiDetail2: "请你在考虑到整个课程的情况下,优化该任务描述和任务名:<任务名>:<任务描述>",
  52. aiDetail3: "请你在考虑到整个课程的情况下,**重点考虑该任务及工具名和工具内容的情况下**,优化工具指引。",
  53. aiDetail4: "请你在考虑到整个课程的情况下,**重点考虑该任务详情**以及工具的情况下,优化评价标准。",
  54. aiTeacher: "请根据<任务大纲>为每个教学任务设计详细的教案,其中包括但不仅限于该任务的教学目标,教学过程,师生研讨,拓展,学生任务单,相关知识点的练习或Qui以及答案等。",
  55. teacherDetail: "请根据<教案描述>重新设计该教案。其中包括但不仅限于该任务的教学目标,教学过程,师生研讨,拓展,学生任务单,相关知识点的练习或Qui以及答案等。",
  56. },
  57. eDetail: "",
  58. edtiPan: false
  59. }
  60. },
  61. methods: {
  62. edit() {
  63. if (this.edtiPan) {
  64. this.edtiPan = false
  65. }
  66. this.edtiPan = true;
  67. this.eDetail = JSON.parse(JSON.stringify(this.detail));
  68. },
  69. confrim() {
  70. this.$emit("setAiJson", this.pan, this.eDetail);
  71. this.edtiPan = false;
  72. },
  73. reset() {
  74. this.$confirm("确定重置此提示词么?", "提示", {
  75. confirmButtonText: "确定",
  76. cancelButtonText: "取消",
  77. type: "warning",
  78. })
  79. .then(() => {
  80. this.edtiPan = false;
  81. this.$emit("setAiJson", this.pan, this.aiJson[this.pan]);
  82. })
  83. .catch(() => {
  84. });
  85. }
  86. },
  87. }
  88. </script>
  89. <style scoped>
  90. .at_body {
  91. width: 100%;
  92. margin-bottom: 10px;
  93. }
  94. .at_title {
  95. font-size: 14px;
  96. margin-bottom: 10px;
  97. display: flex;
  98. align-items: center;
  99. }
  100. .at_text {
  101. background: #fffef6;
  102. padding: 8px;
  103. width: 100%;
  104. box-sizing: border-box;
  105. font-size: 15px;
  106. line-height: 22px;
  107. border-radius: 4px;
  108. }
  109. .at_text_img {
  110. display: flex;
  111. align-items: center;
  112. justify-content: flex-end;
  113. margin-bottom: 5px;
  114. }
  115. .at_restart {
  116. background-image: url(../../../assets/icon/course/restart.svg);
  117. width: 25px;
  118. height: 25px;
  119. background-size: 100% 100%;
  120. cursor: pointer;
  121. }
  122. .at_edit {
  123. background-image: url(../../../assets/icon/course/edit2.svg);
  124. width: 25px;
  125. height: 25px;
  126. background-size: 100% 100%;
  127. cursor: pointer;
  128. }
  129. .at_text_detail {
  130. word-break: break-all;
  131. }
  132. .binfo_input {
  133. width: 100%;
  134. margin: 0;
  135. padding: 5px 7px;
  136. display: block;
  137. min-width: 0;
  138. outline: none;
  139. box-sizing: border-box;
  140. background: none;
  141. border: none;
  142. border-radius: 4px;
  143. background: #fff;
  144. font-size: 15px;
  145. resize: none;
  146. font-family: "Microsoft YaHei";
  147. min-height: 48px;
  148. /* border: 1px solid #3682fc00; */
  149. border: 1.5px solid #cad1dc;
  150. }
  151. .binfo_textarea {
  152. border: 1.5px solid #cad1dc;
  153. font-size: 15px;
  154. resize: none;
  155. /* background: #f6f6f6; */
  156. font-family: "Microsoft YaHei";
  157. }
  158. .binfo_input:focus-visible {
  159. border: 1.5px solid #3681fc !important;
  160. }
  161. .at_btn {
  162. margin-top: 5px;
  163. text-align: right;
  164. }
  165. .binfo_textarea::-webkit-scrollbar {
  166. /*滚动条整体样式*/
  167. width: 6px;
  168. /*高宽分别对应横竖滚动条的尺寸*/
  169. height: 6px;
  170. }
  171. /*定义滚动条轨道 内阴影+圆角*/
  172. .binfo_textarea::-webkit-scrollbar-track {
  173. border-radius: 10px;
  174. background-color: rgba(0, 0, 0, 0.1);
  175. }
  176. /*定义滑块 内阴影+圆角*/
  177. .binfo_textarea::-webkit-scrollbar-thumb {
  178. border-radius: 10px;
  179. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  180. background-color: rgba(0, 0, 0, 0.1);
  181. }
  182. </style>