aiBoxRight.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668
  1. <template>
  2. <div class="ai_body" v-loading="loading">
  3. <div class="ai_body_dialog" ref="chatDialog">
  4. <div class="dialog_content" v-for="item in array" :key="item.uid">
  5. <div v-if="item.content" style="margin-left: auto;">
  6. <div class="content content2" v-html="item.content"></div>
  7. <div class="role">
  8. <img src="../../../assets/icon/new/role2.png" />
  9. </div>
  10. </div>
  11. <div style="margin-top:20px;margin-bottom:20px ; margin-right: auto;">
  12. <div class="role">
  13. <img :src="item.fileid
  14. ? item.fileid
  15. : require('../../../assets/icon/new/role1.png')
  16. " />
  17. </div>
  18. <div element-loading-background="#f6f9ff" :style="{
  19. minHeight: item.loading ? '50px' : 'unset',
  20. minWidth: item.loading ? '50px' : 'unset'
  21. }" class="content" v-loading="item.loading">
  22. <span class="vditor-reset" v-html="item.aiContent"></span><span class="createTime"
  23. v-text="item.createtime"></span>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="ai_body_select" v-if="false">
  29. <div class="checkBox" v-if="checkBool">
  30. <div class="task">
  31. <div class="title">选择需要优化的任务:</div>
  32. <div class="content">
  33. <div class="span" @click="addAllTask()">
  34. <div class="check">
  35. <img :src="checkImg" alt="" v-if="checkArray.length !== course.length" />
  36. <img :src="checkIsImg" alt="" v-else />
  37. </div>
  38. <span>全选</span>
  39. </div>
  40. <div class="span" v-for="(item, index) in course" :key="index" @click="addTask(index)">
  41. <div class="check">
  42. <img :src="checkImg" alt="" v-if="checkArray.indexOf(index) === -1" />
  43. <img :src="checkIsImg" alt="" v-else />
  44. </div>
  45. <span>任务{{ index + 1 }}</span>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="part">
  50. <div class="title">选择优化的部分:</div>
  51. <div class="content">
  52. <div class="span" v-for="(item, index) in partArray" :key="index" :class="{ active: part == item.name }"
  53. @click="checkPart(item.name)">
  54. {{ item.name }}
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <span class="check" :class="{ isCheck: checkBool }" v-if="!checkArray.length && !part"
  60. @click="checkBool = !checkBool">选择优化内容</span>
  61. <span class="check" :class="{ isCheck: checkBool }" @click="checkBool = !checkBool" v-else>
  62. <el-tooltip :content="taskName" placement="top" effect="dark">
  63. <!-- content to trigger tooltip here -->
  64. <span>{{ taskName }}</span>
  65. </el-tooltip>
  66. </span>
  67. </div>
  68. <div class="ai_body_input">
  69. <div class="ai_b_i_btnArea">
  70. <span class="clear" @click.stop="clear()">
  71. <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  72. <path fill-rule="evenodd" clip-rule="evenodd"
  73. d="M2.5 3.125C2.5 2.77982 2.77982 2.5 3.125 2.5H16.875C17.2202 2.5 17.5 2.77982 17.5 3.125V8.02715C17.5 8.37233 17.2202 8.65215 16.875 8.65215C16.5298 8.65215 16.25 8.37233 16.25 8.02715V3.75H3.75V16.25H8.125C8.47018 16.25 8.75 16.5298 8.75 16.875C8.75 17.2202 8.47018 17.5 8.125 17.5H3.125C2.77982 17.5 2.5 17.2202 2.5 16.875V3.125Z" />
  74. <path fill-rule="evenodd" clip-rule="evenodd"
  75. d="M5.625 6.1521C5.625 5.80692 5.90482 5.5271 6.25 5.5271H13.125C13.4702 5.5271 13.75 5.80692 13.75 6.1521C13.75 6.49728 13.4702 6.7771 13.125 6.7771H6.25C5.90482 6.7771 5.625 6.49728 5.625 6.1521Z" />
  76. <path fill-rule="evenodd" clip-rule="evenodd"
  77. d="M5.625 9.2771C5.625 8.93192 5.90482 8.6521 6.25 8.6521H9.37496C9.72014 8.6521 9.99996 8.93192 9.99996 9.2771C9.99996 9.62228 9.72014 9.9021 9.37496 9.9021H6.25C5.90482 9.9021 5.625 9.62228 5.625 9.2771Z" />
  78. <path fill-rule="evenodd" clip-rule="evenodd"
  79. d="M12.465 11.507L15.9141 14.9048C16.1279 14.5365 16.25 14.1088 16.25 13.6521C16.25 12.2714 15.1307 11.1521 13.75 11.1521C13.2799 11.1521 12.8406 11.2815 12.465 11.507ZM15.0374 15.7957L11.5873 12.397C11.3726 12.7659 11.25 13.1944 11.25 13.6521C11.25 15.0328 12.3693 16.1521 13.75 16.1521C14.2211 16.1521 14.6613 16.0222 15.0374 15.7957ZM11.0797 11.0192C11.759 10.3303 12.7051 9.9021 13.75 9.9021C15.8211 9.9021 17.5 11.581 17.5 13.6521C17.5 14.6767 17.0882 15.6064 16.4226 16.2827C15.7431 16.9729 14.7961 17.4021 13.75 17.4021C11.6789 17.4021 10 15.7232 10 13.6521C10 12.6263 10.4127 11.6957 11.0797 11.0192Z" />
  80. </svg>
  81. <span>清屏</span>
  82. </span>
  83. <span class="clear" @click.stop="showjList = !showjList" v-if="jArray.length">
  84. <span>查看</span>
  85. </span>
  86. <div style="margin-left: auto;">
  87. <el-switch v-model="continuous"></el-switch>
  88. <span @click.stop="continuous = !continuous">连续对话</span>
  89. </div>
  90. </div>
  91. <div class="ai_b_i_roleListBox" ref="roleListRef" v-if="showRoleList && choseRoleList.length > 0">
  92. <div :class="[
  93. 'ai_b_i_rlb_item',
  94. index == choseRoleItem ? 'ai_b_i_rlb_itemActive' : ''
  95. ]" :ref="`roleItem${index}Ref`" v-for="(item, index) in choseRoleList" :key="item.id"
  96. @mouseover="choseRoleItem = index" @click.stop="choseRole(item)">
  97. <div class="ai_b_i_rlb_itemTop">
  98. <img :src="item.headUrl
  99. ? item.headUrl
  100. : require('../../../assets/icon/new/role1.png')
  101. " alt="" />
  102. <div class="ai_b_i_rlb_i_name">
  103. <span>{{ item.assistantName }}</span>
  104. <span>作者:{{ item.username }}</span>
  105. </div>
  106. </div>
  107. <div class="ai_b_i_rlb_itemBottom">
  108. {{ item.prologue }}
  109. </div>
  110. </div>
  111. </div>
  112. <div class="ai_b_i_jListPanel" @click="showjList = !showjList" v-if="showjList && jArray.length > 0"></div>
  113. <div class="ai_b_i_jListBox" v-if="showjList && jArray.length > 0">
  114. <div class="jlist_box" v-for="(item, index) in jArray" :key="index">
  115. <el-tooltip :content="item.area + ':' + item.value" placement="top" effect="dark" popper-class="text_tooltip2">
  116. <!-- content to trigger tooltip here -->
  117. <span>{{ item.area }}:{{ item.value }}</span>
  118. </el-tooltip>
  119. <div class="cancel" @click="cancelJ(item.string)">×</div>
  120. </div>
  121. </div>
  122. <!-- <div class="ai_b_i_textListBox">
  123. <div class="ai_b_i_tlb_left"></div>
  124. <div class="ai_b_i_tlb_right"></div>
  125. </div> -->
  126. <!-- @input="inputChange" -->
  127. <textarea class="ai_body_input_textarea" @keydown="textareaKeydown" ref="textareaRef" v-model.trim="courseText"
  128. placeholder="在此输入您想了解的内容"></textarea>
  129. <div :class="[
  130. 'c_pub_button_confirm',
  131. courseText ? '' : 'c_pub_button_confirmDisabled'
  132. ]" v-if="!loading" @click="addContent">
  133. 发送
  134. </div>
  135. </div>
  136. <!-- <div class="ai_body_input">
  137. <textarea
  138. style="padding-right: 85px;"
  139. rows="3"
  140. @keyup.enter="addContent"
  141. class="binfo_input binfo_textarea"
  142. cols
  143. v-model.trim="courseText"
  144. placeholder="在此输入您想了解的内容"
  145. ></textarea>
  146. <div
  147. class="c_pub_button_confirm"
  148. v-if="!loading && courseText"
  149. @click="addContent"
  150. >
  151. 发送
  152. </div>
  153. <div class="c_pub_button_confirm" @click="promptTit" v-else>发送</div>
  154. </div> -->
  155. </div>
  156. </template>
  157. <script>
  158. import checkImg from "../../../assets/icon/sourceFile/check.png";
  159. import checkIsImg from "../../../assets/icon/sourceFile/check_is.png";
  160. import { v4 as uuidv4 } from "uuid";
  161. import MarkdownIt from "markdown-it";
  162. export default {
  163. props: {
  164. unitJson: {
  165. type: Array
  166. },
  167. courseId: {
  168. type: String,
  169. default: ""
  170. },
  171. quoteArray: {
  172. type: Object,
  173. default: function () {
  174. return {};
  175. }
  176. },
  177. teacherCourseText: {
  178. type: String,
  179. default: ""
  180. },
  181. targetCourseText: {
  182. type: String,
  183. default: ""
  184. },
  185. courseText2: {
  186. type: String,
  187. default: ""
  188. },
  189. targetCourseText2: {
  190. type: String,
  191. default: ""
  192. },
  193. cpote: {
  194. type: Object,
  195. default: function () {
  196. return {};
  197. }
  198. },
  199. },
  200. data() {
  201. return {
  202. array: [],
  203. jArray: [],
  204. courseText: "",
  205. checkImg: checkImg,
  206. checkIsImg: checkIsImg,
  207. userid: this.$route.query.userid,
  208. oid: this.$route.query.oid,
  209. org: this.$route.query.org,
  210. checkArray: [],
  211. course: [{ title: "任务1" }, { title: "任务2" }, { title: "任务3" }],
  212. partArray: [
  213. { name: "全部内容" },
  214. { name: "任务设计" },
  215. { name: "评价设计" }
  216. ],
  217. part: "全部内容",
  218. checkBool: false,
  219. loading: false,
  220. textareaHeight: 50,
  221. publicRoleList: [],
  222. roleList: [],
  223. textList: [
  224. {
  225. title: "项目式学习",
  226. dataList: [
  227. "请给我一些学生开展项目式学习可以使用的主题或问题参考,请说出学生将要解决的问题,以及学生要经历怎样的学习活动。",
  228. "请将一个关于生态保护项目的项目式学习展开描述,你需要描述学生如何解决这个问题,你需要至少写出四个活动,这些活动需要按照前后逻辑关系排列。",
  229. "请对驱动问题为“如何为学校建造一个富有特色的花坛?”的项目式学习进行子问题拆解,至少拆解为5个子问题,并根据子问题对应写出各环节的主要活动。"
  230. ]
  231. },
  232. {
  233. title: "教学评价",
  234. dataList: [
  235. "如果需要给学生的社区服务进行评价,给出评价维度和至少3个等级的表现描述。",
  236. "为6年级学生设计一份关于梧桐山研究报告的评估任务表,并给出参考的报告流程,至少包含8个步骤,并包括地图、图片和至少300个词。",
  237. "创建一个给5年级学生使用的课堂小测试,包含5道多选题,评价学生对于太阳能这个概念的理解。你需要给出题目和正确答案。"
  238. ]
  239. },
  240. {
  241. title: "教学设计",
  242. dataList: [
  243. "如果需要5年级学生感受“移步换景”的景观写作手法,你有什么合适的阅读材料推荐?你需要给出材料名称,以及材料的哪部分内容。",
  244. "设计一个针对8年级学生且关于人类迁徙主题的地理课,并在课程中设计至少1项小组活动。",
  245. "设计一个针对5年级学生的课程,课程综合科学和信息技术领域,解决生物与环境领域的生活问题,你需要给出完整的课程框架和活动。",
  246. "如果3年级的学生不能理解光合作用的实现过程,需要你帮我设计一个支持他们理解的教学活动,需要包含活动的形式、实施材料和清单。",
  247. "请基于贝叶斯定理为8年级学生出三道题目。",
  248. "如果需要八年级学生了解尼罗河流域的文化发展史,你有哪些推荐的网站或参考书籍?"
  249. ]
  250. },
  251. {
  252. title: "班级管理",
  253. dataList: [
  254. "创建一组给一年级学生使用的班级口号,要求大家注意卫生、保护环境,口号需要对仗工整,符合一年级学生的理解水平。",
  255. " 设计一套用于6年级学生的班级管理规章制度,内容需要包括学习、纪律、卫生、思想品德方面。"
  256. ]
  257. },
  258. {
  259. title: "课堂组织",
  260. dataList: [
  261. "请为“制作垃圾分类宣传单”的小组活动设计小组分工表,每个小组的成员为4-6人。",
  262. "请给5年级“校园植物图鉴”社团课程设计一份小组合作公约,需包含小组成员信息、小组项目目标、填写日期,总长度不超过300字,并且提供至少3处学生自行填写的部分。",
  263. "请用苏格拉底提问的方式,引导5年级学生拆解驱动问题:如何解决教室黑板反光的问题?其中需包含对于反光原因的分析与实验探究。"
  264. ]
  265. },
  266. {
  267. title: "教师发展",
  268. dataList: [
  269. "教师需要理解项目式学习的理论基础和基础概念,你需要生成一份阅读清单,要求内容为中文书籍或文献。",
  270. "设计一个教师进行个人学期总结的框架,需要体现在教学、教研、个人学习方面的进步。"
  271. ]
  272. },
  273. {
  274. title: "代码分析",
  275. dataList: [
  276. "这段代码实现了什么效果?",
  277. "请描述这段代码。",
  278. "根据这段代码,给我一些修改意见。"
  279. ]
  280. }
  281. ],
  282. showTextList: false,
  283. showRoleList: false,
  284. choseRoleItem: 0,
  285. choseTextItem: 0,
  286. continuous: false,
  287. showjList: false
  288. };
  289. },
  290. watch: {
  291. unitJson: {
  292. immediate: true,
  293. deep: true,
  294. handler(newValue, oldValue) {
  295. this.course = this.unitJson[0].chapterInfo[0].taskJson;
  296. this.jArray = this.getString();
  297. if (!this.jArray.length) {
  298. this.showjList = false
  299. }
  300. }
  301. },
  302. courseId: {
  303. immediate: true,
  304. deep: true,
  305. handler(newValue, oldValue) {
  306. if (newValue) {
  307. this.getChatList().then(_ => {
  308. this.$nextTick(() => {
  309. console.log(this.$refs.chatDialog.scrollHeight);
  310. this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
  311. });
  312. });
  313. }
  314. }
  315. },
  316. quoteArray: {
  317. immediate: true,
  318. deep: true,
  319. handler(newValue, oldValue) {
  320. this.jArray = this.getString();
  321. if (!this.jArray.length) {
  322. this.showjList = false
  323. }
  324. }
  325. },
  326. teacherCourseText: {
  327. immediate: true,
  328. deep: true,
  329. handler(newValue, oldValue) {
  330. this.jArray = this.getString();
  331. if (!this.jArray.length) {
  332. this.showjList = false
  333. }
  334. }
  335. },
  336. targetCourseText: {
  337. immediate: true,
  338. deep: true,
  339. handler(newValue, oldValue) {
  340. this.jArray = this.getString();
  341. if (!this.jArray.length) {
  342. this.showjList = false
  343. }
  344. }
  345. },
  346. courseText2: {
  347. immediate: true,
  348. deep: true,
  349. handler(newValue, oldValue) {
  350. this.jArray = this.getString();
  351. if (!this.jArray.length) {
  352. this.showjList = false
  353. }
  354. }
  355. },
  356. targetCourseText2: {
  357. immediate: true,
  358. deep: true,
  359. handler(newValue, oldValue) {
  360. this.jArray = this.getString();
  361. if (!this.jArray.length) {
  362. this.showjList = false
  363. }
  364. }
  365. },
  366. cpote: {
  367. immediate: true,
  368. deep: true,
  369. handler(newValue, oldValue) {
  370. this.jArray = this.getString();
  371. if (!this.jArray.length) {
  372. this.showjList = false
  373. }
  374. }
  375. },
  376. },
  377. methods: {
  378. cancelJ(string) {
  379. this.$emit('setIsQuote', string)
  380. },
  381. getString() {
  382. let quoteArray = []
  383. let array = Object.keys(this.quoteArray)
  384. array.forEach(item => {
  385. if (!this.quoteArray[item]) {
  386. return
  387. }
  388. let string = item
  389. let area = ''
  390. let text = ''
  391. if (string == 'aiteacherTextDetail') {
  392. area = '已有教案摘要'
  393. text = this.teacherCourseText
  394. } else if (string == 'aitargetTextDetail') {
  395. area = '课程目标'
  396. text = this.targetCourseText
  397. } else if (string == 'aiDetail') {
  398. area = '课程简要描述'
  399. text = this.courseText2
  400. } else if (string == 'aitargetTextDetail2') {
  401. area = '课程目标'
  402. text = this.targetCourseText2
  403. } else if (string.indexOf('aiDetail1') != -1) {
  404. let index = parseInt(string.split('aiDetail1-')[1])
  405. area = `任务${index + 1}课程大纲`
  406. text = this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail2
  407. } else if (string == 'aiCpote1') {
  408. area = '概念群'
  409. text = this.cpote.cpote1
  410. } else if (string == 'aiCpote2') {
  411. area = '问题链'
  412. text = this.cpote.cpote2
  413. } else if (string == 'aiCpote3') {
  414. area = '目标层'
  415. text = this.cpote.cpote3
  416. } else if (string == 'aiCpote4') {
  417. area = '任务簇'
  418. text = this.cpote.cpote4
  419. } else if (string.indexOf('teacherDetail2') != -1) {
  420. let index = parseInt(string.split('teacherDetail2-')[1])
  421. area = `任务${index + 1}教案`
  422. text = this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3
  423. } else if (string.indexOf('aiDetail2') != -1) {
  424. let index = parseInt(string.split('aiDetail2-')[1])
  425. area = `任务${index + 1}任务描述`
  426. text = this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail
  427. } else if (string.indexOf('aiDetail3') != -1) {
  428. let index = parseInt(string.split('-')[1])
  429. let index2 = parseInt(string.split('-')[2])
  430. area = `任务${index + 1}工具${index2 + 1}的工具描述`
  431. text = this.unitJson[0].chapterInfo[0].taskJson[index].toolChoose[index2].toolDetail
  432. }
  433. quoteArray.push({
  434. string,
  435. area,
  436. value: text
  437. })
  438. })
  439. return quoteArray
  440. },
  441. promptTit() {
  442. if (!this.loading && !this.courseText) {
  443. this.$message({
  444. message: "请输入您想要了解的内容",
  445. type: "warning"
  446. });
  447. } else {
  448. this.$message({
  449. message: "请回答完毕后再次发送",
  450. type: "warning"
  451. });
  452. }
  453. },
  454. addContent() {
  455. let message = this.courseText;
  456. if (this.courseText) {
  457. let msg = ``;
  458. if (this.checkArray.length) {
  459. msg = `
  460. ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".`
  461. let task = [];
  462. if (this.part == "全部内容") {
  463. for (var i = 0; i < this.checkArray.length; i++) {
  464. let _index = this.checkArray[i];
  465. task.push(this.course[_index]);
  466. }
  467. } else if (this.part == "任务设计") {
  468. for (var i = 0; i < this.checkArray.length; i++) {
  469. let _index = this.checkArray[i];
  470. task.push(this.course[_index]);
  471. }
  472. } else if (this.part == "评价设计") {
  473. for (var i = 0; i < this.checkArray.length; i++) {
  474. let _index = this.checkArray[i];
  475. task.push(this.course[_index].eList);
  476. }
  477. }
  478. msg += `
  479. ## 修改内容
  480. ${JSON.stringify(task)}
  481. `;
  482. msg += `
  483. ## 要求
  484. ${this.courseText}
  485. `;
  486. message = msg;
  487. }
  488. if (this.jArray.length) {
  489. let task = [];
  490. for (var i = 0; i < this.jArray.length; i++) {
  491. let _index = this.jArray[i];
  492. task.push(`${_index.area}: ${_index.value.replaceAll('\n', '')}`);
  493. }
  494. msg += `
  495. ## 参考资料
  496. ${task.join('\n')}
  497. `;
  498. msg += `
  499. ## 要求
  500. 根据<参考资料>中的内容实现以下要求:${this.courseText}
  501. `;
  502. message = msg;
  503. }
  504. // 这里处理@的角色
  505. let _atRoleList = [];
  506. let _roleList = [...this.roleList, ...this.publicRoleList];
  507. _roleList.forEach(i => {
  508. if (message.indexOf(`@${i.assistantName}`) != -1) {
  509. _atRoleList.push(i);
  510. }
  511. });
  512. if (_atRoleList.length > 0) {
  513. //有@角色
  514. let _replaceText = message;
  515. let _htmlText = message;
  516. _atRoleList.forEach(_i => {
  517. _replaceText = _replaceText.replaceAll(`@${_i.assistantName}`, ``);
  518. _htmlText = _htmlText.replaceAll(
  519. `@${_i.assistantName}`,
  520. `<span class='aite-name'>@${_i.assistantName}</span>`
  521. );
  522. });
  523. _atRoleList.forEach((_item, _index) => {
  524. const _uid = uuidv4();
  525. if (_index == 0) {
  526. this.array.push({
  527. loading: true,
  528. role: "user",
  529. content: _htmlText,
  530. uid: _uid,
  531. AI: "AI",
  532. aiContent: "",
  533. oldContent: "",
  534. isShowSynchronization: false,
  535. filename: _item.assistantName,
  536. index: this.array.length,
  537. is_mind_map: false,
  538. fileid: _item.headUrl,
  539. createtime: new Date().toLocaleString().replaceAll("/", "-")
  540. });
  541. } else {
  542. this.array.push({
  543. loading: true,
  544. role: "user",
  545. content: "",
  546. uid: _uid,
  547. AI: "AI",
  548. aiContent: "",
  549. oldContent: "",
  550. isShowSynchronization: false,
  551. filename: _item.assistantName,
  552. index: this.array.length,
  553. is_mind_map: false,
  554. fileid: _item.headUrl,
  555. createtime: new Date().toLocaleString().replaceAll("/", "-")
  556. });
  557. }
  558. this.$nextTick(() => {
  559. this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
  560. });
  561. let params = {
  562. assistant_id: _item.assistant_id,
  563. userId: this.userid,
  564. message: _replaceText,
  565. session_name: `${this.courseId}-addCourseA`,
  566. uid: _uid,
  567. file_ids: [],
  568. model: "gpt-4o-2024-08-06"
  569. };
  570. var OpenCC = require("opencc-js");
  571. let converter = OpenCC.Converter({
  572. from: "cn",
  573. to: "hk"
  574. });
  575. this.ajax
  576. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  577. .then(res => {
  578. if (
  579. converter(res.data.FunctionResponse.result) ==
  580. converter("发送成功")
  581. ) {
  582. } else {
  583. this.$message.warning(res.data.FunctionResponse.result);
  584. }
  585. })
  586. .catch(err => {
  587. console.log(err);
  588. });
  589. this.getAtAuContent(_uid);
  590. });
  591. this.courseText = "";
  592. } else {
  593. let _uuid = uuidv4();
  594. this.array.push({
  595. role: "user",
  596. content: `${this.courseText}`,
  597. uid: _uuid,
  598. AI: "AI",
  599. aiContent: "",
  600. oldContent: "",
  601. isShowSynchronization: false,
  602. filename: "",
  603. index: this.array.length,
  604. is_mind_map: false,
  605. createtime: new Date().toLocaleString().replaceAll("/", "-"),
  606. loading: true
  607. });
  608. let history = [];
  609. if (this.continuous) {
  610. this.array.forEach(i => {
  611. if (i.content) history.push({ role: "user", content: i.content });
  612. if (i.aiContent)
  613. history.push({ role: "assistant", content: i.aiContent });
  614. });
  615. }
  616. history.push({ role: "user", content: message });
  617. this.$nextTick(() => {
  618. this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
  619. });
  620. let params = JSON.stringify({
  621. // model: "gpt-3.5-turbo",
  622. // model: "gpt-4o-2024-08-06",
  623. model: "qwen-plus",
  624. temperature: 0,
  625. max_tokens: 4096,
  626. top_p: 1,
  627. frequency_penalty: 0,
  628. presence_penalty: 0,
  629. messages: history,
  630. uid: _uuid,
  631. mind_map_question: ""
  632. });
  633. this.courseText = "";
  634. this.ajax
  635. .post("https://gpt4.cocorobo.cn/chat", params)
  636. .then(res => {
  637. if (res.data.FunctionResponse.result == "发送成功") {
  638. } else {
  639. this.$message.warning(res.data.FunctionResponse.result);
  640. }
  641. })
  642. .catch(e => {
  643. console.log(e);
  644. });
  645. this.getAiContent(_uuid);
  646. }
  647. }
  648. },
  649. getAiContent(_uid) {
  650. let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
  651. let _allText = "";
  652. let _mdText = "";
  653. const md = new MarkdownIt();
  654. _source.onmessage = _e => {
  655. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  656. //对话已经完成
  657. _mdText = _mdText.replace("_", "");
  658. _source.close();
  659. this.$nextTick(() => {
  660. this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
  661. });
  662. this.array.find(i => i.uid == _uid).aiContent = _mdText;
  663. this.array.find(i => i.uid == _uid).isalltext = true;
  664. this.array.find(i => i.uid == _uid).isShowSynchronization = true;
  665. this.array.find(i => i.uid == _uid).loading = false;
  666. // 这里保存对话
  667. if (this.courseId) {
  668. this.insertChat(_uid);
  669. }
  670. return;
  671. } else {
  672. //对话还在继续
  673. let _text = "";
  674. _text = _e.data.replaceAll("'", "");
  675. if (_allText == "") {
  676. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  677. } else {
  678. _allText += _text;
  679. }
  680. _mdText = _allText + "_";
  681. _mdText = _mdText.replace(/\\n/g, "\n");
  682. _mdText = _mdText.replace(/\\/g, "");
  683. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  684. //转化返回的回复流数据
  685. _mdText = md.render(_mdText);
  686. this.array.find(i => i.uid == _uid).aiContent = _mdText;
  687. this.array.find(i => i.uid == _uid).loading = false;
  688. this.$nextTick(() => {
  689. this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
  690. });
  691. // 处理流数据
  692. }
  693. };
  694. },
  695. getAtAuContent(_uid) {
  696. let _source = new EventSource(
  697. `https://gpt4.cocorobo.cn/question/${_uid}`
  698. ); //http://gpt4.cocorobo.cn:8011/question/ https://gpt4.cocorobo.cn/question/
  699. let _allText = "";
  700. let _mdText = "";
  701. const md = new MarkdownIt();
  702. _source.onmessage = _e => {
  703. let _eData = JSON.parse(_e.data);
  704. if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
  705. let _result = [];
  706. if ("result" in _eData) {
  707. _result = _eData.result;
  708. for (let i = 0; i < _result.length; i++) {
  709. _mdText = _mdText.replace(_result[i].text, _result[i].fileName);
  710. }
  711. }
  712. _mdText = _mdText.replace("_", "");
  713. this.array.find(i => i.uid == _uid).aiContent = _mdText;
  714. this.array.find(i => i.uid == _uid).isalltext = true;
  715. this.array.find(i => i.uid == _uid).isShowSynchronization = true;
  716. this.array.find(i => i.uid == _uid).loading = false;
  717. this.$nextTick(() => {
  718. this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
  719. });
  720. this.insertChat(_uid);
  721. } else {
  722. let _text = _eData.content.replace("'", "").replace("'", "");
  723. if (_allText == "") {
  724. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  725. } else {
  726. _allText += _text;
  727. }
  728. _mdText = _allText + "_";
  729. _mdText = _mdText.replace(/\\n/g, "\n");
  730. _mdText = _mdText.replace(/\\/g, "");
  731. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  732. //转化返回的回复流数据
  733. _mdText = md.render(_mdText);
  734. this.array.find(i => i.uid == _uid).aiContent = _mdText;
  735. this.array.find(i => i.uid == _uid).loading = false;
  736. this.$nextTick(() => {
  737. this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
  738. });
  739. // 处理流数据
  740. }
  741. };
  742. },
  743. //保存消息
  744. insertChat(_uid) {
  745. let _data = this.array.find(i => i.uid == _uid);
  746. if (!_data) return;
  747. let params = {
  748. userId: this.userid,
  749. userName: "qgt",
  750. groupId: "602def61-005d-11ee-91d8-005056b8q12w",
  751. answer: _data.aiContent,
  752. problem: _data.content,
  753. file_id: _data.fileid ? _data.fileid : "",
  754. alltext: _data.aiContent,
  755. type: "chat",
  756. filename: _data.filename,
  757. session_name: `${this.courseId}-addCourseA` //这是对话记录位置
  758. };
  759. this.ajax
  760. .post("https://gpt4.cocorobo.cn/insert_chat", params)
  761. .then(res => { });
  762. },
  763. // 获取对应的聊天记录
  764. getChatList() {
  765. return new Promise((resolve, reject) => {
  766. if (this.loading) return this.$message.info("请稍等...");
  767. this.array = [];
  768. this.loading = true;
  769. let params = {
  770. userid: this.userid,
  771. groupid: "602def61-005d-11ee-91d8-005056b8q12w",
  772. // session_name:``
  773. session_name: `${this.courseId}-addCourseA`
  774. };
  775. this.ajax
  776. .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
  777. .then(res => {
  778. let _data = JSON.parse(res.data.FunctionResponse);
  779. if (_data.length > 0) {
  780. let _chatList = [];
  781. for (let i = 0; i < _data.length; i++) {
  782. _chatList.push({
  783. loading: false,
  784. role: "user",
  785. content: _data[i].problem,
  786. uid: _data[i].id,
  787. AI: "AI",
  788. aiContent: _data[i].answer,
  789. oldContent: _data[i].answer,
  790. isShowSynchronization: false,
  791. filename: _data[i].filename,
  792. index: i,
  793. is_mind_map: false,
  794. fileid: _data[i].fileid,
  795. createtime: _data[i].createtime
  796. });
  797. }
  798. this.array = _chatList;
  799. this.loading = false;
  800. } else {
  801. let _uid = uuidv4();
  802. let _chatList = [];
  803. _chatList.push({
  804. loading: false,
  805. role: "",
  806. content: "",
  807. uid: _uid,
  808. AI: "AI",
  809. aiContent:
  810. "您好,我是您的创课助手小可,在创课中遇到什么问题,都可以与我对话~,我会尽量帮助您的",
  811. oldContent:
  812. "您好,我是您的创课助手小可,在创课中遇到什么问题,都可以与我对话~,我会尽量帮助您的",
  813. isShowSynchronization: false,
  814. filename: "",
  815. index: 0,
  816. is_mind_map: false,
  817. fileid: ""
  818. });
  819. this.array = _chatList;
  820. if (this.courseId) {
  821. this.insertChat(_uid);
  822. }
  823. //没有对话记录
  824. this.loading = false;
  825. }
  826. resolve();
  827. })
  828. .catch(err => {
  829. console.log(err);
  830. this.$message.error("获取对话记录失败");
  831. this.loading = false;
  832. resolve();
  833. });
  834. });
  835. },
  836. addTask(index) {
  837. if (this.checkArray.indexOf(index) !== -1) {
  838. this.checkArray.splice(this.checkArray.indexOf(index), 1);
  839. } else {
  840. this.checkArray.push(index);
  841. }
  842. console.log(index);
  843. },
  844. addAllTask() {
  845. if (this.checkArray.length === this.course.length) {
  846. this.checkArray = [];
  847. } else {
  848. this.checkArray = [];
  849. this.course.forEach((item, index) => {
  850. this.checkArray.push(index);
  851. });
  852. }
  853. },
  854. checkPart(name) {
  855. this.part = name;
  856. },
  857. inputChange() {
  858. if (this.courseText.at(-1) == "@") {
  859. this.showRoleList = true;
  860. }
  861. if (this.courseText.at(-1) == "/") {
  862. console.log("哇卡ka2");
  863. }
  864. this.$nextTick(() => {
  865. this.$refs.textareaRef.style.height = "35px";
  866. this.$refs.textareaRef.style.height =
  867. this.$refs.textareaRef.scrollHeight + "px";
  868. this.textareaHeight = this.$refs.textareaRef.style.height;
  869. });
  870. },
  871. textareaKeydown(_e) {
  872. if (this.showRoleList && this.choseRoleList.length > 0) {
  873. console.log(_e.keyCode);
  874. switch (_e.keyCode) {
  875. case 38: //小键盘上
  876. _e.preventDefault();
  877. if (this.choseRoleItem == 0) return;
  878. this.choseRoleItem--;
  879. // 修改滚动条高度
  880. this.$refs.roleListRef.scrollTo({
  881. top:
  882. this.$refs[`roleItem${this.choseRoleItem}Ref`][0].offsetTop -
  883. 10,
  884. behavior: "smooth"
  885. });
  886. // this.$refs.roleListRef.scrollTop = this.choseRoleItem * 107;
  887. break;
  888. case 40: //小键盘下
  889. _e.preventDefault();
  890. if (this.choseRoleItem == this.choseRoleList.length - 1) return;
  891. this.choseRoleItem++;
  892. this.$refs.roleListRef.scrollTo({
  893. top:
  894. this.$refs[`roleItem${this.choseRoleItem}Ref`][0].offsetTop -
  895. 10,
  896. behavior: "smooth"
  897. });
  898. // this.$refs.roleListRef.scrollTop = this.choseRoleItem * 107;
  899. break;
  900. case 13: //回车
  901. _e.preventDefault();
  902. this.choseRole(this.choseRoleList[this.choseRoleItem]);
  903. break;
  904. }
  905. } else if (_e.key === "Enter") {
  906. _e.preventDefault();
  907. if (_e.shiftKey) {
  908. this.courseText += "\n";
  909. } else {
  910. this.addContent();
  911. }
  912. }
  913. },
  914. clear() {
  915. this.$confirm("确定清空聊天记录吗?", "提示", {
  916. confirmButtonText: "确定",
  917. cancelButtonText: "取消",
  918. type: "warning"
  919. })
  920. .then(_ => {
  921. this.loading = true;
  922. let params = {
  923. user_id: this.userid,
  924. id: "602def61-005d-11ee-91d8-005056b8q12w",
  925. session_name: `${this.courseId}-addCourseA`
  926. };
  927. this.ajax
  928. .post("https://gpt4.cocorobo.cn/delete_park_session", params)
  929. .then(res => {
  930. this.array = [];
  931. this.$message.success("清除聊天记录成功");
  932. this.loading = false;
  933. })
  934. .catch(err => {
  935. this.loading = false;
  936. this.$message.error("清除聊天记录失败");
  937. });
  938. })
  939. .catch(_ => { });
  940. },
  941. getRoleList() {
  942. this.roleList = [];
  943. let params = {
  944. userId: this.userid
  945. };
  946. this.ajax
  947. .post("https://gpt4.cocorobo.cn/get_ai_agent_assistant_list", params)
  948. .then(res => {
  949. let _data = res.data.FunctionResponse.result;
  950. if (_data) {
  951. this.roleList = JSON.parse(_data);
  952. }
  953. })
  954. .catch(e => {
  955. console.log(e);
  956. // this.$message.error("获取角色列表失败");
  957. this.roleList = [];
  958. });
  959. },
  960. getPublicRoleList() {
  961. this.publicRoleList = [];
  962. let params = {
  963. userId: this.userid,
  964. organizeid: this.oid
  965. };
  966. this.ajax
  967. .post(
  968. "https://gpt4.cocorobo.cn/get_ai_agent_assistant_share_list",
  969. params
  970. )
  971. .then(res => {
  972. let _data = res.data.FunctionResponse.result;
  973. if (_data) {
  974. this.publicRoleList = JSON.parse(_data);
  975. }
  976. })
  977. .catch(e => {
  978. this.publicRoleList = [];
  979. console.log(e);
  980. // console.log("获取公共角色失败", e);
  981. });
  982. },
  983. choseRole(item) {
  984. let _lastAtIndex = this.courseText.lastIndexOf("@");
  985. this.courseText = `${this.courseText.slice(0, _lastAtIndex)}@${item.assistantName
  986. } `;
  987. this.$refs.textareaRef.focus();
  988. this.showRoleList = false;
  989. }
  990. },
  991. computed: {
  992. courseTextLength() {
  993. return this.courseText.length;
  994. },
  995. taskName() {
  996. let task = "";
  997. if (this.checkArray.length) {
  998. task = "任务";
  999. this.checkArray = this.checkArray.sort((a, b) => a - b);
  1000. let a = JSON.parse(JSON.stringify(this.checkArray));
  1001. for (let index = 0; index < a.length; index++) {
  1002. a[index]++;
  1003. }
  1004. task += a.join("/");
  1005. }
  1006. return task + " " + this.part;
  1007. },
  1008. choseRoleList() {
  1009. let result = [...this.roleList, ...this.publicRoleList];
  1010. const _index = this.courseText.lastIndexOf("@");
  1011. if (_index !== -1) {
  1012. let roleName = this.courseText.substring(_index + 1);
  1013. result = result.filter(i => i.assistantName.indexOf(roleName) != -1);
  1014. } else {
  1015. return [];
  1016. }
  1017. this.choseRoleItem = 0;
  1018. return result;
  1019. }
  1020. },
  1021. mounted() {
  1022. this.getChatList().then(_ => {
  1023. this.$nextTick(() => {
  1024. console.log(this.$refs.chatDialog.scrollHeight);
  1025. this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
  1026. });
  1027. });
  1028. this.getRoleList();
  1029. this.getPublicRoleList();
  1030. this.jArray = this.getString();
  1031. }
  1032. };
  1033. </script>
  1034. <style scoped>
  1035. .ai_body {
  1036. height: 100%;
  1037. width: calc(100% - 20px);
  1038. margin: 0 auto;
  1039. display: flex;
  1040. flex-direction: column;
  1041. }
  1042. .binfo_input {
  1043. width: 100%;
  1044. margin: 0;
  1045. padding: 12px 14px;
  1046. display: block;
  1047. min-width: 0;
  1048. outline: none;
  1049. box-sizing: border-box;
  1050. background: none;
  1051. border: none;
  1052. border-radius: 4px;
  1053. background: #fff;
  1054. font-size: 14px;
  1055. resize: none;
  1056. font-family: "Microsoft YaHei";
  1057. min-height: 48px;
  1058. /* border: 1px solid #3682fc00; */
  1059. border: 1.5px solid #cad1dc;
  1060. }
  1061. .binfo_textarea {
  1062. border: 1.5px solid #cad1dc;
  1063. font-size: 14px;
  1064. resize: none;
  1065. /* background: #f6f6f6; */
  1066. font-family: "Microsoft YaHei";
  1067. }
  1068. .binfo_textarea::-webkit-scrollbar {
  1069. /*滚动条整体样式*/
  1070. width: 6px;
  1071. /*高宽分别对应横竖滚动条的尺寸*/
  1072. height: 6px;
  1073. }
  1074. /*定义滚动条轨道 内阴影+圆角*/
  1075. .binfo_textarea::-webkit-scrollbar-track {
  1076. border-radius: 10px;
  1077. background-color: rgba(0, 0, 0, 0.1);
  1078. }
  1079. /*定义滑块 内阴影+圆角*/
  1080. .binfo_textarea::-webkit-scrollbar-thumb {
  1081. border-radius: 10px;
  1082. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1083. background-color: rgba(0, 0, 0, 0.1);
  1084. }
  1085. .binfo_input:focus-visible {
  1086. border: 1.5px solid #3681fc !important;
  1087. }
  1088. .ai_body_input {
  1089. position: relative;
  1090. display: flex;
  1091. margin-top: auto;
  1092. width: 100%;
  1093. /* height: auto; */
  1094. /* max-height: 80vh; */
  1095. justify-content: space-between;
  1096. align-items: flex-end;
  1097. border-radius: 10px;
  1098. border: 1.5px solid #3681fc !important;
  1099. /* padding: 10px;
  1100. padding-top: 20px; */
  1101. /* overflow: auto; */
  1102. }
  1103. .ai_b_i_btnArea {
  1104. width: calc(100% - 10px);
  1105. position: absolute;
  1106. bottom: calc(100% + 5px);
  1107. height: 30px;
  1108. display: flex;
  1109. /* justify-content: space-between; */
  1110. }
  1111. .ai_b_i_btnArea>div {
  1112. display: flex;
  1113. align-items: center;
  1114. }
  1115. .ai_b_i_btnArea>div>span {
  1116. margin-left: 5px;
  1117. cursor: pointer;
  1118. }
  1119. .ai_b_i_btnArea>.clear+.clear {
  1120. margin-left: 10px;
  1121. }
  1122. .ai_b_i_btnArea>.clear {
  1123. box-sizing: border-box;
  1124. padding: 5px 10px;
  1125. box-sizing: border-box;
  1126. cursor: pointer;
  1127. border: solid 1px #3781fb;
  1128. border-radius: 15px;
  1129. display: flex;
  1130. font-size: 15px;
  1131. align-items: center;
  1132. justify-content: center;
  1133. background-color: #fff;
  1134. }
  1135. .ai_b_i_btnArea>.clear>svg {
  1136. width: 17px;
  1137. height: 17px;
  1138. margin-right: 5px;
  1139. fill: black;
  1140. }
  1141. .ai_b_i_btnArea>.clear:hover {
  1142. background-color: #ebf4fe;
  1143. color: #409eff;
  1144. }
  1145. .ai_b_i_btnArea>.clear:hover>svg {
  1146. fill: #409eff;
  1147. }
  1148. .ai_b_i_textListBox {
  1149. width: 100%;
  1150. height: 300px;
  1151. background-color: #fff;
  1152. position: absolute;
  1153. bottom: calc(100% + 5px);
  1154. box-sizing: border-box;
  1155. padding: 10px;
  1156. overflow: auto;
  1157. border-radius: 8px;
  1158. border: 1px solid #e7e7e7;
  1159. box-shadow: 0 4px 10px 0 rgba(29, 57, 131, 0.08),
  1160. 1px 1px 20px 4px rgba(29, 57, 131, 0.05);
  1161. display: flex;
  1162. }
  1163. .ai_b_i_tlb_left {
  1164. width: 60px;
  1165. height: 100%;
  1166. background-color: red;
  1167. }
  1168. .ai_b_i_tlb_right {
  1169. flex: 1;
  1170. height: 100%;
  1171. background-color: yellow;
  1172. }
  1173. .ai_b_i_roleListBox {
  1174. width: 100%;
  1175. height: 300px;
  1176. background-color: #fff;
  1177. position: absolute;
  1178. bottom: calc(100% + 5px);
  1179. box-sizing: border-box;
  1180. padding: 10px;
  1181. overflow: auto;
  1182. border-radius: 8px;
  1183. border: 1px solid #e7e7e7;
  1184. box-shadow: 0 4px 10px 0 rgba(29, 57, 131, 0.08),
  1185. 1px 1px 20px 4px rgba(29, 57, 131, 0.05);
  1186. }
  1187. .ai_b_i_rlb_item {
  1188. width: calc(100% - 20px);
  1189. height: auto;
  1190. padding: 10px;
  1191. background-color: #f3f7fd;
  1192. margin-bottom: 20px;
  1193. border-radius: 8px;
  1194. display: flex;
  1195. flex-direction: column;
  1196. justify-content: center;
  1197. transition: 0.3s;
  1198. cursor: pointer;
  1199. }
  1200. .ai_b_i_rlb_itemActive {
  1201. background-color: #d1d5db !important;
  1202. }
  1203. /* .ai_b_i_rlb_item:hover{
  1204. background-color: #d1d5db;
  1205. } */
  1206. .ai_b_i_rlb_itemTop {
  1207. display: flex;
  1208. }
  1209. .ai_b_i_rlb_itemTop>img {
  1210. width: 40px;
  1211. height: 40px;
  1212. margin-right: 10px;
  1213. border-radius: 100%;
  1214. overflow: hidden;
  1215. }
  1216. .ai_b_i_rlb_itemTop>div {
  1217. display: flex;
  1218. flex-direction: column;
  1219. }
  1220. .ai_b_i_rlb_itemTop>div>span {
  1221. font-size: 16px;
  1222. font-weight: bold;
  1223. }
  1224. .ai_b_i_rlb_itemTop>div>span:last-child {
  1225. font-size: 14px;
  1226. color: #999;
  1227. }
  1228. .ai_b_i_rlb_itemBottom {
  1229. margin-top: 10px;
  1230. display: flex;
  1231. }
  1232. .ai_b_i_rlb_itemBottom>span {
  1233. width: 60px;
  1234. height: 30px;
  1235. border-radius: 15px;
  1236. display: flex;
  1237. }
  1238. .ai_body_input_textarea {
  1239. flex: 1;
  1240. margin: 10px 5px 10px 5px;
  1241. min-height: 35px;
  1242. height: 35px;
  1243. max-height: 60vh;
  1244. border: none;
  1245. outline: none;
  1246. resize: none;
  1247. font-size: 18px;
  1248. overflow: auto;
  1249. padding-right: 100px;
  1250. }
  1251. .ai_body_input_textarea::-webkit-input-placeholder {
  1252. font-size: 16px;
  1253. /* 修改placeholder字体大小 */
  1254. color: grey;
  1255. /* 修改placeholder文字颜色 */
  1256. }
  1257. .ai_body_input_textarea::-moz-placeholder {
  1258. font-size: 16px;
  1259. /* 修改placeholder字体大小 */
  1260. color: grey;
  1261. /* 修改placeholder文字颜色 */
  1262. opacity: 1;
  1263. /* 修复Firefox的透明度问题 */
  1264. }
  1265. .ai_body_input_textarea::-moz-placeholder {
  1266. font-size: 16px;
  1267. /* 修改placeholder字体大小 */
  1268. color: grey;
  1269. /* 修改placeholder文字颜色 */
  1270. opacity: 1;
  1271. /* 修复Firefox的透明度问题 */
  1272. }
  1273. .ai_body_input_textarea::-ms-input-placeholder {
  1274. font-size: 16px;
  1275. /* 修改placeholder字体大小 */
  1276. color: grey;
  1277. /* 修改placeholder文字颜色 */
  1278. }
  1279. .ai_body_input_textarea::-webkit-scrollbar {
  1280. width: 6px;
  1281. }
  1282. .ai_body_input_textarea::-webkit-scrollbar-track {
  1283. background: #d8d9dc;
  1284. border-radius: 2px;
  1285. }
  1286. .ai_body_input_textarea::-webkit-scrollbar-thumb {
  1287. background: #c9c9c9;
  1288. border-radius: 10px;
  1289. }
  1290. .ai_body_input_textarea::-webkit-scrollbar-thumb:hover {
  1291. background: #c9c9c9;
  1292. }
  1293. .c_pub_button_confirm {
  1294. /* position: absolute;
  1295. bottom: 13px;
  1296. right: 13px; */
  1297. /* margin-top: 10px; */
  1298. width: 60px;
  1299. margin-right: 5px;
  1300. display: flex;
  1301. justify-content: center;
  1302. margin-bottom: 10px;
  1303. position: absolute;
  1304. right: 10px;
  1305. bottom: 0px;
  1306. white-space: nowrap;
  1307. border-radius: 10px;
  1308. }
  1309. .c_pub_button_confirmDisabled {
  1310. background-color: #aeccfe;
  1311. }
  1312. .ai_body_dialog {
  1313. padding: 10px 0;
  1314. box-sizing: border-box;
  1315. /* min-height: calc(20vh - 10px); */
  1316. /* height: calc(100%); */
  1317. overflow: auto;
  1318. margin-bottom: 10px;
  1319. }
  1320. .dialog_content {
  1321. width: 100%;
  1322. display: flex;
  1323. flex-direction: column;
  1324. }
  1325. .dialog_content>div {
  1326. display: flex;
  1327. align-items: flex-start;
  1328. width: 100%;
  1329. }
  1330. .dialog_content+.dialog_content {
  1331. margin: 15px 0;
  1332. }
  1333. .dialog_content>div .right {
  1334. flex-direction: row-reverse;
  1335. }
  1336. .dialog_content>div .right .role {
  1337. margin-right: 0;
  1338. margin-left: 10px;
  1339. }
  1340. .dialog_content>div .role {
  1341. min-width: 30px;
  1342. width: 30px;
  1343. height: 30px;
  1344. margin-right: 10px;
  1345. border-radius: 50%;
  1346. }
  1347. .dialog_content>div .role>img {
  1348. height: 100%;
  1349. width: 100%;
  1350. border-radius: 100%;
  1351. }
  1352. .dialog_content>div .content {
  1353. padding: 10px 10px;
  1354. border-radius: 2px 8px 8px 8px;
  1355. width: auto;
  1356. word-break: break-word;
  1357. box-sizing: border-box;
  1358. /* white-space: pre-line; */
  1359. max-width: calc(100% - 50px);
  1360. background: #f6f9ff;
  1361. /* overflow: hidden; */
  1362. margin: 0 10px;
  1363. position: relative;
  1364. }
  1365. .createTime {
  1366. width: 100%;
  1367. height: 20px;
  1368. position: absolute;
  1369. bottom: -25px;
  1370. left: 0;
  1371. font-size: 14px;
  1372. white-space: nowrap;
  1373. color: #919191;
  1374. }
  1375. .dialog_content>div .content2 {
  1376. background: #3681fc;
  1377. color: #fff;
  1378. border-radius: 8px 2px 8px 8px;
  1379. margin-left: auto;
  1380. }
  1381. .ai_body_select {
  1382. position: relative;
  1383. }
  1384. .ai_body_select>.check {
  1385. background: #e7e7e7;
  1386. display: flex;
  1387. width: fit-content;
  1388. padding: 0 10px;
  1389. height: 30px;
  1390. border-radius: 21px;
  1391. font-size: 14px;
  1392. align-items: center;
  1393. justify-content: center;
  1394. color: #0061ff;
  1395. font-weight: 700;
  1396. margin: 10px 0;
  1397. cursor: pointer;
  1398. }
  1399. .ai_body_select>.check::before {
  1400. content: "";
  1401. width: 15px;
  1402. height: 15px;
  1403. display: block;
  1404. background-image: url("../../../assets/icon/course/aiPart.png");
  1405. background-size: 100% 100%;
  1406. margin-right: 5px;
  1407. }
  1408. .ai_body_select>.check::after {
  1409. content: "";
  1410. width: 15px;
  1411. height: 15px;
  1412. display: block;
  1413. background-image: url("../../../assets/icon/course/aiPart_arrow.png");
  1414. background-size: 100% 100%;
  1415. margin-right: 5px;
  1416. }
  1417. .ai_body_select>.isCheck {
  1418. background: #0061ff;
  1419. display: flex;
  1420. width: fit-content;
  1421. padding: 0 10px;
  1422. height: 30px;
  1423. border-radius: 21px;
  1424. font-size: 14px;
  1425. align-items: center;
  1426. justify-content: center;
  1427. color: #fff;
  1428. font-weight: 700;
  1429. margin: 10px 0;
  1430. cursor: pointer;
  1431. max-width: 100%;
  1432. box-sizing: border-box;
  1433. }
  1434. .ai_body_select>.isCheck>span {
  1435. width: calc(100% - 40px);
  1436. display: block;
  1437. overflow: hidden;
  1438. white-space: nowrap;
  1439. text-overflow: ellipsis;
  1440. }
  1441. .ai_body_select>.isCheck::before {
  1442. content: "";
  1443. width: 15px;
  1444. height: 15px;
  1445. display: block;
  1446. background-image: url("../../../assets/icon/course/aiPart_active.png");
  1447. background-size: 100% 100%;
  1448. margin-right: 5px;
  1449. }
  1450. .ai_body_select>.isCheck::after {
  1451. content: "";
  1452. width: 15px;
  1453. height: 15px;
  1454. display: block;
  1455. background-image: url("../../../assets/icon/course/aiPart_arrow_active.png");
  1456. background-size: 100% 100%;
  1457. margin-right: 5px;
  1458. }
  1459. .ai_body_select>.checkBox {
  1460. position: absolute;
  1461. bottom: 40px;
  1462. border: 1px solid #e0eafb;
  1463. width: 100%;
  1464. height: 300px;
  1465. background: #fff;
  1466. border-radius: 5px;
  1467. padding: 10px;
  1468. box-sizing: border-box;
  1469. }
  1470. .ai_body_select>.checkBox>.task>.title,
  1471. .ai_body_select>.checkBox>.part>.title {
  1472. font-size: 14px;
  1473. font-weight: 700;
  1474. margin-bottom: 5px;
  1475. }
  1476. .ai_body_select>.checkBox>.task {
  1477. height: calc(100% - 60px);
  1478. }
  1479. .ai_body_select>.checkBox>.part {}
  1480. .ai_body_select>.checkBox>.task>.content {
  1481. height: calc(100% - 40px);
  1482. overflow: auto;
  1483. }
  1484. .ai_body_select>.checkBox>.task>.content>.span+.span {
  1485. margin-top: 5px;
  1486. }
  1487. .ai_body_select>.checkBox>.task>.content>.span {
  1488. display: flex;
  1489. align-items: center;
  1490. font-size: 14px;
  1491. cursor: pointer;
  1492. }
  1493. .ai_body_select>.checkBox>.task>.content>.span>.check {
  1494. width: 13px;
  1495. height: 13px;
  1496. display: flex;
  1497. align-items: center;
  1498. margin-right: 5px;
  1499. }
  1500. .ai_body_select>.checkBox>.task>.content>.span>.check>img {
  1501. width: 100%;
  1502. height: 100%;
  1503. }
  1504. .ai_body_select>.checkBox>.part>.content {
  1505. display: flex;
  1506. align-items: center;
  1507. font-size: 14px;
  1508. justify-content: space-between;
  1509. }
  1510. .ai_body_select>.checkBox>.part>.content>.span {
  1511. padding: 3px 6px;
  1512. border: 1px solid #e0eafb;
  1513. border-radius: 40px;
  1514. cursor: pointer;
  1515. }
  1516. .ai_body_select>.checkBox>.part>.content>.span.active {
  1517. color: #0061ff;
  1518. border-color: #0061ff;
  1519. }
  1520. .ai_b_i_jListPanel {
  1521. width: 400px;
  1522. height: 100%;
  1523. top: 0;
  1524. right: 0;
  1525. position: fixed;
  1526. /* background-color: #000; */
  1527. z-index: 990;
  1528. }
  1529. .ai_b_i_jListBox {
  1530. width: 100%;
  1531. max-height: 300px;
  1532. background-color: #fff;
  1533. position: absolute;
  1534. bottom: calc(100% + 5px);
  1535. box-sizing: border-box;
  1536. padding: 10px;
  1537. overflow: auto;
  1538. border-radius: 8px;
  1539. border: 1px solid #e7e7e7;
  1540. box-shadow: 0 4px 10px 0 rgba(29, 57, 131, 0.08),
  1541. 1px 1px 20px 4px rgba(29, 57, 131, 0.05);
  1542. z-index: 999;
  1543. }
  1544. .jlist_box {
  1545. background: #f1f1f1;
  1546. border-radius: 5px;
  1547. margin-bottom: 10px;
  1548. padding: 8px 18px 8px 8px;
  1549. box-sizing: border-box;
  1550. width: 100%;
  1551. position: relative;
  1552. }
  1553. .jlist_box .cancel {
  1554. position: absolute;
  1555. top: 8px;
  1556. right: 5px;
  1557. cursor: pointer;
  1558. font-size: 14px;
  1559. }
  1560. .jlist_box>span {
  1561. display: -webkit-box;
  1562. -webkit-box-orient: vertical;
  1563. -webkit-line-clamp: 3;
  1564. text-overflow: ellipsis;
  1565. overflow: hidden;
  1566. word-break: break-all;
  1567. }
  1568. </style>