searchArea.vue 91 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909
  1. <template>
  2. <div class="search">
  3. <div class="s_top" ref="chatRef">
  4. <div class="s_t_chat" v-for="(item, index) in chatList" :key="index">
  5. <div
  6. class="s_t_c_user"
  7. v-if="
  8. item.content &&
  9. item.content != 'wanSearch' &&
  10. item.content != 'getImage' &&
  11. item.content !='addAsk'
  12. "
  13. >
  14. <div class="s_t_c_u_left">
  15. <div class="s_t_c_u_l_content">{{ item.content }}</div>
  16. <div class="s_t_c_u_l_time">{{ item.createtime }}</div>
  17. </div>
  18. <div class="s_t_c_u_right">
  19. <span>我</span>
  20. </div>
  21. </div>
  22. <div
  23. class="s_t_c_ai"
  24. v-if="item.content != 'wanSearch' && item.content != 'getImage' && item.content !='addAsk'"
  25. >
  26. <div class="s_t_c_a_left">
  27. <span>Ai</span>
  28. </div>
  29. <div class="s_t_c_a_right">
  30. <div
  31. class="s_t_c_a_r_content"
  32. v-if="pan(item.aiContent).length"
  33. style="display: flex;justify-content: space-between;flex-wrap: wrap;"
  34. >
  35. <div
  36. v-if="!pan(item.aiContent).length"
  37. class="d_t_c_a_r_content"
  38. v-loading="item.loading"
  39. v-html="item.aiContent"
  40. ></div>
  41. <div
  42. v-else
  43. v-for="(i, index) in pan(item.aiContent)"
  44. :key="index"
  45. style="position: relative;"
  46. class="d_t_c_a_r_c_img"
  47. >
  48. <img
  49. style="width: 130px;height: 130px;object-fit: cover;"
  50. :src="i.image"
  51. alt=""
  52. @click="previewImg(i.image)"
  53. />
  54. <span class="download_image" @click.stop="download(i.image)">
  55. <img
  56. :src="require('../../../assets/icon/fileIcon/download.png')"
  57. />
  58. </span>
  59. </div>
  60. <!-- {{ item }} -->
  61. <div style="margin-top: 10px;width: 100%;display: flex;justify-content: end;" v-if="pan(item.aiContent).length > 1 && chatList.length-2 == index" >
  62. <img style="cursor: pointer;" @click="resetImg(item.content)" src="../../../assets/icon/course/resImg.png" alt="">
  63. </div>
  64. </div>
  65. <div
  66. v-else
  67. class="s_t_c_a_r_content"
  68. v-loading="item.loading"
  69. v-html="htmlContent(item.aiContent)"
  70. ></div>
  71. <!-- {{ Array.isArray(JSON.parse(item.aiContent)) }} -->
  72. <!-- {{ JSON.parse(item) }} -->
  73. <div v-if="!pan(item.aiContent).length" class="aiCopy">
  74. <img
  75. @click="onCopy(item.aiContent)"
  76. style="width: 30px;"
  77. src="../../../assets/icon/course/copyTxt.png"
  78. alt=""
  79. />
  80. </div>
  81. <!-- <div
  82. class="s_t_c_a_r_contentImage"
  83. v-loading="item.loading"
  84. >
  85. <span style="margin-bottom: 10px;">为您找到以下图片: {{ item.content }}</span> -->
  86. <!-- {{ item.aiContent }} -->
  87. <!-- <img
  88. v-for="(i, index) in item.aiContent"
  89. @click.stop="$hevueImgPreview(item)"
  90. :key="index"
  91. :src="i.image"
  92. /> -->
  93. <!-- <div class="imgNumberBlock">
  94. <div class="imgNumber" v-for="(i,index) in imgNumList" :key="index+'b'">
  95. {{ i }}
  96. </div>
  97. <div class="imgNumber" style="background: none;">
  98. <img style="width: 36px;height: 30px;" src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame%20131715569413607.png" alt="">
  99. </div>
  100. </div> -->
  101. <!-- </div> -->
  102. <!-- <div class="s_t_c_a_r_time">{{ item.createtime }}</div> -->
  103. </div>
  104. </div>
  105. <div class="s_t_chat" v-if="item.content == 'wanSearch'">
  106. <div class="s_t_c_ai">
  107. <div class="s_t_c_a_left">
  108. <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
  109. <span v-else>Ai</span>
  110. </div>
  111. <div class="s_t_c_a_right">
  112. <div class="s_t_c_a_r_content2" v-loading="item.loading">
  113. <div class="s_t_c_a_r_c_title">
  114. <img :src="require('../../../assets/icon/course/idea.png')" />
  115. <span>猜你想搜:</span>
  116. </div>
  117. <div
  118. class="s_t_c_a_r_c_item"
  119. v-for="(item, index) in item.aiContent"
  120. :key="index"
  121. @click="sendAiIdea(item.label)"
  122. >
  123. {{ index + 1 }}.{{ item.title }}:{{ item.label }}
  124. </div>
  125. </div>
  126. <div class="s_t_c_a_r_time">{{ item.createtime }}</div>
  127. </div>
  128. </div>
  129. </div>
  130. <div class="s_t_addAsk" v-if="item.content == 'addAsk' && !item.aiContent.questions && item.aiContent.length && !item.loading">
  131. <span v-for="item2 in item.aiContent" :key="item2.index" @click.stop="send(item2.label)">{{item2.label}}</span>
  132. </div>
  133. <div class="s_t_addAsk" v-if="item.content == 'addAsk' && item.aiContent.questions && !item.loading">
  134. <span v-for="(item2,index2) in item.aiContent.questions" :key="index2" @click.stop="send(item2.question?item2.question:item2)">{{item2.question?item2.question:item2}}</span>
  135. </div>
  136. <div class="s_t_addAsk" v-if="item.content == 'addAsk' && item.loading">
  137. <span style="width:50px;height:50px" v-loading="true"></span>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="s_bottom">
  142. <!-- <div class="s_b_btnAreaTop">
  143. </div> -->
  144. <div class="s_b_btnArea">
  145. <div :class="['s_b_ba-item',sendType==3?'s_b_ba_active':'']" @click="chooseType(3)" >
  146. <!-- <img src="../../../assets/icon/course/sImg.png" style="margin-right: 5px;" alt="" v-if="sendType!=3">
  147. <img src="../../../assets/icon/course/sImg2.png" style="margin-right: 5px;" alt="" v-else> -->
  148. 生成图片
  149. </div>
  150. <div :class="['s_b_ba-item',sendType==1?'s_b_ba_active':'']" @click="chooseType(1)" >
  151. <!-- <img src="../../../assets/icon/course/sImg.png" style="margin-right: 5px;" alt="" v-if="sendType!=1">
  152. <img src="../../../assets/icon/course/sImg2.png" style="margin-right: 5px;" alt="" v-else> -->
  153. 搜索图片
  154. </div>
  155. <div :class="['s_b_ba-item',sendType==2?'s_b_ba_active':'']" @click="chooseType(2)">
  156. <!-- <img src="../../../assets/icon/course/sRio.png" style="margin-right: 5px;" alt="" v-if="sendType!=2">
  157. <img src="../../../assets/icon/course/sRio2.png" style="margin-right: 5px;" alt="" v-else> -->
  158. 搜索视频
  159. </div>
  160. <!-- <div class="s_b_ba-item" @click="clear()" v-if="!openAtBox">
  161. 清空聊天记录
  162. </div>
  163. <div :class="['s_b_ba-item',recordType==1?'s_b_ba_active':'']" @click="$parent.startAssistant()" v-if="!openAtBox">
  164. 语音助手
  165. </div> -->
  166. </div>
  167. <div class="s_b_atBox" v-if="openAtBox" v-loading="loading">
  168. <div class="s_b_at_tag">
  169. <span
  170. :class="[atTagIndex == 0 ? 's_b_at_tag_active' : '']"
  171. @click.stop="atTagIndex = 0"
  172. >任务</span
  173. >
  174. <span
  175. :class="[[1, 2].includes(atTagIndex) ? 's_b_at_tag_active' : '']"
  176. @click.stop="atTagIndex = 1"
  177. >成员</span
  178. >
  179. </div>
  180. <div class="s_b_at_list">
  181. <template v-if="atTagIndex == 0">
  182. <div v-for="(item1, index1) in taskList" :key="index1">
  183. <div
  184. class="s_b_at_l_top"
  185. v-if="item1.dyName"
  186. @click="
  187. atTask(`阶段${index1 + 1} ${item1.dyName} `, index1, 0, item1)
  188. "
  189. >
  190. <span>阶段{{ index1 + 1 }} {{ item1.dyName }}</span>
  191. <span
  192. class="s_b_at_l_i_h_icon1"
  193. :style="
  194. `${!item1.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  195. "
  196. @click.stop="item1.isOpen = !item1.isOpen"
  197. ></span>
  198. </div>
  199. <div
  200. class="s_b_at_l_item"
  201. v-for="(item2, index2) in item1.task"
  202. :key="index1 + '-' + index2"
  203. v-if="item1.isOpen"
  204. >
  205. <div
  206. class="s_b_at_l_i_header"
  207. v-if="item2.tool[0].tool != undefined"
  208. @click="
  209. atTask(
  210. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  211. item2.taskName
  212. } `,
  213. index2,
  214. 1,
  215. item2
  216. )
  217. "
  218. >
  219. <span
  220. class="s_b_at_l_i_h_icon1"
  221. :style="
  222. `${!item2.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  223. "
  224. @click.stop="item2.isOpen = !item2.isOpen"
  225. ></span>
  226. <span>任务{{ index2 + 1 }}:{{ item2.taskName }}</span>
  227. </div>
  228. <div
  229. class="s_b_at_l_i_header"
  230. v-else
  231. @click="
  232. atTask(
  233. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  234. item2.taskName
  235. } `,
  236. index2,
  237. 1,
  238. item2
  239. )
  240. "
  241. >
  242. <span
  243. class="s_b_at_l_i_h_icon2"
  244. :style="
  245. `${!item2.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  246. "
  247. @click.stop="item2.isOpen = !item2.isOpen"
  248. ></span>
  249. <span>任务{{ index2 + 1 }}:{{ item2.taskName }}</span>
  250. </div>
  251. <div
  252. class="s_b_at_l_i_content"
  253. v-if="item2.tool[0].tool != undefined && item2.isOpen"
  254. v-for="(item3, index3) in item2.tool"
  255. :key="index1 + '-' + index2 + '-' + index3"
  256. @click="
  257. atTask(
  258. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  259. item2.taskName
  260. }-工具${index3 + 1}:${toolsList[item3.tool]} `,
  261. index3,
  262. 2,
  263. item3
  264. )
  265. "
  266. >
  267. <span>工具{{ index3 + 1 }}:{{ toolsList[item3.tool] }}</span>
  268. </div>
  269. </div>
  270. </div>
  271. </template>
  272. <template v-if="atTagIndex == 1 && workSum!=0">
  273. <div v-if="userList.length == 0">暂无成员...</div>
  274. <div
  275. class="s_b_ab_user"
  276. v-for="(item, index) in userList"
  277. :key="item.id"
  278. v-else
  279. >
  280. <div class="s_b_ab_u_name">
  281. <el-tooltip
  282. class="item"
  283. effect="light:"
  284. :content="item.username"
  285. placement="top"
  286. >
  287. <span>{{ item.username }}</span>
  288. </el-tooltip>
  289. </div>
  290. <div class="s_b_ab_u_message">
  291. <span>作业提交情况</span>
  292. <div>
  293. <span>已提交:{{ item.count }}</span>
  294. <span>未提交:{{ (workSum-item.count) }}</span>
  295. </div>
  296. </div>
  297. <div class="s_b_ab_u_btnArea">
  298. <span @click="sumUpStudent(item)">总结分析</span>
  299. <span @click.stop="lookStudentDetail(item)">作业详细</span>
  300. </div>
  301. </div>
  302. </template>
  303. <template v-if="atTagIndex == 2">
  304. <div class="s_b_at_studentDetail">
  305. <img
  306. :src="require('../../../assets/icon/course/back.svg')"
  307. @click.stop="atTagIndex = 1"
  308. />
  309. <span>学生:{{ lookStudentData.userName }}</span>
  310. </div>
  311. <div class="s_b_at_studentList">
  312. <div
  313. class="s_b_at_sl_item"
  314. v-if="[3, 2, 8].includes(item.type)"
  315. v-for="(item, index) in lookStudentData.list"
  316. @click.stop="sumUpStudent2(item)"
  317. >
  318. <div class="s_b_at_sl_phase">
  319. {{
  320. `阶段${item.stage + 1}/任务${item.task +
  321. 1}/工具${item.tool + 1}`
  322. }}
  323. </div>
  324. <div class="s_b_at_sl_message" v-if="item.type === 3">
  325. <div>
  326. 题目:
  327. <el-tooltip
  328. class="item"
  329. effect="light:"
  330. :content="item.content.answerTitle"
  331. placement="top"
  332. ><span>{{ item.content.answerTitle }}</span></el-tooltip
  333. >
  334. </div>
  335. <div>
  336. 答题:
  337. <span>{{ item.content.answer }}</span>
  338. </div>
  339. </div>
  340. <div
  341. class="s_b_at_sl_message"
  342. v-if="item.type === 8"
  343. v-for="(item1, index1) in item.content.testJson
  344. ? item.content.testJson.testJson
  345. : []"
  346. :key="index1"
  347. >
  348. <div>
  349. 题目:
  350. <el-tooltip
  351. class="item"
  352. effect="light:"
  353. :content="item1.teststitle"
  354. placement="top"
  355. ><span>{{ item1.teststitle }}</span></el-tooltip
  356. >
  357. </div>
  358. <div>
  359. 选项:
  360. <span>
  361. <div v-for="(item2, index2) in item1.checkList">
  362. {{ index2 + 1 }}、{{ item2.src ? item2.src : item2 }}
  363. </div>
  364. </span>
  365. </div>
  366. <div>
  367. 答案:{{ answerData(item1.checkList, item1.answer) }}
  368. </div>
  369. <div>
  370. 答题:
  371. <span>{{
  372. answerData(item1.checkList, item.content.anwer[index1])
  373. }}</span>
  374. </div>
  375. </div>
  376. <div
  377. class="s_b_at_sl_message"
  378. v-if="item.type === 2"
  379. v-for="(item1, index1) in item.content.askJson
  380. ? item.content.askJson.askJson
  381. : []"
  382. :key="index1"
  383. >
  384. <div>
  385. 题目:
  386. <el-tooltip
  387. class="item"
  388. effect="light:"
  389. :content="item1.askstitle"
  390. placement="top"
  391. ><span>{{ item1.askstitle }}</span></el-tooltip
  392. >
  393. </div>
  394. <div>
  395. 选项:
  396. <span>
  397. <div v-for="(item2, index2) in item1.checkList">
  398. {{ index2 + 1 }}、{{ item2.src ? item2.src : item2 }}
  399. </div>
  400. </span>
  401. </div>
  402. <div>
  403. 答题:
  404. <span>{{
  405. answerData(item1.checkList, item.content.anwer[index1])
  406. }}</span>
  407. </div>
  408. </div>
  409. </div>
  410. </div>
  411. </template>
  412. </div>
  413. </div>
  414. <div class="s_b_inputArea">
  415. <!-- <div class="s_b_tape" @click="goTape()"></div> -->
  416. <div class="s_b_input">
  417. <el-input
  418. :disabled="loading || chatLoading"
  419. v-loading="loading || chatLoading"
  420. @keyup.enter.native="send()"
  421. placeholder="输入@可以分析任务和作业情况"
  422. class="s_b_i_left"
  423. v-model="text"
  424. ref="textRef"
  425. ></el-input>
  426. <!-- <div class="s_b_i_right" @click="sendFile()">
  427. <span></span>
  428. </div> -->
  429. </div>
  430. <div class="s_b_btn" @click="send()">
  431. <span v-if="!loading && !chatLoading"></span>
  432. <div v-else @click.stop="stopSend()">停止</div>
  433. </div>
  434. </div>
  435. </div>
  436. </div>
  437. </template>
  438. <script>
  439. import { v4 as uuidv4 } from "uuid";
  440. import MarkdownIt from "markdown-it";
  441. import { tools } from "../../../common/tools";
  442. var OpenCC = require("opencc-js");
  443. let converter = OpenCC.Converter({
  444. from:'hk',
  445. to:'cn'
  446. })
  447. export default {
  448. props: {
  449. courseDetail: {
  450. type: Object,
  451. default: () => {}
  452. },
  453. recordType:{
  454. type:Number,
  455. default:0
  456. },
  457. navList: {
  458. type: Array,
  459. default: () => []
  460. },
  461. tcid: {
  462. type: String,
  463. default: ""
  464. },
  465. fileId:{
  466. type:Array,
  467. default:()=>[]
  468. }
  469. },
  470. data() {
  471. return {
  472. text: "",
  473. ppage: 1,
  474. sendType: 0,
  475. loading: false,
  476. chatLoading: false,
  477. imageCheck: false,
  478. videoCheck: false,
  479. userid: this.$route.query.userid,
  480. courseId: this.$route.query.courseId,
  481. imgNumList: ["U1", "U2", "U3", "U4"],
  482. chatList: [],
  483. nowChatList: [],
  484. atTagIndex: 0,
  485. source: null,
  486. saveUid: "",
  487. toolsList: {
  488. "58": "模拟驾驶",
  489. "59": "路径搜索",
  490. "60": "深度学习",
  491. "10": "倒计时",
  492. "65": "挑人",
  493. "7": "思维网格",
  494. "1": "电子白板",
  495. "52": "文档",
  496. "3": "思维导图",
  497. "48": "表格",
  498. "49": "学生分组",
  499. "4": "问卷调查",
  500. "45": "选择题",
  501. "15": "问答",
  502. "16": "作业提交",
  503. "50": "批量上传",
  504. "41": "选择匹配",
  505. "47": "排序",
  506. "40": "个人评价",
  507. "18": "训练平台",
  508. "21": "AIoT Blockly",
  509. "23": "AI Python",
  510. "24": "AI Blockly",
  511. "32": "源码编辑",
  512. "57": "CocoPi",
  513. "63": "海龟编程",
  514. "28": "翻译",
  515. "31": "数字画板",
  516. "39": "GeoGebra",
  517. "66": "公式编辑",
  518. "67": "分子结构",
  519. "68": "时间轴",
  520. "69": "英语写作",
  521. "70": "英语口语",
  522. "25": "目标管理",
  523. "26": "课程设计",
  524. "62": "交互视频",
  525. "71": "AI智能体"
  526. },
  527. lookStudentData: {},
  528. taskList: [],
  529. userList: [],
  530. tools: JSON.parse(converter(JSON.stringify(tools))),
  531. };
  532. },
  533. computed: {
  534. openAtBox() {
  535. // return false;
  536. if (this.text.length == 0) return false;
  537. if (this.text.lastIndexOf("@") == this.text.length - 1) {
  538. return true;
  539. } else {
  540. return false;
  541. }
  542. },
  543. atTaskList() {
  544. let _result = [];
  545. this.taskList.forEach((item1, index1) => {
  546. if (item1.dyName) {
  547. _result.push({
  548. name: `阶段${index1 + 1} ${item1.dyName}`,
  549. tool:null,
  550. type: 0
  551. });
  552. }
  553. item1.task.forEach((item2, index2) => {
  554. if (item2.taskName) {
  555. _result.push({
  556. name: `任务${index2 + 1}:${item2.taskName}`,
  557. tool:null,
  558. type: 1,
  559. superiors: {
  560. name: `阶段${index1 + 1} ${item1.dyName}`,
  561. type: 0
  562. }
  563. });
  564. }
  565. item2.tool.forEach((item3, index3) => {
  566. if (item3.tool != undefined) {
  567. _result.push({
  568. name: `工具${index3 + 1}:${this.toolsList[item3.tool]}`,
  569. tool:item3.tool,
  570. type: 2,
  571. superiors: {
  572. name: `任务${index2 + 1}:${item2.taskName}`,
  573. type: 1,
  574. superiors: {
  575. name: `阶段${index1 + 1} ${item1.dyName}`,
  576. type: 0
  577. }
  578. }
  579. });
  580. }
  581. });
  582. });
  583. });
  584. return _result;
  585. },
  586. pan() {
  587. return content => {
  588. try {
  589. return JSON.parse(content);
  590. } catch (error) {
  591. return [];
  592. }
  593. };
  594. },
  595. htmlContent() {
  596. const md = new MarkdownIt();
  597. return _md => {
  598. return md.render(_md);
  599. };
  600. },
  601. answerData() {
  602. return (checkList, answer) => {
  603. if (typeof answer == "number") {
  604. return answer + 1;
  605. } else {
  606. let _result = ``;
  607. answer.forEach((item, index) => {
  608. _result += `${item + 1}`;
  609. if (index != answer.length - 1) {
  610. _result += `、`;
  611. }
  612. });
  613. return _result;
  614. }
  615. };
  616. },
  617. workSum(){
  618. let sum = 0;
  619. this.atTaskList.forEach(i=>{
  620. if(i.type!=2)return;
  621. if([4,15,45].includes(i.tool)){
  622. return sum+=1;
  623. }
  624. })
  625. return sum;
  626. }
  627. },
  628. watch: {
  629. navList() {
  630. this.initTaskList();
  631. },
  632. atTagIndex(newValue) {
  633. if (newValue != 2) {
  634. this.lookStudentData = {};
  635. }
  636. }
  637. },
  638. methods: {
  639. chooseType(type){
  640. console.log('👇')
  641. console.log(type)
  642. if(this.sendType==type){
  643. this.sendType = 0;
  644. }else{
  645. this.sendType = type;
  646. }
  647. console.log('👇')
  648. console.log(this.sendType)
  649. },
  650. resetImg(_text){
  651. this.ppage++
  652. let _uuid = uuidv4();
  653. this.chatList.push({
  654. role: "user",
  655. content: `${_text}`,
  656. uid: _uuid,
  657. AI: "AI",
  658. aiContent: "",
  659. oldContent: "",
  660. isShowSynchronization: false,
  661. filename: "",
  662. index: this.chatList.length,
  663. is_mind_map: false,
  664. loading: true
  665. });
  666. this.text = "";
  667. let params = {
  668. page: this.ppage,
  669. pagesize: 6,
  670. query: _text
  671. };
  672. // this.$message.info(_text);
  673. this.chatList.push({
  674. role: "user",
  675. content: `getImage`,
  676. uid: _uuid,
  677. AI: "AI",
  678. aiContent: "",
  679. oldContent: "",
  680. isShowSynchronization: false,
  681. filename: "",
  682. index: this.chatList.length,
  683. is_mind_map: false,
  684. loading: true
  685. });
  686. this.scrollBottom();
  687. this.ajax
  688. .post("https://gpt.cocorobo.cn/search_image", params)
  689. .then(res => {
  690. let data = res.data.FunctionResponse.result;
  691. // console.log('res',res.data.FunctionResponse.result);
  692. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  693. data
  694. );
  695. this.chatList.find(i => i.uid == _uuid).loading = false;
  696. this.chatLoading = false;
  697. this.insertChat(_uuid);
  698. });
  699. },
  700. stopSend() {
  701. if (this.source) {
  702. this.source.close();
  703. if (this.chatList[this.chatList.length - 1].content == "wanSearch") {
  704. this.chatList.pop();
  705. }
  706. this.loading = false;
  707. this.chatLoading = false;
  708. this.source = null;
  709. this.insertChat(this.saveUid);
  710. }
  711. },
  712. onCopy(content) {
  713. // 创建临时textarea元素
  714. const tempInput = document.createElement("textarea");
  715. tempInput.value = content; // 设置要复制的内容
  716. // 隐藏元素
  717. tempInput.style.position = "absolute";
  718. tempInput.style.left = "-9999px";
  719. // 将元素添加到DOM中
  720. document.body.appendChild(tempInput);
  721. // 选中元素内容
  722. tempInput.select();
  723. // 执行复制操作
  724. document.execCommand("copy");
  725. // 移除临时元素
  726. document.body.removeChild(tempInput);
  727. this.$message({
  728. message: "复制成功",
  729. type: "success"
  730. });
  731. },
  732. previewImg(url) {
  733. this.$hevueImgPreview(url);
  734. },
  735. clear() {
  736. this.chatList = [];
  737. },
  738. atTask(name, index, type, data) {
  739. let _result = name;
  740. // if(type == 1){
  741. // _result=`任务${index+1}:${name} `
  742. // }else if(type==2){
  743. // _result=`工具${index+1}:${name} `
  744. // }else if(type==0){
  745. // _result=`阶段${index+1} ${name} `
  746. // }
  747. this.text += _result;
  748. this.$refs.textRef.focus();
  749. },
  750. // choiceRole() {
  751. // this.cardType = 1;
  752. // },
  753. // sendFile() {
  754. // if (this.loading) return this.$message.info("请稍等");
  755. // this.$message.info("点击了附件");
  756. // },
  757. // goTape() {
  758. // if (this.loading) return this.$message.info("请稍等");
  759. // this.$message.info(`点击了语音`);
  760. // },
  761. send(_text = this.text,val = 0) {
  762. this.ppage = 1
  763. if (this.loading || this.chatLoading) return this.$message.info("请稍等");
  764. if (_text.trim().length == 0) return this.$message.info("请输入内容");
  765. let _atRoleList = [];
  766. this.atTaskList.forEach(i => {
  767. let _result = ``;
  768. if (i.type == 0) {
  769. _result = `${i.name} `;
  770. } else if (i.type == 1) {
  771. _result = `${i.superiors.name}-${i.name} `;
  772. } else if (i.type == 2) {
  773. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name} `;
  774. }
  775. if (_text.indexOf(`@${_result}`) != -1) {
  776. _atRoleList.push(i);
  777. }
  778. });
  779. if (_atRoleList.length > 0) {
  780. return this.atSend(_text, _atRoleList);
  781. }
  782. let _msg = ``;
  783. this.chatLoading = true;
  784. let _uuid = uuidv4();
  785. // if(this.sendType==3){
  786. // _text = `帮我生成一张图片:`
  787. // }
  788. this.chatList.push({
  789. role: "user",
  790. content: `${this.sendType==3?`帮我生成一张图片:${_text}`:_text}`,
  791. uid: _uuid,
  792. AI: "AI",
  793. aiContent: "",
  794. oldContent: "",
  795. isShowSynchronization: false,
  796. filename: "",
  797. index: this.chatList.length,
  798. is_mind_map: false,
  799. loading: true
  800. });
  801. this.scrollBottom();
  802. console.log(this.sendType)
  803. if ( this.sendType == 2 || _text.indexOf("视频") != -1) {
  804. return this.ajax.post(`https://gpt4.cocorobo.cn/get_network_search`,{
  805. engine:"bilibili",
  806. keyword:_text
  807. }).then(res=>{
  808. console.log(res)
  809. let _dataList = res.data.FunctionResponse;
  810. let _resultText = ``;
  811. _dataList.forEach(i=>{
  812. i.title = i.title.replaceAll('<em class="keyword">','').replaceAll('</em>','')
  813. _resultText+=`名称:${i.title}\n简介:${i.description}\n地址:[${i.arcurl}](${i.arcurl})\n\n`
  814. })
  815. this.chatList.find(i => i.uid == _uuid).aiContent =_resultText
  816. this.chatList.find(i => i.uid == _uuid).loading = false;
  817. this.chatLoading = false;
  818. this.scrollBottom();
  819. this.insertChat(_uuid);
  820. this.text = "";
  821. }).catch(e=>{
  822. this.$message.error('获取视频失败');
  823. this.chatLoading = false;
  824. })
  825. }else if(this.sendType == 3){
  826. this.text = "";
  827. let params = {
  828. page: this.ppage,
  829. pagesize: 1,
  830. query: _text
  831. };
  832. // this.$message.info(_text);
  833. this.chatList.push({
  834. role: "user",
  835. content: `getImage`,
  836. uid: _uuid,
  837. AI: "AI",
  838. aiContent: "",
  839. oldContent: "",
  840. isShowSynchronization: false,
  841. filename: "",
  842. index: this.chatList.length,
  843. is_mind_map: false,
  844. loading: true
  845. });
  846. this.ajax
  847. .post("https://gpt.cocorobo.cn/search_image", params)
  848. .then(res => {
  849. let data = res.data.FunctionResponse.result;
  850. // console.log('res',res.data.FunctionResponse.result);
  851. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  852. data
  853. );
  854. this.chatList.find(i => i.uid == _uuid).loading = false;
  855. this.chatLoading = false;
  856. this.insertChat(_uuid);
  857. });
  858. return;
  859. } else if (this.sendType == 1 || _text.indexOf("图片") != -1 ) {
  860. // console.log("图片");
  861. this.text = "";
  862. let params = {
  863. page: this.ppage,
  864. pagesize: 6,
  865. query: _text
  866. };
  867. // this.$message.info(_text);
  868. this.chatList.push({
  869. role: "user",
  870. content: `getImage`,
  871. uid: _uuid,
  872. AI: "AI",
  873. aiContent: "",
  874. oldContent: "",
  875. isShowSynchronization: false,
  876. filename: "",
  877. index: this.chatList.length,
  878. is_mind_map: false,
  879. loading: true
  880. });
  881. this.ajax
  882. .post("https://gpt.cocorobo.cn/search_image", params)
  883. .then(res => {
  884. let data = res.data.FunctionResponse.result;
  885. // console.log('res',res.data.FunctionResponse.result);
  886. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  887. data
  888. );
  889. this.chatList.find(i => i.uid == _uuid).loading = false;
  890. this.chatLoading = false;
  891. this.insertChat(_uuid);
  892. // console.log('resresresres',res);
  893. // if (res.data.FunctionResponse.result == "发送成功") {
  894. // } else {
  895. // this.$message.warning(res.data.FunctionResponse.result);
  896. // }
  897. });
  898. return;
  899. }
  900. // num=0
  901. // _msg = `
  902. // NOTICE
  903. // 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.
  904. // ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
  905. // Instruction: Based on the context, follow "Format example", write content.
  906. // # Context
  907. // ## 任务
  908. // 你的任务是根据用户的请求,结合以下“课程信息”包含的子条目(“课程标题”,“主题”,“学科”以及“年级”),向用户输出相关的4张图片,将结果2*2的形式返回给用户。
  909. // 课程信息
  910. // 课程标题:${this.courseDetail.title}
  911. // 分类:${this.courseDetail.name?this.courseDetail.name:"无"}
  912. // 学生年级:${this.courseDetail.classname?this.courseDetail.classname:"无"}
  913. // ## 规则
  914. // 1. 输出内容应该与“课程信息”相关,避免提供无关的信息。
  915. // 2. 当课程信息中的子条目内容为“无”时,无视这些条目进行输出即可。
  916. // 3. 搜索建议的结果应该符合伦理规范。
  917. // ## 输出格式
  918. // 1. 以2*2的格式输出应包括4张相关的图片。
  919. // `
  920. // }
  921. let history = [];
  922. this.nowChatList.forEach(i => {
  923. if (i.content == "wanSearch") {
  924. // history.push({
  925. // role:"assistant",
  926. // content: JSON.stringify(i.aiContent)
  927. // })
  928. return;
  929. } else if (i.content == "getImage") {
  930. return history.push({
  931. type: "text",
  932. text: i.aiContent
  933. });
  934. }else if(i.content == "addAsk"){
  935. }
  936. if (i.content) {
  937. history.push({
  938. type: "text",
  939. text: i.content
  940. });
  941. }
  942. if (i.aiContent) {
  943. history.push({
  944. type: "text",
  945. text: i.aiContent
  946. });
  947. }
  948. });
  949. // history.pop();
  950. if (_msg) {
  951. history.push({ type: "text", text: _msg });
  952. }else{
  953. history.push({ type: "text", text: _text });
  954. }
  955. let params = {
  956. assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
  957. userId: this.userid,
  958. message: _text,
  959. session_name: `${this.courseId}-studyStudent-md`,
  960. uid: _uuid,
  961. file_ids: this.fileId
  962. };
  963. // let params = {
  964. // model: "gpt-3.5-turbo",
  965. // temperature: 0,
  966. // max_tokens: 4096,
  967. // top_p: 1,
  968. // frequency_penalty: 0,
  969. // presence_penalty: 0,
  970. // messages: history,
  971. // uid: _uuid,
  972. // mind_map_question: _text
  973. // };
  974. // let params = {
  975. // message: {
  976. // anthropic_version: "bedrock-2023-05-31",
  977. // max_tokens: 4096,
  978. // temperature: 0,
  979. // top_p: 1,
  980. // messages: history
  981. // },
  982. // uid: _uuid,
  983. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  984. // };
  985. this.text = "";
  986. // console.log('56465166541561616',params);
  987. this.ajax
  988. // .post("https://claude3.cocorobo.cn/chat", params)
  989. // .post("https://gpt4.cocorobo.cn/chat", params)
  990. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  991. .then(res => {
  992. if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
  993. } else {
  994. // this.$message.warning(res.data.FunctionResponse.result);
  995. console.log(res.data.FunctionResponse.result)
  996. this.chatLoading = false;
  997. }
  998. })
  999. .catch(e => {
  1000. console.log(e);
  1001. this.chatLoading = false;
  1002. });
  1003. this.saveUid = _uuid;
  1004. this.getAtAuContent(_uuid);
  1005. },
  1006. atSend(_text, _atList) {
  1007. let _msg = ``;
  1008. let noAtText = _text;
  1009. _atList.forEach(i => {
  1010. let _result = ``;
  1011. if (i.type == 0) {
  1012. _result = `${i.name} `;
  1013. } else if (i.type == 1) {
  1014. _result = `${i.superiors.name}-${i.name} `;
  1015. } else if (i.type == 2) {
  1016. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name} `;
  1017. }
  1018. if (_text.indexOf(`@${_result}`) != -1) {
  1019. noAtText = noAtText.replaceAll(`@${_result}`, "");
  1020. }
  1021. });
  1022. this.chatLoading = true;
  1023. let _uuid = uuidv4();
  1024. this.chatList.push({
  1025. role: "user",
  1026. content: `${_text}`,
  1027. uid: _uuid,
  1028. AI: "AI",
  1029. aiContent: "",
  1030. oldContent: "",
  1031. isShowSynchronization: false,
  1032. filename: "",
  1033. index: this.chatList.length,
  1034. is_mind_map: false,
  1035. loading: true
  1036. });
  1037. this.scrollBottom();
  1038. _msg = `
  1039. NOTICE
  1040. 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.
  1041. ## 目的
  1042. 你是用户的课堂助手,你需要基于提供给你的课程相关信息,对用户的提问进行回答。
  1043. ---
  1044. ## 定义
  1045. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  1046. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  1047. 【阶段】:阶段表示课程的某一单独部分,通常包含一个或多个任务。
  1048. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  1049. 【工具】:工具通常是指学生要完成任务的手段。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。
  1050. ---
  1051. ## 工作流程
  1052. 1. 读取【课程信息】中的内容,了解课程说明、课程结构以及【任务】详情。
  1053. 2. 用户会询问你某个【任务】的具体信息,你需要总结该任务信息,并就用户的问题进行回答。
  1054. 3. 你的总结包括以下要点:
  1055. 3.1 任务从属于哪个阶段。
  1056. 3.2 任务包含哪些工具。
  1057. 3.3 该任务目标是什么,以及该任务的工具如何达成它的目标。
  1058. ---
  1059. ## 规则
  1060. 1.你和用户讨论的范围应当仅局限于课程相关内容。
  1061. 2.当用户的提问需要你对课程拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  1062. 3.你通常可以在【任务描述】中了解任务目标,但当【任务描述】不包含此内容的时候,你不需要总结这部分内容。
  1063. ---
  1064. ## 课程信息
  1065. ###课程说明与课程结构
  1066. 课程标题:${this.courseDetail.title}
  1067. 分类:${this.courseDetail.name ? this.courseDetail.name : "无"}
  1068. 学生年级:${this.courseDetail.classname ? this.courseDetail.classname : "无"}
  1069. 学习内容:${this.exportCourse()}
  1070. ## 要求
  1071. ${_atList
  1072. .map(i => {
  1073. let _result = ``;
  1074. if (i.type == 0) {
  1075. _result = `${i.name}`;
  1076. } else if (i.type == 1) {
  1077. _result = `${i.superiors.name}-${i.name}`;
  1078. } else if (i.type == 2) {
  1079. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name}`;
  1080. }
  1081. console.log(_result);
  1082. return _result;
  1083. })
  1084. .join(",")} ${noAtText}
  1085. `;
  1086. // this.chatLoading = false;
  1087. // console.log(_msg)
  1088. // return
  1089. // ${this._atList.map(i=>i.name).join(',')} ${noAtText}
  1090. let history = [];
  1091. this.nowChatList.forEach(i => {
  1092. if (i.content == "wanSearch") {
  1093. return;
  1094. } else if (i.content == "getImage") {
  1095. return history.push({
  1096. role: "assistant",
  1097. content: i.aiContent
  1098. });
  1099. }
  1100. if (i.content) {
  1101. history.push({
  1102. role: "user",
  1103. content: i.content
  1104. });
  1105. }
  1106. if (i.aiContent) {
  1107. history.push({
  1108. role: "assistant",
  1109. content: i.aiContent
  1110. });
  1111. }
  1112. });
  1113. // if (_msg) {
  1114. history.push({ role: "user", content: _msg });
  1115. // }
  1116. history.push({ role: "user", content: _text });
  1117. let params = {
  1118. assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
  1119. userId: this.userid,
  1120. message: _text,
  1121. session_name: `${this.courseId}-studyStudent-md`,
  1122. uid: _uuid,
  1123. file_ids: this.fileId
  1124. };
  1125. // let params = {
  1126. // model: "gpt-3.5-turbo",
  1127. // temperature: 0,
  1128. // max_tokens: 4096,
  1129. // top_p: 1,
  1130. // frequency_penalty: 0,
  1131. // presence_penalty: 0,
  1132. // messages: history,
  1133. // uid: _uuid,
  1134. // mind_map_question: noAtText
  1135. // };
  1136. // let params = {
  1137. // message: {
  1138. // anthropic_version: "bedrock-2023-05-31",
  1139. // max_tokens: 4096,
  1140. // temperature: 0,
  1141. // top_p: 1,
  1142. // messages: history
  1143. // },
  1144. // uid: _uuid,
  1145. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  1146. // };
  1147. this.text = "";
  1148. this.ajax
  1149. // .post("https://gpt4.cocorobo.cn/chat", params)
  1150. // .post("https://claude3.cocorobo.cn/chat", params)
  1151. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  1152. .then(res => {
  1153. if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
  1154. } else {
  1155. // this.$message.warning(res.data.FunctionResponse.result);
  1156. console.log(res.data.FunctionResponse.result)
  1157. this.chatLoading = false;
  1158. }
  1159. })
  1160. .catch(e => {
  1161. console.log(e);
  1162. this.chatLoading = false;
  1163. });
  1164. this.saveUid = _uuid;
  1165. // this.getAiContent(_uuid);
  1166. this.getAtAuContent(_uuid)
  1167. },
  1168. exportCourse() {
  1169. 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>`;
  1170. const _chapInfo = JSON.parse(this.courseDetail.chapters);
  1171. let _chap = "";
  1172. for (let i = 0; i < _chapInfo.length; i++) {
  1173. _chap += `<div style="font-size:40px;margin-top:70px;"><span>第${i +
  1174. 1}阶段:${_chapInfo[i].dyName}</span></div>`;
  1175. let _task = _chapInfo[i].chapterInfo[0].taskJson;
  1176. for (let j = 0; j < _task.length; j++) {
  1177. _chap += `<div style="font-size:30px;margin-top:50px;"><span>任务${j +
  1178. 1}:${_task[j].task}</span></div>`;
  1179. if (_task[j].taskDetail) {
  1180. _chap += `<div style="font-size:25px;margin-top:40px;">任务描述</div>`;
  1181. _chap += `<div style="font-size:25px;margin-top:10px;">${_task[j].taskDetail}</div>`;
  1182. }
  1183. let _tool = _task[j].toolChoose;
  1184. if (_tool[0].tool.length) {
  1185. for (let z = 0; z < _tool.length; z++) {
  1186. _chap += `<div style="font-size:23px;margin-top:30px;"><span>步骤${z +
  1187. 1}:</span><span>${
  1188. tools[_tool[z].tool[0]] ? tools[_tool[z].tool[0]].name : ""
  1189. }</span></div>`;
  1190. if (_tool[z].toolDetail) {
  1191. _chap += `<div style="font-size:23px;margin-top:20px;">工具描述</div>`;
  1192. _chap += `<div style="font-size:23px;margin-top:10px;">${_tool[z].toolDetail}</div>`;
  1193. }
  1194. }
  1195. }
  1196. }
  1197. }
  1198. let _html = _user + _chap;
  1199. return _html;
  1200. },
  1201. // 获取ai对话
  1202. getAiContent(_uid) {
  1203. // this.source = new EventSource(
  1204. // `https://claude3.cocorobo.cn/streamChat/${_uid}`
  1205. // );
  1206. this.source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`);
  1207. // this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
  1208. let _allText = "";
  1209. let _mdText = "";
  1210. // const md = new MarkdownIt();
  1211. this.source.onmessage = _e => {
  1212. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  1213. //对话已经完成
  1214. _mdText = _mdText.replace("_", "");
  1215. this.source.close();
  1216. this.chatLoading = false;
  1217. this.scrollBottom();
  1218. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  1219. this.chatList.find(i => i.uid == _uid).isalltext = true;
  1220. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  1221. this.chatList.find(i => i.uid == _uid).loading = false;
  1222. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  1223. this.addAsk(this.chatList.find(i => i.uid == _uid).content)
  1224. // 这里保存对话
  1225. this.insertChat(_uid);
  1226. return;
  1227. } else {
  1228. //对话还在继续
  1229. let _text = "";
  1230. _text = _e.data.replaceAll("'", "");
  1231. if (_allText == "") {
  1232. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  1233. } else {
  1234. _allText += _text;
  1235. }
  1236. _mdText = _allText + "_";
  1237. _mdText = _mdText.replace(/\\n/g, "\n");
  1238. _mdText = _mdText.replace(/\\/g, "");
  1239. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  1240. //转化返回的回复流数据
  1241. // _mdText = md.render(_mdText);
  1242. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  1243. this.chatList.find(i => i.uid == _uid).loading = false;
  1244. this.scrollBottom();
  1245. // 处理流数据
  1246. }
  1247. };
  1248. },
  1249. getAtAuContent(_uid) {
  1250. this.source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`);
  1251. //http://gpt4.cocorobo.cn:8011/question/ https://gpt4.cocorobo.cn/question/
  1252. let _allText = "";
  1253. let _mdText = "";
  1254. let _index = 0;
  1255. // const md = new MarkdownIt();
  1256. this.source.onmessage = _e => {
  1257. let _eData = JSON.parse(_e.data);
  1258. if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
  1259. let _result = [];
  1260. if ("result" in _eData) {
  1261. _result = _eData.result;
  1262. for (let i = 0; i < _result.length; i++) {
  1263. _mdText = _mdText.replace(_result[i].text, _result[i].fileName);
  1264. }
  1265. }
  1266. _mdText = _mdText.replace("_", "");
  1267. this.chatLoading = false;
  1268. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  1269. this.chatList.find(i => i.uid == _uid).isalltext = true;
  1270. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  1271. this.chatList.find(i => i.uid == _uid).loading = false;
  1272. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  1273. this.addAsk(this.chatList.find(i => i.uid == _uid).content)
  1274. this.source.close();
  1275. this.insertChat(_uid);
  1276. } else {
  1277. _index+=1;
  1278. let _text = _eData.content.replace("'", "").replace("'", "");
  1279. if (_allText == "") {
  1280. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  1281. } else {
  1282. _allText += _text;
  1283. }
  1284. _mdText = _allText + "_";
  1285. _mdText = _mdText.replace(/\\n/g, "\n");
  1286. _mdText = _mdText.replace(/\\/g, "");
  1287. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  1288. //转化返回的回复流数据
  1289. // _mdText = md.render(_mdText);
  1290. if(_index==10){
  1291. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  1292. this.chatList.find(i => i.uid == _uid).loading = false;
  1293. this.$nextTick(() => {
  1294. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  1295. });
  1296. _index= 0;
  1297. }
  1298. // 处理流数据
  1299. }
  1300. };
  1301. },
  1302. getWAntSearchContent(_uid) {
  1303. // this.source = new EventSource(
  1304. // `https://claude3.cocorobo.cn/streamChat/${_uid}`
  1305. // );
  1306. this.source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`);
  1307. // this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
  1308. let _allText = "";
  1309. let _mdText = "";
  1310. this.scrollBottom();
  1311. this.source.onmessage = _e => {
  1312. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  1313. //对话已经完成
  1314. _mdText = _mdText.replace("_", "");
  1315. _mdText = _mdText.replace("```json", "");
  1316. _mdText = _mdText.replace("```", "");
  1317. // 使用正则表达式匹配JSON数组
  1318. const regex = /\[\s*{[^]*}\s*\]/;
  1319. const match = _mdText.match(regex);
  1320. let _result = match[0]
  1321. this.source.close();
  1322. this.chatLoading = false;
  1323. this.chatList.find(i => i.uid == _uid).aiContent = JSON.parse(
  1324. _result
  1325. );
  1326. this.chatList.find(i => i.uid == _uid).isalltext = true;
  1327. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  1328. this.chatList.find(i => i.uid == _uid).loading = false;
  1329. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  1330. this.scrollBottom();
  1331. // 这里保存对话
  1332. return;
  1333. } else {
  1334. //对话还在继续
  1335. let _text = "";
  1336. _text = _e.data.replaceAll("'", "");
  1337. if (_allText == "") {
  1338. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  1339. } else {
  1340. _allText += _text;
  1341. }
  1342. _mdText = _allText + "_";
  1343. _mdText = _mdText.replace(/\\n/g, "\n");
  1344. _mdText = _mdText.replace(/\\/g, "");
  1345. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  1346. //转化返回的回复流数据
  1347. this.scrollBottom();
  1348. }
  1349. };
  1350. },
  1351. //保存消息
  1352. insertChat(_uid) {
  1353. if (_uid == "") return;
  1354. let _data = this.chatList.find(i => i.uid == _uid);
  1355. if (!_data) return;
  1356. let params = {
  1357. userId: this.userid,
  1358. userName: "qgt",
  1359. groupId: "602def61-005d-11ee-91d8-005056b8q12w",
  1360. answer: _data.aiContent,
  1361. problem: _data.content,
  1362. file_id: _data.fileid ? _data.fileid : "",
  1363. alltext: _data.aiContent,
  1364. type: "chat",
  1365. filename: _data.filename,
  1366. session_name: `${this.courseId}-studyStudent-md` //这是对话记录位置
  1367. };
  1368. this.saveUid = "";
  1369. this.ajax
  1370. .post("https://gpt4.cocorobo.cn/insert_chat", params)
  1371. .then(res => {});
  1372. },
  1373. // 获取对应的聊天记录
  1374. getChatList() {
  1375. return new Promise((resolve, reject) => {
  1376. if (this.loading) return this.$message.info("请稍等...");
  1377. this.chatList = [];
  1378. this.loading = true;
  1379. let params = {
  1380. userid: this.userid,
  1381. groupid: "602def61-005d-11ee-91d8-005056b8q12w",
  1382. // session_name:``
  1383. session_name: `${this.courseId}-studyStudent-md`
  1384. };
  1385. this.ajax
  1386. .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
  1387. .then(res => {
  1388. let _data = JSON.parse(res.data.FunctionResponse);
  1389. if (_data.length > 0) {
  1390. let _chatList = [];
  1391. for (let i = 0; i < _data.length; i++) {
  1392. _chatList.push({
  1393. loading: false,
  1394. role: "user",
  1395. content: _data[i].problem,
  1396. uid: _data[i].id,
  1397. AI: "AI",
  1398. aiContent: _data[i].answer,
  1399. oldContent: _data[i].answer,
  1400. isShowSynchronization: false,
  1401. filename: _data[i].filename,
  1402. index: i,
  1403. is_mind_map: false,
  1404. fileid: _data[i].fileid
  1405. });
  1406. }
  1407. this.chatList = _chatList;
  1408. this.loading = false;
  1409. } else {
  1410. //没有对话记录
  1411. this.loading = false;
  1412. }
  1413. resolve();
  1414. })
  1415. .catch(err => {
  1416. console.log(err);
  1417. this.$message.error("获取对话记录失败");
  1418. this.loading = false;
  1419. resolve();
  1420. });
  1421. });
  1422. },
  1423. sendAiIdea(text) {
  1424. if (this.loading) return this.$message.info("请稍等");
  1425. this.send(text);
  1426. },
  1427. getWantSearch() {
  1428. this.chatLoading = true;
  1429. let _uuid = uuidv4();
  1430. let _msg = `
  1431. 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.
  1432. ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
  1433. Instruction: Based on the context, follow "Format example", write content
  1434. ## 任务
  1435. 你的任务是根据“课程信息”,提供用户需要的搜索建议,将搜索建议的结果以有序列表的形式返回给用户。
  1436. ## 课程信息
  1437. #### 课程标题:${this.courseDetail.title}
  1438. #### 分类:${this.courseDetail.name ? this.courseDetail.name : "无"}
  1439. #### 学生年级:${
  1440. this.courseDetail.classname ? this.courseDetail.classname : "无"
  1441. }
  1442. ## 规则
  1443. 输出结果基于“课程信息”,避免提供无关的信息。
  1444. 搜索建议的结果符合伦理规范。
  1445. ## 输出
  1446. 输出应包括6个相关的搜索建议,每个搜索建议需要以问号的方式结束。
  1447. 请一步步思考如何根据现有信息推送搜索建议,但是不需要输出搜索建议以外的内
  1448. ## 输出格式
  1449. 搜索建议应以有序列表形式呈现,每个建议包括关键词和简短描述。输出JSON格式的
  1450. ## Format example
  1451. [{"index": 1,"title": "垃圾分类标准","label": "不同国家的垃圾分类标准和方法?"},{"index": 2,"title":"可回收垃圾处理","label": "可回收垃圾的处理流程和再利用方法?"},{ "index": 3, "title": "有害垃圾的影响", "label": "有害垃圾对环境和人体健康的潜在影响?"},{ "index": 4, "title": "垃圾分类标准", "label": "不同国家的垃圾分类标准和方法?"},{ "index": 5, "title": "可回收垃圾处理", "label": "可回收垃圾的处理流程和再利用方法?"},{ "index": 6, "title": "有害垃圾的影响", "label": "有害垃圾对环境和人体健康的潜在影响?"}]
  1452. `;
  1453. this.chatList.push({
  1454. role: "user",
  1455. content: `wanSearch`,
  1456. uid: _uuid,
  1457. AI: "AI",
  1458. aiContent: "",
  1459. oldContent: "",
  1460. isShowSynchronization: false,
  1461. filename: "",
  1462. index: this.chatList.length,
  1463. is_mind_map: false,
  1464. loading: true
  1465. });
  1466. this.scrollBottom();
  1467. // let params = {
  1468. // model: "gpt-3.5-turbo",
  1469. // temperature: 0,
  1470. // max_tokens: 4096,
  1471. // top_p: 1,
  1472. // frequency_penalty: 0,
  1473. // presence_penalty: 0,
  1474. // messages: [{ role: "user", content: _msg }],
  1475. // uid: _uuid,
  1476. // mind_map_question: ""
  1477. // };
  1478. let params = {
  1479. assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
  1480. userId: this.userid,
  1481. message: [{ type: "text", text: _msg }],
  1482. session_name:_uuid,
  1483. // uid: _uuid,
  1484. file_ids: this.fileId
  1485. };
  1486. // let params = {
  1487. // message: {
  1488. // anthropic_version: "bedrock-2023-05-31",
  1489. // max_tokens: 4096,
  1490. // temperature: 0,
  1491. // top_p: 1,
  1492. // messages: [{ role: "user", content: _msg }]
  1493. // },
  1494. // uid: _uuid,
  1495. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  1496. // };
  1497. this.text = "";
  1498. this.ajax
  1499. // .post("https://gpt4.cocorobo.cn/chat", params)
  1500. // .post("https://claude3.cocorobo.cn/chat", params)
  1501. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
  1502. .then(res => {
  1503. console.log(res)
  1504. let _data = res.data.FunctionResponse.message;
  1505. _data = _data.replaceAll("```json", "").replaceAll("```", "");
  1506. const match = _data.match(/\[\s*{[^]*}\s*\]/)
  1507. console.log(_data)
  1508. console.log(match)
  1509. this.chatList.find(i => i.uid == _uuid).aiContent =JSON.parse(match[0]);
  1510. this.chatList.find(i => i.uid == _uuid).isalltext = true;
  1511. this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
  1512. this.chatList.find(i => i.uid == _uuid).loading = false;
  1513. this.scrollBottom();
  1514. this.chatLoading = false;
  1515. })
  1516. .catch(e => {
  1517. this.chatLoading = false;
  1518. console.log(e);
  1519. });
  1520. // this.getWAntSearchContent(_uuid);
  1521. },
  1522. addAsk(_text){
  1523. // this.chatLoading = true;
  1524. let _uuid = uuidv4();
  1525. let _msg = `NOTICERole: 你是一个多功能的AI助手,能够根据学生的文本内容判断其情感状态,并提供相应的支持和引导。Output: Provide your output in json format.ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced \"Format example\".Instruction: Based on the context, follow \"Format example\", write content.# Context## 任务1.学生文本内容,执行以下任务。首先,请你判断学生是否进行情感倾诉,比如心情不好、遭遇校园暴力、对他人进行人身攻击等。如果是,请扮演一个心理咨询师的角色,坚持人本主义的立场,善良、温柔地引导对方,安抚对方的情绪,为对方提供心理支持。剩下的其它情况,请你扮演提问引导者的角色,延续学生的提问,围绕问题本身,提出3个问题,激发学生的深度思考、创造性思考。2.人本主义心理学人本主义心理学强调个体的主观体验和自我实现,认为每个人都有内在的潜力和价值。心理咨询师应当以同理心、无条件积极关注和真诚的态度对待来访者,帮助他们发现自身的力量和解决问题的能力。3.提问引导技巧提问引导技巧包括开放性问题、反思性问题和假设性问题等,旨在通过提问激发对方的思考和探索,帮助他们深入理解问题并找到解决方案。## 工作流程1. 仔细阅读并分析学生提供的文本内容。2. 判断学生是否进行情感倾诉。3. 如果是情感倾诉,扮演心理咨询师的角色,提供情感支持和引导。4. 如果不是情感倾诉,扮演提问引导者的角色,围绕问题本身提出3个问题。## 限制/注意事项 1.在回答时应保持专业性和权威性,确保信息的准确性和可靠性。2.避免生成与问题无关或不恰当的回答,确保回答的相关性和实用性。3.在提供情感支持时,注意用词温柔,避免引起对方的负面情绪。## 要求1. 内容包含情感支持或追加问题。2. 情感支持部分应体现同理心和积极关注。3. 追加问题应具有启发性和深度。## 学生文本内容${_text}# Format example [{\"index\": 1,\"label\": \"不同国家的垃圾分类标准和方法?\"},{\"index\": 2, \"label\": \"可回收垃圾的处理流程和再利用方法?\"},{\"index\": 3,\"label\": \"有害垃圾对环境和人体健康的潜在影响?\"}]`;
  1526. _msg = _msg.replace(/[\r\n]/g, "");
  1527. this.chatList.push({
  1528. role: "user",
  1529. content: `addAsk`,
  1530. uid: _uuid,
  1531. AI: "AI",
  1532. aiContent: "",
  1533. oldContent: "",
  1534. isShowSynchronization: false,
  1535. filename: "",
  1536. index: this.chatList.length,
  1537. is_mind_map: false,
  1538. loading: true
  1539. });
  1540. this.scrollBottom();
  1541. let history = [];
  1542. // this.nowChatList.forEach(i => {
  1543. // if (i.content == "wanSearch") {
  1544. // // history.push({
  1545. // // role:"assistant",
  1546. // // content: JSON.stringify(i.aiContent)
  1547. // // })
  1548. // return;
  1549. // } else if (i.content == "getImage") {
  1550. // return history.push({
  1551. // role: "assistant",
  1552. // content: i.aiContent
  1553. // });
  1554. // }else if(i.content == "addAsk"){
  1555. // }
  1556. // if (i.content) {
  1557. // history.push({
  1558. // role: "user",
  1559. // content: i.content
  1560. // });
  1561. // }
  1562. // if (i.aiContent) {
  1563. // history.push({
  1564. // role: "assistant",
  1565. // content: i.aiContent
  1566. // });
  1567. // }
  1568. // });
  1569. history.push({ type: "text", text: _msg });
  1570. console.log(history)
  1571. // let params = {
  1572. // model: "gpt-3.5-turbo",
  1573. // temperature: 0,
  1574. // max_tokens: 4096,
  1575. // top_p: 1,
  1576. // frequency_penalty: 0,
  1577. // presence_penalty: 0,
  1578. // messages:history,
  1579. // stream: false,
  1580. // uid: _uuid,
  1581. // mind_map_question: ""
  1582. // };
  1583. let params = {
  1584. assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
  1585. userId: this.userid,
  1586. message: history,
  1587. session_name:_uuid,
  1588. // uid: _uuid,
  1589. file_ids: this.fileId
  1590. };
  1591. // let params = {
  1592. // message: {
  1593. // anthropic_version: "bedrock-2023-05-31",
  1594. // max_tokens: 4096,
  1595. // temperature: 0,
  1596. // top_p: 1,
  1597. // messages: [{ role: "user", content: _msg }]
  1598. // },
  1599. // uid: _uuid,
  1600. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  1601. // };
  1602. this.text = "";
  1603. this.ajax
  1604. // .post("https://gpt4.cocorobo.cn/chat", params)
  1605. // .post("https://claude3.cocorobo.cn/chat", params)
  1606. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
  1607. .then(res => {
  1608. console.log(res)
  1609. let _data = res.data.FunctionResponse.message;
  1610. console.log(_data);
  1611. _data = _data.replaceAll("```json", "").replaceAll("```", "");
  1612. this.chatList.find(i => i.uid == _uuid).aiContent =JSON.parse(_data);
  1613. this.chatList.find(i => i.uid == _uuid).isalltext = true;
  1614. this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
  1615. this.chatList.find(i => i.uid == _uuid).loading = false;
  1616. this.scrollBottom();
  1617. // this.chatLoading = false;
  1618. })
  1619. .catch(e => {
  1620. this.chatLoading = false;
  1621. this.chatList.find(i => i.uid == _uuid).loading = false;
  1622. console.log(e);
  1623. });
  1624. },
  1625. scrollBottom() {
  1626. this.$nextTick(() => {
  1627. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  1628. });
  1629. },
  1630. initTaskList() {
  1631. this.taskList = [];
  1632. this.taskList = JSON.parse(JSON.stringify(this.navList));
  1633. this.taskList.forEach(i1 => {
  1634. i1.isOpen = true;
  1635. i1.task.forEach(i2 => {
  1636. i2.isOpen = true;
  1637. i2.tool.forEach(i3 => {
  1638. i3.isOpen = true;
  1639. });
  1640. });
  1641. });
  1642. },
  1643. getWorkData() {
  1644. if(this.workSum==0)return;
  1645. let params = {
  1646. cid: this.courseId,
  1647. classid: this.tcid
  1648. };
  1649. this.userList = [];
  1650. this.ajax
  1651. .get(this.$store.state.api + "selectWorkBycidAi", params)
  1652. .then(res => {
  1653. let _data = res.data[0];
  1654. console.log(_data);
  1655. if (_data.length > 0) {
  1656. this.userList = _data;
  1657. }
  1658. })
  1659. .catch(e => {
  1660. // this.$message.error()
  1661. this.userList = [];
  1662. console.log(e);
  1663. });
  1664. },
  1665. lookStudentDetail(_data) {
  1666. this.loading = true;
  1667. let params = {
  1668. cid: this.courseId,
  1669. uid: _data.userid
  1670. };
  1671. this.ajax
  1672. .get(this.$store.state.api + "selectWorkBycidAiByUid", params)
  1673. .then(res => {
  1674. let _result = res.data[0];
  1675. this.atTagIndex = 2;
  1676. this.loading = false;
  1677. _result.forEach(i => {
  1678. i.content = JSON.parse(i.content)[0];
  1679. });
  1680. this.lookStudentData = {
  1681. userName: _data.username,
  1682. list: _result ? _result : []
  1683. };
  1684. console.log(this.lookStudentData);
  1685. });
  1686. },
  1687. sumUpStudent(_data) {
  1688. let params = {
  1689. cid: this.courseId,
  1690. uid: _data.userid
  1691. };
  1692. this.loading = true;
  1693. this.ajax
  1694. .get(this.$store.state.api + "selectWorkBycidAiByUid", params)
  1695. .then(res => {
  1696. let _result = res.data[0];
  1697. console.log(_result);
  1698. console.log("👆");
  1699. this.text += `${_data.username} 总结分析`;
  1700. let _msg = ``;
  1701. this.chatLoading = true;
  1702. let _uuid = uuidv4();
  1703. this.chatList.push({
  1704. role: "user",
  1705. content: `${this.text}`,
  1706. uid: _uuid,
  1707. AI: "AI",
  1708. aiContent: "",
  1709. oldContent: "",
  1710. isShowSynchronization: false,
  1711. filename: "",
  1712. index: this.chatList.length,
  1713. is_mind_map: false,
  1714. loading: true
  1715. });
  1716. this.text = "";
  1717. let _wordData = "";
  1718. _result.forEach(i => {
  1719. if (i.type == 3) {
  1720. let content = JSON.parse(i.content)[0];
  1721. return (_wordData += `问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n\n`);
  1722. } else if (i.type == 8) {
  1723. let content = JSON.parse(i.content)[0];
  1724. _wordData += `选择题:\n`;
  1725. let _json = content.testJson ? content.testJson.testJson : [];
  1726. _json.forEach((i2, index2) => {
  1727. _wordData += `题目:${i2.teststitle}\n选项:\n`;
  1728. i2.checkList.forEach((item, index) => {
  1729. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  1730. });
  1731. if (typeof i2.answer != "number") {
  1732. i2.answer.forEach(a => {
  1733. a += 1;
  1734. });
  1735. content.anwer[index2].forEach(b => {
  1736. b += 1;
  1737. });
  1738. _wordData += `答案:${i2.answer.join("、")}`;
  1739. _wordData += `学生选择:${content.anwer[index2].join(
  1740. "、"
  1741. )}\n\n`;
  1742. } else {
  1743. _wordData += `答案:${i2.answer + 1}`;
  1744. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  1745. }
  1746. });
  1747. return _wordData;
  1748. } else if (i.type == 2) {
  1749. let content = JSON.parse(i.content)[0];
  1750. _wordData += `问卷:${content.askJson.askTitle}\n`;
  1751. let _json = content.askJson ? content.askJson.askJson : [];
  1752. _json.forEach((i2, index2) => {
  1753. _wordData += `题目:${i2.askstitle}\n选项:\n`;
  1754. i2.checkList.forEach((item, index) => {
  1755. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  1756. });
  1757. if (typeof content.anwer[index2] != "number") {
  1758. _wordData += `学生选择:${content.anwer[index2].join(
  1759. "、"
  1760. )}\n\n`;
  1761. } else {
  1762. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  1763. }
  1764. });
  1765. }
  1766. });
  1767. // console.log(_wordData)
  1768. // this.loading = false;
  1769. // return this.chatLoading = false;
  1770. _msg = `
  1771. NOTICE
  1772. 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.
  1773. ## 目的
  1774. 你是教师用户的课堂助手,你需要基于提供给你的课程相关信息以及学生的作业数据,就某些具体作业对全班学生进行总结分析。
  1775. ---
  1776. ## 定义
  1777. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  1778. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  1779. 【阶段】:阶段表示课程的某一单独部分,包含一个或多个任务。
  1780. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  1781. 【工具】:工具通常是指学生的作业(在课上要具体做的事情)。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。工具中通常会包含学生的作业数据。
  1782. ---
  1783. ## 工作流程与规则
  1784. 1. 了解信息。读取【工具总览表格】以及【工具详情:总体数据】中的内容,了解学生作业详情。
  1785. 2. 确保信息的完整性和可解读性。当面对不确定信息时,你应当积极提问。这一点适用于以下两种情况:
  1786. 2.1 当用户的提问需要你对课程、任务或工具拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  1787. 2.2 当你不理解某个工具的设置时(比如当你发现题目、选项的表述不完整或者有不符合中文表达规则的符号;又比如你发现缺乏必要的统计信息),你应当积极向用户询问。
  1788. 2.3 **例外情况**:在告知用户并征得同意的情况下,你可以忽视上述问题并执行后续流程。
  1789. 3. 进行总结。
  1790. 3.1 对表格信息进行简单总结。包括任务、阶段、工具及其内容。
  1791. 3.2 进行结果分析。对于每一个工具,都从全班的角度出发进行简单总结。
  1792. 3.3 进行错因分析。仅仅针对于某些错误率较高的题目,从全班的角度出发,进行错因分析。
  1793. 4. 提供扩展题目。针对错误的题目,向用户提供同等水平的题目以起到举一反三的练习效果。
  1794. 5. 回答问题。当用户询问你某个【工具】的具体信息,这部分信息通常将就是学生的作业。你需要简单总结该部分信息,并就用户的问题进行回答。
  1795. ---
  1796. ## 做题信息
  1797. 学生名称:${_data.username}
  1798. ${_wordData}
  1799. `;
  1800. console.log(_msg);
  1801. // this.chatLoading = false;
  1802. // return;
  1803. let history = [];
  1804. this.nowChatList.forEach(i => {
  1805. if (i.content == "wanSearch") {
  1806. return;
  1807. } else if (i.content == "getImage") {
  1808. return history.push({
  1809. role: "assistant",
  1810. content: i.aiContent
  1811. });
  1812. }
  1813. if (i.content) {
  1814. history.push({
  1815. role: "user",
  1816. content: i.content
  1817. });
  1818. }
  1819. if (i.aiContent) {
  1820. history.push({
  1821. role: "assistant",
  1822. content: i.aiContent
  1823. });
  1824. }
  1825. });
  1826. // if (_msg) {
  1827. history.push({ role: "user", content: _msg });
  1828. let params = {
  1829. assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
  1830. userId: this.userid,
  1831. message: _text,
  1832. session_name: `${this.courseId}-studyStudent-md`,
  1833. uid: _uuid,
  1834. file_ids: this.fileId
  1835. };
  1836. // let params = {
  1837. // model: "gpt-3.5-turbo",
  1838. // temperature: 0,
  1839. // max_tokens: 4096,
  1840. // top_p: 1,
  1841. // frequency_penalty: 0,
  1842. // presence_penalty: 0,
  1843. // messages: history,
  1844. // uid: _uuid,
  1845. // mind_map_question: _text
  1846. // };
  1847. // let params = {
  1848. // message: {
  1849. // anthropic_version: "bedrock-2023-05-31",
  1850. // max_tokens: 4096,
  1851. // temperature: 0,
  1852. // top_p: 1,
  1853. // messages: history
  1854. // },
  1855. // uid: _uuid,
  1856. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  1857. // };
  1858. this.ajax
  1859. // .post("https://gpt4.cocorobo.cn/chat", params)
  1860. // .post("https://claude3.cocorobo.cn/chat", params)
  1861. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  1862. .then(res => {
  1863. if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
  1864. this.loading = false;
  1865. } else {
  1866. // this.$message.warning(res.data.FunctionResponse.result);
  1867. console.log(res.data.FunctionResponse.result)
  1868. this.chatLoading = false;
  1869. this.loading = false;
  1870. }
  1871. })
  1872. .catch(e => {
  1873. console.log(e);
  1874. this.chatLoading = false;
  1875. this.loading = false;
  1876. });
  1877. this.saveUid = _uuid;
  1878. // this.getAiContent(_uuid);
  1879. this.getAtAuContent(_uuid)
  1880. });
  1881. },
  1882. sumUpStudent2(_data) {
  1883. this.text += `${_data.username} 作业分析`;
  1884. let _msg = ``;
  1885. this.chatLoading = true;
  1886. let _uuid = uuidv4();
  1887. this.chatList.push({
  1888. role: "user",
  1889. content: `${this.text}`,
  1890. uid: _uuid,
  1891. AI: "AI",
  1892. aiContent: "",
  1893. oldContent: "",
  1894. isShowSynchronization: false,
  1895. filename: "",
  1896. index: this.chatList.length,
  1897. is_mind_map: false,
  1898. loading: true
  1899. });
  1900. this.text = "";
  1901. let _wordData = "";
  1902. let content = _data.content;
  1903. if (_data.type == 3) {
  1904. _wordData += `问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n\n`;
  1905. } else if (_data.type == 8) {
  1906. _wordData += `选择题:\n`;
  1907. let _json = content.testJson ? content.testJson.testJson : [];
  1908. _json.forEach((i2, index2) => {
  1909. _wordData += `题目:${i2.teststitle}\n选项:\n`;
  1910. i2.checkList.forEach((item, index) => {
  1911. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  1912. });
  1913. if (typeof i2.answer != "number") {
  1914. i2.answer.forEach(a => {
  1915. a += 1;
  1916. });
  1917. content.anwer[index2].forEach(b => {
  1918. b += 1;
  1919. });
  1920. _wordData += `答案:${i2.answer.join("、")}`;
  1921. _wordData += `学生选择:${content.anwer[index2].join("、")}\n\n`;
  1922. } else {
  1923. _wordData += `答案:${i2.answer + 1}`;
  1924. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  1925. }
  1926. });
  1927. _wordData;
  1928. } else if (_data.type == 2) {
  1929. _wordData += `问卷:${content.askJson.askTitle}\n`;
  1930. let _json = content.askJson ? content.askJson.askJson : [];
  1931. _json.forEach((i2, index2) => {
  1932. _wordData += `题目:${i2.askstitle}\n选项:\n`;
  1933. i2.checkList.forEach((item, index) => {
  1934. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  1935. });
  1936. if (typeof content.anwer[index2] != "number") {
  1937. _wordData += `学生选择:${content.anwer[index2].join("、")}\n\n`;
  1938. } else {
  1939. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  1940. }
  1941. });
  1942. }
  1943. // if(_data.type==3){
  1944. // _wordData+=`问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n`
  1945. // }else if(_data.type==8){
  1946. // _wordData+=`选择题:\n`
  1947. // content.testJson.testJson.forEach((i2,index2)=>{
  1948. // _wordData += `题目:${i2.teststitle}\n选项:\n`
  1949. // i2.checkList.forEach((item,index)=>{
  1950. // _wordData+=`${index+1}:${item}\n`
  1951. // })
  1952. // _wordData +=`答案:${i2.answer}`
  1953. // _wordData +=`学生选择:${(content.anwer[index2])+1}\n`
  1954. // })
  1955. // }
  1956. // console.log("👇👇👇")
  1957. // console.log(_wordData)
  1958. // this.chatLoading = false;
  1959. // this.loading = false;
  1960. // return
  1961. _msg = `
  1962. NOTICE
  1963. 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.
  1964. ## 目的
  1965. 你是教师用户的课堂助手,你需要基于提供给你的课程相关信息以及学生的作业数据,就某些具体作业对全班学生进行总结分析。
  1966. ---
  1967. ## 定义
  1968. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  1969. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  1970. 【阶段】:阶段表示课程的某一单独部分,包含一个或多个任务。
  1971. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  1972. 【工具】:工具通常是指学生的作业(在课上要具体做的事情)。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。工具中通常会包含学生的作业数据。
  1973. ---
  1974. ## 工作流程与规则
  1975. 1. 了解信息。读取【工具总览表格】以及【工具详情:总体数据】中的内容,了解学生作业详情。
  1976. 2. 确保信息的完整性和可解读性。当面对不确定信息时,你应当积极提问。这一点适用于以下两种情况:
  1977. 2.1 当用户的提问需要你对课程、任务或工具拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  1978. 2.2 当你不理解某个工具的设置时(比如当你发现题目、选项的表述不完整或者有不符合中文表达规则的符号;又比如你发现缺乏必要的统计信息),你应当积极向用户询问。
  1979. 2.3 **例外情况**:在告知用户并征得同意的情况下,你可以忽视上述问题并执行后续流程。
  1980. 3. 进行总结。
  1981. 3.1 对表格信息进行简单总结。包括任务、阶段、工具及其内容。
  1982. 3.2 进行结果分析。对于每一个工具,都从全班的角度出发进行简单总结。
  1983. 3.3 进行错因分析。仅仅针对于某些错误率较高的题目,从全班的角度出发,进行错因分析。
  1984. 4. 提供扩展题目。针对错误的题目,向用户提供同等水平的题目以起到举一反三的练习效果。
  1985. 5. 回答问题。当用户询问你某个【工具】的具体信息,这部分信息通常将就是学生的作业。你需要简单总结该部分信息,并就用户的问题进行回答。
  1986. ---
  1987. ## 做题信息
  1988. 学生名称:${_data.username}
  1989. ${_wordData}
  1990. `;
  1991. console.log(_msg);
  1992. let history = [];
  1993. this.nowChatList.forEach(i => {
  1994. if (i.content == "wanSearch") {
  1995. return;
  1996. } else if (i.content == "getImage") {
  1997. return history.push({
  1998. role: "assistant",
  1999. content: i.aiContent
  2000. });
  2001. }
  2002. if (i.content) {
  2003. history.push({
  2004. role: "user",
  2005. content: i.content
  2006. });
  2007. }
  2008. if (i.aiContent) {
  2009. history.push({
  2010. role: "assistant",
  2011. content: i.aiContent
  2012. });
  2013. }
  2014. });
  2015. // if (_msg) {
  2016. history.push({ role: "user", content: _msg });
  2017. let params = {
  2018. assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
  2019. userId: this.userid,
  2020. message: _text,
  2021. session_name: `${this.courseId}-studyStudent-md`,
  2022. uid: _uuid,
  2023. file_ids: this.fileId
  2024. };
  2025. // let params = {
  2026. // model: "gpt-3.5-turbo",
  2027. // temperature: 0,
  2028. // max_tokens: 4096,
  2029. // top_p: 1,
  2030. // frequency_penalty: 0,
  2031. // presence_penalty: 0,
  2032. // messages: history,
  2033. // uid: _uuid,
  2034. // mind_map_question: _text
  2035. // };
  2036. // let params = {
  2037. // message: {
  2038. // anthropic_version: "bedrock-2023-05-31",
  2039. // max_tokens: 4096,
  2040. // temperature: 0,
  2041. // top_p: 1,
  2042. // messages: history
  2043. // },
  2044. // uid: _uuid,
  2045. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2046. // };
  2047. this.ajax
  2048. // .post("https://gpt4.cocorobo.cn/chat", params)
  2049. // .post("https://claude3.cocorobo.cn/chat", params)
  2050. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  2051. .then(res => {
  2052. if (converter(res.data.FunctionResponse.result) == converter("发送成功")) {
  2053. } else {
  2054. // this.$message.warning(res.data.FunctionResponse.result);
  2055. console.log(res.data.FunctionResponse.result)
  2056. this.chatLoading = false;
  2057. }
  2058. })
  2059. .catch(e => {
  2060. console.log(e);
  2061. this.chatLoading = false;
  2062. });
  2063. this.saveUid = _uuid;
  2064. // this.getAiContent(_uuid);
  2065. this.getAtAuContent(_uuid)
  2066. },
  2067. download(_url) {
  2068. let xhr = new XMLHttpRequest();
  2069. xhr.open("GET", _url, true);
  2070. xhr.responseType = "blob";
  2071. xhr.onload = () => {
  2072. if (xhr.status === 200) {
  2073. let blob = xhr.response;
  2074. // const _blob = new Blob([blob], { type: fileType });
  2075. const downloadElement = document.createElement("a");
  2076. const url = window.URL.createObjectURL(blob);
  2077. downloadElement.href = url;
  2078. downloadElement.download = "Image.jpg";
  2079. downloadElement.click();
  2080. window.URL.revokeObjectURL(url); // 释放内存
  2081. }else{
  2082. this.$message.error("此图片不支持下载");
  2083. }
  2084. };
  2085. xhr.onerror = (e)=>{
  2086. console.log(e)
  2087. this.$message.error("此图片不支持下载");
  2088. }
  2089. xhr.send();
  2090. }
  2091. },
  2092. mounted() {
  2093. this.getChatList().then(_ => {
  2094. this.scrollBottom();
  2095. this.getWantSearch();
  2096. });
  2097. this.nowChatList = [];
  2098. this.sendType = 0;
  2099. this.initTaskList();
  2100. this.getWorkData();
  2101. }
  2102. };
  2103. </script>
  2104. <style scoped>
  2105. .search {
  2106. width: 100%;
  2107. height: 100%;
  2108. box-sizing: border-box;
  2109. }
  2110. .checkboxCss{
  2111. color: #fff;
  2112. background-color: #76a7f5 !important;
  2113. }
  2114. .imgNumberBlock {
  2115. width: 100%;
  2116. height: 30px;
  2117. display: flex;
  2118. justify-content: space-between;
  2119. box-sizing: border-box;
  2120. /* padding: 5px 10px; */
  2121. }
  2122. .imgNumberBlock > .imgNumber {
  2123. width: 18%;
  2124. height: 30px;
  2125. white-space: initial;
  2126. background: rgba(224, 234, 251, 1);
  2127. border-radius: 5px;
  2128. display: flex;
  2129. align-items: center;
  2130. cursor: pointer;
  2131. justify-content: center;
  2132. }
  2133. .s_top {
  2134. width: 100%;
  2135. height: calc(100% - 90px);
  2136. overflow-x: hidden;
  2137. box-sizing: border-box;
  2138. padding: 20px 0;
  2139. }
  2140. .s_t_chat {
  2141. width: 100%;
  2142. display: flex;
  2143. box-sizing: border-box;
  2144. padding: 10px;
  2145. flex-direction: column;
  2146. }
  2147. .s_t_chat > div {
  2148. display: flex;
  2149. align-items: flex-start;
  2150. width: 100%;
  2151. }
  2152. .s_t_c_user {
  2153. box-sizing: border-box;
  2154. padding-left: 35px;
  2155. }
  2156. .s_t_c_u_left {
  2157. width: 90%;
  2158. height: auto;
  2159. }
  2160. .s_t_c_u_l_content {
  2161. width: auto;
  2162. max-width: 100%;
  2163. height: auto;
  2164. box-sizing: border-box;
  2165. padding: 10px;
  2166. color: white;
  2167. background-color: #3681fc;
  2168. border-radius: 8px 2px 8px 8px;
  2169. white-space: pre-line;
  2170. word-break: break-all;
  2171. }
  2172. .s_t_c_a_r_contentImage > span {
  2173. display: block;
  2174. }
  2175. .s_t_c_a_r_contentImage > img {
  2176. width: 45%;
  2177. height: 125px;
  2178. margin: 1% 1.5%;
  2179. border-radius: 5px;
  2180. cursor: pointer;
  2181. }
  2182. .s_t_c_a_r_contentImage {
  2183. width: auto;
  2184. max-width: 100%;
  2185. height: auto;
  2186. box-sizing: border-box;
  2187. padding: 10px;
  2188. background-color: #f6f8ff;
  2189. border-radius: 2px 8px 8px 8px;
  2190. white-space: pre-line;
  2191. word-break: break-all;
  2192. }
  2193. .s_t_c_u_l_time {
  2194. width: 100%;
  2195. display: flex;
  2196. justify-content: flex-end;
  2197. font-size: 12px;
  2198. color: #9f9f9f;
  2199. margin-top: 5px;
  2200. }
  2201. .s_t_c_u_right {
  2202. width: 35px;
  2203. height: 35px;
  2204. display: flex;
  2205. justify-content: center;
  2206. margin-left: 5px;
  2207. }
  2208. .s_t_c_u_right > span {
  2209. width: 32px;
  2210. height: 32px;
  2211. display: flex;
  2212. justify-content: center;
  2213. align-items: center;
  2214. color: white;
  2215. background-color: #3681fc;
  2216. border-radius: 50%;
  2217. }
  2218. .s_t_c_ai {
  2219. box-sizing: border-box;
  2220. padding-right: 35px;
  2221. position: relative;
  2222. margin-top: 10px;
  2223. }
  2224. .aiCopy {
  2225. position: absolute;
  2226. right: 5px;
  2227. bottom: 0%;
  2228. /* transform: translate(0, -30%); */
  2229. cursor: pointer;
  2230. }
  2231. .s_t_c_a_right {
  2232. min-width: 90%;
  2233. height: auto;
  2234. }
  2235. .s_t_c_a_r_content {
  2236. width: auto;
  2237. max-width: 100%;
  2238. height: auto;
  2239. box-sizing: border-box;
  2240. padding: 10px;
  2241. background-color: #f6f8ff;
  2242. border-radius: 2px 8px 8px 8px;
  2243. white-space: pre-line;
  2244. word-break: break-all;
  2245. }
  2246. .s_t_c_a_r_content2 {
  2247. background-color: #f6f8ff;
  2248. width: 100%;
  2249. height: auto;
  2250. box-sizing: border-box;
  2251. padding: 10px;
  2252. border-radius: 2px 8px 8px 8px;
  2253. box-shadow: 0 0px 10px #c5cbee;
  2254. }
  2255. .s_t_c_a_r_c_title {
  2256. display: flex;
  2257. align-items: center;
  2258. }
  2259. .s_t_c_a_r_c_title > img {
  2260. width: 16px;
  2261. height: 16px;
  2262. }
  2263. .s_t_c_a_r_c_item {
  2264. width: 100%;
  2265. height: auto;
  2266. box-sizing: border-box;
  2267. padding: 10px;
  2268. background-color: #ffffff;
  2269. border-radius: 5px;
  2270. margin-top: 10px;
  2271. color: #666666;
  2272. font-size: 14px;
  2273. cursor: pointer;
  2274. border: solid #ffffff 1px;
  2275. box-shadow: 0 0 5px 2px #ffffff;
  2276. }
  2277. .s_t_c_a_r_c_item:hover {
  2278. border: solid #b8d2fe 1px;
  2279. box-shadow: 0 0 5px 2px #b8d2fe;
  2280. }
  2281. .s_t_c_a_r_c_title > span {
  2282. font-weight: bold;
  2283. }
  2284. .s_t_c_a_r_time {
  2285. width: 100%;
  2286. display: flex;
  2287. justify-content: flex-start;
  2288. font-size: 12px;
  2289. color: #9f9f9f;
  2290. margin-top: 5px;
  2291. }
  2292. .s_t_c_a_left {
  2293. width: 35px;
  2294. height: 35px;
  2295. display: flex;
  2296. justify-content: center;
  2297. margin-right: 5px;
  2298. }
  2299. .s_t_c_a_left > span {
  2300. width: 32px;
  2301. height: 32px;
  2302. display: flex;
  2303. justify-content: center;
  2304. align-items: center;
  2305. color: white;
  2306. background-color: #3681fc;
  2307. border-radius: 50%;
  2308. }
  2309. .s_bottom {
  2310. width: 100%;
  2311. height: 90px;
  2312. display: flex;
  2313. flex-direction: column;
  2314. justify-content: space-between;
  2315. position: relative;
  2316. }
  2317. .s_b_btnAreaTop{
  2318. width: 100%;
  2319. height: 35px;
  2320. margin-bottom:5px;
  2321. display: flex;
  2322. align-items: center;
  2323. box-sizing: border-box;
  2324. padding: 0 10px;
  2325. overflow: auto;
  2326. background-color: yellow;
  2327. }
  2328. .s_b_btnArea {
  2329. width: 100%;
  2330. height: 30px;
  2331. display: flex;
  2332. align-items: center;
  2333. box-sizing: border-box;
  2334. padding: 0 10px;
  2335. overflow: auto;
  2336. }
  2337. .s_b_ba-item {
  2338. width: auto;
  2339. box-sizing: border-box;
  2340. padding: 0 10px;
  2341. height: 25px;
  2342. background-color: white;
  2343. display: flex;
  2344. justify-content: center;
  2345. align-items: center;
  2346. /* 阴影 */
  2347. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
  2348. border-radius: 15px;
  2349. font-size: 14px;
  2350. cursor: pointer;
  2351. margin-right: 10px;
  2352. white-space: nowrap;
  2353. }
  2354. .s_b_ba_active{
  2355. background-color: #3781FC;
  2356. color: #fff;
  2357. }
  2358. .s_b_inputArea {
  2359. width: 100%;
  2360. height: 55px;
  2361. box-sizing: border-box;
  2362. border-top: solid 1px #ededed;
  2363. display: flex;
  2364. justify-content: space-between;
  2365. align-items: center;
  2366. padding-right: 10px;
  2367. }
  2368. .s_b_tape {
  2369. width: 35px;
  2370. height: 35px;
  2371. background: url("../../../assets/icon/course/tape.png") no-repeat;
  2372. background-size: 50% 60%;
  2373. background-position: center;
  2374. cursor: pointer;
  2375. }
  2376. .s_b_input {
  2377. /* width: 65%; */
  2378. flex: 1;
  2379. height: 45px;
  2380. background-color: #f3f3f3;
  2381. border-radius: 50px;
  2382. margin: 0 10px;
  2383. display: flex;
  2384. align-items: center;
  2385. overflow: hidden;
  2386. }
  2387. .s_b_i_left {
  2388. width: 100%;
  2389. line-height: 45px;
  2390. height: 100%;
  2391. }
  2392. .s_b_i_left >>> .el-input__inner {
  2393. border: none;
  2394. background-color: #f3f3f3;
  2395. outline: none;
  2396. border-radius: 50px 0 0 50px;
  2397. }
  2398. .s_b_i_right {
  2399. width: 45px;
  2400. height: 45px;
  2401. display: flex;
  2402. justify-content: center;
  2403. align-items: center;
  2404. }
  2405. .s_b_i_right > span {
  2406. width: 35px;
  2407. height: 35px;
  2408. background: url("../../../assets/icon/course/file.png") no-repeat;
  2409. background-size: 50% 60%;
  2410. background-position: center;
  2411. cursor: pointer;
  2412. }
  2413. .s_b_btn {
  2414. width: 40px;
  2415. height: 40px;
  2416. background-color: #3681fc;
  2417. display: flex;
  2418. justify-content: center;
  2419. align-items: center;
  2420. border-radius: 50%;
  2421. cursor: pointer;
  2422. }
  2423. .s_b_btn > div {
  2424. width: 100%;
  2425. height: 100%;
  2426. display: flex;
  2427. justify-content: center;
  2428. align-items: center;
  2429. color: #fff;
  2430. }
  2431. .s_b_btn > span {
  2432. width: 30px;
  2433. height: 30px;
  2434. background: url("../../../assets/icon/course/send.png") no-repeat;
  2435. background-size: 70% 70%;
  2436. background-position: center;
  2437. }
  2438. .s_b_atBox {
  2439. width: 95%;
  2440. height: 450px;
  2441. position: absolute;
  2442. bottom: calc(100% - 30px);
  2443. left: 0;
  2444. max-height: 450px;
  2445. box-sizing: border-box;
  2446. border: solid 1px #d8d8d8;
  2447. box-shadow: 0 4px 4px 0 #00000040;
  2448. margin-left: 1.5%;
  2449. background-color: #fff;
  2450. }
  2451. .s_b_at_tag {
  2452. width: 100%;
  2453. height: 35px;
  2454. border-bottom: 1px solid #d8d8d8;
  2455. display: flex;
  2456. align-items: center;
  2457. padding: 0 10px;
  2458. box-sizing: border-box;
  2459. position: relative;
  2460. }
  2461. .s_b_at_tag > span {
  2462. margin: 0 10px;
  2463. font-weight: bold;
  2464. cursor: pointer;
  2465. transition: 0.1s;
  2466. position: relative;
  2467. }
  2468. .s_b_at_tag_active {
  2469. color: #3681fc;
  2470. }
  2471. .s_b_at_tag_active::after {
  2472. content: "";
  2473. width: 100%;
  2474. height: 3px;
  2475. border-radius: 3px;
  2476. bottom: -8px;
  2477. left: 0px;
  2478. background-color: #3681fc;
  2479. position: absolute;
  2480. }
  2481. .s_b_at_list {
  2482. width: 100%;
  2483. max-height: calc(100% - 35px);
  2484. overflow: auto;
  2485. box-sizing: border-box;
  2486. padding: 10px;
  2487. }
  2488. .s_b_at_l_top {
  2489. width: 100%;
  2490. box-sizing: border-box;
  2491. padding: 12px 10px;
  2492. height: 30px;
  2493. display: flex;
  2494. align-items: center;
  2495. justify-content: space-between;
  2496. margin: 10px 0;
  2497. border-radius: 5px;
  2498. cursor: pointer;
  2499. font-size: 16px;
  2500. border-bottom: solid 1px #e2f5fc;
  2501. }
  2502. .s_b_at_l_top > span:nth-child(1) {
  2503. display: block;
  2504. width: calc(100% - 30px);
  2505. overflow: hidden;
  2506. text-overflow: ellipsis;
  2507. white-space: nowrap;
  2508. }
  2509. .s_b_at_l_i_header {
  2510. width: 100%;
  2511. box-sizing: border-box;
  2512. padding: 10px 10px;
  2513. height: 30px;
  2514. display: flex;
  2515. align-items: center;
  2516. margin: 10px 0;
  2517. border-radius: 5px;
  2518. cursor: pointer;
  2519. font-size: 16px;
  2520. }
  2521. .s_b_at_l_i_header > span:nth-child(2) {
  2522. display: block;
  2523. width: calc(100% - 30px);
  2524. overflow: hidden;
  2525. text-overflow: ellipsis;
  2526. white-space: nowrap;
  2527. }
  2528. .s_b_at_l_top > hover {
  2529. background-color: #3781fc;
  2530. color: #fff;
  2531. }
  2532. .s_b_at_l_top > hover > .s_b_at_l_i_h_icon1 {
  2533. background-image: url("../../../assets/icon/course/bDown2.png");
  2534. }
  2535. .s_b_at_l_i_header:hover {
  2536. background-color: #3781fc;
  2537. color: #fff;
  2538. }
  2539. .s_b_at_l_i_header:hover > .s_b_at_l_i_h_icon1 {
  2540. background-image: url("../../../assets/icon/course/bDown2.png");
  2541. }
  2542. .s_b_at_l_i_header:hover > .s_b_at_l_i_h_icon2 {
  2543. background-color: #fff;
  2544. }
  2545. .s_b_at_l_i_h_icon1 {
  2546. min-width: 15px;
  2547. min-height: 15px;
  2548. background-image: url("../../../assets/icon/course/down.png");
  2549. background-repeat: no-repeat;
  2550. background-size: 100% 100%;
  2551. /* transform: rotate(90deg); */
  2552. margin-right: 10px;
  2553. transition: 0.2s;
  2554. }
  2555. .s_b_at_l_i_h_icon2 {
  2556. min-width: 10px;
  2557. min-height: 10px;
  2558. background-color: #3681fc;
  2559. border-radius: 50%;
  2560. margin-right: 15px;
  2561. transition: 0.2s;
  2562. }
  2563. .s_b_at_l_i_content {
  2564. width: 100%;
  2565. box-sizing: border-box;
  2566. padding: 8px 35px;
  2567. height: 25;
  2568. display: flex;
  2569. align-items: center;
  2570. margin: 5px 0;
  2571. border-radius: 5px;
  2572. cursor: pointer;
  2573. font-size: 14px;
  2574. }
  2575. .s_b_at_l_i_content:hover {
  2576. background-color: #3781fc;
  2577. color: #fff;
  2578. }
  2579. .s_b_ab_user {
  2580. width: 100%;
  2581. height: 100px;
  2582. box-sizing: border-box;
  2583. border: solid 1px #3781fc;
  2584. display: flex;
  2585. justify-content: center;
  2586. align-items: center;
  2587. position: relative;
  2588. margin-bottom: 20px;
  2589. }
  2590. .s_b_ab_u_name {
  2591. width: 25%;
  2592. max-width: 25%;
  2593. box-sizing: border-box;
  2594. margin: 0 20px;
  2595. padding: 5px 10px;
  2596. display: flex;
  2597. justify-content: center;
  2598. align-items: center;
  2599. border: solid 1px #3781fc;
  2600. border-radius: 2px;
  2601. }
  2602. .s_b_ab_u_name > span {
  2603. max-width: 100%;
  2604. overflow: hidden;
  2605. text-overflow: ellipsis;
  2606. white-space: nowrap;
  2607. display: block;
  2608. font-size: 14px;
  2609. color: #3681fc;
  2610. }
  2611. .s_b_ab_u_message {
  2612. flex: 1;
  2613. height: 100%;
  2614. display: flex;
  2615. flex-direction: column;
  2616. justify-content: center;
  2617. box-sizing: border-box;
  2618. padding-top: 10px;
  2619. padding-right: 10px;
  2620. }
  2621. .s_b_ab_u_message > span {
  2622. font-size: 16px;
  2623. font-weight: bold;
  2624. display: flex;
  2625. align-items: flex-end;
  2626. flex: 1;
  2627. }
  2628. .s_b_ab_u_message > div {
  2629. width: 100%;
  2630. display: flex;
  2631. justify-content: space-between;
  2632. align-items: center;
  2633. font-size: 16px;
  2634. font-weight: bold;
  2635. flex: 1;
  2636. }
  2637. .s_b_ab_u_btnArea {
  2638. width: auto;
  2639. height: auto;
  2640. position: absolute;
  2641. right: 0;
  2642. top: 5px;
  2643. }
  2644. .s_b_ab_u_btnArea > span {
  2645. box-sizing: border-box;
  2646. color: #3681fc;
  2647. border: solid 1px #3681fc;
  2648. padding: 2px;
  2649. margin-left: 2px;
  2650. font-size: 14px;
  2651. cursor: pointer;
  2652. }
  2653. .s_b_ab_u_btnArea > span:hover {
  2654. color: #fff;
  2655. border: solid 1px #fff;
  2656. background-color: #3681fc;
  2657. }
  2658. .s_b_at_studentDetail {
  2659. width: 100%;
  2660. height: 25px;
  2661. margin: 0 0 10px 0;
  2662. display: flex;
  2663. align-items: center;
  2664. }
  2665. .s_b_at_studentDetail > img {
  2666. width: 20px;
  2667. height: 15px;
  2668. margin-right: 10px;
  2669. cursor: pointer;
  2670. }
  2671. .s_b_at_studentDetail > span {
  2672. font-weight: bold;
  2673. }
  2674. .s_b_at_studentList {
  2675. width: 100%;
  2676. height: calc(100% - 25px);
  2677. overflow: auto;
  2678. }
  2679. .s_b_at_sl_item {
  2680. width: 100%;
  2681. height: auto;
  2682. box-sizing: border-box;
  2683. border: solid 1px #36a9fc;
  2684. padding: 10px;
  2685. margin-bottom: 10px;
  2686. cursor: pointer;
  2687. }
  2688. .s_b_at_sl_item > .s_b_at_sl_message:nth-child(n + 1) {
  2689. margin-top: 10px;
  2690. }
  2691. .s_b_at_sl_phase {
  2692. width: 100%;
  2693. display: flex;
  2694. justify-content: flex-end;
  2695. margin-bottom: 10px;
  2696. margin-right: 10px;
  2697. font-size: 14px;
  2698. font-weight: bold;
  2699. }
  2700. .s_b_at_sl_message {
  2701. font-weight: bold;
  2702. margin: 10px;
  2703. }
  2704. .s_b_at_sl_message > div {
  2705. display: flex;
  2706. width: 100%;
  2707. margin: 10px;
  2708. }
  2709. .s_b_at_sl_message > div > span {
  2710. width: calc(100% - 50px);
  2711. text-overflow: ellipsis;
  2712. overflow: hidden;
  2713. white-space: nowrap;
  2714. display: block;
  2715. }
  2716. .s_b_at_sl_message > div > span > div {
  2717. margin: 5px 0;
  2718. white-space: wrap;
  2719. }
  2720. .s_t_addAsk{
  2721. width:100%;
  2722. height:auto;
  2723. padding:10px 20px;
  2724. display:flex;
  2725. flex-direction:column;
  2726. justify-content:center;
  2727. align-items:center;
  2728. box-sizing:border-box;
  2729. }
  2730. .s_t_addAsk>span{
  2731. box-sizing:border-box;
  2732. width:auto;
  2733. height:auto;
  2734. padding:15px;
  2735. margin-bottom:10px;
  2736. background-color:#F5F6F7;
  2737. border-radius:10px;
  2738. cursor:pointer;
  2739. border:solid 1px #E8E9EC;
  2740. transition:.3s;
  2741. }
  2742. .s_t_addAsk>span:hover{
  2743. background-color:#E8E9EC;
  2744. }
  2745. .d_t_c_a_r_c_img:hover .download_image {
  2746. display: block;
  2747. }
  2748. .download_image {
  2749. position: absolute;
  2750. display: none;
  2751. right: 5px;
  2752. bottom: 5px;
  2753. width: 30px;
  2754. height: 30px;
  2755. cursor: pointer;
  2756. }
  2757. .download_image > img {
  2758. width: 100%;
  2759. height: 100%;
  2760. }
  2761. </style>