searchArea.vue 101 KB

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