taskArea.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. <template>
  2. <div class="task">
  3. <div class="taskTop" v-if="false">
  4. <div class="tt_title">任务时间分配</div>
  5. <div class="tt_item">
  6. <div class="tt_i_title">
  7. <span>课程时间轴</span>
  8. </div>
  9. <div class="tt_i_box">
  10. <img :src="require('../../../assets/icon/course/group.png')" />
  11. </div>
  12. </div>
  13. <div class="tt_item">
  14. <div class="tt_i_title">
  15. <span>任务状态</span>
  16. <span>学生活动中...</span>
  17. </div>
  18. <div class="tt_i_box">
  19. <div class="tt_i_b_item">
  20. <div class="tt_i_b_title">作业提交</div>
  21. <div class="tt_i_b_box">
  22. <div class="tt_i_b_b_item">
  23. <div>提交人数</div>
  24. <span>34<span>人</span></span>
  25. </div>
  26. <div class="tt_i_b_b_item">
  27. <div>正确率</div>
  28. <span>88<span>%</span></span>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="tt_i_b_item">
  33. <div class="tt_i_b_title">交流互动</div>
  34. <div class="tt_i_b_box">
  35. <div class="tt_i_b_b_item">
  36. <div>参与人数</div>
  37. <span>56<span>人</span></span>
  38. </div>
  39. <div class="tt_i_b_b_item">
  40. <div>点赞数</div>
  41. <span>36<span>个</span></span>
  42. </div>
  43. <div class="tt_i_b_b_item">
  44. <div>评论数</div>
  45. <span>128<span>条</span></span>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="t_top" ref="chatRef">
  53. <div class="t_t_chat" v-for="(item, index) in chatList" :key="index">
  54. <div class="t_t_c_user" v-if="item.content">
  55. <div class="t_t_c_u_left">
  56. <div class="t_t_c_u_l_content">{{ item.content }}</div>
  57. <div class="t_t_c_u_l_time">{{ item.createtime }}</div>
  58. </div>
  59. <div class="t_t_c_u_right">
  60. <span>我</span>
  61. </div>
  62. </div>
  63. <div class="t_t_c_ai">
  64. <div class="t_t_c_a_left">
  65. <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
  66. <span v-else>Ai</span>
  67. </div>
  68. <div class="t_t_c_a_right">
  69. <div class="t_t_c_a_r_content" style="display: flex;justify-content: space-between;flex-wrap: wrap;" v-if="item.content.includes('图片')">
  70. <div
  71. v-if="!pan(item.aiContent).length"
  72. class="d_t_c_a_r_content"
  73. v-loading="item.loading"
  74. v-html="item.aiContent"
  75. ></div>
  76. <div v-else v-for="i in pan(item.aiContent)">
  77. <img style="width: 120px;height: 120px;" :src="i.image" alt="" @click="previewImg(i.image)">
  78. </div>
  79. </div>
  80. <div
  81. v-else
  82. class="t_t_c_a_r_content"
  83. v-loading="item.loading"
  84. v-html="item.aiContent"
  85. ></div>
  86. <div class="t_t_c_a_r_time">{{ item.createtime }}</div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="t_bottom">
  92. <div class="t_b_btnArea">
  93. <!-- <div class="s_b_ba-item" @click.stop="choiceRole()">选择角色</div> -->
  94. <div class="t_b_ba_item" @click="sendType('智能总结')">智能总结</div>
  95. <div class="t_b_ba_item" @click="sendType('智能出题')">智能出题</div>
  96. <!-- <div class="t_b_ba_item" @click="sendType('优秀标兵')">优秀标兵</div> -->
  97. <div class="t_b_ba_item" @click="sendType('扩展知识')">扩展知识</div>
  98. <div class="t_b_ba_item" @click="clear()">清空聊天记录</div>
  99. </div>
  100. <div class="t_b_inputArea">
  101. <!-- <div class="t_b_tape" @click="goTape()"></div> -->
  102. <div class="t_b_input">
  103. <el-input
  104. :disabled="loading || chatLoading"
  105. v-loading="loading || chatLoading"
  106. @keyup.enter.native="send()"
  107. class="t_b_i_left"
  108. v-model="text"
  109. ></el-input>
  110. <!-- <div class="t_b_i_right" @click="sendFile()">
  111. <span></span>
  112. </div> -->
  113. </div>
  114. <div class="t_b_btn" @click="send()">
  115. <span></span>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. // import { Loading } from 'element-ui';
  123. import { v4 as uuidv4 } from "uuid";
  124. import MarkdownIt from "markdown-it";
  125. import { tools } from "../../../common/tools";
  126. export default {
  127. props: {
  128. courseDetail: {
  129. type: Object,
  130. default: () => {}
  131. }
  132. },
  133. data() {
  134. return {
  135. userid: this.$route.query.userid,
  136. courseId: this.$route.query.courseId,
  137. text: "",
  138. loading: false,
  139. chatLoading: false,
  140. chatList: []
  141. };
  142. },
  143. computed: {
  144. pan() {
  145. return (content) => {
  146. try {
  147. return JSON.parse(content)
  148. } catch (error) {
  149. return []
  150. }
  151. };
  152. }
  153. },
  154. methods: {
  155. exportCourse() {
  156. let _user = `<div style="font-size:30px;margin-top:10px;"><span style="color: rgb(113, 124, 141); font-weight: 400;">创建者:</span><span>${this.courseDetail.username}</span></div>`;
  157. const _chapInfo = JSON.parse(this.courseDetail.chapters);
  158. let _chap = "";
  159. for (let i = 0; i < _chapInfo.length; i++) {
  160. _chap += `<div style="font-size:40px;margin-top:70px;"><span>第${
  161. i + 1
  162. }阶段:${_chapInfo[i].dyName}</span></div>`;
  163. let _task = _chapInfo[i].chapterInfo[0].taskJson;
  164. for (let j = 0; j < _task.length; j++) {
  165. _chap += `<div style="font-size:30px;margin-top:50px;"><span>任务${
  166. j + 1
  167. }:${_task[j].task}</span></div>`;
  168. if (_task[j].taskDetail) {
  169. _chap += `<div style="font-size:25px;margin-top:40px;">任务描述</div>`;
  170. _chap += `<div style="font-size:25px;margin-top:10px;">${_task[j].taskDetail}</div>`;
  171. }
  172. let _tool = _task[j].toolChoose;
  173. if (_tool[0].tool.length) {
  174. for (let z = 0; z < _tool.length; z++) {
  175. _chap += `<div style="font-size:23px;margin-top:30px;"><span>步骤${
  176. z + 1
  177. }:</span><span>${
  178. tools[_tool[z].tool[0]] ? tools[_tool[z].tool[0]].name : ""
  179. }</span></div>`;
  180. if (_tool[z].toolDetail) {
  181. _chap += `<div style="font-size:23px;margin-top:20px;">工具描述</div>`;
  182. _chap += `<div style="font-size:23px;margin-top:10px;">${_tool[z].toolDetail}</div>`;
  183. }
  184. }
  185. }
  186. }
  187. }
  188. let _html = _user + _chap;
  189. return _html
  190. },
  191. previewImg(url) {
  192. this.$hevueImgPreview(url);
  193. },
  194. clear(){
  195. this.chatList = [];
  196. },
  197. // 获取ai对话
  198. getAiContent(_uid) {
  199. let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
  200. let _allText = "";
  201. let _mdText = "";
  202. const md = new MarkdownIt();
  203. _source.onmessage = _e => {
  204. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  205. //对话已经完成
  206. _mdText = _mdText.replace("_", "");
  207. _source.close();
  208. this.chatLoading = false;
  209. this.scrollBottom();
  210. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  211. this.chatList.find(i => i.uid == _uid).isalltext = true;
  212. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  213. this.chatList.find(i => i.uid == _uid).loading = false;
  214. // 这里保存对话
  215. this.insertChat(_uid);
  216. return;
  217. } else {
  218. //对话还在继续
  219. let _text = "";
  220. _text = _e.data.replaceAll("'", "");
  221. if (_allText == "") {
  222. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  223. } else {
  224. _allText += _text;
  225. }
  226. _mdText = _allText + "_";
  227. _mdText = _mdText.replace(/\\n/g, "\n");
  228. _mdText = _mdText.replace(/\\/g, "");
  229. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  230. //转化返回的回复流数据
  231. _mdText = md.render(_mdText);
  232. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  233. this.chatList.find(i => i.uid == _uid).loading = false;
  234. this.scrollBottom();
  235. // 处理流数据
  236. }
  237. };
  238. },
  239. //保存消息
  240. insertChat(_uid) {
  241. let _data = this.chatList.find(i => i.uid == _uid);
  242. if (!_data) return;
  243. let params = {
  244. userId: this.userid,
  245. userName: "qgt",
  246. groupId: "602def61-005d-11ee-91d8-005056b8q12w",
  247. answer: _data.aiContent,
  248. problem: _data.content,
  249. file_id: _data.fileid ? _data.fileid : "",
  250. alltext: _data.aiContent,
  251. type: "chat",
  252. filename: _data.filename,
  253. session_name: `${this.courseId}-studyStudent` //这是对话记录位置
  254. };
  255. this.ajax
  256. .post("https://gpt4.cocorobo.cn/insert_chat", params)
  257. .then(res => {});
  258. },
  259. // 获取对应的聊天记录
  260. getChatList() {
  261. return new Promise((resolve, reject) => {
  262. if (this.loading) return this.$message.info("请稍等...");
  263. this.chatList = [];
  264. this.loading = true;
  265. this.chatLoading = true;
  266. let params = {
  267. userid: this.userid,
  268. groupid: "602def61-005d-11ee-91d8-005056b8q12w",
  269. // session_name:``
  270. session_name: `${this.courseId}-studyStudent`
  271. };
  272. this.ajax
  273. .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
  274. .then(res => {
  275. let _data = JSON.parse(res.data.FunctionResponse);
  276. if (_data.length > 0) {
  277. let _chatList = [];
  278. for (let i = 0; i < _data.length; i++) {
  279. _chatList.push({
  280. loading: false,
  281. role: "user",
  282. content: _data[i].problem,
  283. uid: _data[i].id,
  284. AI: "AI",
  285. aiContent: _data[i].answer,
  286. oldContent: _data[i].answer,
  287. isShowSynchronization: false,
  288. filename: _data[i].filename,
  289. index: i,
  290. is_mind_map: false,
  291. fileid: _data[i].fileid
  292. });
  293. }
  294. this.chatList = _chatList;
  295. this.loading = false;
  296. this.chatLoading = false;
  297. } else {
  298. //没有对话记录
  299. this.loading = false;
  300. this.chatLoading = false;
  301. }
  302. resolve();
  303. })
  304. .catch(err => {
  305. console.log(err);
  306. this.$message.error("获取对话记录失败");
  307. this.loading = false;
  308. this.chatLoading = false;
  309. resolve();
  310. });
  311. });
  312. },
  313. // choiceRole() {
  314. // this.cardType = 1;
  315. // },
  316. // sendFile() {
  317. // if (this.loading) return this.$message.info("请稍等");
  318. // this.$message.info("点击了附件");
  319. // },
  320. // goTape() {
  321. // if (this.loading) return this.$message.info("请稍等");
  322. // this.$message.info(`点击了语音`);
  323. // },
  324. send(_text = this.text) {
  325. if (this.loading || this.chatLoading) return this.$message.info("请稍等");
  326. if (_text.trim().length == 0) return this.$message.info("请输入内容");
  327. this.chatLoading = true;
  328. let _uuid = uuidv4();
  329. this.chatList.push({
  330. role: "user",
  331. content: `${_text}`,
  332. uid: _uuid,
  333. AI: "AI",
  334. aiContent: "",
  335. oldContent: "",
  336. isShowSynchronization: false,
  337. filename: "",
  338. index: this.chatList.length,
  339. is_mind_map: false,
  340. loading: true
  341. });
  342. this.scrollBottom();
  343. let params = {
  344. model: "gpt-3.5-turbo",
  345. temperature: 0,
  346. max_tokens: 4096,
  347. top_p: 1,
  348. frequency_penalty: 0,
  349. presence_penalty: 0,
  350. messages: [{ role: "user", content: _text }],
  351. uid: _uuid,
  352. mind_map_question: ""
  353. };
  354. this.text = "";
  355. this.ajax
  356. .post("https://gpt4.cocorobo.cn/chat", params)
  357. .then(res => {
  358. if (res.data.FunctionResponse.result == "发送成功") {
  359. } else {
  360. this.$message.warning(res.data.FunctionResponse.result);
  361. this.chatLoading = false;
  362. }
  363. })
  364. .catch(e => {
  365. console.log(e);
  366. this.chatLoading = false;
  367. });
  368. this.getAiContent(_uuid);
  369. },
  370. sendType(_text) {
  371. if (this.loading || this.chatLoading) return this.$message.info("请稍等");
  372. let _msg = ``;
  373. if (_text == "扩展知识") {
  374. // return console.log(this.courseDetail);
  375. _msg = `
  376. NOTICE
  377. Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
  378. ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
  379. Instruction: Based on the context, follow "Format example", write content.
  380. # Context
  381. ## 任务
  382. 你的任务是根据用户的请求,结合以下“课程信息”包含的子条目(“课程标题”,“分类”以及“年级”),向用户输出相关的扩展知识点,将结果以有序列表的形式返回给用户。
  383. 课程信息
  384. 课程标题:${this.courseDetail.title}
  385. 分类:${this.courseDetail.name?this.courseDetail.name:"无"}
  386. 学生年级:${this.courseDetail.classname?this.courseDetail.classname:"无"}
  387. ## 规则
  388. 1. 内容应该与“课程信息”相关,避免提供无关的信息。
  389. 2. 当课程信息中的子条目内容为“无”时,无视这些条目进行即可。
  390. 3. 搜索建议的结果应该符合伦理规范。
  391. 4. 一步步思考如何根据“课程信息”来输出“扩展知识点”,但是你不需要“扩展知识点”以外的内容。
  392. ## 格式要求
  393. 1. 应包括5个相关的“扩展知识点”。
  394. 2. 搜索建议应以有序列表形式呈现,每个建议包括关键词和简短描述。
  395. # Format example
  396. ## 课程标题:垃圾回收
  397. 分类:无
  398. 年级:无
  399. 1. 垃圾分类标准:不同国家的垃圾分类标准和方法。
  400. 2. 可回收垃圾处理:可回收垃圾的处理流程和再利用方法。
  401. 3. 有害垃圾的影响:有害垃圾对环境和人体健康的潜在影响。
  402. 4. 垃圾减量化策略:减少垃圾产生的有效策略和实践。
  403. 5. 环保教育活动:在学校中推广环保意识的活动和资源。
  404. `;
  405. } else if (_text == "智能出题") {
  406. _msg = `
  407. NOTICE
  408. Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
  409. ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
  410. Instruction: Based on the context, follow "Format example", write content.
  411. # Context
  412. ## 任务
  413. 你的任务是根据用户的请求,结合以下“课程信息”包含的子条目(“课程标题”,“分类”以及“年级”),向用户输出相关的练习题目,将结果以有序列表的形式返回给用户。
  414. 课程信息
  415. 课程标题:${this.courseDetail.title}
  416. 分类:${this.courseDetail.name?this.courseDetail.name:"无"}
  417. 学生年级:${this.courseDetail.classname?this.courseDetail.classname:"无"}
  418. ## 规则
  419. 1. 练习题目内容应该与“课程信息”相关,避免提供无关的信息。
  420. 2. 当课程信息中的子条目内容为“无”时,无视这些条目进行输出即可。
  421. 3. 一步步思考如何根据“课程信息”输出“练习题目”,但是你不需要输出“练习题目”以外的内容。
  422. 4.输出练习题目后,提示用户“希望这些题目能帮到你,如果需要其他类型题目或者更多题目,可以随时向我输入你的需求”
  423. ## 格式要求
  424. 1. 输出应包括3道相关的“练习题目”。
  425. 2. 练习题目默认只包含3道4选1的单选题,除非用户在提示词中更具体地指明了题目类型和数量。
  426. 3. 练习题目应以有序列表形式呈现,每个建议包括关键词和简短描述。
  427. # Format example
  428. ## 课程标题:垃圾回收
  429. 分类:无
  430. 年级:无
  431. 1. 垃圾回收的主要目的是: a) 增加垃圾的数量 b) 减少垃圾的数量 c) 提高垃圾的质量 d) 增加垃圾的种类
  432. 2. 以下哪种垃圾是可以回收的? a) 食物残渣 b) 塑料瓶 c) 湿纸巾 d) 动物粪便
  433. 3. 垃圾分类中,玻璃瓶通常属于哪一类? a) 可回收垃圾 b) 厨余垃圾 c) 有害垃圾 d) 其他垃圾
  434. `;
  435. } else if (_text == "智能总结") {
  436. _msg = `
  437. NOTICE
  438. Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
  439. ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
  440. Instruction: Based on the context, follow "Format example", write content.
  441. # Context
  442. ## 任务
  443. 你的任务是根据用户的请求,结合以下“课程信息”包含的子条目(“课程标题”,“主题”,“学科”,“年级”以及“学习内容”),对课程进行课程总结,请根据输出格式将内容输出给用户。
  444. 课程信息
  445. 课程标题:${this.courseDetail.title}
  446. 分类:${this.courseDetail.name?this.courseDetail.name:"无"}
  447. 学生年级:${this.courseDetail.classname?this.courseDetail.classname:"无"}
  448. 学习内容:${this.exportCourse()}
  449. ## 规则
  450. 1. “课程总结”内容应该与“课程信息”相关,避免提供无关的信息。
  451. 2. 当课程信息中的子条目内容为“无”时,无视这些条目进行输出即可。
  452. 3. 一步步思考如何根据“课程信息”输出“课程总结”。
  453. ## 格式要求
  454. 1. 以无序列表的形式输出“课程信息”中的“课程标题”,“主题”,“学科”以及“年级”,若这些条目中的内容为“无”,则不需要输出
  455. ## 示例
  456. 课程标题:垃圾回收
  457. 分类:自然科学 语文 数学
  458. 年级:无
  459. 学习内容:垃圾回收是指将废弃物重新加工利用的过程,这不仅有助于减少环境污染,还能节约资源。首先,垃圾回收可以减少填埋场的压力,避免土地资源的浪费和地下水的污染。其次,通过回收纸张、塑料、金属等材料,我们可以减少对原材料的需求,从而保护森林、矿产等自然资源。此外,垃圾回收还能减少温室气体的排放,缓解气候变化。引导学生思考垃圾回收的意义,可以从以下几个方面入手:一是环境保护,垃圾回收能有效减少污染,保护生态系统;二是资源节约,通过回收利用,我们可以减少对自然资源的消耗;三是经济效益,垃圾回收产业可以创造就业机会,促进经济发展。通过这些思考,学生们可以更深刻地理解垃圾回收的重要性,并在日常生活中积极参与到垃圾分类和回收的行动中来,共同为可持续发展贡献力量。
  460. # Format example
  461. ## 课程标题:垃圾回收
  462. 分类:自然科学 语文 数学
  463. 年级:无
  464. 学习内容:学习内容包含一份引导学生思考为何要进行垃圾回收的文档材料
  465. `;
  466. }
  467. if (!_msg) return;
  468. // console.log(_msg)
  469. this.chatLoading = true;
  470. let _uuid = uuidv4();
  471. this.chatList.push({
  472. role: "user",
  473. content: `${_text}`,
  474. uid: _uuid,
  475. AI: "AI",
  476. aiContent: "",
  477. oldContent: "",
  478. isShowSynchronization: false,
  479. filename: "",
  480. index: this.chatList.length,
  481. is_mind_map: false,
  482. loading: true
  483. });
  484. this.scrollBottom();
  485. let params = {
  486. model: "gpt-3.5-turbo",
  487. temperature: 0,
  488. max_tokens: 4096,
  489. top_p: 1,
  490. frequency_penalty: 0,
  491. presence_penalty: 0,
  492. messages: [{ role: "user", content: _msg }],
  493. uid: _uuid,
  494. mind_map_question: ""
  495. };
  496. this.text = "";
  497. this.ajax
  498. .post("https://gpt4.cocorobo.cn/chat", params)
  499. .then(res => {
  500. if (res.data.FunctionResponse.result == "发送成功") {
  501. } else {
  502. this.$message.warning(res.data.FunctionResponse.result);
  503. this.chatLoading = false;
  504. }
  505. })
  506. .catch(e => {
  507. console.log(e);
  508. this.chatLoading = false;
  509. });
  510. this.getAiContent(_uuid);
  511. // this.send(text);
  512. },
  513. // sendImage() {
  514. // this.$message.info("发送图片");
  515. // },
  516. // sendVideo() {
  517. // this.$message.info("发送视频");
  518. // },
  519. scrollBottom() {
  520. this.$nextTick(() => {
  521. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  522. });
  523. }
  524. },
  525. mounted() {
  526. this.getChatList().then(_ => {
  527. this.scrollBottom();
  528. });
  529. }
  530. };
  531. </script>
  532. <style scoped>
  533. .task {
  534. width: 100%;
  535. height: 100%;
  536. box-sizing: border-box;
  537. }
  538. .taskTop {
  539. width: 100%;
  540. height: 280px;
  541. box-sizing: border-box;
  542. padding: 10px;
  543. overflow-x: hidden;
  544. }
  545. .tt_title {
  546. font-size: 18px;
  547. font-weight: bold;
  548. margin-bottom: 5px;
  549. }
  550. .tt_item {
  551. width: 100%;
  552. height: auto;
  553. margin-top: 10px;
  554. }
  555. .tt_i_title {
  556. display: flex;
  557. justify-content: space-between;
  558. align-items: center;
  559. }
  560. .tt_i_title > span:nth-of-type(2) {
  561. box-sizing: border-box;
  562. padding: 0 10px;
  563. height: 25px;
  564. background-color: #effcf5;
  565. color: #83e0af;
  566. }
  567. .tt_i_box {
  568. width: 100%;
  569. height: auto;
  570. display: flex;
  571. margin-top: 10px;
  572. justify-content: space-between;
  573. }
  574. .tt_i_box > img {
  575. width: 100%;
  576. height: 50px;
  577. }
  578. .tt_i_b_item {
  579. width: auto;
  580. height: 90px;
  581. background-color: #f6f9ff;
  582. }
  583. .tt_i_b_title {
  584. width: 100%;
  585. height: 30px;
  586. display: flex;
  587. justify-content: center;
  588. align-items: center;
  589. box-sizing: border-box;
  590. border: solid 1px #e0eafb;
  591. color: #626466;
  592. }
  593. .tt_i_b_box {
  594. width: auto;
  595. height: 60px;
  596. box-sizing: border-box;
  597. border: solid 1px #e0eafb;
  598. border-top: none;
  599. display: flex;
  600. }
  601. .tt_i_b_b_item {
  602. width: 70px;
  603. height: 100%;
  604. display: flex;
  605. flex-direction: column;
  606. justify-content: center;
  607. align-items: center;
  608. border-left: solid 1px #e0eafb;
  609. }
  610. .tt_i_b_box > .tt_i_b_b_item:nth-of-type(1) {
  611. border-left: none;
  612. }
  613. .tt_i_b_b_item > div {
  614. font-size: 14px;
  615. color: #949599;
  616. }
  617. .tt_i_b_b_item > span {
  618. font-weight: bold;
  619. }
  620. .tt_i_b_b_item > span > span {
  621. font-size: 12px;
  622. font-weight: 200;
  623. }
  624. .t_top {
  625. width: 100%;
  626. height: calc(100% - 90px);
  627. /* height: calc(100% - 370px); */
  628. overflow: auto;
  629. box-sizing: border-box;
  630. padding: 20px 0;
  631. }
  632. .t_t_chat {
  633. width: 100%;
  634. display: flex;
  635. box-sizing: border-box;
  636. padding: 10px;
  637. flex-direction: column;
  638. }
  639. .t_t_chat > div {
  640. display: flex;
  641. align-items: flex-start;
  642. width: 100%;
  643. }
  644. .t_t_c_user {
  645. box-sizing: border-box;
  646. padding-left: 35px;
  647. }
  648. .t_t_c_u_left {
  649. width: 90%;
  650. height: auto;
  651. }
  652. .t_t_c_u_l_content {
  653. width: auto;
  654. max-width: 100%;
  655. height: auto;
  656. box-sizing: border-box;
  657. padding: 10px;
  658. color: white;
  659. background-color: #3681fc;
  660. border-radius: 8px 2px 8px 8px;
  661. white-space: pre-line;
  662. }
  663. .t_t_c_u_l_time {
  664. width: 100%;
  665. display: flex;
  666. justify-content: flex-end;
  667. font-size: 12px;
  668. color: #9f9f9f;
  669. margin-top: 5px;
  670. }
  671. .t_t_c_u_right {
  672. width: 35px;
  673. height: 35px;
  674. display: flex;
  675. justify-content: center;
  676. margin-left: 5px;
  677. }
  678. .t_t_c_u_right > span {
  679. width: 32px;
  680. height: 32px;
  681. display: flex;
  682. justify-content: center;
  683. align-items: center;
  684. color: white;
  685. background-color: #3681fc;
  686. border-radius: 50%;
  687. }
  688. .t_t_c_ai {
  689. margin-top: 10px;
  690. box-sizing: border-box;
  691. padding-right: 35px;
  692. }
  693. .t_t_c_a_right {
  694. min-width: 90%;
  695. height: auto;
  696. }
  697. .t_t_c_a_r_content {
  698. width: auto;
  699. max-width: 100%;
  700. height: auto;
  701. box-sizing: border-box;
  702. padding: 10px;
  703. background-color: #f6f8ff;
  704. border-radius: 2px 8px 8px 8px;
  705. white-space: pre-line;
  706. word-break: break-all;
  707. }
  708. .t_t_c_a_r_content2 {
  709. background-color: #f6f8ff;
  710. width: 100%;
  711. height: auto;
  712. box-sizing: border-box;
  713. padding: 10px;
  714. border-radius: 2px 8px 8px 8px;
  715. white-space: pre-line;
  716. box-shadow: 0 0px 10px #c5cbee;
  717. }
  718. .t_t_c_a_r_c_title {
  719. display: flex;
  720. align-items: center;
  721. }
  722. .t_t_c_a_r_c_title > img {
  723. width: 16px;
  724. height: 16px;
  725. }
  726. .t_t_c_a_r_c_item {
  727. width: 100%;
  728. height: auto;
  729. box-sizing: border-box;
  730. padding: 10px;
  731. background-color: #ffffff;
  732. border-radius: 5px;
  733. margin-top: 5px;
  734. color: #666666;
  735. font-size: 14px;
  736. cursor: pointer;
  737. }
  738. .t_t_c_a_r_c_item:hover {
  739. border: solid #b8d2fe 1px;
  740. box-shadow: 0 0 5px 2px #b8d2fe;
  741. }
  742. .t_t_c_a_r_c_title > span {
  743. font-weight: bold;
  744. }
  745. .t_t_c_a_r_time {
  746. width: 100%;
  747. display: flex;
  748. justify-content: flex-start;
  749. font-size: 12px;
  750. color: #9f9f9f;
  751. margin-top: 5px;
  752. }
  753. .t_t_c_a_left {
  754. width: 35px;
  755. height: 35px;
  756. display: flex;
  757. justify-content: center;
  758. margin-right: 5px;
  759. }
  760. .t_t_c_a_left > span {
  761. width: 32px;
  762. height: 32px;
  763. display: flex;
  764. justify-content: center;
  765. align-items: center;
  766. color: white;
  767. background-color: #3681fc;
  768. border-radius: 50%;
  769. }
  770. .t_bottom {
  771. width: 100%;
  772. height: 90px;
  773. display: flex;
  774. flex-direction: column;
  775. justify-content: space-between;
  776. }
  777. .t_b_btnArea {
  778. width: 100%;
  779. height: 30px;
  780. display: flex;
  781. align-items: center;
  782. box-sizing: border-box;
  783. padding: 0 10px;
  784. overflow-y: hidden;
  785. }
  786. .t_b_ba_item {
  787. width: auto;
  788. box-sizing: border-box;
  789. padding: 0 10px;
  790. height: 25px;
  791. background-color: white;
  792. display: flex;
  793. justify-content: center;
  794. align-items: center;
  795. /* 阴影 */
  796. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
  797. border-radius: 15px;
  798. font-size: 14px;
  799. cursor: pointer;
  800. margin-right: 10px;
  801. white-space: nowrap;
  802. transition: 0.3s;
  803. }
  804. .t_b_ba_item:hover {
  805. background-color: rgb(236, 236, 236);
  806. }
  807. .t_b_inputArea {
  808. width: 100%;
  809. height: 55px;
  810. box-sizing: border-box;
  811. border-top: solid 1px #ededed;
  812. display: flex;
  813. justify-content: space-between;
  814. align-items: center;
  815. padding-right: 10px;
  816. }
  817. .t_b_tape {
  818. width: 35px;
  819. height: 35px;
  820. background: url("../../../assets/icon/course/tape.png") no-repeat;
  821. background-size: 50% 60%;
  822. background-position: center;
  823. cursor: pointer;
  824. }
  825. .t_b_input {
  826. /* width: 75%; */
  827. flex: 1;
  828. height: 45px;
  829. background-color: #f3f3f3;
  830. border-radius: 50px;
  831. margin: 0 10px;
  832. display: flex;
  833. overflow: hidden;
  834. align-items: center;
  835. }
  836. .t_b_i_left {
  837. /* width: calc(100% - 45px); */
  838. width: 100%;
  839. line-height: 45px;
  840. height: 100%;
  841. }
  842. .t_b_i_left >>> .el-input__inner {
  843. border: none;
  844. background-color: #f3f3f3;
  845. outline: none;
  846. border-radius: 50px 0 0 50px;
  847. }
  848. .t_b_i_right {
  849. width: 45px;
  850. height: 45px;
  851. display: flex;
  852. justify-content: center;
  853. align-items: center;
  854. }
  855. .t_b_i_right > span {
  856. width: 35px;
  857. height: 35px;
  858. background: url("../../../assets/icon/course/file.png") no-repeat;
  859. background-size: 50% 60%;
  860. background-position: center;
  861. cursor: pointer;
  862. }
  863. .t_b_btn {
  864. width: 40px;
  865. height: 40px;
  866. background-color: #3681fc;
  867. display: flex;
  868. justify-content: center;
  869. align-items: center;
  870. border-radius: 50%;
  871. cursor: pointer;
  872. }
  873. .t_b_btn > span {
  874. width: 30px;
  875. height: 30px;
  876. background: url("../../../assets/icon/course/send.png") no-repeat;
  877. background-size: 70% 70%;
  878. background-position: center;
  879. }
  880. td,
  881. th {
  882. padding: 10px;
  883. }
  884. </style>