taskArea.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <template>
  2. <div class="task">
  3. <div class="taskTop">
  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.role =='user'">
  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.time}}</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" v-if="item.role =='ai'">
  64. <div class="t_t_c_a_left">
  65. <span>Ai</span>
  66. </div>
  67. <div class="t_t_c_a_right">
  68. <div class="t_t_c_a_r_content" v-loading="loading && index == chatList.length - 1" v-html="item.content"></div>
  69. <div class="t_t_c_a_r_time">{{item.time}}</div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="t_bottom">
  75. <div class="t_b_btnArea">
  76. <!-- <div class="s_b_ba-item" @click.stop="choiceRole()">选择角色</div> -->
  77. <div class="t_b_ba_item" @click="sendType('智能总结')">智能总结</div>
  78. <div class="t_b_ba_item" @click="sendType('智能出题')">智能出题</div>
  79. <!-- <div class="t_b_ba_item" @click="sendType('优秀标兵')">优秀标兵</div> -->
  80. <div class="t_b_ba_item" @click="sendType('扩展知识')">扩展知识</div>
  81. </div>
  82. <div class="t_b_inputArea">
  83. <div class="t_b_tape" @click="goTape()"></div>
  84. <div class="t_b_input">
  85. <el-input :disabled="loading" @keyup.enter.native="send()" class="t_b_i_left" v-model="text"></el-input>
  86. <div class="t_b_i_right" @click="sendFile()">
  87. <span></span>
  88. </div>
  89. </div>
  90. <div class="t_b_btn" @click="send()">
  91. <span></span>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </template>
  97. <script>
  98. // import { Loading } from 'element-ui';
  99. export default {
  100. data(){
  101. return{
  102. text:"",
  103. loading:false,
  104. chatList:[
  105. {
  106. role:"ai",
  107. content:`您好,有什么可以帮助您的吗?`,
  108. time:new Date().toLocaleString().replace(/\//ig,'-')
  109. },
  110. // {
  111. // role:"user",
  112. // content:"正十三边形的每个角是多少度?",
  113. // time:"2023-11-11 11:10:11"
  114. // },
  115. // {
  116. // role:"ai",
  117. // content:`小朋友们,你们知道正十三边形吗?就像我们班有13个好朋友站成一个圈圈一样。如果我们想知道每个人转身看向下一个人需要转多少度,我们可以这样想:首先,所有朋友手拉手围成的圈圈是360度,对吧?但是,我们不能直接算每个人转身的角度,因为那是外面的角度,我们要算里面的角度,就像每个人转身时脚尖指向圈心的角度。
  118. // 我们先用一个小技巧,算出所有内角加起来是多少度。方法是:(13-2)乘以180度,得到1980度。这是因为,想象成一个多边形,它可以分成11个三角形,每个三角形的角度和是180度。
  119. // 然后,我们把1980度平分给13个角,就是每个角的度数了。算一算,1980除以13等于152度。所以,正十三边形的每个角是152度。就像每个人转身看下一个朋友,每个人需要转152度一样。`,
  120. // time:"2023-11-11 11:10:11"
  121. // },
  122. ],
  123. }
  124. },
  125. methods: {
  126. choiceRole(){
  127. this.cardType = 1;
  128. },
  129. sendFile(){
  130. if (this.loading) return this.$message.info("请稍等");
  131. this.$message.info("点击了附件")
  132. },
  133. goTape(){
  134. if (this.loading) return this.$message.info("请稍等");
  135. this.$message.info(`点击了语音`)
  136. },
  137. send(){
  138. if (this.loading) return this.$message.info("请稍等");
  139. if(this.text.trim().length==0)return this.$message.info("请输入内容")
  140. this.loading = true;
  141. this.chatList.push({
  142. role:"user",
  143. content:this.text,
  144. time:new Date().toLocaleString().replace(/\//ig,'-')
  145. })
  146. this.chatList.push({
  147. role:"ai",
  148. content:"",
  149. time:new Date().toLocaleString().replace(/\//ig,'-')
  150. })
  151. this.$nextTick(() => {
  152. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  153. });;
  154. setTimeout(()=>{
  155. let aiContent="对不起,这个问题我回答不了。"
  156. switch(this.text){
  157. case "智能总结":
  158. aiContent=`在这节课上,教师和学生们围绕垃圾问题进行了深入的讨论和实践活动。截止到目前为止,课程已经教学了以下内容:
  159. 1.环境调查与问题识别:学生们首先进行了实地调查,发现了大鹏新区存在的环境问题,特别是垃圾问题。学生们观察到菜市场和路边有大量垃圾堆积。
  160. 2.垃圾产生的数据分析:教师引导学生计算家庭和学校垃圾产生的总量,并通过比喻(如成年公羊和非洲大象的重量)来形象地表达垃圾的重量,增强学生对垃圾量的直观理解。
  161. 3.垃圾处理方法的探讨:学生们讨论了垃圾的处理方式,包括填埋、焚烧发电以及回收利用。他们探讨了这些方法的优缺点,如填埋会占用大量土地并可能污染土地和水源,焚烧则可能导致空气污染。
  162. 4.垃圾分类的重要性:课程强调了垃圾分类的重要性,并通过实际分类活动让学生们理解不同垃圾的处理方式。学生们学习了如何将垃圾分为可回收垃圾、厨余垃圾、有害垃圾和其他垃圾,并探讨了各类垃圾的具体处理方法。
  163. 5.实际行动的倡议:教师鼓励学生从减少一次性用品的使用开始,采取实际行动来减少垃圾产生。学生们提出了多种减少和重新利用垃圾的创意方法,如将剩饭剩菜喂给小动物或制作成堆肥。
  164. 总结来说,这节课通过实地调查、数据分析和小组讨论等多种教学方法,有效地提高了学生们对环境保护和垃圾处理问题的认识和参与度。学生们通过实际操作和讨论,学习了垃圾分类的技能,并对垃圾处理的各种方法有了深入的了解和评价。`
  165. break;
  166. case "智能出题":
  167. aiContent = `选择题:下列哪一项应该被归类为可回收物?
  168. A. 废弃的塑料袋
  169. B. 污染严重的厨房纸巾
  170. C. 破碎的玻璃杯
  171. D. 废旧的电池`
  172. break;
  173. case "优秀标兵":
  174. aiContent = `这节课的学习数据如下:
  175. <img src='https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711713252928457.png' style="max-width:100%">
  176. 1.陈小春:陈小春同学的作业完成率接近完美,考试成绩也非常优秀,课堂参与度非常积极,项目贡献被评为优秀。综合各方面表现,陈小春在学习上非常突出,是一个全面发展的学生。
  177. 2.李雷:李雷同学的作业完成率较高,考试成绩良好,课堂参与度积极,项目贡献优秀。李雷在学习成绩和课堂表现上表现突出,是一个学习能力强的学生。
  178. 3.林婷婷:虽然林婷婷同学的作业完成率略低于陈小春和李雷,但考试成绩与李雷持平,且课堂参与度积极,项目贡献良好。林婷婷在学习成绩上表现稳定,是一个有潜力的学生。`;
  179. break;
  180. case "扩展知识":
  181. aiContent = `在这节关于解决垃圾问题的科学课上,学生们已经通过实际的调查和计算,以及对垃圾分类和处理方法的讨论,获得了很多实用的知识。为了进一步扩展这些知识,以下是一些可以在课堂上引入的相关主题和活动:
  182. 1.全球垃圾处理策略对比:
  183. a.研究并讨论不同国家如何处理垃圾,例如德国、日本和瑞士的垃圾分类和处理系统。这可以帮助学生了解不同文化和政策环境下的环保策略。
  184. b.学生可以制作海报或演示文稿,展示每个国家的垃圾处理方法,并讨论其优缺点。
  185. 2.垃圾减量的科技创新:
  186. a.探索和讨论新技术如何帮助减少垃圾产生,例如生物降解材料、可回收包装设计等。
  187. b.邀请一个环保技术公司的代表来讲述他们如何通过创新技术来处理或减少垃圾。
  188. 3.实地考察:
  189. a.组织一次学校附近的垃圾处理设施或回收中心的参观。让学生亲眼看到垃圾是如何被分类、处理和回收的。
  190. b.在参观后,学生可以讨论他们的观察结果,以及这些设施如何影响社区和环境。
  191. 4.环保项目设计:
  192. a.鼓励学生设计自己的环保项目,如校园内的垃圾分类宣传、制作可持续材料的手工艺品等。
  193. b.这些项目可以在学校的科学展览会上展出,或者在校园网站上分享。
  194. 5.家庭和社区的环保行动:
  195. a.让学生调查并记录他们家庭一周内的垃圾产生和处理情况,然后讨论如何改进。
  196. b.学生可以创建一个“绿色挑战”活动,鼓励家庭成员减少垃圾产生,如使用可重复使用的购物袋、减少一次性产品使用等。
  197. 通过这些扩展活动,学生不仅能够加深对垃圾问题的理解,还能学习到如何在日常生活中实际应用这些知识,从而更有效地保护我们的环境。`;
  198. break;
  199. }
  200. this.chatList[this.chatList.length - 1].content = aiContent;
  201. this.chatList[
  202. this.chatList.length - 1
  203. ].time = new Date().toLocaleString().replace(/\//gi, "-");
  204. // this.chatList.push({
  205. // role:"ai",
  206. // content:aiContent,
  207. // time:new Date().toLocaleString().replace(/\//ig,'-')
  208. // })
  209. this.text = "";
  210. this.$nextTick(() => {
  211. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  212. });;
  213. this.loading = false;
  214. },5000)
  215. // this.chatList.push({
  216. // role:"user",
  217. // content:this.text,
  218. // time:"2023-11-11 11:10:11"
  219. // },{
  220. // role:"ai",
  221. // content:`小朋友,你真棒!`,//这里需要调用接口
  222. // time:"2023-11-11 11:10:11"
  223. // })
  224. // this.text = "";
  225. // // 元素滚动条触底
  226. // this.$nextTick(() => {
  227. // this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  228. // });;
  229. },
  230. sendType(text){
  231. if (this.loading) return this.$message.info("请稍等");
  232. this.text = text;
  233. this.send();
  234. },
  235. sendImage(){
  236. this.$message.info("发送图片")
  237. },
  238. sendVideo(){
  239. this.$message.info("发送视频")
  240. },
  241. },
  242. }
  243. </script>
  244. <style scoped>
  245. .task{
  246. width: 100%;
  247. height: 100%;
  248. box-sizing: border-box;
  249. }
  250. .taskTop{
  251. width: 100%;
  252. height: 280px;
  253. box-sizing: border-box;
  254. padding: 10px;
  255. overflow-x: hidden;
  256. }
  257. .tt_title{
  258. font-size: 18px;
  259. font-weight: bold;
  260. margin-bottom: 5px;
  261. }
  262. .tt_item{
  263. width: 100%;
  264. height: auto;
  265. margin-top: 10px;
  266. }
  267. .tt_i_title{
  268. display: flex;
  269. justify-content: space-between;
  270. align-items: center;
  271. }
  272. .tt_i_title>span:nth-of-type(2){
  273. box-sizing: border-box;
  274. padding: 0 10px;
  275. height: 25px;
  276. background-color: #EFFCF5;
  277. color: #83E0AF;
  278. }
  279. .tt_i_box{
  280. width: 100%;
  281. height: auto;
  282. display: flex;
  283. margin-top: 10px;
  284. justify-content: space-between;
  285. }
  286. .tt_i_box>img{
  287. width: 100%;
  288. height: 50px;
  289. }
  290. .tt_i_b_item{
  291. width: auto;
  292. height: 90px;
  293. background-color: #F6F9FF;
  294. }
  295. .tt_i_b_title{
  296. width: 100%;
  297. height: 30px;
  298. display: flex;
  299. justify-content: center;
  300. align-items: center;
  301. box-sizing: border-box;
  302. border: solid 1px #E0EAFB;
  303. color: #626466;
  304. }
  305. .tt_i_b_box{
  306. width: auto;
  307. height: 60px;
  308. box-sizing: border-box;
  309. border: solid 1px #E0EAFB;
  310. border-top: none;
  311. display: flex;
  312. }
  313. .tt_i_b_b_item{
  314. width: 70px;
  315. height: 100%;
  316. display: flex;
  317. flex-direction: column;
  318. justify-content: center;
  319. align-items: center;
  320. border-left: solid 1px #E0EAFB;
  321. }
  322. .tt_i_b_box>.tt_i_b_b_item:nth-of-type(1){
  323. border-left:none
  324. }
  325. .tt_i_b_b_item>div{
  326. font-size: 14px;
  327. color: #949599;
  328. }
  329. .tt_i_b_b_item>span{
  330. font-weight: bold;
  331. }
  332. .tt_i_b_b_item>span>span{
  333. font-size: 12px;
  334. font-weight: 200;
  335. }
  336. .t_top{
  337. width: 100%;
  338. height: calc(100% - 370px);
  339. overflow: auto;
  340. box-sizing: border-box;
  341. padding: 20px 0;
  342. }
  343. .t_t_chat{
  344. width: 100%;
  345. display: flex;
  346. box-sizing: border-box;
  347. padding: 10px;
  348. }
  349. .t_t_chat>div{
  350. display: flex;
  351. align-items: flex-start;
  352. width: 100%;
  353. }
  354. .t_t_c_user{
  355. box-sizing: border-box;
  356. padding-left: 35px;
  357. }
  358. .t_t_c_u_left{
  359. width: 90%;
  360. height: auto;
  361. }
  362. .t_t_c_u_l_content{
  363. width: auto;
  364. max-width: 100%;
  365. height: auto;
  366. box-sizing: border-box;
  367. padding: 10px;
  368. color: white;
  369. background-color: #3681FC;
  370. border-radius: 8px 2px 8px 8px;
  371. white-space: pre-line
  372. }
  373. .t_t_c_u_l_time{
  374. width: 100%;
  375. display: flex;
  376. justify-content: flex-end;
  377. font-size: 12px;
  378. color: #9F9F9F;
  379. margin-top: 5px;
  380. }
  381. .t_t_c_u_right{
  382. width: 35px;
  383. height: 35px;
  384. display: flex;
  385. justify-content: center;
  386. margin-left: 5px
  387. }
  388. .t_t_c_u_right>span{
  389. width: 32px;
  390. height: 32px;
  391. display: flex;
  392. justify-content: center;
  393. align-items: center;
  394. color: white;
  395. background-color: #3681FC;
  396. border-radius: 50%;;
  397. }
  398. .t_t_c_ai{
  399. box-sizing: border-box;
  400. padding-right: 35px;
  401. }
  402. .t_t_c_a_right{
  403. min-width: 90%;
  404. height: auto;
  405. }
  406. .t_t_c_a_r_content{
  407. width: auto;
  408. max-width: 100%;
  409. height: auto;
  410. box-sizing: border-box;
  411. padding: 10px;
  412. background-color: #F6F8FF;
  413. border-radius: 2px 8px 8px 8px;
  414. white-space: pre-line;
  415. word-break: break-all;
  416. }
  417. .t_t_c_a_r_content2{
  418. background-color: #F6F8FF;
  419. width: 100%;
  420. height: auto;
  421. box-sizing: border-box;
  422. padding: 10px;
  423. border-radius: 2px 8px 8px 8px;
  424. white-space: pre-line;
  425. box-shadow: 0 0px 10px #c5cbee;
  426. }
  427. .t_t_c_a_r_c_title{
  428. display: flex;
  429. align-items: center;
  430. }
  431. .t_t_c_a_r_c_title>img{
  432. width: 16px;
  433. height: 16px;
  434. }
  435. .t_t_c_a_r_c_item{
  436. width: 100%;
  437. height: auto;
  438. box-sizing: border-box;
  439. padding: 10px;
  440. background-color: #FFFFFF;
  441. border-radius: 5px;
  442. margin-top: 5px;
  443. color: #666666;
  444. font-size: 14px;
  445. cursor: pointer;
  446. }
  447. .t_t_c_a_r_c_item:hover{
  448. border: solid #B8D2FE 1px;
  449. box-shadow: 0 0 5px 2px #B8D2FE;
  450. }
  451. .t_t_c_a_r_c_title>span{
  452. font-weight: bold;
  453. }
  454. .t_t_c_a_r_time{
  455. width: 100%;
  456. display: flex;
  457. justify-content: flex-start;
  458. font-size: 12px;
  459. color: #9F9F9F;
  460. margin-top: 5px;
  461. }
  462. .t_t_c_a_left{
  463. width: 35px;
  464. height: 35px;
  465. display: flex;
  466. justify-content: center;
  467. margin-right: 5px
  468. }
  469. .t_t_c_a_left>span{
  470. width: 32px;
  471. height: 32px;
  472. display: flex;
  473. justify-content: center;
  474. align-items: center;
  475. color: white;
  476. background-color: #3681FC;
  477. border-radius: 50%;
  478. }
  479. .t_bottom{
  480. width: 100%;
  481. height: 90px;
  482. display: flex;
  483. flex-direction: column;
  484. justify-content: space-between;
  485. }
  486. .t_b_btnArea{
  487. width: 100%;
  488. height: 30px;
  489. display: flex;
  490. align-items: center;
  491. box-sizing: border-box;
  492. padding: 0 10px;
  493. overflow-y: hidden;
  494. }
  495. .t_b_ba_item{
  496. width: auto;
  497. box-sizing: border-box;
  498. padding: 0 10px;
  499. height: 25px;
  500. background-color: white;
  501. display: flex;
  502. justify-content: center;
  503. align-items: center;
  504. /* 阴影 */
  505. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
  506. border-radius: 15px;
  507. font-size: 14px;
  508. cursor: pointer;
  509. margin-right: 10px;
  510. white-space: nowrap;
  511. transition: .3s;
  512. }
  513. .t_b_ba_item:hover{
  514. background-color: rgb(236, 236, 236);
  515. }
  516. .t_b_inputArea{
  517. width: 100%;
  518. height: 55px;
  519. box-sizing: border-box;
  520. border-top: solid 1px #EDEDED;
  521. display: flex;
  522. justify-content: center;
  523. align-items: center;
  524. }
  525. .t_b_tape{
  526. width: 35px;
  527. height: 35px;
  528. background: url("../../../assets/icon/course/tape.png") no-repeat;
  529. background-size: 50% 60%;
  530. background-position: center;
  531. cursor: pointer;
  532. }
  533. .t_b_input{
  534. width: 65%;
  535. height: 45px;
  536. background-color: #F3F3F3;
  537. border-radius: 50px;
  538. margin: 0 10px;
  539. display: flex;
  540. align-items: center;
  541. }
  542. .t_b_i_left{
  543. width: calc(100% - 45px);
  544. height: 100%;
  545. }
  546. .t_b_i_left>>>.el-input__inner{
  547. border: none;
  548. background-color: #F3F3F3;
  549. outline: none;
  550. border-radius: 50px 0 0 50px;
  551. }
  552. .t_b_i_right{
  553. width: 45px;
  554. height: 45px;
  555. display: flex;
  556. justify-content: center;
  557. align-items: center;
  558. }
  559. .t_b_i_right>span{
  560. width: 35px;
  561. height: 35px;
  562. background: url("../../../assets/icon/course/file.png") no-repeat;
  563. background-size: 50% 60%;
  564. background-position: center;
  565. cursor: pointer;
  566. }
  567. .t_b_btn{
  568. width: 40px;
  569. height: 40px;
  570. background-color: #3681FC;
  571. display: flex;
  572. justify-content: center;
  573. align-items: center;
  574. border-radius: 50%;
  575. cursor: pointer;
  576. }
  577. .t_b_btn>span{
  578. width: 30px;
  579. height: 30px;
  580. background: url("../../../assets/icon/course/send.png") no-repeat;
  581. background-size: 70% 70%;
  582. background-position: center;
  583. }
  584. td,th{
  585. padding: 10px;
  586. }
  587. </style>