searchArea.vue 144 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514
  1. <template>
  2. <div class="search">
  3. <div class="s_top" ref="chatRef" v-if="cardType == 0">
  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. <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
  32. <span v-else>Ai</span>
  33. </div>
  34. <div class="s_t_c_a_right">
  35. <div
  36. class="s_t_c_a_r_content"
  37. v-if="pan(item.aiContent).length"
  38. style="
  39. display: flex;
  40. justify-content: space-between;
  41. flex-wrap: wrap;
  42. "
  43. >
  44. <div
  45. v-if="!pan(item.aiContent).length"
  46. class="d_t_c_a_r_content"
  47. v-loading="item.loading"
  48. v-html="item.aiContent"
  49. ></div>
  50. <div
  51. v-else
  52. v-for="(i, index) in pan(item.aiContent)"
  53. :key="index"
  54. style="position: relative"
  55. class="d_t_c_a_r_c_img"
  56. >
  57. <img
  58. style="width: 130px; height: 130px; object-fit: cover"
  59. :src="i.image"
  60. alt=""
  61. @error="setDefaultSrc"
  62. @click="previewImg(i.image)"
  63. />
  64. <span class="download_image" @click.stop="download(i.image)">
  65. <img
  66. :src="require('../../../assets/icon/fileIcon/download.png')"
  67. />
  68. </span>
  69. </div>
  70. <!-- {{ item }} -->
  71. <div
  72. style="
  73. margin-top: 10px;
  74. width: 100%;
  75. display: flex;
  76. justify-content: end;
  77. "
  78. v-if="
  79. pan(item.aiContent).length > 1 && chatList.length - 2 == index
  80. "
  81. >
  82. <img
  83. style="cursor: pointer"
  84. @click="resetImg(item.content)"
  85. src="../../../assets/icon/course/resImg.png"
  86. alt=""
  87. />
  88. </div>
  89. </div>
  90. <div
  91. v-else
  92. class="s_t_c_a_r_content"
  93. v-loading="item.loading"
  94. v-html="htmlContent(item.aiContent)"
  95. ></div>
  96. <!-- {{ Array.isArray(JSON.parse(item.aiContent)) }} -->
  97. <!-- {{ JSON.parse(item) }} -->
  98. <div
  99. v-if="!pan(item.aiContent).length && !item.loading"
  100. class="aiCopy"
  101. >
  102. <img
  103. v-if="chatList.length - 2 == index"
  104. @click.stop="refresh(item)"
  105. style="width: 15px; margin-bottom: 7px"
  106. :src="require('../../../assets/icon/course/refresh.svg')"
  107. />
  108. <img
  109. @click="onCopy(item.aiContent)"
  110. style="width: 30px; margin-bottom: 7px"
  111. src="../../../assets/icon/course/copyTxt.png"
  112. alt=""
  113. />
  114. <svg
  115. @click.stop="aiTalkAll(item)"
  116. width="16"
  117. height="16"
  118. viewBox="0 0 16 16"
  119. fill="none"
  120. style="width: 15px; margin-bottom: 7px"
  121. xmlns="http://www.w3.org/2000/svg"
  122. >
  123. <path
  124. fill-rule="evenodd"
  125. clip-rule="evenodd"
  126. d="M10.92 1.6203C11.1849 1.42128 11.5611 1.47474 11.7601 1.73969C13.0908 3.51135 13.8796 5.71444 13.8796 8.10004C13.8796 10.4856 13.0908 12.6887 11.7601 14.4604C11.5611 14.7253 11.1849 14.7788 10.92 14.5798C10.655 14.3808 10.6016 14.0046 10.8006 13.7397C11.9806 12.1687 12.6796 10.2169 12.6796 8.10004C12.6796 5.98321 11.9806 4.03137 10.8006 2.46038C10.6016 2.19543 10.655 1.81931 10.92 1.6203ZM6.91962 4.6203C7.18457 4.42128 7.56069 4.47474 7.75971 4.73969C8.46276 5.67568 8.8796 6.84005 8.8796 8.10003C8.8796 9.36002 8.46276 10.5244 7.75971 11.4604C7.56069 11.7253 7.18457 11.7788 6.91962 11.5798C6.65467 11.3808 6.60121 11.0046 6.80023 10.7397C7.35255 10.0044 7.6796 9.09126 7.6796 8.10003C7.6796 7.10881 7.35255 6.19571 6.80023 5.46038C6.60121 5.19543 6.65467 4.81931 6.91962 4.6203ZM4.05485 7.29282C3.82996 7.04946 3.45035 7.03449 3.20698 7.25939C2.96362 7.48428 2.94865 7.86389 3.17355 8.10725C3.23988 8.17904 3.27961 8.27348 3.27961 8.37855C3.27961 8.48652 3.23762 8.58344 3.16781 8.65593C2.93796 8.89462 2.94512 9.27445 3.18381 9.50431C3.4225 9.73416 3.80233 9.727 4.03219 9.48831C4.30866 9.20122 4.47961 8.80923 4.47961 8.37855C4.47961 7.95987 4.318 7.57758 4.05485 7.29282Z"
  127. :fill="
  128. aiTalkUid == item.uid && aiIsTalk ? '#3681FC' : 'black'
  129. "
  130. />
  131. </svg>
  132. <!-- <img
  133. @click.stop="aiTalkAll(item)"
  134. v-if="aiTalkUid == item.uid && aiIsTalk"
  135. style="width: 15px; margin-bottom: 7px"
  136. :src="require('../../../assets/icon/course/megaphone.svg')"
  137. />
  138. <img
  139. @click.stop="aiTalkAll(item)"
  140. v-else
  141. style="width: 15px; margin-bottom: 7px"
  142. :src="require('../../../assets/icon/course/megaphone3.svg')"
  143. /> -->
  144. </div>
  145. <!-- <div
  146. class="s_t_c_a_r_contentImage"
  147. v-loading="item.loading"
  148. >
  149. <span style="margin-bottom: 10px;">为您找到以下图片: {{ item.content }}</span> -->
  150. <!-- {{ item.aiContent }} -->
  151. <!-- <img
  152. v-for="(i, index) in item.aiContent"
  153. @click.stop="$hevueImgPreview(item)"
  154. :key="index"
  155. :src="i.image"
  156. /> -->
  157. <!-- <div class="imgNumberBlock">
  158. <div class="imgNumber" v-for="(i,index) in imgNumList" :key="index+'b'">
  159. {{ i }}
  160. </div>
  161. <div class="imgNumber" style="background: none;">
  162. <img style="width: 36px;height: 30px;" src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame%20131715569413607.png" alt="">
  163. </div>
  164. </div> -->
  165. <!-- </div> -->
  166. <!-- <div class="s_t_c_a_r_time">{{ item.createtime }}</div> -->
  167. </div>
  168. </div>
  169. <div class="s_t_chat" v-if="item.content == 'wanSearch'">
  170. <div class="s_t_c_ai">
  171. <div class="s_t_c_a_left">
  172. <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
  173. <span v-else>Ai</span>
  174. </div>
  175. <div class="s_t_c_a_right">
  176. <div class="s_t_c_a_r_content2" v-loading="item.loading">
  177. <div class="s_t_c_a_r_c_title">
  178. <img :src="require('../../../assets/icon/course/idea.png')" />
  179. <span>猜你想搜:</span>
  180. </div>
  181. <div
  182. class="s_t_c_a_r_c_item"
  183. v-for="(item, index) in item.aiContent"
  184. :key="index"
  185. @click="sendAiIdea(item.label)"
  186. >
  187. {{ index + 1 }}.{{ item.title ? item.title : "" }}:{{
  188. item.label
  189. }}
  190. </div>
  191. </div>
  192. <div class="s_t_c_a_r_time">{{ item.createtime }}</div>
  193. </div>
  194. </div>
  195. </div>
  196. <div
  197. class="s_t_addAsk"
  198. v-if="
  199. item.content == 'addAsk' &&
  200. !item.aiContent.questions &&
  201. item.aiContent.length &&
  202. !item.loading
  203. "
  204. >
  205. <span
  206. v-for="item2 in item.aiContent"
  207. :key="item2.index"
  208. @click.stop="send(item2.label)"
  209. >{{ item2.label }}</span
  210. >
  211. </div>
  212. <div
  213. class="s_t_addAsk"
  214. v-if="
  215. item.content == 'addAsk' &&
  216. item.aiContent.questions &&
  217. !item.loading
  218. "
  219. >
  220. <span
  221. v-for="(item2, index2) in item.aiContent.questions"
  222. :key="index2"
  223. @click.stop="send(item2.question ? item2.question : item2)"
  224. >{{ item2.question ? item2.question : item2 }}</span
  225. >
  226. </div>
  227. <div class="s_t_addAsk" v-if="item.content == 'addAsk' && item.loading">
  228. <span style="width: 50px; height: 50px" v-loading="true"></span>
  229. </div>
  230. </div>
  231. </div>
  232. <div class="choiceTopArea" v-if="cardType == 1">
  233. <div class="choiceTop">
  234. <div class="choiceRoleHeader">
  235. <div class="s_t_c_ai">
  236. <div class="s_t_c_a_left">
  237. <el-avatar
  238. :src="require('../../../assets/icon/course/ai.png')"
  239. ></el-avatar>
  240. </div>
  241. <div class="s_t_c_a_right">
  242. <div class="s_t_c_a_r_content">选择您需要的智能体,开始对话</div>
  243. </div>
  244. </div>
  245. </div>
  246. <div class="choiceSelect">
  247. <div class="cs_type">
  248. <span
  249. :class="sortOption == 0 ? 'cs_typeActive' : ''"
  250. @click="optBtn(0)"
  251. >我的</span
  252. >
  253. <span
  254. :class="sortOption == 1 ? 'cs_typeActive' : ''"
  255. @click="optBtn(1)"
  256. >社区</span
  257. >
  258. </div>
  259. <div class="cs_box">
  260. <div
  261. :class="[
  262. 'cs_b_item',
  263. choseRoleItem && choseRoleItem.assistant_id == item.assistant_id
  264. ? 'cs_b_itemActive'
  265. : ''
  266. ]"
  267. v-for="(item, index) in showRoleList"
  268. :key="sortOption + '-' + index"
  269. @click.stop="choseRole(item)"
  270. >
  271. <el-avatar
  272. class="cs_b_i_avatar"
  273. fit="cover"
  274. shape="square"
  275. :src="
  276. item.headUrl && item.headUrl != ''
  277. ? item.headUrl
  278. : require('../../../assets/icon/course/ai.png')
  279. "
  280. ></el-avatar>
  281. <div class="cs_b_i_name">{{ item.assistantName }}</div>
  282. <div class="cs_b_i_des">{{ item.description }}</div>
  283. </div>
  284. </div>
  285. <!-- <div style="width: 100%">
  286. <div class="roleInput">
  287. <el-input
  288. placeholder="请输入内容"
  289. v-model="roleText"
  290. prefix-icon="el-icon-search"
  291. clearable
  292. >
  293. </el-input>
  294. </div>
  295. <div class="roleBtn">
  296. <el-button
  297. class="option"
  298. :style="{
  299. background: sortOption == 0 ? '#36A9FC' : '',
  300. color: sortOption == 0 ? '#fff' : '',
  301. }"
  302. @click="optBtn(0)"
  303. plain
  304. >我的</el-button
  305. >
  306. <el-button
  307. class="option"
  308. :style="{
  309. background: sortOption == 1 ? '#36A9FC' : '',
  310. color: sortOption == 1 ? '#fff' : '',
  311. }"
  312. @click="optBtn(1)"
  313. plain
  314. >社区</el-button
  315. >
  316. </div>
  317. </div>
  318. <div class="roleListBox">
  319. <div
  320. class="characterBlock"
  321. v-for="(item, index) in showRoleList"
  322. :key="item.id"
  323. @click.stop="choseRole(item)"
  324. >
  325. <div class="imgLeft">
  326. <div class="img">
  327. <img
  328. style="width: 100%; height: 100%"
  329. :src="
  330. item.headUrl && item.headUrl != ''
  331. ? item.headUrl
  332. : require('../../../assets/icon/course/ai.png')
  333. "
  334. />
  335. </div>
  336. </div>
  337. <div class="txtRight">
  338. <el-tooltip
  339. class="item"
  340. effect="dark"
  341. :content="item.assistantName"
  342. placement="top"
  343. >
  344. <div class="bir">{{ item.assistantName }}</div>
  345. </el-tooltip>
  346. <div
  347. :style="{
  348. color: '#fff',
  349. display:
  350. choseRoleItem &&
  351. choseRoleItem.assistant_id == item.assistant_id
  352. ? 'block'
  353. : 'none',
  354. }"
  355. >
  356. 已选择
  357. </div>
  358. </div>
  359. </div>
  360. </div> -->
  361. </div>
  362. <!-- <div
  363. class="characterBlock"
  364. v-if="sortOption == 0"
  365. v-for="(item, index) in roleList"
  366. :key="item.id"
  367. @click.stop="choseRole(item)"
  368. >
  369. <div class="imgLeft">
  370. <div class="img">
  371. <img v-if="item.headUrl" style="width: 100%;height: 100%;" :src="item.headUrl" />
  372. <img v-else style="width: 100%;height: 100%;" :src="require('../../../assets/icon/course/ai.png')">
  373. </div>
  374. </div>
  375. <div class="txtRight">
  376. <div class="bir">{{ item.assistantName }}</div>
  377. <div
  378. :style="{
  379. color: '#fff',
  380. display:
  381. (choseRoleItem && choseRoleItem.assistant_id == item.assistant_id)
  382. ? 'block'
  383. : 'none'
  384. }"
  385. >
  386. 已选择
  387. </div>
  388. </div>
  389. </div> -->
  390. </div>
  391. <!-- <div class="choiceBottom">
  392. <el-button class="cb_btn" size="mini" @click="noChangeRole()"
  393. >取消</el-button
  394. >
  395. <el-button
  396. class="cb_btn"
  397. size="mini"
  398. type="primary"
  399. @click="changeRole()"
  400. >确定</el-button
  401. >
  402. </div> -->
  403. </div>
  404. <div class="s_bottom">
  405. <div class="s_b_btnAreaTop" v-if="cardType != 1">
  406. <div class="s_b_bat_left">
  407. <span
  408. ><el-tooltip
  409. class="item"
  410. effect="dark"
  411. content="清空聊天记录"
  412. placement="top"
  413. >
  414. <svg
  415. width="20"
  416. height="20"
  417. viewBox="0 0 20 20"
  418. fill="none"
  419. xmlns="http://www.w3.org/2000/svg"
  420. @click.stop="clear()"
  421. >
  422. <path
  423. fill-rule="evenodd"
  424. clip-rule="evenodd"
  425. d="M2.5 3.125C2.5 2.77982 2.77982 2.5 3.125 2.5H16.875C17.2202 2.5 17.5 2.77982 17.5 3.125V8.02715C17.5 8.37233 17.2202 8.65215 16.875 8.65215C16.5298 8.65215 16.25 8.37233 16.25 8.02715V3.75H3.75V16.25H8.125C8.47018 16.25 8.75 16.5298 8.75 16.875C8.75 17.2202 8.47018 17.5 8.125 17.5H3.125C2.77982 17.5 2.5 17.2202 2.5 16.875V3.125Z"
  426. fill="black"
  427. fill-opacity="0.6"
  428. />
  429. <path
  430. fill-rule="evenodd"
  431. clip-rule="evenodd"
  432. d="M5.625 6.1521C5.625 5.80692 5.90482 5.5271 6.25 5.5271H13.125C13.4702 5.5271 13.75 5.80692 13.75 6.1521C13.75 6.49728 13.4702 6.7771 13.125 6.7771H6.25C5.90482 6.7771 5.625 6.49728 5.625 6.1521Z"
  433. fill="black"
  434. fill-opacity="0.6"
  435. />
  436. <path
  437. fill-rule="evenodd"
  438. clip-rule="evenodd"
  439. d="M5.625 9.2771C5.625 8.93192 5.90482 8.6521 6.25 8.6521H9.37496C9.72014 8.6521 9.99996 8.93192 9.99996 9.2771C9.99996 9.62228 9.72014 9.9021 9.37496 9.9021H6.25C5.90482 9.9021 5.625 9.62228 5.625 9.2771Z"
  440. fill="black"
  441. fill-opacity="0.6"
  442. />
  443. <path
  444. fill-rule="evenodd"
  445. clip-rule="evenodd"
  446. d="M12.465 11.507L15.9141 14.9048C16.1279 14.5365 16.25 14.1088 16.25 13.6521C16.25 12.2714 15.1307 11.1521 13.75 11.1521C13.2799 11.1521 12.8406 11.2815 12.465 11.507ZM15.0374 15.7957L11.5873 12.397C11.3726 12.7659 11.25 13.1944 11.25 13.6521C11.25 15.0328 12.3693 16.1521 13.75 16.1521C14.2211 16.1521 14.6613 16.0222 15.0374 15.7957ZM11.0797 11.0192C11.759 10.3303 12.7051 9.9021 13.75 9.9021C15.8211 9.9021 17.5 11.581 17.5 13.6521C17.5 14.6767 17.0882 15.6064 16.4226 16.2827C15.7431 16.9729 14.7961 17.4021 13.75 17.4021C11.6789 17.4021 10 15.7232 10 13.6521C10 12.6263 10.4127 11.6957 11.0797 11.0192Z"
  447. fill="black"
  448. fill-opacity="0.6"
  449. />
  450. </svg>
  451. </el-tooltip>
  452. </span>
  453. <span
  454. ><el-tooltip
  455. class="item"
  456. effect="dark"
  457. :content="openMegaphone ? '默认不朗诵' : '默认朗诵'"
  458. placement="top"
  459. >
  460. <svg
  461. width="20"
  462. height="20"
  463. viewBox="0 0 20 20"
  464. fill="none"
  465. @click.stop="changeMegaphone()"
  466. xmlns="http://www.w3.org/2000/svg"
  467. v-if="!openMegaphone"
  468. >
  469. <path
  470. fill-rule="evenodd"
  471. clip-rule="evenodd"
  472. d="M13.65 2.02537C13.9812 1.7766 14.4513 1.84342 14.7001 2.17461C16.3635 4.38918 17.3495 7.14305 17.3495 10.125C17.3495 10.9115 17.2809 11.6821 17.1494 12.4311L15.7571 11.6061C15.8181 11.121 15.8495 10.6267 15.8495 10.125C15.8495 7.47901 14.9758 5.03921 13.5007 3.07548C13.252 2.74429 13.3188 2.27414 13.65 2.02537ZM10.9679 8.76803C10.7613 7.71703 10.3195 6.74982 9.69963 5.92461C9.45087 5.59342 8.98072 5.5266 8.64952 5.77537C8.31833 6.02414 8.25152 6.49429 8.50028 6.82548C8.68121 7.06635 8.84279 7.32248 8.98275 7.59163L10.9679 8.76803ZM9.434 11.4702L10.7676 12.2604C10.5271 13.012 10.1631 13.7084 9.69963 14.3255C9.45087 14.6567 8.98072 14.7235 8.64952 14.4747C8.31833 14.226 8.25152 13.7558 8.50028 13.4246C8.93199 12.8499 9.2536 12.1882 9.434 11.4702ZM14.9175 14.7196L16.218 15.4903C15.8093 16.4122 15.2985 17.2787 14.7001 18.0755C14.4513 18.4067 13.9812 18.4735 13.65 18.2247C13.3188 17.9759 13.252 17.5058 13.5007 17.1746C14.0666 16.4213 14.544 15.5979 14.9175 14.7196ZM5.06857 9.11603C4.78744 8.81182 4.31294 8.79311 4.00873 9.07423C3.70452 9.35535 3.68581 9.82986 3.96693 10.1341C4.04986 10.2238 4.09951 10.3419 4.09951 10.4732C4.09951 10.6082 4.04703 10.7293 3.95977 10.8199C3.67245 11.1183 3.6814 11.5931 3.97976 11.8804C4.27812 12.1677 4.75291 12.1588 5.04023 11.8604C5.38582 11.5015 5.59951 11.0115 5.59951 10.4732C5.59951 9.94984 5.3975 9.47198 5.06857 9.11603Z"
  473. fill="black"
  474. fill-opacity="0.6"
  475. />
  476. <path
  477. fill-rule="evenodd"
  478. clip-rule="evenodd"
  479. d="M1.03865 4.82622C1.21124 4.52729 1.59349 4.42486 1.89242 4.59745L18.7327 14.3202C19.0316 14.4928 19.134 14.875 18.9614 15.1739C18.7888 15.4729 18.4066 15.5753 18.1077 15.4027L1.26742 5.67998C0.968486 5.5074 0.866064 5.12515 1.03865 4.82622Z"
  480. fill="black"
  481. fill-opacity="0.6"
  482. />
  483. </svg>
  484. <svg v-else @click.stop="changeMegaphone()" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  485. <path fill-rule="evenodd" clip-rule="evenodd" d="M13.65 2.02537C13.9812 1.7766 14.4513 1.84342 14.7001 2.17461C16.3635 4.38918 17.3495 7.14305 17.3495 10.125C17.3495 13.107 16.3635 15.8609 14.7001 18.0755C14.4513 18.4067 13.9812 18.4735 13.65 18.2247C13.3188 17.9759 13.252 17.5058 13.5007 17.1746C14.9758 15.2109 15.8495 12.7711 15.8495 10.125C15.8495 7.47901 14.9758 5.03921 13.5007 3.07548C13.252 2.74429 13.3188 2.27414 13.65 2.02537Z" fill="#3681FC"/>
  486. <path fill-rule="evenodd" clip-rule="evenodd" d="M8.64952 5.77537C8.98072 5.5266 9.45087 5.59342 9.69963 5.92461C10.5784 7.09461 11.0995 8.55006 11.0995 10.125C11.0995 11.7 10.5784 13.1555 9.69963 14.3255C9.45087 14.6567 8.98072 14.7235 8.64952 14.4747C8.31833 14.226 8.25152 13.7558 8.50028 13.4246C9.19069 12.5055 9.5995 11.3641 9.5995 10.125C9.5995 8.88601 9.19069 7.74463 8.50028 6.82548C8.25152 6.49429 8.31833 6.02414 8.64952 5.77537Z" fill="#3681FC"/>
  487. <path fill-rule="evenodd" clip-rule="evenodd" d="M4.00873 9.07423C4.31294 8.79311 4.78744 8.81182 5.06857 9.11603C5.3975 9.47198 5.59951 9.94984 5.59951 10.4732C5.59951 11.0115 5.38582 11.5015 5.04023 11.8604C4.75291 12.1588 4.27812 12.1677 3.97976 11.8804C3.6814 11.5931 3.67245 11.1183 3.95977 10.8199C4.04703 10.7293 4.09951 10.6082 4.09951 10.4732C4.09951 10.3419 4.04986 10.2238 3.96693 10.1341C3.68581 9.82986 3.70452 9.35535 4.00873 9.07423Z" fill="#3681FC"/>
  488. </svg>
  489. </el-tooltip
  490. ></span>
  491. </div>
  492. <div class="s_b_bat_right">
  493. <!-- <img :src="require('../../../assets/icon/course/bulb.svg')"> -->
  494. <span>
  495. <svg
  496. width="20"
  497. height="20"
  498. viewBox="0 0 20 20"
  499. fill="none"
  500. xmlns="http://www.w3.org/2000/svg"
  501. >
  502. <path
  503. fill-rule="evenodd"
  504. clip-rule="evenodd"
  505. d="M10 6.25C7.92893 6.25 6.25 7.92893 6.25 10C6.25 12.0711 7.92893 13.75 10 13.75C12.0711 13.75 13.75 12.0711 13.75 10C13.75 7.92893 12.0711 6.25 10 6.25ZM5 10C5 7.23858 7.23858 5 10 5C12.7614 5 15 7.23858 15 10C15 12.7614 12.7614 15 10 15C7.23858 15 5 12.7614 5 10Z"
  506. fill="black"
  507. fill-opacity="0.6"
  508. />
  509. <path
  510. fill-rule="evenodd"
  511. clip-rule="evenodd"
  512. d="M10 1.25C10.3452 1.25 10.625 1.52982 10.625 1.875V3.125C10.625 3.47018 10.3452 3.75 10 3.75C9.65482 3.75 9.375 3.47018 9.375 3.125V1.875C9.375 1.52982 9.65482 1.25 10 1.25Z"
  513. fill="black"
  514. fill-opacity="0.6"
  515. />
  516. <path
  517. fill-rule="evenodd"
  518. clip-rule="evenodd"
  519. d="M18.75 10C18.75 10.3452 18.4702 10.625 18.125 10.625L16.875 10.625C16.5298 10.625 16.25 10.3452 16.25 10C16.25 9.65482 16.5298 9.375 16.875 9.375L18.125 9.375C18.4702 9.375 18.75 9.65482 18.75 10Z"
  520. fill="black"
  521. fill-opacity="0.6"
  522. />
  523. <path
  524. fill-rule="evenodd"
  525. clip-rule="evenodd"
  526. d="M3.75 10C3.75 10.3452 3.47018 10.625 3.125 10.625L1.875 10.625C1.52982 10.625 1.25 10.3452 1.25 10C1.25 9.65482 1.52982 9.375 1.875 9.375L3.125 9.375C3.47018 9.375 3.75 9.65482 3.75 10Z"
  527. fill="black"
  528. fill-opacity="0.6"
  529. />
  530. <path
  531. fill-rule="evenodd"
  532. clip-rule="evenodd"
  533. d="M5.58052 5.58061C5.33644 5.82469 4.94071 5.82469 4.69664 5.58061L3.81275 4.69673C3.56867 4.45265 3.56867 4.05692 3.81275 3.81285C4.05683 3.56877 4.45256 3.56877 4.69664 3.81285L5.58052 4.69673C5.8246 4.94081 5.8246 5.33654 5.58052 5.58061Z"
  534. fill="black"
  535. fill-opacity="0.6"
  536. />
  537. <path
  538. fill-rule="evenodd"
  539. clip-rule="evenodd"
  540. d="M14.4194 5.58052C14.1753 5.33644 14.1753 4.94071 14.4194 4.69664L15.3033 3.81275C15.5473 3.56867 15.9431 3.56867 16.1872 3.81275C16.4312 4.05683 16.4312 4.45256 16.1872 4.69664L15.3033 5.58052C15.0592 5.8246 14.6635 5.8246 14.4194 5.58052Z"
  541. fill="black"
  542. fill-opacity="0.6"
  543. />
  544. <path
  545. fill-rule="evenodd"
  546. clip-rule="evenodd"
  547. d="M8.75 18.125C8.75 17.7798 9.02982 17.5 9.375 17.5H10.625C10.9702 17.5 11.25 17.7798 11.25 18.125C11.25 18.4702 10.9702 18.75 10.625 18.75H9.375C9.02982 18.75 8.75 18.4702 8.75 18.125Z"
  548. fill="black"
  549. fill-opacity="0.6"
  550. />
  551. <path
  552. fill-rule="evenodd"
  553. clip-rule="evenodd"
  554. d="M7.5 16.25C7.5 15.9048 7.77982 15.625 8.125 15.625H11.875C12.2202 15.625 12.5 15.9048 12.5 16.25C12.5 16.5952 12.2202 16.875 11.875 16.875H8.125C7.77982 16.875 7.5 16.5952 7.5 16.25Z"
  555. fill="black"
  556. fill-opacity="0.6"
  557. />
  558. </svg>
  559. </span>
  560. </div>
  561. </div>
  562. <div class="s_b_btnArea">
  563. <div
  564. :class="['s_b_ba-item', cardType == 1 ? 's_b_ba_active' : '']"
  565. @click.stop="choiceRole()"
  566. >
  567. <!-- <img
  568. style="width: 20px"
  569. src="../../../assets/icon/course/role.png"
  570. alt=""
  571. /> -->
  572. <svg
  573. width="16"
  574. height="16"
  575. style="margin-right: 5px"
  576. viewBox="0 0 16 16"
  577. fill="none"
  578. xmlns="http://www.w3.org/2000/svg"
  579. >
  580. <path
  581. fill-rule="evenodd"
  582. clip-rule="evenodd"
  583. d="M7.65475 5.14423C7.84523 4.95323 8.15406 4.95323 8.34454 5.14423L11.8564 8.66565C12.0469 8.85665 12.0469 9.16633 11.8564 9.35733C11.6659 9.54833 11.3571 9.54833 11.1666 9.35733L7.99964 6.18174L4.83266 9.35733C4.64218 9.54833 4.33334 9.54833 4.14286 9.35733C3.95238 9.16633 3.95238 8.85665 4.14286 8.66565L7.65475 5.14423Z"
  584. :fill="cardType == 1 ? '#fff' : 'black'"
  585. />
  586. <path
  587. d="M13.9433 2.84505L11.222 1.54948C11.1036 1.49702 10.9687 1.49109 10.8459 1.53296C10.7231 1.57483 10.6221 1.66119 10.5643 1.77369C10.5066 1.88618 10.4967 2.01594 10.5367 2.13536C10.5767 2.25478 10.6635 2.35446 10.7787 2.41319L13.5 3.70876V11.2767L8 13.4973L2.50001 11.277V3.70876L5.22167 2.41319C5.33977 2.35619 5.42965 2.25649 5.47169 2.13586C5.51372 2.01524 5.50449 1.88349 5.44602 1.7694C5.38754 1.6553 5.28457 1.56814 5.1596 1.52693C5.03462 1.48573 4.89779 1.49383 4.779 1.54948L2.05701 2.84505C1.88938 2.92416 1.74825 3.04712 1.64975 3.19986C1.55125 3.3526 1.49936 3.52895 1.50001 3.70876V11.2767C1.50001 11.6665 1.74101 12.0152 2.11334 12.1651L7.807 14.4634C7.93067 14.5135 8.07033 14.5135 8.194 14.4634L13.887 12.1654C14.0689 12.0922 14.2241 11.9688 14.3332 11.8107C14.4423 11.6525 14.5004 11.4668 14.5 11.277V3.70876C14.5006 3.52899 14.4488 3.35268 14.3503 3.19995C14.2519 3.04722 14.1109 2.92424 13.9433 2.84505Z"
  588. :fill="cardType == 1 ? '#fff' : 'black'"
  589. />
  590. </svg>
  591. 智能体
  592. </div>
  593. <div
  594. :class="['s_b_ba-item', sendType == 3 ? 's_b_ba_active' : '']"
  595. @click="chooseType(3)"
  596. >
  597. <!-- <img src="../../../assets/icon/course/sImg.png" style="margin-right: 5px;" alt="" v-if="sendType!=3">
  598. <img src="../../../assets/icon/course/sImg2.png" style="margin-right: 5px;" alt="" v-else> -->
  599. 生成图片
  600. </div>
  601. <div
  602. :class="['s_b_ba-item', sendType == 1 ? 's_b_ba_active' : '']"
  603. @click="chooseType(1)"
  604. >
  605. <!-- <img src="../../../assets/icon/course/sImg.png" style="margin-right: 5px;" alt="" v-if="sendType!=1">
  606. <img src="../../../assets/icon/course/sImg2.png" style="margin-right: 5px;" alt="" v-else> -->
  607. 搜索图片
  608. </div>
  609. <div
  610. :class="['s_b_ba-item', sendType == 2 ? 's_b_ba_active' : '']"
  611. @click="chooseType(2)"
  612. >
  613. <!-- <img src="../../../assets/icon/course/sRio.png" style="margin-right: 5px;" alt="" v-if="sendType!=2">
  614. <img src="../../../assets/icon/course/sRio2.png" style="margin-right: 5px;" alt="" v-else> -->
  615. 搜索视频
  616. </div>
  617. </div>
  618. <div class="s_b_atBox" v-if="openAtBox" v-loading="loading">
  619. <div class="s_b_at_tag">
  620. <span
  621. :class="[atTagIndex == 0 ? 's_b_at_tag_active' : '']"
  622. @click.stop="atTagIndex = 0"
  623. >任务</span
  624. >
  625. <span
  626. :class="[[1, 2].includes(atTagIndex) ? 's_b_at_tag_active' : '']"
  627. @click.stop="atTagIndex = 1"
  628. >成员</span
  629. >
  630. </div>
  631. <div class="s_b_at_list">
  632. <template v-if="atTagIndex == 0">
  633. <div v-for="(item1, index1) in taskList" :key="index1">
  634. <div
  635. class="s_b_at_l_top"
  636. v-if="item1.dyName"
  637. @click="
  638. atTask(`阶段${index1 + 1} ${item1.dyName} `, index1, 0, item1)
  639. "
  640. >
  641. <span>阶段{{ index1 + 1 }} {{ item1.dyName }}</span>
  642. <span
  643. class="s_b_at_l_i_h_icon1"
  644. :style="
  645. `${!item1.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  646. "
  647. @click.stop="item1.isOpen = !item1.isOpen"
  648. ></span>
  649. </div>
  650. <div
  651. class="s_b_at_l_item"
  652. v-for="(item2, index2) in item1.task"
  653. :key="index1 + '-' + index2"
  654. v-if="item1.isOpen"
  655. >
  656. <div
  657. class="s_b_at_l_i_header"
  658. v-if="item2.tool[0].tool != undefined"
  659. @click="
  660. atTask(
  661. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  662. item2.taskName
  663. } `,
  664. index2,
  665. 1,
  666. item2
  667. )
  668. "
  669. >
  670. <span
  671. class="s_b_at_l_i_h_icon1"
  672. :style="
  673. `${!item2.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  674. "
  675. @click.stop="item2.isOpen = !item2.isOpen"
  676. ></span>
  677. <span>任务{{ index2 + 1 }}:{{ item2.taskName }}</span>
  678. </div>
  679. <div
  680. class="s_b_at_l_i_header"
  681. v-else
  682. @click="
  683. atTask(
  684. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  685. item2.taskName
  686. } `,
  687. index2,
  688. 1,
  689. item2
  690. )
  691. "
  692. >
  693. <span
  694. class="s_b_at_l_i_h_icon2"
  695. :style="
  696. `${!item2.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  697. "
  698. @click.stop="item2.isOpen = !item2.isOpen"
  699. ></span>
  700. <span>任务{{ index2 + 1 }}:{{ item2.taskName }}</span>
  701. </div>
  702. <div
  703. class="s_b_at_l_i_content"
  704. v-if="item2.tool[0].tool != undefined && item2.isOpen"
  705. v-for="(item3, index3) in item2.tool"
  706. :key="index1 + '-' + index2 + '-' + index3"
  707. @click="
  708. atTask(
  709. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  710. item2.taskName
  711. }-工具${index3 + 1}:${toolsList[item3.tool]} `,
  712. index3,
  713. 2,
  714. item3
  715. )
  716. "
  717. >
  718. <span>工具{{ index3 + 1 }}:{{ toolsList[item3.tool] }}</span>
  719. </div>
  720. </div>
  721. </div>
  722. </template>
  723. <template v-if="atTagIndex == 1 && workSum != 0">
  724. <div v-if="userList.length == 0">暂无成员...</div>
  725. <div
  726. class="s_b_ab_user"
  727. v-for="(item, index) in userList"
  728. :key="item.id"
  729. v-else
  730. >
  731. <div class="s_b_ab_u_name">
  732. <el-tooltip
  733. class="item"
  734. effect="light:"
  735. :content="item.username"
  736. placement="top"
  737. >
  738. <span>{{ item.username }}</span>
  739. </el-tooltip>
  740. </div>
  741. <div class="s_b_ab_u_message">
  742. <span>作业提交情况</span>
  743. <div>
  744. <span>已提交:{{ item.count }}</span>
  745. <span>未提交:{{ workSum - item.count }}</span>
  746. </div>
  747. </div>
  748. <div class="s_b_ab_u_btnArea">
  749. <span @click="sumUpStudent(item)">总结分析</span>
  750. <span @click.stop="lookStudentDetail(item)">作业详细</span>
  751. </div>
  752. </div>
  753. </template>
  754. <template v-if="atTagIndex == 2">
  755. <div class="s_b_at_studentDetail">
  756. <img
  757. :src="require('../../../assets/icon/course/back.svg')"
  758. @click.stop="atTagIndex = 1"
  759. />
  760. <span>学生:{{ lookStudentData.userName }}</span>
  761. </div>
  762. <div class="s_b_at_studentList">
  763. <div
  764. class="s_b_at_sl_item"
  765. v-if="[3, 2, 8].includes(item.type)"
  766. v-for="(item, index) in lookStudentData.list"
  767. @click.stop="sumUpStudent2(item)"
  768. >
  769. <div class="s_b_at_sl_phase">
  770. {{
  771. `阶段${item.stage + 1}/任务${item.task +
  772. 1}/工具${item.tool + 1}`
  773. }}
  774. </div>
  775. <div class="s_b_at_sl_message" v-if="item.type === 3">
  776. <div>
  777. 题目:
  778. <el-tooltip
  779. class="item"
  780. effect="light:"
  781. :content="item.content.answerTitle"
  782. placement="top"
  783. ><span>{{ item.content.answerTitle }}</span></el-tooltip
  784. >
  785. </div>
  786. <div>
  787. 答题:
  788. <span>{{ item.content.answer }}</span>
  789. </div>
  790. </div>
  791. <div
  792. class="s_b_at_sl_message"
  793. v-if="item.type === 8"
  794. v-for="(item1, index1) in item.content.testJson
  795. ? item.content.testJson.testJson
  796. : []"
  797. :key="index1"
  798. >
  799. <div>
  800. 题目:
  801. <el-tooltip
  802. class="item"
  803. effect="light:"
  804. :content="item1.teststitle"
  805. placement="top"
  806. ><span>{{ item1.teststitle }}</span></el-tooltip
  807. >
  808. </div>
  809. <div>
  810. 选项:
  811. <span>
  812. <div v-for="(item2, index2) in item1.checkList">
  813. {{ index2 + 1 }}、{{ item2.src ? item2.src : item2 }}
  814. </div>
  815. </span>
  816. </div>
  817. <div>
  818. 答案:{{ answerData(item1.checkList, item1.answer) }}
  819. </div>
  820. <div>
  821. 答题:
  822. <span>{{
  823. answerData(item1.checkList, item.content.anwer[index1])
  824. }}</span>
  825. </div>
  826. </div>
  827. <div
  828. class="s_b_at_sl_message"
  829. v-if="item.type === 2"
  830. v-for="(item1, index1) in item.content.askJson
  831. ? item.content.askJson.askJson
  832. : []"
  833. :key="index1"
  834. >
  835. <div>
  836. 题目:
  837. <el-tooltip
  838. class="item"
  839. effect="light:"
  840. :content="item1.askstitle"
  841. placement="top"
  842. ><span>{{ item1.askstitle }}</span></el-tooltip
  843. >
  844. </div>
  845. <div>
  846. 选项:
  847. <span>
  848. <div v-for="(item2, index2) in item1.checkList">
  849. {{ index2 + 1 }}、{{ item2.src ? item2.src : item2 }}
  850. </div>
  851. </span>
  852. </div>
  853. <div>
  854. 答题:
  855. <span>{{
  856. answerData(item1.checkList, item.content.anwer[index1])
  857. }}</span>
  858. </div>
  859. </div>
  860. </div>
  861. </div>
  862. </template>
  863. </div>
  864. </div>
  865. <div class="s_b_inputArea" v-if="cardType == 0">
  866. <!-- <div class="s_b_tape" @click="goTape()"></div> -->
  867. <div class="s_b_input">
  868. <el-input
  869. :disabled="loading || chatLoading || sendFnType == 1"
  870. v-loading="loading || chatLoading"
  871. v-if="sendFnType == 0"
  872. @keyup.enter.native="send()"
  873. :placeholder="
  874. sendFnType == 0
  875. ? '请在此输入您想了解的内容'
  876. : '请点击录音按钮开始录音'
  877. "
  878. class="s_b_i_left"
  879. v-model="text"
  880. ref="textRef"
  881. ></el-input>
  882. <el-input
  883. v-loading="loading || chatLoading"
  884. v-if="sendFnType == 1 && isTalk"
  885. :readonly="isReadonly"
  886. @focus="setCursorToEnd"
  887. placeholder="请说话"
  888. class="s_b_i_left"
  889. v-model="text"
  890. ref="inputEndRef"
  891. ></el-input>
  892. <div
  893. class="s_b_recorded"
  894. @click.stop="talk()"
  895. v-loading="loading || chatLoading"
  896. v-if="sendFnType && !isTalk"
  897. >
  898. <span>点击说话</span>
  899. </div>
  900. <!-- <div class="s_b_i_right" @click="sendFile()">
  901. <span></span>
  902. </div> -->
  903. </div>
  904. <div class="s_b_inputBtnArea">
  905. <el-tooltip
  906. v-if="sendFnType == 0 && text == '' && !chatLoading"
  907. class="item"
  908. effect="light"
  909. content="语音输入"
  910. placement="top"
  911. >
  912. <span @click.stop="changeFnType(1)">
  913. <svg
  914. width="22"
  915. height="22"
  916. viewBox="0 0 22 22"
  917. fill="none"
  918. xmlns="http://www.w3.org/2000/svg"
  919. >
  920. <path
  921. fill-rule="evenodd"
  922. clip-rule="evenodd"
  923. d="M11.4583 14.0308C13.8381 14.0308 15.7551 12.0651 15.7551 9.62496V6.23588C15.7551 3.79574 13.8381 1.83008 11.4583 1.83008C9.07845 1.83008 7.16138 3.79574 7.16138 6.23588V9.62496C7.16138 12.0651 9.07845 14.0308 11.4583 14.0308ZM8.4835 6.23588C8.4835 4.54134 9.80561 3.18571 11.4583 3.18571C13.1109 3.18571 14.433 4.54134 14.433 6.23588V9.62496C14.433 11.3195 13.1109 12.6751 11.4583 12.6751C9.80561 12.6751 8.4835 11.3195 8.4835 9.62496V6.23588ZM18.3333 10.6405C18.3333 10.2677 18.0358 9.96264 17.6722 9.96264C17.3417 9.96264 17.0442 10.2338 17.0111 10.5727C16.5484 13.3178 14.2347 15.3852 11.4583 15.3852C8.68181 15.3852 6.36811 13.3178 5.90537 10.5727C5.87231 10.2338 5.57484 9.96264 5.24431 9.96264C4.88073 9.96264 4.58325 10.2677 4.58325 10.6405V10.7421C5.1121 13.9279 7.65717 16.4019 10.7972 16.7069V19.635H7.93254C7.54315 19.635 7.22748 19.9587 7.22748 20.358C7.22748 20.7572 7.54315 21.0809 7.93254 21.0809H14.9832C15.3726 21.0809 15.6883 20.7572 15.6883 20.358C15.6883 19.9587 15.3726 19.635 14.9832 19.635H12.1193V16.7069C15.2593 16.4019 17.8044 13.9279 18.3002 10.776C18.3002 10.7591 18.3085 10.7337 18.3167 10.7082L18.3167 10.7082L18.3167 10.7082C18.325 10.6828 18.3333 10.6574 18.3333 10.6405Z"
  924. fill="black"
  925. fill-opacity="0.9"
  926. />
  927. </svg>
  928. </span>
  929. </el-tooltip>
  930. <el-tooltip
  931. v-if="sendFnType == 1 && text == '' && !isTalk && !chatLoading"
  932. class="item"
  933. effect="light"
  934. content="文字输入"
  935. placement="top"
  936. >
  937. <span @click.stop="changeFnType(0)">
  938. <svg
  939. width="22"
  940. height="22"
  941. viewBox="0 0 22 22"
  942. fill="none"
  943. xmlns="http://www.w3.org/2000/svg"
  944. >
  945. <path
  946. fill-rule="evenodd"
  947. clip-rule="evenodd"
  948. d="M2.75 3.4375C2.75 3.0578 3.0578 2.75 3.4375 2.75H18.5625C18.9422 2.75 19.25 3.0578 19.25 3.4375V18.5625C19.25 18.9422 18.9422 19.25 18.5625 19.25H3.4375C3.0578 19.25 2.75 18.9422 2.75 18.5625V3.4375ZM4.125 4.125V17.875H17.875V4.125H4.125Z"
  949. fill="black"
  950. fill-opacity="0.9"
  951. />
  952. <path
  953. fill-rule="evenodd"
  954. clip-rule="evenodd"
  955. d="M6.875 6.875C6.875 6.4953 7.1828 6.1875 7.5625 6.1875H14.4375C14.8172 6.1875 15.125 6.4953 15.125 6.875V8.25C15.125 8.6297 14.8172 8.9375 14.4375 8.9375C14.0578 8.9375 13.75 8.6297 13.75 8.25V7.5625H11.6875V14.4375H12.375C12.7547 14.4375 13.0625 14.7453 13.0625 15.125C13.0625 15.5047 12.7547 15.8125 12.375 15.8125H9.625C9.2453 15.8125 8.9375 15.5047 8.9375 15.125C8.9375 14.7453 9.2453 14.4375 9.625 14.4375H10.3125V7.5625H8.25V8.25C8.25 8.6297 7.9422 8.9375 7.5625 8.9375C7.1828 8.9375 6.875 8.6297 6.875 8.25V6.875Z"
  956. fill="black"
  957. fill-opacity="0.9"
  958. />
  959. </svg>
  960. </span>
  961. </el-tooltip>
  962. <el-tooltip
  963. v-if="text == '' && !isTalk && !chatLoading"
  964. class="item"
  965. effect="light"
  966. content="语音助手"
  967. placement="top"
  968. >
  969. <span @click.stop="openPhone">
  970. <svg
  971. width="22"
  972. height="22"
  973. viewBox="0 0 22 22"
  974. fill="none"
  975. xmlns="http://www.w3.org/2000/svg"
  976. >
  977. <path
  978. fill-rule="evenodd"
  979. clip-rule="evenodd"
  980. d="M6.84155 5.76478C6.55991 5.4855 6.10327 5.4855 5.82162 5.76478L4.37921 7.1951C4.23486 7.33825 4.18177 7.5001 4.19436 7.6318C4.3842 9.61702 5.57859 12.5019 7.56276 14.4694C9.61252 16.502 11.9775 17.6669 14.4337 17.8187C14.5856 17.8281 14.7568 17.7668 14.8985 17.6263L16.2213 16.3145C16.5253 16.0132 16.4975 15.5167 16.1619 15.2504L14.8224 14.1878C14.5354 13.9602 14.1218 13.9829 13.8619 14.2405L13.3463 14.7518C12.6962 15.3965 11.6475 15.5966 10.809 15.0406C10.2045 14.6397 9.43899 14.0617 8.70643 13.3353C7.92049 12.556 7.30647 11.7387 6.90026 11.1205C6.41585 10.3834 6.52495 9.47493 7.0107 8.83269L7.88884 7.67165C8.10418 7.38693 8.07563 6.98852 7.82185 6.73686L6.84155 5.76478ZM4.80168 4.7534C5.64663 3.91553 7.01655 3.91554 7.86149 4.7534L8.84178 5.72547C9.60314 6.48045 9.6888 7.67569 9.04277 8.52984L8.16462 9.69089C7.99476 9.91548 7.99659 10.169 8.10873 10.3396C8.47364 10.8949 9.02654 11.63 9.72637 12.3239C10.3781 12.9702 11.0661 13.4905 11.6108 13.8516C11.8045 13.9801 12.0985 13.9664 12.3264 13.7404L12.842 13.2292C13.6215 12.4561 14.8626 12.388 15.7235 13.0709L17.063 14.1335C18.0699 14.9323 18.1531 16.4217 17.2413 17.3259L15.9185 18.6377C15.5191 19.0336 14.9558 19.284 14.344 19.2462C11.4699 19.0687 8.78913 17.7083 6.54282 15.4808C4.31506 13.2717 2.97905 10.0743 2.7584 7.76683C2.69877 7.14323 2.96262 6.57704 3.35928 6.18372L4.80168 4.7534Z"
  981. fill="#3681FC"
  982. />
  983. <path
  984. fill-rule="evenodd"
  985. clip-rule="evenodd"
  986. d="M11.9697 2.96967C12.2626 2.67678 12.7374 2.67678 13.0303 2.96967L19.0303 8.96967C19.3232 9.26256 19.3232 9.73744 19.0303 10.0303C18.7374 10.3232 18.2626 10.3232 17.9697 10.0303L11.9697 4.03033C11.6768 3.73744 11.6768 3.26256 11.9697 2.96967ZM11.2197 7.78033C10.9268 7.48744 10.9268 7.01256 11.2197 6.71967C11.5126 6.42678 11.9874 6.42678 12.2803 6.71967L15.2803 9.71967C15.5732 10.0126 15.5732 10.4874 15.2803 10.7803C14.9874 11.0732 14.5126 11.0732 14.2197 10.7803L11.2197 7.78033Z"
  987. fill="#3681FC"
  988. />
  989. </svg>
  990. </span>
  991. </el-tooltip>
  992. <el-tooltip
  993. v-if="isTalk && !chatLoading"
  994. class="item"
  995. effect="light"
  996. content="结束录音"
  997. placement="top"
  998. >
  999. <span @click.stop="stopTalk()">
  1000. <svg
  1001. width="22"
  1002. height="22"
  1003. viewBox="0 0 22 22"
  1004. fill="none"
  1005. xmlns="http://www.w3.org/2000/svg"
  1006. >
  1007. <path
  1008. d="M11 19.25C6.4625 19.25 2.75 15.5375 2.75 11C2.75 6.4625 6.4625 2.75 11 2.75C15.5375 2.75 19.25 6.4625 19.25 11C19.25 15.5375 15.5375 19.25 11 19.25ZM11 17.1875C14.4031 17.1875 17.1875 14.4031 17.1875 11C17.1875 7.59687 14.4031 4.8125 11 4.8125C7.59687 4.8125 4.8125 7.59687 4.8125 11C4.8125 14.4031 7.59687 17.1875 11 17.1875Z"
  1009. fill="#EE3E3E"
  1010. />
  1011. <path
  1012. d="M12.75 8.25H9.25C8.69772 8.25 8.25 8.69772 8.25 9.25V12.75C8.25 13.3023 8.69772 13.75 9.25 13.75H12.75C13.3023 13.75 13.75 13.3023 13.75 12.75V9.25C13.75 8.69772 13.3023 8.25 12.75 8.25Z"
  1013. fill="#EE3E3E"
  1014. />
  1015. </svg>
  1016. </span>
  1017. </el-tooltip>
  1018. <el-tooltip
  1019. v-if="sendFnType == 0 && text != '' && !chatLoading"
  1020. class="item"
  1021. effect="light"
  1022. content="发送"
  1023. placement="top"
  1024. >
  1025. <span @click.stop="send()" style="background-color: #3681FC;">
  1026. <svg
  1027. width="22"
  1028. height="22"
  1029. viewBox="0 0 22 22"
  1030. fill="none"
  1031. xmlns="http://www.w3.org/2000/svg"
  1032. >
  1033. <path
  1034. d="M8.42244 19.8714C8.22794 19.8714 8.04142 19.7941 7.90389 19.6566C7.76636 19.5191 7.6891 19.3325 7.6891 19.138V12.4427C7.6891 12.2227 7.7881 12.0137 7.96044 11.8744L13.9004 7.06005C14.0517 6.94251 14.2429 6.88887 14.4332 6.91061C14.6235 6.93235 14.7977 7.02775 14.9185 7.17636C15.0393 7.32498 15.0971 7.515 15.0795 7.70572C15.0619 7.89644 14.9704 8.07269 14.8244 8.19672L9.15577 12.791V16.9344L10.9378 14.5584C11.1541 14.2687 11.5538 14.1807 11.8728 14.353L14.8281 15.937L18.3334 3.35305C18.4031 3.10738 18.2601 2.95338 18.1941 2.89838C18.1281 2.84338 17.9558 2.72972 17.7248 2.83605L4.4331 9.07305L6.15644 10.063C6.50844 10.2647 6.62944 10.712 6.42777 11.064C6.2261 11.416 5.77877 11.537 5.42677 11.3354L2.48244 9.64505C2.36583 9.57832 2.2699 9.48072 2.20521 9.36297C2.14051 9.24523 2.10957 9.11192 2.11577 8.97772C2.12677 8.70272 2.2881 8.46072 2.53744 8.34338L17.1014 1.50872C17.7834 1.18972 18.5644 1.29238 19.1401 1.78005C19.4203 2.01397 19.6266 2.32417 19.734 2.67302C19.8414 3.02187 19.8452 3.39438 19.7451 3.74538L15.9904 17.213C15.9608 17.3188 15.9078 17.4165 15.8354 17.499C15.7629 17.5815 15.6728 17.6466 15.5718 17.6896C15.4707 17.7325 15.3613 17.7522 15.2516 17.7472C15.1419 17.7421 15.0348 17.7124 14.9381 17.6604L11.7334 15.9407L9.0091 19.578C8.8661 19.765 8.6461 19.8714 8.42244 19.8714Z"
  1035. fill="white"
  1036. />
  1037. </svg>
  1038. </span>
  1039. </el-tooltip>
  1040. <el-tooltip
  1041. v-if="chatLoading"
  1042. class="item"
  1043. effect="light"
  1044. content="停止发送"
  1045. placement="top"
  1046. >
  1047. <span @click.stop="stopSend()" style="background-color: #3681FC;">
  1048. <svg
  1049. width="22"
  1050. height="22"
  1051. viewBox="0 0 24 24"
  1052. fill="none"
  1053. xmlns="http://www.w3.org/2000/svg"
  1054. >
  1055. <path
  1056. d="M5.25 4C5.25 3.44772 5.69772 3 6.25 3H8.7C9.25228 3 9.7 3.44772 9.7 4V20C9.7 20.5523 9.25228 21 8.7 21H6.25C5.69772 21 5.25 20.5523 5.25 20V4ZM14.25 4C14.25 3.44772 14.6977 3 15.25 3H17.75C18.3023 3 18.75 3.44772 18.75 4V20C18.75 20.5523 18.3023 21 17.75 21H15.25C14.6977 21 14.25 20.5523 14.25 20V4Z"
  1057. fill="white"
  1058. fill-opacity="0.9"
  1059. />
  1060. </svg>
  1061. </span>
  1062. </el-tooltip>
  1063. </div>
  1064. <!-- <div class="voice_or_keyboard">
  1065. <el-tooltip
  1066. v-if="sendFnType == 0"
  1067. class="item"
  1068. effect="dark"
  1069. content="使用语音"
  1070. placement="top"
  1071. >
  1072. <img
  1073. :src="require('../../../assets/icon/course/voice.svg')"
  1074. @click.stop="changeFnType(1)"
  1075. />
  1076. </el-tooltip>
  1077. <el-tooltip
  1078. v-if="sendFnType == 1"
  1079. class="item"
  1080. effect="dark"
  1081. content="使用键盘"
  1082. placement="top"
  1083. >
  1084. <img
  1085. :src="require('../../../assets/icon/course/keyboard.svg')"
  1086. @click.stop="changeFnType(0)"
  1087. />
  1088. </el-tooltip>
  1089. </div> -->
  1090. <!-- <div class="s_b_btn" @click="send()" v-if="sendFnType == 0">
  1091. <span v-if="!loading && !chatLoading"></span>
  1092. <div v-else @click.stop="stopSend()">停止</div>
  1093. </div> -->
  1094. <!-- <div class="s_b_btn" v-if="sendFnType == 1">
  1095. <img
  1096. v-if="!loading && !chatLoading && !isTalk"
  1097. @click.stop="talk()"
  1098. :src="require('../../../assets/icon/course/voice2.svg')"
  1099. />
  1100. <img
  1101. style="width: 50px; height: 50px"
  1102. v-else-if="!loading && !chatLoading && isTalk"
  1103. @click.stop="stopTalk()"
  1104. :src="require('../../../assets/icon/course/isTape.svg')"
  1105. />
  1106. <div v-else @click.stop="stopSend()">停止</div>
  1107. </div> -->
  1108. <!-- <div class="s_b_btn2" @click.stop="openPhone">
  1109. <img :src="require('../../../assets/icon/course/phone.svg')" />
  1110. </div> -->
  1111. </div>
  1112. <div class="s_b_inputArea" v-if="cardType == 1">
  1113. <div class="s_b_input">
  1114. <el-input
  1115. placeholder="搜索想要的智能体"
  1116. class="s_b_i_left"
  1117. v-model="roleText"
  1118. ></el-input>
  1119. <!-- <div class="s_b_i_right" @click="sendFile()">
  1120. <span></span>
  1121. </div> -->
  1122. </div>
  1123. <div class="s_b_inputBtnArea">
  1124. <el-tooltip
  1125. class="item"
  1126. effect="light"
  1127. content="查询"
  1128. placement="top"
  1129. >
  1130. <span style="background-color: #3681FC;">
  1131. <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
  1132. <path fill-rule="evenodd" clip-rule="evenodd" d="M10.568 6.01235C8.05196 6.01235 6.01235 8.05196 6.01235 10.568C6.01235 13.0839 8.05196 15.1235 10.568 15.1235C11.8261 15.1235 12.9643 14.6142 13.7892 13.7892C14.6142 12.9643 15.1235 11.8261 15.1235 10.568C15.1235 8.05196 13.0839 6.01235 10.568 6.01235ZM5 10.568C5 7.49286 7.49286 5 10.568 5C13.643 5 16.1359 7.49286 16.1359 10.568C16.1359 11.923 15.6513 13.1657 14.8468 14.1309L16.6421 15.9262C16.8398 16.1239 16.8398 16.4444 16.6421 16.6421C16.4444 16.8398 16.1239 16.8398 15.9262 16.6421L14.1309 14.8468C13.1657 15.6513 11.923 16.1359 10.568 16.1359C7.49286 16.1359 5 13.643 5 10.568Z" fill="white" fill-opacity="0.9"/>
  1133. </svg>
  1134. </span>
  1135. </el-tooltip>
  1136. </div>
  1137. </div>
  1138. </div>
  1139. <iframe
  1140. allow="camera *; microphone *;display-capture;midi;encrypted-media;"
  1141. src="https://beta.cloud.cocorobo.cn/browser/public/index.html"
  1142. ref="iiframe"
  1143. v-show="false"
  1144. ></iframe>
  1145. <!-- 文字转语音-->
  1146. <iframe
  1147. allow="camera *; microphone *;display-capture;midi;encrypted-media;"
  1148. src="https://beta.cloud.cocorobo.cn/browser/public/index1.html"
  1149. ref="iiframe2"
  1150. v-show="false"
  1151. ></iframe>
  1152. </div>
  1153. </template>
  1154. <script>
  1155. import { v4 as uuidv4 } from "uuid";
  1156. import MarkdownIt from "markdown-it";
  1157. import { tools } from "../../../common/tools";
  1158. var OpenCC = require("opencc-js");
  1159. let converter = OpenCC.Converter({
  1160. from: "hk",
  1161. to: "cn"
  1162. });
  1163. export default {
  1164. props: {
  1165. courseDetail: {
  1166. type: Object,
  1167. default: () => {}
  1168. },
  1169. recordType: {
  1170. type: Number,
  1171. default: 0
  1172. },
  1173. navList: {
  1174. type: Array,
  1175. default: () => []
  1176. },
  1177. tcid: {
  1178. type: String,
  1179. default: ""
  1180. },
  1181. fileId: {
  1182. type: Array,
  1183. default: () => []
  1184. },
  1185. openMegaphone: {
  1186. type: Boolean,
  1187. default: false
  1188. }
  1189. },
  1190. data() {
  1191. return {
  1192. text: "",
  1193. ppage: 1,
  1194. sendType: 0,
  1195. sendFnType: 0,
  1196. isTalk: false,
  1197. loading: false,
  1198. chatLoading: false,
  1199. imageCheck: false,
  1200. videoCheck: false,
  1201. userid: this.$route.query.userid,
  1202. courseId: this.$route.query.courseId,
  1203. tcid2: this.$route.query.tcid,
  1204. imgNumList: ["U1", "U2", "U3", "U4"],
  1205. chatList: [],
  1206. nowChatList: [],
  1207. atTagIndex: 0,
  1208. source: null,
  1209. saveUid: "",
  1210. toolsList: {
  1211. 58: "模拟驾驶",
  1212. 59: "路径搜索",
  1213. 60: "深度学习",
  1214. 10: "倒计时",
  1215. 65: "挑人",
  1216. 7: "思维网格",
  1217. 1: "电子白板",
  1218. 52: "文档",
  1219. 3: "思维导图",
  1220. 48: "表格",
  1221. 49: "学生分组",
  1222. 4: "问卷调查",
  1223. 45: "选择题",
  1224. 15: "问答",
  1225. 16: "作业提交",
  1226. 50: "批量上传",
  1227. 41: "选择匹配",
  1228. 47: "排序",
  1229. 40: "个人评价",
  1230. 18: "训练平台",
  1231. 21: "AIoT Blockly",
  1232. 23: "AI Python",
  1233. 24: "AI Blockly",
  1234. 32: "源码编辑",
  1235. 57: "CocoPi",
  1236. 63: "海龟编程",
  1237. 28: "翻译",
  1238. 31: "数字画板",
  1239. 39: "GeoGebra",
  1240. 66: "公式编辑",
  1241. 67: "分子结构",
  1242. 68: "时间轴",
  1243. 69: "英语写作",
  1244. 70: "英语口语",
  1245. 25: "目标管理",
  1246. 26: "课程设计",
  1247. 62: "交互视频",
  1248. 71: "AI智能体"
  1249. },
  1250. lookStudentData: {},
  1251. taskList: [],
  1252. userList: [],
  1253. tools: JSON.parse(converter(JSON.stringify(tools))),
  1254. aiTalkList: [],
  1255. aiIsTalk: false,
  1256. aiTalkUid: "",
  1257. choseRoleItem: null,
  1258. cardType: 0,
  1259. roleList: [],
  1260. roleList2: [],
  1261. sortOption: 0, //切换角色 0我的 1 社区
  1262. roleText: "",
  1263. isReadonly: true
  1264. };
  1265. },
  1266. computed: {
  1267. showRoleList() {
  1268. let _result = [];
  1269. if (this.sortOption == 0) {
  1270. _result = this.roleList;
  1271. } else if (this.sortOption == 1) {
  1272. _result = this.roleList2;
  1273. }
  1274. if (this.roleText) {
  1275. _result = _result.filter(
  1276. i => i.assistantName.indexOf(this.roleText) != -1
  1277. );
  1278. }
  1279. return _result;
  1280. },
  1281. openAtBox() {
  1282. // return false;
  1283. if (this.text.length == 0) return false;
  1284. if (this.text.lastIndexOf("@") == this.text.length - 1) {
  1285. return true;
  1286. } else {
  1287. return false;
  1288. }
  1289. },
  1290. atTaskList() {
  1291. let _result = [];
  1292. this.taskList.forEach((item1, index1) => {
  1293. if (item1.dyName) {
  1294. _result.push({
  1295. name: `阶段${index1 + 1} ${item1.dyName}`,
  1296. tool: null,
  1297. type: 0
  1298. });
  1299. }
  1300. item1.task.forEach((item2, index2) => {
  1301. if (item2.taskName) {
  1302. _result.push({
  1303. name: `任务${index2 + 1}:${item2.taskName}`,
  1304. tool: null,
  1305. type: 1,
  1306. superiors: {
  1307. name: `阶段${index1 + 1} ${item1.dyName}`,
  1308. type: 0
  1309. }
  1310. });
  1311. }
  1312. item2.tool.forEach((item3, index3) => {
  1313. if (item3.tool != undefined) {
  1314. _result.push({
  1315. name: `工具${index3 + 1}:${this.toolsList[item3.tool]}`,
  1316. tool: item3.tool,
  1317. type: 2,
  1318. superiors: {
  1319. name: `任务${index2 + 1}:${item2.taskName}`,
  1320. type: 1,
  1321. superiors: {
  1322. name: `阶段${index1 + 1} ${item1.dyName}`,
  1323. type: 0
  1324. }
  1325. }
  1326. });
  1327. }
  1328. });
  1329. });
  1330. });
  1331. return _result;
  1332. },
  1333. pan() {
  1334. return content => {
  1335. try {
  1336. return JSON.parse(content);
  1337. } catch (error) {
  1338. return [];
  1339. }
  1340. };
  1341. },
  1342. htmlContent() {
  1343. const md = new MarkdownIt();
  1344. return _md => {
  1345. return md.render(_md);
  1346. };
  1347. },
  1348. answerData() {
  1349. return (checkList, answer) => {
  1350. if (typeof answer == "number") {
  1351. return answer + 1;
  1352. } else {
  1353. let _result = ``;
  1354. answer.forEach((item, index) => {
  1355. _result += `${item + 1}`;
  1356. if (index != answer.length - 1) {
  1357. _result += `、`;
  1358. }
  1359. });
  1360. return _result;
  1361. }
  1362. };
  1363. },
  1364. workSum() {
  1365. let sum = 0;
  1366. this.atTaskList.forEach(i => {
  1367. if (i.type != 2) return;
  1368. if ([4, 15, 45].includes(i.tool)) {
  1369. return (sum += 1);
  1370. }
  1371. });
  1372. return sum;
  1373. }
  1374. },
  1375. watch: {
  1376. navList() {
  1377. this.initTaskList();
  1378. },
  1379. atTagIndex(newValue) {
  1380. if (newValue != 2) {
  1381. this.lookStudentData = {};
  1382. }
  1383. }
  1384. },
  1385. methods: {
  1386. insertMemorandum(_html) {
  1387. //保存行为操作
  1388. //variable
  1389. //btn
  1390. let params = [
  1391. {
  1392. uid: this.userid,
  1393. courseId: this.courseId + (this.tcid2 ? this.tcid2 : ""),
  1394. content: _html
  1395. }
  1396. ];
  1397. this.ajax
  1398. .post(
  1399. this.$store.state.api + "insert_systemOperation_countdownBehavior",
  1400. params
  1401. )
  1402. .then(res => {
  1403. if (res.data == 1) {
  1404. console.log("保存操作成功");
  1405. } else {
  1406. console.log("保存操作失败");
  1407. }
  1408. })
  1409. .catch(e => {
  1410. console.log("保存操作失败");
  1411. console.log(e);
  1412. });
  1413. },
  1414. openPhone() {
  1415. // this.$message.info("打开电话面板")
  1416. this.$parent.changeItemType(4);
  1417. },
  1418. setDefaultSrc(e) {
  1419. e.target.src = require("../../../assets/icon/course/404.png");
  1420. },
  1421. refresh(item) {
  1422. this.send(item.content);
  1423. },
  1424. changeFnType(newValue) {
  1425. if (this.isTalk) return this.$message.info("请先停止录音");
  1426. this.sendFnType = newValue;
  1427. },
  1428. chooseType(type) {
  1429. if (this.sendType == type) {
  1430. this.sendType = 0;
  1431. } else {
  1432. this.sendType = type;
  1433. }
  1434. },
  1435. talk() {
  1436. let iiframe = this.$refs["iiframe"];
  1437. iiframe.contentWindow.window.document.getElementById(
  1438. "languageOptions"
  1439. ).selectedIndex = 2; //普通话
  1440. iiframe.contentWindow.testdoContinuousPronunciationAssessment();
  1441. this.isTalk = true;
  1442. iiframe.contentWindow.onRecognizedResult = e => {
  1443. let _msg = e.privText;
  1444. console.log(_msg);
  1445. if (_msg) this.text += _msg;
  1446. };
  1447. // setTimeout(()=>this.text="珠穆朗玛峰的高度",3000)
  1448. },
  1449. stopTalk() {
  1450. if (!this.isTalk) return this.$message.info("请先开始录音");
  1451. let iiframe = this.$refs["iiframe"];
  1452. iiframe.contentWindow.window.document
  1453. .getElementById("scenarioStopButton")
  1454. .click();
  1455. iiframe.contentWindow.onSessionStopped = (s, e) => {
  1456. this.isTalk = false;
  1457. this.send();
  1458. };
  1459. },
  1460. resetImg(_text) {
  1461. this.ppage++;
  1462. let _uuid = uuidv4();
  1463. this.chatList.push({
  1464. role: "user",
  1465. content: `${_text}`,
  1466. uid: _uuid,
  1467. AI: "AI",
  1468. aiContent: "",
  1469. oldContent: "",
  1470. isShowSynchronization: false,
  1471. filename: "",
  1472. index: this.chatList.length,
  1473. is_mind_map: false,
  1474. loading: true
  1475. });
  1476. this.text = "";
  1477. let params = {
  1478. page: this.ppage,
  1479. pagesize: 6,
  1480. query: _text
  1481. };
  1482. // this.$message.info(_text);
  1483. this.chatList.push({
  1484. role: "user",
  1485. content: `getImage`,
  1486. uid: _uuid,
  1487. AI: "AI",
  1488. aiContent: "",
  1489. oldContent: "",
  1490. isShowSynchronization: false,
  1491. filename: "",
  1492. index: this.chatList.length,
  1493. is_mind_map: false,
  1494. loading: true
  1495. });
  1496. this.scrollBottom();
  1497. this.ajax
  1498. .post("https://gpt.cocorobo.cn/search_image", params)
  1499. .then(res => {
  1500. let data = res.data.FunctionResponse.result;
  1501. // console.log('res',res.data.FunctionResponse.result);
  1502. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  1503. data
  1504. );
  1505. this.chatList.find(i => i.uid == _uuid).loading = false;
  1506. this.chatLoading = false;
  1507. this.insertChat(_uuid);
  1508. });
  1509. },
  1510. stopSend() {
  1511. if (this.source) {
  1512. this.source.close();
  1513. if (this.chatList[this.chatList.length - 1].content == "wanSearch") {
  1514. this.chatList.pop();
  1515. }
  1516. this.loading = false;
  1517. this.chatLoading = false;
  1518. this.source = null;
  1519. this.insertChat(this.saveUid);
  1520. }
  1521. },
  1522. onCopy(content) {
  1523. // 创建临时textarea元素
  1524. const tempInput = document.createElement("textarea");
  1525. tempInput.value = content; // 设置要复制的内容
  1526. // 隐藏元素
  1527. tempInput.style.position = "absolute";
  1528. tempInput.style.left = "-9999px";
  1529. // 将元素添加到DOM中
  1530. document.body.appendChild(tempInput);
  1531. // 选中元素内容
  1532. tempInput.select();
  1533. // 执行复制操作
  1534. document.execCommand("copy");
  1535. // 移除临时元素
  1536. document.body.removeChild(tempInput);
  1537. this.$message({
  1538. message: "复制成功",
  1539. type: "success"
  1540. });
  1541. },
  1542. previewImg(url) {
  1543. this.$hevueImgPreview(url);
  1544. },
  1545. clear() {
  1546. // this.chatList = [];
  1547. this.$confirm("确定清空聊天记录吗?", "提示", {
  1548. confirmButtonText: "确定",
  1549. cancelButtonText: "取消",
  1550. type: "warning"
  1551. })
  1552. .then(_ => {
  1553. this.loading = true;
  1554. let params = {
  1555. user_id: this.userid,
  1556. id: "602def61-005d-11ee-91d8-005056b8q12w",
  1557. session_name: `${this.courseId}-studyStudent-md`
  1558. };
  1559. this.ajax
  1560. .post("https://gpt4.cocorobo.cn/delete_park_session", params)
  1561. .then(res => {
  1562. this.chatList = [];
  1563. this.stopSend();
  1564. this.$message.success("清除聊天记录成功");
  1565. this.loading = false;
  1566. })
  1567. .catch(err => {
  1568. this.loading = false;
  1569. this.$message.error("清除聊天记录失败");
  1570. });
  1571. })
  1572. .catch(_ => {});
  1573. },
  1574. atTask(name, index, type, data) {
  1575. let _result = name;
  1576. // if(type == 1){
  1577. // _result=`任务${index+1}:${name} `
  1578. // }else if(type==2){
  1579. // _result=`工具${index+1}:${name} `
  1580. // }else if(type==0){
  1581. // _result=`阶段${index+1} ${name} `
  1582. // }
  1583. this.text += _result;
  1584. this.$refs.textRef.focus();
  1585. },
  1586. send(_text = this.text, val = 0) {
  1587. this.ppage = 1;
  1588. if (this.loading || this.chatLoading) return this.$message.info("请稍等");
  1589. if (_text.trim().length == 0) return this.$message.info("请输入内容");
  1590. let _atRoleList = [];
  1591. if ((this.cardType = 1)) {
  1592. this.cardType = 0;
  1593. }
  1594. this.atTaskList.forEach(i => {
  1595. let _result = ``;
  1596. if (i.type == 0) {
  1597. _result = `${i.name} `;
  1598. } else if (i.type == 1) {
  1599. _result = `${i.superiors.name}-${i.name} `;
  1600. } else if (i.type == 2) {
  1601. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name} `;
  1602. }
  1603. if (_text.indexOf(`@${_result}`) != -1) {
  1604. _atRoleList.push(i);
  1605. }
  1606. });
  1607. if (_atRoleList.length > 0) {
  1608. return this.atSend(_text, _atRoleList);
  1609. }
  1610. let _msg = ``;
  1611. this.chatLoading = true;
  1612. let _uuid = uuidv4();
  1613. // if(this.sendType==3){
  1614. // _text = `帮我生成一张图片:`
  1615. // }
  1616. this.chatList.push({
  1617. role: "user",
  1618. content: `${this.sendType == 3 ? `帮我生成一张图片:${_text}` : _text}`,
  1619. uid: _uuid,
  1620. AI: "AI",
  1621. aiContent: "",
  1622. oldContent: "",
  1623. isShowSynchronization: false,
  1624. filename: this.choseRoleItem ? this.choseRoleItem.headUrl : "",
  1625. index: this.chatList.length,
  1626. is_mind_map: false,
  1627. loading: true
  1628. });
  1629. this.scrollBottom();
  1630. if (this.sendType == 2 || _text.indexOf("视频") != -1) {
  1631. this.insertMemorandum(`<span class="btn">搜索视频</span>`);
  1632. return this.ajax
  1633. .post(`https://gpt4.cocorobo.cn/get_network_search`, {
  1634. engine: "bilibili",
  1635. keyword: _text
  1636. })
  1637. .then(res => {
  1638. console.log(res);
  1639. let _dataList = res.data.FunctionResponse;
  1640. let _resultText = ``;
  1641. _dataList.forEach(i => {
  1642. i.title = i.title
  1643. .replaceAll('<em class="keyword">', "")
  1644. .replaceAll("</em>", "");
  1645. _resultText += `名称:${i.title}\n简介:${i.description}\n地址:[${i.arcurl}](${i.arcurl})\n\n`;
  1646. });
  1647. this.chatList.find(i => i.uid == _uuid).aiContent = _resultText;
  1648. this.chatList.find(i => i.uid == _uuid).loading = false;
  1649. this.chatLoading = false;
  1650. this.scrollBottom();
  1651. this.insertChat(_uuid);
  1652. this.text = "";
  1653. })
  1654. .catch(e => {
  1655. this.$message.error("获取视频失败");
  1656. this.chatLoading = false;
  1657. });
  1658. } else if (this.sendType == 3) {
  1659. this.insertMemorandum(`<span class="btn">生成图片</span>`);
  1660. this.text = "";
  1661. let params = {
  1662. n: 1,
  1663. prompt: _text,
  1664. quality: "standard",
  1665. size: "1024x1024",
  1666. style: "natural"
  1667. };
  1668. // this.$message.info(_text);
  1669. this.chatList.push({
  1670. role: "user",
  1671. content: `getImage`,
  1672. uid: _uuid,
  1673. AI: "AI",
  1674. aiContent: "",
  1675. oldContent: "",
  1676. isShowSynchronization: false,
  1677. filename: "",
  1678. index: this.chatList.length,
  1679. is_mind_map: false,
  1680. loading: true
  1681. });
  1682. this.ajax
  1683. .post("https://gpt4.cocorobo.cn/getImage", params)
  1684. .then(res => {
  1685. let data = res.data.FunctionResponse;
  1686. // console.log('res',res.data.FunctionResponse.result);
  1687. let _result = [];
  1688. if (!data.image_url_list.length) {
  1689. this.chatLoading = false;
  1690. this.chatList.pop();
  1691. this.chatList.pop();
  1692. return this.$message.error("生成图片失败");
  1693. }
  1694. data.image_url_list.forEach(i => {
  1695. _result.push({
  1696. image: i
  1697. });
  1698. });
  1699. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  1700. _result
  1701. );
  1702. this.chatList.find(i => i.uid == _uuid).loading = false;
  1703. console.log(this.chatList.find(i => i.uid == _uuid).aiContent);
  1704. this.chatLoading = false;
  1705. this.insertChat(_uuid);
  1706. this.scrollBottom();
  1707. })
  1708. .catch(e => {
  1709. this.chatLoading = false;
  1710. this.chatList.pop();
  1711. this.chatList.pop();
  1712. this.$message.error("生成失败");
  1713. });
  1714. return;
  1715. } else if (this.sendType == 1 || _text.indexOf("图片") != -1) {
  1716. this.insertMemorandum(`<span class="btn">搜索图片</span>`);
  1717. // console.log("图片");
  1718. this.text = "";
  1719. let params = {
  1720. page: this.ppage,
  1721. pagesize: 6,
  1722. query: _text
  1723. };
  1724. // this.$message.info(_text);
  1725. this.chatList.push({
  1726. role: "user",
  1727. content: `getImage`,
  1728. uid: _uuid,
  1729. AI: "AI",
  1730. aiContent: "",
  1731. oldContent: "",
  1732. isShowSynchronization: false,
  1733. filename: "",
  1734. index: this.chatList.length,
  1735. is_mind_map: false,
  1736. loading: true
  1737. });
  1738. this.ajax
  1739. .post("https://gpt.cocorobo.cn/search_image", params)
  1740. .then(res => {
  1741. let data = res.data.FunctionResponse.result;
  1742. // console.log('res',res.data.FunctionResponse.result);
  1743. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  1744. data
  1745. );
  1746. console.log("👇");
  1747. console.log(this.chatList.find(i => i.uid == _uuid).aiContent);
  1748. this.chatList.find(i => i.uid == _uuid).loading = false;
  1749. this.chatLoading = false;
  1750. this.insertChat(_uuid);
  1751. // console.log('resresresres',res);
  1752. // if (res.data.FunctionResponse.result == "发送成功") {
  1753. // } else {
  1754. // this.$message.warning(res.data.FunctionResponse.result);
  1755. // }
  1756. });
  1757. return;
  1758. }
  1759. let history = [];
  1760. this.nowChatList.forEach(i => {
  1761. if (i.content == "wanSearch") {
  1762. // history.push({
  1763. // role:"assistant",
  1764. // content: JSON.stringify(i.aiContent)
  1765. // })
  1766. return;
  1767. } else if (i.content == "getImage") {
  1768. return history.push({
  1769. type: "text",
  1770. text: i.aiContent
  1771. });
  1772. } else if (i.content == "addAsk") {
  1773. }
  1774. if (i.content) {
  1775. history.push({
  1776. type: "text",
  1777. text: i.content
  1778. });
  1779. }
  1780. if (i.aiContent) {
  1781. history.push({
  1782. type: "text",
  1783. text: i.aiContent
  1784. });
  1785. }
  1786. });
  1787. // history.pop();
  1788. if (_msg) {
  1789. history.push({ type: "text", text: _msg });
  1790. } else {
  1791. history.push({ type: "text", text: _text });
  1792. }
  1793. let params = {
  1794. assistant_id: this.choseRoleItem
  1795. ? this.choseRoleItem.assistant_id
  1796. : "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
  1797. userId: this.userid,
  1798. message: _text,
  1799. session_name: `${this.courseId}-studyStudent-md`,
  1800. uid: _uuid,
  1801. file_ids: this.fileId
  1802. };
  1803. // let params = {
  1804. // model: "gpt-3.5-turbo",
  1805. // temperature: 0,
  1806. // max_tokens: 4096,
  1807. // top_p: 1,
  1808. // frequency_penalty: 0,
  1809. // presence_penalty: 0,
  1810. // messages: history,
  1811. // uid: _uuid,
  1812. // mind_map_question: _text
  1813. // };
  1814. // let params = {
  1815. // message: {
  1816. // anthropic_version: "bedrock-2023-05-31",
  1817. // max_tokens: 4096,
  1818. // temperature: 0,
  1819. // top_p: 1,
  1820. // messages: history
  1821. // },
  1822. // uid: _uuid,
  1823. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  1824. // };
  1825. this.text = "";
  1826. this.ajax
  1827. // .post("https://claude3.cocorobo.cn/chat", params)
  1828. // .post("https://gpt4.cocorobo.cn/chat", params)
  1829. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  1830. .then(res => {
  1831. if (
  1832. converter(res.data.FunctionResponse.result) == converter("发送成功")
  1833. ) {
  1834. } else {
  1835. // this.$message.warning(res.data.FunctionResponse.result);
  1836. console.log(res.data.FunctionResponse.result);
  1837. this.chatLoading = false;
  1838. }
  1839. })
  1840. .catch(e => {
  1841. console.log(e);
  1842. this.chatLoading = false;
  1843. });
  1844. this.saveUid = _uuid;
  1845. this.getAtAuContent(_uuid);
  1846. },
  1847. atSend(_text, _atList) {
  1848. let _msg = ``;
  1849. let noAtText = _text;
  1850. _atList.forEach(i => {
  1851. let _result = ``;
  1852. if (i.type == 0) {
  1853. _result = `${i.name} `;
  1854. } else if (i.type == 1) {
  1855. _result = `${i.superiors.name}-${i.name} `;
  1856. } else if (i.type == 2) {
  1857. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name} `;
  1858. }
  1859. if (_text.indexOf(`@${_result}`) != -1) {
  1860. noAtText = noAtText.replaceAll(`@${_result}`, "");
  1861. }
  1862. });
  1863. this.chatLoading = true;
  1864. let _uuid = uuidv4();
  1865. this.chatList.push({
  1866. role: "user",
  1867. content: `${_text}`,
  1868. uid: _uuid,
  1869. AI: "AI",
  1870. aiContent: "",
  1871. oldContent: "",
  1872. isShowSynchronization: false,
  1873. filename: "",
  1874. index: this.chatList.length,
  1875. is_mind_map: false,
  1876. loading: true
  1877. });
  1878. this.scrollBottom();
  1879. _msg = `
  1880. NOTICE
  1881. 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.
  1882. ## 目的
  1883. 你是用户的课堂助手,你需要基于提供给你的课程相关信息,对用户的提问进行回答。
  1884. ---
  1885. ## 定义
  1886. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  1887. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  1888. 【阶段】:阶段表示课程的某一单独部分,通常包含一个或多个任务。
  1889. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  1890. 【工具】:工具通常是指学生要完成任务的手段。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。
  1891. ---
  1892. ## 工作流程
  1893. 1. 读取【课程信息】中的内容,了解课程说明、课程结构以及【任务】详情。
  1894. 2. 用户会询问你某个【任务】的具体信息,你需要总结该任务信息,并就用户的问题进行回答。
  1895. 3. 你的总结包括以下要点:
  1896. 3.1 任务从属于哪个阶段。
  1897. 3.2 任务包含哪些工具。
  1898. 3.3 该任务目标是什么,以及该任务的工具如何达成它的目标。
  1899. ---
  1900. ## 规则
  1901. 1.你和用户讨论的范围应当仅局限于课程相关内容。
  1902. 2.当用户的提问需要你对课程拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  1903. 3.你通常可以在【任务描述】中了解任务目标,但当【任务描述】不包含此内容的时候,你不需要总结这部分内容。
  1904. ---
  1905. ## 课程信息
  1906. ###课程说明与课程结构
  1907. 课程标题:${this.courseDetail.title ? this.courseDetail.title : ""}
  1908. 分类:${this.courseDetail.name ? this.courseDetail.name : "无"}
  1909. 学生年级:${this.courseDetail.classname ? this.courseDetail.classname : "无"}
  1910. 学习内容:${this.exportCourse()}
  1911. ## 要求
  1912. ${_atList
  1913. .map(i => {
  1914. let _result = ``;
  1915. if (i.type == 0) {
  1916. _result = `${i.name}`;
  1917. } else if (i.type == 1) {
  1918. _result = `${i.superiors.name}-${i.name}`;
  1919. } else if (i.type == 2) {
  1920. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name}`;
  1921. }
  1922. console.log(_result);
  1923. return _result;
  1924. })
  1925. .join(",")} ${noAtText}
  1926. `;
  1927. // this.chatLoading = false;
  1928. // console.log(_msg)
  1929. // return
  1930. // ${this._atList.map(i=>i.name).join(',')} ${noAtText}
  1931. let history = [];
  1932. this.nowChatList.forEach(i => {
  1933. if (i.content == "wanSearch") {
  1934. return;
  1935. } else if (i.content == "getImage") {
  1936. return history.push({
  1937. role: "assistant",
  1938. content: i.aiContent
  1939. });
  1940. }
  1941. if (i.content) {
  1942. history.push({
  1943. role: "user",
  1944. content: i.content
  1945. });
  1946. }
  1947. if (i.aiContent) {
  1948. history.push({
  1949. role: "assistant",
  1950. content: i.aiContent
  1951. });
  1952. }
  1953. });
  1954. // if (_msg) {
  1955. history.push({ role: "user", content: _msg });
  1956. // }
  1957. history.push({ role: "user", content: _text });
  1958. let params = {
  1959. assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
  1960. userId: this.userid,
  1961. message: _text,
  1962. session_name: `${this.courseId}-studyStudent-md`,
  1963. uid: _uuid,
  1964. file_ids: this.fileId
  1965. };
  1966. // let params = {
  1967. // model: "gpt-3.5-turbo",
  1968. // temperature: 0,
  1969. // max_tokens: 4096,
  1970. // top_p: 1,
  1971. // frequency_penalty: 0,
  1972. // presence_penalty: 0,
  1973. // messages: history,
  1974. // uid: _uuid,
  1975. // mind_map_question: noAtText
  1976. // };
  1977. // let params = {
  1978. // message: {
  1979. // anthropic_version: "bedrock-2023-05-31",
  1980. // max_tokens: 4096,
  1981. // temperature: 0,
  1982. // top_p: 1,
  1983. // messages: history
  1984. // },
  1985. // uid: _uuid,
  1986. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  1987. // };
  1988. this.text = "";
  1989. this.ajax
  1990. // .post("https://gpt4.cocorobo.cn/chat", params)
  1991. // .post("https://claude3.cocorobo.cn/chat", params)
  1992. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  1993. .then(res => {
  1994. if (
  1995. converter(res.data.FunctionResponse.result) == converter("发送成功")
  1996. ) {
  1997. } else {
  1998. // this.$message.warning(res.data.FunctionResponse.result);
  1999. console.log(res.data.FunctionResponse.result);
  2000. this.chatLoading = false;
  2001. }
  2002. })
  2003. .catch(e => {
  2004. console.log(e);
  2005. this.chatLoading = false;
  2006. });
  2007. this.saveUid = _uuid;
  2008. // this.getAiContent(_uuid);
  2009. this.getAtAuContent(_uuid);
  2010. },
  2011. exportCourse() {
  2012. 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>`;
  2013. const _chapInfo = JSON.parse(this.courseDetail.chapters);
  2014. let _chap = "";
  2015. for (let i = 0; i < _chapInfo.length; i++) {
  2016. _chap += `<div style="font-size:40px;margin-top:70px;"><span>第${i +
  2017. 1}阶段:${_chapInfo[i].dyName}</span></div>`;
  2018. let _task = _chapInfo[i].chapterInfo[0].taskJson;
  2019. for (let j = 0; j < _task.length; j++) {
  2020. _chap += `<div style="font-size:30px;margin-top:50px;"><span>任务${j +
  2021. 1}:${_task[j].task}</span></div>`;
  2022. if (_task[j].taskDetail) {
  2023. _chap += `<div style="font-size:25px;margin-top:40px;">任务描述</div>`;
  2024. _chap += `<div style="font-size:25px;margin-top:10px;">${_task[j].taskDetail}</div>`;
  2025. }
  2026. let _tool = _task[j].toolChoose;
  2027. if (_tool[0].tool.length) {
  2028. for (let z = 0; z < _tool.length; z++) {
  2029. _chap += `<div style="font-size:23px;margin-top:30px;"><span>步骤${z +
  2030. 1}:</span><span>${
  2031. tools[_tool[z].tool[0]] ? tools[_tool[z].tool[0]].name : ""
  2032. }</span></div>`;
  2033. if (_tool[z].toolDetail) {
  2034. _chap += `<div style="font-size:23px;margin-top:20px;">工具描述</div>`;
  2035. _chap += `<div style="font-size:23px;margin-top:10px;">${_tool[z].toolDetail}</div>`;
  2036. }
  2037. }
  2038. }
  2039. }
  2040. }
  2041. let _html = _user + _chap;
  2042. return _html;
  2043. },
  2044. // 获取ai对话
  2045. getAiContent(_uid) {
  2046. // this.source = new EventSource(
  2047. // `https://claude3.cocorobo.cn/streamChat/${_uid}`
  2048. // );
  2049. this.source = new EventSource(
  2050. `https://gpt4.cocorobo.cn/question/${_uid}`
  2051. );
  2052. // this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
  2053. let _allText = "";
  2054. let _mdText = "";
  2055. // const md = new MarkdownIt();
  2056. this.source.onmessage = _e => {
  2057. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  2058. //对话已经完成
  2059. _mdText = _mdText.replace("_", "");
  2060. this.source.close();
  2061. this.chatLoading = false;
  2062. this.scrollBottom();
  2063. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  2064. this.chatList.find(i => i.uid == _uid).isalltext = true;
  2065. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  2066. this.chatList.find(i => i.uid == _uid).loading = false;
  2067. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  2068. this.addAsk(this.chatList.find(i => i.uid == _uid).content);
  2069. // 这里保存对话
  2070. this.insertChat(_uid);
  2071. return;
  2072. } else {
  2073. //对话还在继续
  2074. let _text = "";
  2075. _text = _e.data.replaceAll("'", "");
  2076. if (_allText == "") {
  2077. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  2078. } else {
  2079. _allText += _text;
  2080. }
  2081. _mdText = _allText + "_";
  2082. _mdText = _mdText.replace(/\\n/g, "\n");
  2083. _mdText = _mdText.replace(/\\/g, "");
  2084. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  2085. //转化返回的回复流数据
  2086. // _mdText = md.render(_mdText);
  2087. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  2088. this.chatList.find(i => i.uid == _uid).loading = false;
  2089. this.scrollBottom();
  2090. // 处理流数据
  2091. }
  2092. };
  2093. },
  2094. getAtAuContent(_uid) {
  2095. this.source = new EventSource(
  2096. `https://gpt4.cocorobo.cn/question/${_uid}`
  2097. );
  2098. //http://gpt4.cocorobo.cn:8011/question/ https://gpt4.cocorobo.cn/question/
  2099. let _allText = "";
  2100. let _mdText = "";
  2101. let _index = 0;
  2102. let _talkText = "";
  2103. // const md = new MarkdownIt();
  2104. this.source.onmessage = _e => {
  2105. let _eData = JSON.parse(_e.data);
  2106. if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
  2107. let _result = [];
  2108. if ("result" in _eData) {
  2109. _result = _eData.result;
  2110. for (let i = 0; i < _result.length; i++) {
  2111. _mdText = _mdText.replace(_result[i].text, _result[i].fileName);
  2112. }
  2113. }
  2114. _mdText = _mdText.replace("_", "");
  2115. if (this.openMegaphone && this.aiTalkUid == _uid) {
  2116. if (_talkText != "") {
  2117. let _resultText = this.removeMarkdown(_talkText);
  2118. this.aiTalkList.push(_resultText);
  2119. _talkText = "";
  2120. if (!this.aiIsTalk) this.aiTalk(1);
  2121. }
  2122. }
  2123. this.chatLoading = false;
  2124. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  2125. this.chatList.find(i => i.uid == _uid).isalltext = true;
  2126. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  2127. this.chatList.find(i => i.uid == _uid).loading = false;
  2128. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  2129. this.addAsk(this.chatList.find(i => i.uid == _uid).content);
  2130. this.source.close();
  2131. this.insertChat(_uid);
  2132. } else {
  2133. _index += 1;
  2134. let _text = _eData.content.replace("'", "").replace("'", "");
  2135. if (_allText == "") {
  2136. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  2137. _talkText += _text.replace(/^\n+/, "");
  2138. } else {
  2139. _allText += _text;
  2140. _talkText += _text;
  2141. }
  2142. _mdText = _allText + "_";
  2143. _mdText = _mdText.replace(/\\n/g, "\n");
  2144. _mdText = _mdText.replace(/\\/g, "");
  2145. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  2146. //转化返回的回复流数据
  2147. // _mdText = md.render(_mdText);
  2148. if (_index == 10) {
  2149. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  2150. this.chatList.find(i => i.uid == _uid).loading = false;
  2151. this.$nextTick(() => {
  2152. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  2153. });
  2154. _index = 0;
  2155. }
  2156. if (this.openMegaphone && /[,。:;?!)]/.test(_talkText)) {
  2157. let _resultText = this.removeMarkdown(_talkText);
  2158. if (this.aiTalkUid != _uid) {
  2159. this.aiTalkList = [];
  2160. }
  2161. this.aiTalkList.push(_resultText);
  2162. _talkText = "";
  2163. if (this.aiTalkUid != _uid) {
  2164. this.aiTalkUid = _uid;
  2165. this.aiTalk(0);
  2166. } else if (!this.aiIsTalk) {
  2167. this.aiTalk(1);
  2168. }
  2169. }
  2170. // 处理流数据
  2171. }
  2172. };
  2173. },
  2174. getWAntSearchContent(_uid) {
  2175. // this.source = new EventSource(
  2176. // `https://claude3.cocorobo.cn/streamChat/${_uid}`
  2177. // );
  2178. let source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`);
  2179. // this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
  2180. let _allText = "";
  2181. let _mdText = "";
  2182. this.scrollBottom();
  2183. source.onmessage = _e => {
  2184. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  2185. //对话已经完成
  2186. _mdText = _mdText.replace("_", "");
  2187. _mdText = _mdText.replace("```json", "");
  2188. _mdText = _mdText.replace("```", "");
  2189. // 使用正则表达式匹配JSON数组
  2190. const regex = /\[\s*{[^]*}\s*\]/;
  2191. const match = _mdText.match(regex);
  2192. let _result = match[0];
  2193. source.close();
  2194. this.chatList.find(i => i.uid == _uid).aiContent = JSON.parse(
  2195. _result
  2196. );
  2197. this.chatList.find(i => i.uid == _uid).isalltext = true;
  2198. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  2199. this.chatList.find(i => i.uid == _uid).loading = false;
  2200. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  2201. this.scrollBottom();
  2202. // 这里保存对话
  2203. return;
  2204. } else {
  2205. //对话还在继续
  2206. let _text = "";
  2207. _text = _e.data.replaceAll("'", "");
  2208. if (_allText == "") {
  2209. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  2210. } else {
  2211. _allText += _text;
  2212. }
  2213. _mdText = _allText + "_";
  2214. _mdText = _mdText.replace(/\\n/g, "\n");
  2215. _mdText = _mdText.replace(/\\/g, "");
  2216. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  2217. //转化返回的回复流数据
  2218. this.scrollBottom();
  2219. }
  2220. };
  2221. },
  2222. //保存消息
  2223. insertChat(_uid) {
  2224. if (_uid == "") return;
  2225. let _data = this.chatList.find(i => i.uid == _uid);
  2226. if (!_data) return;
  2227. let params = {
  2228. userId: this.userid,
  2229. userName: "qgt",
  2230. groupId: "602def61-005d-11ee-91d8-005056b8q12w",
  2231. answer: _data.aiContent,
  2232. problem: _data.content,
  2233. file_id: _data.fileid ? _data.fileid : "",
  2234. alltext: _data.aiContent,
  2235. type: "chat",
  2236. filename: _data.filename,
  2237. session_name: `${this.courseId}-studyStudent-md` //这是对话记录位置
  2238. };
  2239. this.saveUid = "";
  2240. this.ajax
  2241. .post("https://gpt4.cocorobo.cn/insert_chat", params)
  2242. .then(res => {});
  2243. },
  2244. // 获取对应的聊天记录
  2245. getChatList() {
  2246. return new Promise((resolve, reject) => {
  2247. if (this.loading) return this.$message.info("请稍等...");
  2248. this.chatList = [];
  2249. this.loading = true;
  2250. let params = {
  2251. userid: this.userid,
  2252. groupid: "602def61-005d-11ee-91d8-005056b8q12w",
  2253. // session_name:``
  2254. session_name: `${this.courseId}-studyStudent-md`
  2255. };
  2256. this.ajax
  2257. .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
  2258. .then(res => {
  2259. let _data = JSON.parse(res.data.FunctionResponse);
  2260. if (_data.length > 0) {
  2261. let _chatList = [];
  2262. for (let i = 0; i < _data.length; i++) {
  2263. _chatList.push({
  2264. loading: false,
  2265. role: "user",
  2266. content: _data[i].problem,
  2267. uid: _data[i].id,
  2268. AI: "AI",
  2269. aiContent: _data[i].answer,
  2270. oldContent: _data[i].answer,
  2271. isShowSynchronization: false,
  2272. filename: _data[i].filename,
  2273. index: i,
  2274. is_mind_map: false,
  2275. fileid: _data[i].fileid
  2276. });
  2277. }
  2278. this.chatList = _chatList;
  2279. this.loading = false;
  2280. } else {
  2281. //没有对话记录
  2282. this.loading = false;
  2283. }
  2284. resolve();
  2285. })
  2286. .catch(err => {
  2287. console.log(err);
  2288. this.$message.error("获取对话记录失败");
  2289. this.loading = false;
  2290. resolve();
  2291. });
  2292. });
  2293. },
  2294. sendAiIdea(text) {
  2295. if (this.loading) return this.$message.info("请稍等");
  2296. this.send(text);
  2297. },
  2298. getWantSearch() {
  2299. let _uuid = uuidv4();
  2300. let _msg = `
  2301. 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.
  2302. ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
  2303. Instruction: Based on the context, follow "Format example", write content
  2304. ## 任务
  2305. 你的任务是根据“课程信息”,提供用户需要的搜索建议,将搜索建议的结果以有序列表的形式返回给用户。
  2306. ## 课程信息
  2307. #### 课程标题:${this.courseDetail.title ? this.courseDetail.title : ""}
  2308. #### 分类:${this.courseDetail.name ? this.courseDetail.name : "无"}
  2309. #### 学生年级:${
  2310. this.courseDetail.classname ? this.courseDetail.classname : "无"
  2311. }
  2312. ## 规则
  2313. 输出结果基于“课程信息”,避免提供无关的信息。
  2314. 搜索建议的结果符合伦理规范。
  2315. ## 输出
  2316. 输出应包括6个相关的搜索建议,每个搜索建议需要以问号的方式结束。
  2317. 请一步步思考如何根据现有信息推送搜索建议,但是不需要输出搜索建议以外的内
  2318. ## 输出格式
  2319. 搜索建议应以有序列表形式呈现,每个建议包括关键词和简短描述。输出JSON格式的
  2320. ## Format example
  2321. [{"index": 1,"title": "垃圾分类标准","label": "不同国家的垃圾分类标准和方法?"},{"index": 2,"title":"可回收垃圾处理","label": "可回收垃圾的处理流程和再利用方法?"},{ "index": 3, "title": "有害垃圾的影响", "label": "有害垃圾对环境和人体健康的潜在影响?"},{ "index": 4, "title": "垃圾分类标准", "label": "不同国家的垃圾分类标准和方法?"},{ "index": 5, "title": "可回收垃圾处理", "label": "可回收垃圾的处理流程和再利用方法?"},{ "index": 6, "title": "有害垃圾的影响", "label": "有害垃圾对环境和人体健康的潜在影响?"}]
  2322. `;
  2323. this.chatList.push({
  2324. role: "user",
  2325. content: `wanSearch`,
  2326. uid: _uuid,
  2327. AI: "AI",
  2328. aiContent: "",
  2329. oldContent: "",
  2330. isShowSynchronization: false,
  2331. filename: "",
  2332. index: this.chatList.length,
  2333. is_mind_map: false,
  2334. loading: true
  2335. });
  2336. this.scrollBottom();
  2337. // let params = {
  2338. // model: "gpt-3.5-turbo",
  2339. // temperature: 0,
  2340. // max_tokens: 4096,
  2341. // top_p: 1,
  2342. // frequency_penalty: 0,
  2343. // presence_penalty: 0,
  2344. // messages: [{ role: "user", content: _msg }],
  2345. // uid: _uuid,
  2346. // mind_map_question: ""
  2347. // };
  2348. let params = {
  2349. assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
  2350. userId: this.userid,
  2351. message: [{ type: "text", text: _msg }],
  2352. session_name: _uuid,
  2353. // uid: _uuid,
  2354. file_ids: this.fileId
  2355. };
  2356. // let params = {
  2357. // message: {
  2358. // anthropic_version: "bedrock-2023-05-31",
  2359. // max_tokens: 4096,
  2360. // temperature: 0,
  2361. // top_p: 1,
  2362. // messages: [{ role: "user", content: _msg }]
  2363. // },
  2364. // uid: _uuid,
  2365. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2366. // };
  2367. this.text = "";
  2368. this.ajax
  2369. // .post("https://gpt4.cocorobo.cn/chat", params)
  2370. // .post("https://claude3.cocorobo.cn/chat", params)
  2371. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
  2372. .then(res => {
  2373. // console.log(res);
  2374. let _data = res.data.FunctionResponse.message;
  2375. _data = _data.replaceAll("```json", "").replaceAll("```", "");
  2376. const match = _data.match(/\[\s*{[^]*}\s*\]/);
  2377. // console.log(_data);
  2378. // console.log(match);
  2379. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(
  2380. match[0]
  2381. );
  2382. this.chatList.find(i => i.uid == _uuid).isalltext = true;
  2383. this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
  2384. this.chatList.find(i => i.uid == _uuid).loading = false;
  2385. this.scrollBottom();
  2386. // this.chatLoading = false;
  2387. })
  2388. .catch(e => {
  2389. this.chatLoading = false;
  2390. console.log(e);
  2391. });
  2392. // this.getWAntSearchContent(_uuid);
  2393. },
  2394. addAsk(_text) {
  2395. // this.chatLoading = true;
  2396. let _uuid = uuidv4();
  2397. 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\": \"有害垃圾对环境和人体健康的潜在影响?\"}]`;
  2398. _msg = _msg.replace(/[\r\n]/g, "");
  2399. this.chatList.push({
  2400. role: "user",
  2401. content: `addAsk`,
  2402. uid: _uuid,
  2403. AI: "AI",
  2404. aiContent: "",
  2405. oldContent: "",
  2406. isShowSynchronization: false,
  2407. filename: "",
  2408. index: this.chatList.length,
  2409. is_mind_map: false,
  2410. loading: true
  2411. });
  2412. this.scrollBottom();
  2413. let history = [];
  2414. // this.nowChatList.forEach(i => {
  2415. // if (i.content == "wanSearch") {
  2416. // // history.push({
  2417. // // role:"assistant",
  2418. // // content: JSON.stringify(i.aiContent)
  2419. // // })
  2420. // return;
  2421. // } else if (i.content == "getImage") {
  2422. // return history.push({
  2423. // role: "assistant",
  2424. // content: i.aiContent
  2425. // });
  2426. // }else if(i.content == "addAsk"){
  2427. // }
  2428. // if (i.content) {
  2429. // history.push({
  2430. // role: "user",
  2431. // content: i.content
  2432. // });
  2433. // }
  2434. // if (i.aiContent) {
  2435. // history.push({
  2436. // role: "assistant",
  2437. // content: i.aiContent
  2438. // });
  2439. // }
  2440. // });
  2441. history.push({ type: "text", text: _msg });
  2442. console.log(history);
  2443. // let params = {
  2444. // model: "gpt-3.5-turbo",
  2445. // temperature: 0,
  2446. // max_tokens: 4096,
  2447. // top_p: 1,
  2448. // frequency_penalty: 0,
  2449. // presence_penalty: 0,
  2450. // messages:history,
  2451. // stream: false,
  2452. // uid: _uuid,
  2453. // mind_map_question: ""
  2454. // };
  2455. let params = {
  2456. assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
  2457. userId: this.userid,
  2458. message: history,
  2459. session_name: _uuid,
  2460. // uid: _uuid,
  2461. file_ids: this.fileId
  2462. };
  2463. // let params = {
  2464. // message: {
  2465. // anthropic_version: "bedrock-2023-05-31",
  2466. // max_tokens: 4096,
  2467. // temperature: 0,
  2468. // top_p: 1,
  2469. // messages: [{ role: "user", content: _msg }]
  2470. // },
  2471. // uid: _uuid,
  2472. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2473. // };
  2474. this.text = "";
  2475. this.ajax
  2476. // .post("https://gpt4.cocorobo.cn/chat", params)
  2477. // .post("https://claude3.cocorobo.cn/chat", params)
  2478. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
  2479. .then(res => {
  2480. console.log(res);
  2481. let _data = res.data.FunctionResponse.message;
  2482. _data = _data.replaceAll("```json", "").replaceAll("```", "");
  2483. const match = _data.match(/\[\s*{[^]*}\s*\]/);
  2484. console.log(match[0]);
  2485. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(
  2486. match[0]
  2487. );
  2488. this.chatList.find(i => i.uid == _uuid).isalltext = true;
  2489. this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
  2490. this.chatList.find(i => i.uid == _uuid).loading = false;
  2491. this.scrollBottom();
  2492. // this.chatLoading = false;
  2493. })
  2494. .catch(e => {
  2495. this.chatLoading = false;
  2496. this.chatList.find(i => i.uid == _uuid).loading = false;
  2497. console.log(e);
  2498. });
  2499. },
  2500. scrollBottom() {
  2501. this.$nextTick(() => {
  2502. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  2503. });
  2504. },
  2505. initTaskList() {
  2506. this.taskList = [];
  2507. this.taskList = JSON.parse(JSON.stringify(this.navList));
  2508. this.taskList.forEach(i1 => {
  2509. i1.isOpen = true;
  2510. i1.task.forEach(i2 => {
  2511. i2.isOpen = true;
  2512. i2.tool.forEach(i3 => {
  2513. i3.isOpen = true;
  2514. });
  2515. });
  2516. });
  2517. },
  2518. getWorkData() {
  2519. if (this.workSum == 0) return;
  2520. let params = {
  2521. cid: this.courseId,
  2522. classid: this.tcid
  2523. };
  2524. this.userList = [];
  2525. this.ajax
  2526. .get(this.$store.state.api + "selectWorkBycidAi", params)
  2527. .then(res => {
  2528. let _data = res.data[0];
  2529. console.log(_data);
  2530. if (_data.length > 0) {
  2531. this.userList = _data;
  2532. }
  2533. })
  2534. .catch(e => {
  2535. // this.$message.error()
  2536. this.userList = [];
  2537. console.log(e);
  2538. });
  2539. },
  2540. lookStudentDetail(_data) {
  2541. this.loading = true;
  2542. let params = {
  2543. cid: this.courseId,
  2544. uid: _data.userid
  2545. };
  2546. this.ajax
  2547. .get(this.$store.state.api + "selectWorkBycidAiByUid", params)
  2548. .then(res => {
  2549. let _result = res.data[0];
  2550. this.atTagIndex = 2;
  2551. this.loading = false;
  2552. _result.forEach(i => {
  2553. i.content = JSON.parse(i.content)[0];
  2554. });
  2555. this.lookStudentData = {
  2556. userName: _data.username,
  2557. list: _result ? _result : []
  2558. };
  2559. console.log(this.lookStudentData);
  2560. });
  2561. },
  2562. sumUpStudent(_data) {
  2563. let params = {
  2564. cid: this.courseId,
  2565. uid: _data.userid
  2566. };
  2567. this.loading = true;
  2568. this.ajax
  2569. .get(this.$store.state.api + "selectWorkBycidAiByUid", params)
  2570. .then(res => {
  2571. let _result = res.data[0];
  2572. console.log(_result);
  2573. console.log("👆");
  2574. this.text += `${_data.username} 总结分析`;
  2575. let _msg = ``;
  2576. this.chatLoading = true;
  2577. let _uuid = uuidv4();
  2578. this.chatList.push({
  2579. role: "user",
  2580. content: `${this.text}`,
  2581. uid: _uuid,
  2582. AI: "AI",
  2583. aiContent: "",
  2584. oldContent: "",
  2585. isShowSynchronization: false,
  2586. filename: "",
  2587. index: this.chatList.length,
  2588. is_mind_map: false,
  2589. loading: true
  2590. });
  2591. this.text = "";
  2592. let _wordData = "";
  2593. _result.forEach(i => {
  2594. if (i.type == 3) {
  2595. let content = JSON.parse(i.content)[0];
  2596. return (_wordData += `问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n\n`);
  2597. } else if (i.type == 8) {
  2598. let content = JSON.parse(i.content)[0];
  2599. _wordData += `选择题:\n`;
  2600. let _json = content.testJson ? content.testJson.testJson : [];
  2601. _json.forEach((i2, index2) => {
  2602. _wordData += `题目:${i2.teststitle}\n选项:\n`;
  2603. i2.checkList.forEach((item, index) => {
  2604. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  2605. });
  2606. if (typeof i2.answer != "number") {
  2607. i2.answer.forEach(a => {
  2608. a += 1;
  2609. });
  2610. content.anwer[index2].forEach(b => {
  2611. b += 1;
  2612. });
  2613. _wordData += `答案:${i2.answer.join("、")}`;
  2614. _wordData += `学生选择:${content.anwer[index2].join(
  2615. "、"
  2616. )}\n\n`;
  2617. } else {
  2618. _wordData += `答案:${i2.answer + 1}`;
  2619. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  2620. }
  2621. });
  2622. return _wordData;
  2623. } else if (i.type == 2) {
  2624. let content = JSON.parse(i.content)[0];
  2625. _wordData += `问卷:${content.askJson.askTitle}\n`;
  2626. let _json = content.askJson ? content.askJson.askJson : [];
  2627. _json.forEach((i2, index2) => {
  2628. _wordData += `题目:${i2.askstitle}\n选项:\n`;
  2629. i2.checkList.forEach((item, index) => {
  2630. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  2631. });
  2632. if (typeof content.anwer[index2] != "number") {
  2633. _wordData += `学生选择:${content.anwer[index2].join(
  2634. "、"
  2635. )}\n\n`;
  2636. } else {
  2637. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  2638. }
  2639. });
  2640. }
  2641. });
  2642. // console.log(_wordData)
  2643. // this.loading = false;
  2644. // return this.chatLoading = false;
  2645. _msg = `
  2646. NOTICE
  2647. 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.
  2648. ## 目的
  2649. 你是教师用户的课堂助手,你需要基于提供给你的课程相关信息以及学生的作业数据,就某些具体作业对全班学生进行总结分析。
  2650. ---
  2651. ## 定义
  2652. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  2653. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  2654. 【阶段】:阶段表示课程的某一单独部分,包含一个或多个任务。
  2655. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  2656. 【工具】:工具通常是指学生的作业(在课上要具体做的事情)。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。工具中通常会包含学生的作业数据。
  2657. ---
  2658. ## 工作流程与规则
  2659. 1. 了解信息。读取【工具总览表格】以及【工具详情:总体数据】中的内容,了解学生作业详情。
  2660. 2. 确保信息的完整性和可解读性。当面对不确定信息时,你应当积极提问。这一点适用于以下两种情况:
  2661. 2.1 当用户的提问需要你对课程、任务或工具拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  2662. 2.2 当你不理解某个工具的设置时(比如当你发现题目、选项的表述不完整或者有不符合中文表达规则的符号;又比如你发现缺乏必要的统计信息),你应当积极向用户询问。
  2663. 2.3 **例外情况**:在告知用户并征得同意的情况下,你可以忽视上述问题并执行后续流程。
  2664. 3. 进行总结。
  2665. 3.1 对表格信息进行简单总结。包括任务、阶段、工具及其内容。
  2666. 3.2 进行结果分析。对于每一个工具,都从全班的角度出发进行简单总结。
  2667. 3.3 进行错因分析。仅仅针对于某些错误率较高的题目,从全班的角度出发,进行错因分析。
  2668. 4. 提供扩展题目。针对错误的题目,向用户提供同等水平的题目以起到举一反三的练习效果。
  2669. 5. 回答问题。当用户询问你某个【工具】的具体信息,这部分信息通常将就是学生的作业。你需要简单总结该部分信息,并就用户的问题进行回答。
  2670. ---
  2671. ## 做题信息
  2672. 学生名称:${_data.username}
  2673. ${_wordData}
  2674. `;
  2675. console.log(_msg);
  2676. // this.chatLoading = false;
  2677. // return;
  2678. let history = [];
  2679. this.nowChatList.forEach(i => {
  2680. if (i.content == "wanSearch") {
  2681. return;
  2682. } else if (i.content == "getImage") {
  2683. return history.push({
  2684. role: "assistant",
  2685. content: i.aiContent
  2686. });
  2687. }
  2688. if (i.content) {
  2689. history.push({
  2690. role: "user",
  2691. content: i.content
  2692. });
  2693. }
  2694. if (i.aiContent) {
  2695. history.push({
  2696. role: "assistant",
  2697. content: i.aiContent
  2698. });
  2699. }
  2700. });
  2701. // if (_msg) {
  2702. history.push({ role: "user", content: _msg });
  2703. let params = {
  2704. assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
  2705. userId: this.userid,
  2706. message: _text,
  2707. session_name: `${this.courseId}-studyStudent-md`,
  2708. uid: _uuid,
  2709. file_ids: this.fileId
  2710. };
  2711. // let params = {
  2712. // model: "gpt-3.5-turbo",
  2713. // temperature: 0,
  2714. // max_tokens: 4096,
  2715. // top_p: 1,
  2716. // frequency_penalty: 0,
  2717. // presence_penalty: 0,
  2718. // messages: history,
  2719. // uid: _uuid,
  2720. // mind_map_question: _text
  2721. // };
  2722. // let params = {
  2723. // message: {
  2724. // anthropic_version: "bedrock-2023-05-31",
  2725. // max_tokens: 4096,
  2726. // temperature: 0,
  2727. // top_p: 1,
  2728. // messages: history
  2729. // },
  2730. // uid: _uuid,
  2731. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2732. // };
  2733. this.ajax
  2734. // .post("https://gpt4.cocorobo.cn/chat", params)
  2735. // .post("https://claude3.cocorobo.cn/chat", params)
  2736. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  2737. .then(res => {
  2738. if (
  2739. converter(res.data.FunctionResponse.result) ==
  2740. converter("发送成功")
  2741. ) {
  2742. this.loading = false;
  2743. } else {
  2744. // this.$message.warning(res.data.FunctionResponse.result);
  2745. console.log(res.data.FunctionResponse.result);
  2746. this.chatLoading = false;
  2747. this.loading = false;
  2748. }
  2749. })
  2750. .catch(e => {
  2751. console.log(e);
  2752. this.chatLoading = false;
  2753. this.loading = false;
  2754. });
  2755. this.saveUid = _uuid;
  2756. // this.getAiContent(_uuid);
  2757. this.getAtAuContent(_uuid);
  2758. });
  2759. },
  2760. sumUpStudent2(_data) {
  2761. this.text += `${_data.username} 作业分析`;
  2762. let _msg = ``;
  2763. this.chatLoading = true;
  2764. let _uuid = uuidv4();
  2765. this.chatList.push({
  2766. role: "user",
  2767. content: `${this.text}`,
  2768. uid: _uuid,
  2769. AI: "AI",
  2770. aiContent: "",
  2771. oldContent: "",
  2772. isShowSynchronization: false,
  2773. filename: "",
  2774. index: this.chatList.length,
  2775. is_mind_map: false,
  2776. loading: true
  2777. });
  2778. this.text = "";
  2779. let _wordData = "";
  2780. let content = _data.content;
  2781. if (_data.type == 3) {
  2782. _wordData += `问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n\n`;
  2783. } else if (_data.type == 8) {
  2784. _wordData += `选择题:\n`;
  2785. let _json = content.testJson ? content.testJson.testJson : [];
  2786. _json.forEach((i2, index2) => {
  2787. _wordData += `题目:${i2.teststitle}\n选项:\n`;
  2788. i2.checkList.forEach((item, index) => {
  2789. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  2790. });
  2791. if (typeof i2.answer != "number") {
  2792. i2.answer.forEach(a => {
  2793. a += 1;
  2794. });
  2795. content.anwer[index2].forEach(b => {
  2796. b += 1;
  2797. });
  2798. _wordData += `答案:${i2.answer.join("、")}`;
  2799. _wordData += `学生选择:${content.anwer[index2].join("、")}\n\n`;
  2800. } else {
  2801. _wordData += `答案:${i2.answer + 1}`;
  2802. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  2803. }
  2804. });
  2805. _wordData;
  2806. } else if (_data.type == 2) {
  2807. _wordData += `问卷:${content.askJson.askTitle}\n`;
  2808. let _json = content.askJson ? content.askJson.askJson : [];
  2809. _json.forEach((i2, index2) => {
  2810. _wordData += `题目:${i2.askstitle}\n选项:\n`;
  2811. i2.checkList.forEach((item, index) => {
  2812. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  2813. });
  2814. if (typeof content.anwer[index2] != "number") {
  2815. _wordData += `学生选择:${content.anwer[index2].join("、")}\n\n`;
  2816. } else {
  2817. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  2818. }
  2819. });
  2820. }
  2821. // if(_data.type==3){
  2822. // _wordData+=`问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n`
  2823. // }else if(_data.type==8){
  2824. // _wordData+=`选择题:\n`
  2825. // content.testJson.testJson.forEach((i2,index2)=>{
  2826. // _wordData += `题目:${i2.teststitle}\n选项:\n`
  2827. // i2.checkList.forEach((item,index)=>{
  2828. // _wordData+=`${index+1}:${item}\n`
  2829. // })
  2830. // _wordData +=`答案:${i2.answer}`
  2831. // _wordData +=`学生选择:${(content.anwer[index2])+1}\n`
  2832. // })
  2833. // }
  2834. // console.log("👇👇👇")
  2835. // console.log(_wordData)
  2836. // this.chatLoading = false;
  2837. // this.loading = false;
  2838. // return
  2839. _msg = `
  2840. NOTICE
  2841. 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.
  2842. ## 目的
  2843. 你是教师用户的课堂助手,你需要基于提供给你的课程相关信息以及学生的作业数据,就某些具体作业对全班学生进行总结分析。
  2844. ---
  2845. ## 定义
  2846. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  2847. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  2848. 【阶段】:阶段表示课程的某一单独部分,包含一个或多个任务。
  2849. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  2850. 【工具】:工具通常是指学生的作业(在课上要具体做的事情)。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。工具中通常会包含学生的作业数据。
  2851. ---
  2852. ## 工作流程与规则
  2853. 1. 了解信息。读取【工具总览表格】以及【工具详情:总体数据】中的内容,了解学生作业详情。
  2854. 2. 确保信息的完整性和可解读性。当面对不确定信息时,你应当积极提问。这一点适用于以下两种情况:
  2855. 2.1 当用户的提问需要你对课程、任务或工具拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  2856. 2.2 当你不理解某个工具的设置时(比如当你发现题目、选项的表述不完整或者有不符合中文表达规则的符号;又比如你发现缺乏必要的统计信息),你应当积极向用户询问。
  2857. 2.3 **例外情况**:在告知用户并征得同意的情况下,你可以忽视上述问题并执行后续流程。
  2858. 3. 进行总结。
  2859. 3.1 对表格信息进行简单总结。包括任务、阶段、工具及其内容。
  2860. 3.2 进行结果分析。对于每一个工具,都从全班的角度出发进行简单总结。
  2861. 3.3 进行错因分析。仅仅针对于某些错误率较高的题目,从全班的角度出发,进行错因分析。
  2862. 4. 提供扩展题目。针对错误的题目,向用户提供同等水平的题目以起到举一反三的练习效果。
  2863. 5. 回答问题。当用户询问你某个【工具】的具体信息,这部分信息通常将就是学生的作业。你需要简单总结该部分信息,并就用户的问题进行回答。
  2864. ---
  2865. ## 做题信息
  2866. 学生名称:${_data.username}
  2867. ${_wordData}
  2868. `;
  2869. console.log(_msg);
  2870. let history = [];
  2871. this.nowChatList.forEach(i => {
  2872. if (i.content == "wanSearch") {
  2873. return;
  2874. } else if (i.content == "getImage") {
  2875. return history.push({
  2876. role: "assistant",
  2877. content: i.aiContent
  2878. });
  2879. }
  2880. if (i.content) {
  2881. history.push({
  2882. role: "user",
  2883. content: i.content
  2884. });
  2885. }
  2886. if (i.aiContent) {
  2887. history.push({
  2888. role: "assistant",
  2889. content: i.aiContent
  2890. });
  2891. }
  2892. });
  2893. // if (_msg) {
  2894. history.push({ role: "user", content: _msg });
  2895. let params = {
  2896. assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
  2897. userId: this.userid,
  2898. message: _text,
  2899. session_name: `${this.courseId}-studyStudent-md`,
  2900. uid: _uuid,
  2901. file_ids: this.fileId
  2902. };
  2903. // let params = {
  2904. // model: "gpt-3.5-turbo",
  2905. // temperature: 0,
  2906. // max_tokens: 4096,
  2907. // top_p: 1,
  2908. // frequency_penalty: 0,
  2909. // presence_penalty: 0,
  2910. // messages: history,
  2911. // uid: _uuid,
  2912. // mind_map_question: _text
  2913. // };
  2914. // let params = {
  2915. // message: {
  2916. // anthropic_version: "bedrock-2023-05-31",
  2917. // max_tokens: 4096,
  2918. // temperature: 0,
  2919. // top_p: 1,
  2920. // messages: history
  2921. // },
  2922. // uid: _uuid,
  2923. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2924. // };
  2925. this.ajax
  2926. // .post("https://gpt4.cocorobo.cn/chat", params)
  2927. // .post("https://claude3.cocorobo.cn/chat", params)
  2928. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  2929. .then(res => {
  2930. if (
  2931. converter(res.data.FunctionResponse.result) == converter("发送成功")
  2932. ) {
  2933. } else {
  2934. // this.$message.warning(res.data.FunctionResponse.result);
  2935. console.log(res.data.FunctionResponse.result);
  2936. this.chatLoading = false;
  2937. }
  2938. })
  2939. .catch(e => {
  2940. console.log(e);
  2941. this.chatLoading = false;
  2942. });
  2943. this.saveUid = _uuid;
  2944. // this.getAiContent(_uuid);
  2945. this.getAtAuContent(_uuid);
  2946. },
  2947. download(_url) {
  2948. let xhr = new XMLHttpRequest();
  2949. xhr.open("GET", _url, true);
  2950. xhr.responseType = "blob";
  2951. xhr.onload = () => {
  2952. if (xhr.status === 200) {
  2953. let blob = xhr.response;
  2954. // const _blob = new Blob([blob], { type: fileType });
  2955. const downloadElement = document.createElement("a");
  2956. const url = window.URL.createObjectURL(blob);
  2957. downloadElement.href = url;
  2958. downloadElement.download = "Image.jpg";
  2959. downloadElement.click();
  2960. window.URL.revokeObjectURL(url); // 释放内存
  2961. } else {
  2962. this.$message.error("此图片不支持下载");
  2963. }
  2964. };
  2965. xhr.onerror = e => {
  2966. console.log(e);
  2967. this.$message.error("此图片不支持下载");
  2968. };
  2969. xhr.send();
  2970. },
  2971. removeMarkdown(text) {
  2972. return text
  2973. .replace(/[#*_~`>+\-]/g, "") // 移除 #、*、_、~、`、>、+、- 符号
  2974. .replace(/!\[.*?\]\(.*?\)/g, "") // 移除图片
  2975. .replace(/\[.*?\]\(.*?\)/g, "") // 移除链接
  2976. .replace(/```[\s\S]*?```/g, "") // 移除代码块(不使用 s 标志)
  2977. .replace(/`[^`]*`/g, "") // 移除行内代码
  2978. .replace(/\d+\./g, "") // 移除有序列表
  2979. .replace(/^\s*[-*+]\s+/gm, "") // 移除无序列表
  2980. .replace(/\s+/g, " ") // 将多个空白字符替换为一个空格
  2981. .trim(); // 去除字符串两端的空白字符
  2982. },
  2983. aiTalk(type = 0) {
  2984. //0 新的 1继续
  2985. if (type == 0 && this.aiIsTalk) {
  2986. let _talkTextIiframe2 = this.$refs.iiframe2;
  2987. try {
  2988. _talkTextIiframe2.contentWindow.pausesynthesizer();
  2989. _talkTextIiframe2.contentWindow.closesynthesizer();
  2990. this.aiIsTalk = false;
  2991. if (this.aiTalkList.length) this.aiTalk(0);
  2992. else this.aiTalkUid = "";
  2993. } catch (error) {
  2994. // console.log("error")
  2995. this.aiIsTalk = false;
  2996. if (this.aiTalkList.length) this.aiTalk(0);
  2997. else this.aiTalkUid = "";
  2998. }
  2999. } else {
  3000. let _text = this.aiTalkList.shift();
  3001. let _talkTextIiframe2 = this.$refs.iiframe2;
  3002. if (_text) {
  3003. this.aiIsTalk = true;
  3004. // console.log("👇说👇");
  3005. // console.log(_text);
  3006. _talkTextIiframe2.contentWindow.texttospeech(
  3007. _text,
  3008. () => {
  3009. this.aiTalk(1);
  3010. },
  3011. () => {
  3012. this.aiTalk(0);
  3013. }
  3014. );
  3015. } else {
  3016. try {
  3017. _talkTextIiframe2.contentWindow.closesynthesizer();
  3018. } catch (error) {
  3019. return;
  3020. }
  3021. }
  3022. }
  3023. // if(_text){
  3024. // this.aiIsTalk = true;
  3025. // }
  3026. },
  3027. changeMegaphone(){
  3028. this.$parent.changeMegaphone()
  3029. if(this.aiIsTalk){
  3030. try {
  3031. this.aiTalkList = [];
  3032. let _talkTextIiframe2 = this.$refs.iiframe2;
  3033. _talkTextIiframe2.contentWindow.pausesynthesizer();
  3034. _talkTextIiframe2.contentWindow.closesynthesizer();
  3035. this.aiIsTalk = false;
  3036. } catch (error) {
  3037. this.aiTalkList = [];
  3038. this.aiIsTalk = false;
  3039. }
  3040. }
  3041. },
  3042. aiTalkAll(item) {
  3043. if (this.aiTalkUid == item.uid && this.aiIsTalk) {
  3044. try {
  3045. this.aiTalkList = [];
  3046. let _talkTextIiframe2 = this.$refs.iiframe2;
  3047. _talkTextIiframe2.contentWindow.pausesynthesizer();
  3048. _talkTextIiframe2.contentWindow.closesynthesizer();
  3049. this.aiIsTalk = false;
  3050. } catch (error) {
  3051. this.aiTalkList = [];
  3052. this.aiIsTalk = false;
  3053. }
  3054. } else {
  3055. let _resultText = this.removeMarkdown(item.aiContent);
  3056. this.aiTalkUid = item.uid;
  3057. this.aiTalkList = [];
  3058. this.aiTalkList.push(_resultText);
  3059. this.aiTalk(0);
  3060. }
  3061. },
  3062. choseRole(item) {
  3063. if (
  3064. this.choseRoleItem &&
  3065. this.choseRoleItem.assistant_id == item.assistant_id
  3066. ) {
  3067. return (this.choseRoleItem = null);
  3068. }
  3069. this.choseRoleItem = item;
  3070. this.changeRole();
  3071. console.log("选择角色", this.choseRoleItem);
  3072. // this.scrollBottom();
  3073. },
  3074. noChangeRole() {
  3075. this.cardType = 0;
  3076. this.choseRoleItem = null;
  3077. this.scrollBottom();
  3078. },
  3079. changeRole() {
  3080. this.cardType = 0;
  3081. if (this.choseRoleItem && this.choseRoleItem.assistant_id) {
  3082. this.chatList = [];
  3083. this.nowChatList = [];
  3084. let _uuid = uuidv4();
  3085. this.chatList.push({
  3086. role: "user",
  3087. content: `您好,${this.choseRoleItem.assistantName}`,
  3088. uid: _uuid,
  3089. AI: "AI",
  3090. aiContent: this.choseRoleItem.prologue
  3091. ? this.choseRoleItem.prologue
  3092. : "您好,有什么需要我帮忙的吗?",
  3093. oldContent: "",
  3094. isShowSynchronization: false,
  3095. filename: this.choseRoleItem.headUrl,
  3096. index: this.chatList.length,
  3097. is_mind_map: false,
  3098. loading: false
  3099. });
  3100. this.scrollBottom();
  3101. this.insertMemorandum(
  3102. `选择智能体<span class="variable">${this.choseRoleItem.assistantName}</span>`
  3103. );
  3104. }
  3105. },
  3106. optBtn(val) {
  3107. this.sortOption = val;
  3108. },
  3109. getRoleList() {
  3110. this.roleList = [];
  3111. let params = {
  3112. userId: this.userid
  3113. };
  3114. this.ajax
  3115. .post("https://gpt4.cocorobo.cn/get_ai_agent_assistant_list", params)
  3116. .then(res => {
  3117. let _data = res.data.FunctionResponse.result;
  3118. if (_data.length == 0) return;
  3119. if (_data) {
  3120. this.roleList = JSON.parse(_data);
  3121. }
  3122. })
  3123. .catch(e => {
  3124. console.log("获取角色列表失败");
  3125. this.roleList = [];
  3126. });
  3127. },
  3128. getPublicRoleList() {
  3129. this.roleList2 = [];
  3130. let params = {
  3131. userId: this.userid,
  3132. // organizeid: this.org,
  3133. organizeid: "45facc0a-1211-11ec-80ad-005056b86db5"
  3134. };
  3135. this.ajax
  3136. .post(
  3137. "https://gpt4.cocorobo.cn/get_ai_agent_assistant_share_list",
  3138. params
  3139. )
  3140. .then(res => {
  3141. let _data = res.data.FunctionResponse.result;
  3142. if (_data.length == 0) return;
  3143. if (_data) {
  3144. this.roleList2 = JSON.parse(_data);
  3145. }
  3146. })
  3147. .catch(e => {
  3148. this.roleList2 = [];
  3149. console.log("获取公共角色失败", e);
  3150. });
  3151. },
  3152. choiceRole() {
  3153. if (this.loading) return this.$message.info("请稍等");
  3154. this.cardType = this.cardType == 1 ? 0 : 1;
  3155. },
  3156. setCursorToEnd(event) {
  3157. // 获取输入框的原生 DOM 元素
  3158. const inputElement = event.target;
  3159. // 将光标设置到输入框内容的末尾
  3160. inputElement.setSelectionRange(this.text.length, this.text.length);
  3161. }
  3162. },
  3163. mounted() {
  3164. this.getChatList().then(_ => {
  3165. this.scrollBottom();
  3166. this.getWantSearch();
  3167. });
  3168. this.nowChatList = [];
  3169. this.sendType = 0;
  3170. this.initTaskList();
  3171. this.getWorkData();
  3172. this.getPublicRoleList();
  3173. this.getRoleList();
  3174. this.insertMemorandum(`打开<span class="btn">对话</span>面板`);
  3175. }
  3176. };
  3177. </script>
  3178. <style scoped>
  3179. .search {
  3180. width: 100%;
  3181. height: 100%;
  3182. box-sizing: border-box;
  3183. position: relative;
  3184. display: flex;
  3185. flex-direction: column;
  3186. justify-content: flex-end;
  3187. }
  3188. .checkboxCss {
  3189. color: #fff;
  3190. background-color: #76a7f5 !important;
  3191. }
  3192. .imgNumberBlock {
  3193. width: 100%;
  3194. height: 30px;
  3195. display: flex;
  3196. justify-content: space-between;
  3197. box-sizing: border-box;
  3198. /* padding: 5px 10px; */
  3199. }
  3200. .imgNumberBlock > .imgNumber {
  3201. width: 18%;
  3202. height: 30px;
  3203. white-space: initial;
  3204. background: rgba(224, 234, 251, 1);
  3205. border-radius: 5px;
  3206. display: flex;
  3207. align-items: center;
  3208. cursor: pointer;
  3209. justify-content: center;
  3210. }
  3211. .s_top {
  3212. width: 100%;
  3213. height: calc(100% - 56px);
  3214. overflow-x: hidden;
  3215. box-sizing: border-box;
  3216. padding: 20px 0;
  3217. position: absolute;
  3218. padding-bottom: 70px;
  3219. top: 0;
  3220. }
  3221. .s_t_chat {
  3222. width: 100%;
  3223. display: flex;
  3224. box-sizing: border-box;
  3225. padding: 10px;
  3226. flex-direction: column;
  3227. }
  3228. .s_t_chat > div {
  3229. display: flex;
  3230. align-items: flex-start;
  3231. width: 100%;
  3232. }
  3233. .s_t_c_user {
  3234. box-sizing: border-box;
  3235. padding-left: 35px;
  3236. }
  3237. .s_t_c_u_left {
  3238. width: 90%;
  3239. height: auto;
  3240. }
  3241. .s_t_c_u_l_content {
  3242. width: auto;
  3243. max-width: 100%;
  3244. height: auto;
  3245. box-sizing: border-box;
  3246. padding: 15px 10px;
  3247. color: white;
  3248. background-color: #3681fc;
  3249. border-radius: 8px 2px 8px 8px;
  3250. white-space: pre-line;
  3251. word-break: break-all;
  3252. }
  3253. .s_t_c_a_r_contentImage > span {
  3254. display: block;
  3255. }
  3256. .s_t_c_a_r_contentImage > img {
  3257. width: 45%;
  3258. height: 125px;
  3259. margin: 1% 1.5%;
  3260. border-radius: 5px;
  3261. cursor: pointer;
  3262. }
  3263. .s_t_c_a_r_contentImage {
  3264. width: auto;
  3265. max-width: 100%;
  3266. height: auto;
  3267. box-sizing: border-box;
  3268. padding: 15px 10px;
  3269. background-color: #f6f8ff;
  3270. border-radius: 2px 8px 8px 8px;
  3271. white-space: pre-line;
  3272. word-break: break-all;
  3273. }
  3274. .s_t_c_u_l_time {
  3275. width: 100%;
  3276. display: flex;
  3277. justify-content: flex-end;
  3278. font-size: 12px;
  3279. color: #9f9f9f;
  3280. margin-top: 5px;
  3281. }
  3282. .s_t_c_u_right {
  3283. width: 35px;
  3284. height: 35px;
  3285. display: flex;
  3286. justify-content: center;
  3287. margin-left: 5px;
  3288. }
  3289. .s_t_c_u_right > span {
  3290. width: 32px;
  3291. height: 32px;
  3292. display: flex;
  3293. justify-content: center;
  3294. align-items: center;
  3295. color: white;
  3296. background-color: #3681fc;
  3297. border-radius: 50%;
  3298. }
  3299. .s_t_c_ai {
  3300. box-sizing: border-box;
  3301. padding-right: 35px;
  3302. position: relative;
  3303. margin-top: 10px;
  3304. }
  3305. .aiCopy {
  3306. position: absolute;
  3307. right: -35px;
  3308. bottom: 0%;
  3309. display: flex;
  3310. flex-direction: column;
  3311. justify-content: center;
  3312. align-items: center;
  3313. /* transform: translate(0, -30%); */
  3314. }
  3315. .aiCopy > img {
  3316. margin-right: 5px;
  3317. cursor: pointer;
  3318. }
  3319. .aiCopy > svg {
  3320. margin-right: 6px;
  3321. cursor: pointer;
  3322. }
  3323. .s_t_c_a_right {
  3324. min-width: 90%;
  3325. height: auto;
  3326. position: relative;
  3327. }
  3328. .s_t_c_a_r_content {
  3329. width: auto;
  3330. max-width: 100%;
  3331. height: auto;
  3332. box-sizing: border-box;
  3333. padding: 10px;
  3334. background-color: #f6f8ff;
  3335. border-radius: 2px 8px 8px 8px;
  3336. white-space: pre-line;
  3337. word-break: break-all;
  3338. }
  3339. .s_t_c_a_r_content >>> ul {
  3340. margin-left: 20px;
  3341. }
  3342. /* .s_t_c_a_r_content>>> ol{
  3343. margin-left: 20px;
  3344. } */
  3345. .s_t_c_a_r_content2 {
  3346. background-color: #f6f8ff;
  3347. width: 100%;
  3348. height: auto;
  3349. box-sizing: border-box;
  3350. padding: 10px;
  3351. border-radius: 2px 8px 8px 8px;
  3352. box-shadow: 0 0px 10px #c5cbee;
  3353. }
  3354. .s_t_c_a_r_c_title {
  3355. display: flex;
  3356. align-items: center;
  3357. }
  3358. .s_t_c_a_r_c_title > img {
  3359. width: 16px;
  3360. height: 16px;
  3361. }
  3362. .s_t_c_a_r_c_item {
  3363. width: 100%;
  3364. height: auto;
  3365. box-sizing: border-box;
  3366. padding: 10px;
  3367. background-color: #ffffff;
  3368. border-radius: 5px;
  3369. margin-top: 10px;
  3370. color: #666666;
  3371. font-size: 14px;
  3372. cursor: pointer;
  3373. border: solid #ffffff 1px;
  3374. box-shadow: 0 0 5px 2px #ffffff;
  3375. }
  3376. .s_t_c_a_r_c_item:hover {
  3377. border: solid #b8d2fe 1px;
  3378. box-shadow: 0 0 5px 2px #b8d2fe;
  3379. }
  3380. .s_t_c_a_r_c_title > span {
  3381. font-weight: bold;
  3382. }
  3383. .s_t_c_a_r_time {
  3384. width: 100%;
  3385. display: flex;
  3386. justify-content: flex-start;
  3387. font-size: 12px;
  3388. color: #9f9f9f;
  3389. margin-top: 5px;
  3390. }
  3391. .s_t_c_a_left {
  3392. width: 35px;
  3393. height: 35px;
  3394. display: flex;
  3395. justify-content: center;
  3396. margin-right: 5px;
  3397. }
  3398. .s_t_c_a_left > img {
  3399. width: 35px;
  3400. height: 35px;
  3401. border-radius: 50%;
  3402. }
  3403. .s_t_c_a_left > span {
  3404. width: 32px;
  3405. height: 32px;
  3406. display: flex;
  3407. justify-content: center;
  3408. align-items: center;
  3409. color: white;
  3410. background-color: #3681fc;
  3411. border-radius: 50%;
  3412. }
  3413. .s_bottom {
  3414. width: 100%;
  3415. height: 130px;
  3416. display: flex;
  3417. flex-direction: column;
  3418. justify-content: flex-end;
  3419. position: relative;
  3420. }
  3421. .s_b_btnAreaTop {
  3422. width: 100%;
  3423. height: 35px;
  3424. margin-bottom: 5px;
  3425. display: flex;
  3426. align-items: center;
  3427. box-sizing: border-box;
  3428. padding: 0 10px;
  3429. overflow: auto;
  3430. display: flex;
  3431. justify-content: space-between;
  3432. }
  3433. .s_b_bat_left {
  3434. width: auto;
  3435. height: 100%;
  3436. display: flex;
  3437. align-items: flex-end;
  3438. }
  3439. .s_b_bat_left > img {
  3440. width: 25px;
  3441. height: 25px;
  3442. cursor: pointer;
  3443. margin-right: 5px;
  3444. }
  3445. .s_b_bat_left > span {
  3446. padding: 3px 10px;
  3447. background: #fff;
  3448. box-shadow: 0px 2px 5px 0px #1d398314;
  3449. box-shadow: 0.5px 0.5px 10px 2px #1d39830d;
  3450. border: 0.5px solid #e0eafb;
  3451. border-radius: 50px;
  3452. cursor: pointer;
  3453. display: flex;
  3454. justify-content: center;
  3455. align-items: center;
  3456. margin-right: 15px;
  3457. }
  3458. .s_b_bat_left > span > svg {
  3459. width: 20px;
  3460. height: 20px;
  3461. }
  3462. .s_b_bat_right > span {
  3463. padding: 3px 10px;
  3464. background: #fff;
  3465. box-shadow: 0px 2px 5px 0px #1d398314;
  3466. box-shadow: 0.5px 0.5px 10px 2px #1d39830d;
  3467. border: 0.5px solid #e0eafb;
  3468. border-radius: 50px;
  3469. margin-left: 15px;
  3470. display: flex;
  3471. justify-content: center;
  3472. align-items: center;
  3473. cursor: pointer;
  3474. }
  3475. .s_b_bat_right > span > svg {
  3476. width: 20px;
  3477. height: 20px;
  3478. }
  3479. .s_b_bat_right {
  3480. width: auto;
  3481. height: 100%;
  3482. display: flex;
  3483. align-items: flex-end;
  3484. }
  3485. .s_b_bat_right > img {
  3486. width: 25px;
  3487. height: 25px;
  3488. /* cursor: pointer; */
  3489. margin-right: 5px;
  3490. }
  3491. .s_b_btnArea {
  3492. width: 100%;
  3493. height: 30px;
  3494. display: flex;
  3495. align-items: center;
  3496. box-sizing: border-box;
  3497. padding: 0 10px;
  3498. overflow: auto;
  3499. margin-bottom: 5px;
  3500. }
  3501. .s_b_ba-item {
  3502. width: auto;
  3503. box-sizing: border-box;
  3504. padding: 0 10px;
  3505. height: 25px;
  3506. background-color: white;
  3507. display: flex;
  3508. justify-content: center;
  3509. align-items: center;
  3510. /* 阴影 */
  3511. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
  3512. border-radius: 15px;
  3513. font-size: 14px;
  3514. cursor: pointer;
  3515. margin-right: 10px;
  3516. white-space: nowrap;
  3517. }
  3518. .s_b_ba_active {
  3519. background-color: #3781fc;
  3520. color: #fff;
  3521. }
  3522. .s_b_inputArea {
  3523. width: 100%;
  3524. height: 55px;
  3525. box-sizing: border-box;
  3526. border-top: solid 1px #ededed;
  3527. display: flex;
  3528. justify-content: space-between;
  3529. align-items: center;
  3530. padding-right: 10px;
  3531. }
  3532. .s_b_tape {
  3533. width: 35px;
  3534. height: 35px;
  3535. background: url("../../../assets/icon/course/tape.png") no-repeat;
  3536. background-size: 50% 60%;
  3537. background-position: center;
  3538. cursor: pointer;
  3539. }
  3540. .s_b_input {
  3541. /* width: 65%; */
  3542. flex: 1;
  3543. height: 40px;
  3544. background-color: #f3f3f3;
  3545. border-radius: 50px;
  3546. margin: 0 10px;
  3547. display: flex;
  3548. align-items: center;
  3549. overflow: hidden;
  3550. }
  3551. .s_b_i_left {
  3552. width: 100%;
  3553. line-height: 45px;
  3554. height: 100%;
  3555. display: flex;
  3556. align-items: center;
  3557. }
  3558. .s_b_recorded {
  3559. width: 100%;
  3560. height: 100%;
  3561. display: flex;
  3562. justify-content: center;
  3563. align-items: center;
  3564. color: #00000066;
  3565. cursor: pointer;
  3566. }
  3567. .s_b_i_left >>> .el-input__inner {
  3568. border: none;
  3569. background-color: #f3f3f3;
  3570. outline: none;
  3571. border-radius: 50px 0 0 50px;
  3572. }
  3573. .s_b_i_right {
  3574. width: 45px;
  3575. height: 45px;
  3576. display: flex;
  3577. justify-content: center;
  3578. align-items: center;
  3579. }
  3580. .s_b_i_right > span {
  3581. width: 35px;
  3582. height: 35px;
  3583. background: url("../../../assets/icon/course/file.png") no-repeat;
  3584. background-size: 50% 60%;
  3585. background-position: center;
  3586. cursor: pointer;
  3587. }
  3588. .voice_or_keyboard {
  3589. width: 35px;
  3590. height: 35px;
  3591. margin-right: 10px;
  3592. }
  3593. .voice_or_keyboard > img {
  3594. width: 100%;
  3595. height: 100%;
  3596. cursor: pointer;
  3597. }
  3598. .s_b_btn {
  3599. width: 40px;
  3600. height: 40px;
  3601. background-color: #3681fc;
  3602. display: flex;
  3603. justify-content: center;
  3604. align-items: center;
  3605. border-radius: 50%;
  3606. cursor: pointer;
  3607. }
  3608. .s_b_btn > div {
  3609. width: 100%;
  3610. height: 100%;
  3611. display: flex;
  3612. justify-content: center;
  3613. align-items: center;
  3614. color: #fff;
  3615. }
  3616. .s_b_btn > span {
  3617. width: 30px;
  3618. height: 30px;
  3619. background: url("../../../assets/icon/course/send.png") no-repeat;
  3620. background-size: 70% 70%;
  3621. background-position: center;
  3622. }
  3623. .s_b_btn > img {
  3624. width: 30px;
  3625. height: 30px;
  3626. }
  3627. .s_b_btn2 {
  3628. width: 40px;
  3629. height: 40px;
  3630. background-color: #fff;
  3631. display: flex;
  3632. justify-content: center;
  3633. align-items: center;
  3634. border-radius: 50%;
  3635. cursor: pointer;
  3636. box-sizing: 0 0 2px 2px gray;
  3637. margin-left: 10px;
  3638. }
  3639. .s_b_btn2 > img {
  3640. width: 30px;
  3641. height: 30px;
  3642. }
  3643. .s_b_atBox {
  3644. width: 95%;
  3645. height: 450px;
  3646. position: absolute;
  3647. bottom: calc(100% - 30px);
  3648. left: 0;
  3649. max-height: 450px;
  3650. box-sizing: border-box;
  3651. border: solid 1px #d8d8d8;
  3652. box-shadow: 0 4px 4px 0 #00000040;
  3653. margin-left: 1.5%;
  3654. background-color: #fff;
  3655. }
  3656. .s_b_at_tag {
  3657. width: 100%;
  3658. height: 35px;
  3659. border-bottom: 1px solid #d8d8d8;
  3660. display: flex;
  3661. align-items: center;
  3662. padding: 0 10px;
  3663. box-sizing: border-box;
  3664. position: relative;
  3665. }
  3666. .s_b_at_tag > span {
  3667. margin: 0 10px;
  3668. font-weight: bold;
  3669. cursor: pointer;
  3670. transition: 0.1s;
  3671. position: relative;
  3672. }
  3673. .s_b_at_tag_active {
  3674. color: #3681fc;
  3675. }
  3676. .s_b_at_tag_active::after {
  3677. content: "";
  3678. width: 100%;
  3679. height: 3px;
  3680. border-radius: 3px;
  3681. bottom: -8px;
  3682. left: 0px;
  3683. background-color: #3681fc;
  3684. position: absolute;
  3685. }
  3686. .s_b_at_list {
  3687. width: 100%;
  3688. max-height: calc(100% - 35px);
  3689. overflow: auto;
  3690. box-sizing: border-box;
  3691. padding: 10px;
  3692. }
  3693. .s_b_at_l_top {
  3694. width: 100%;
  3695. box-sizing: border-box;
  3696. padding: 12px 10px;
  3697. height: 30px;
  3698. display: flex;
  3699. align-items: center;
  3700. justify-content: space-between;
  3701. margin: 10px 0;
  3702. border-radius: 5px;
  3703. cursor: pointer;
  3704. font-size: 16px;
  3705. border-bottom: solid 1px #e2f5fc;
  3706. }
  3707. .s_b_at_l_top > span:nth-child(1) {
  3708. display: block;
  3709. width: calc(100% - 30px);
  3710. overflow: hidden;
  3711. text-overflow: ellipsis;
  3712. white-space: nowrap;
  3713. }
  3714. .s_b_at_l_i_header {
  3715. width: 100%;
  3716. box-sizing: border-box;
  3717. padding: 10px 10px;
  3718. height: 30px;
  3719. display: flex;
  3720. align-items: center;
  3721. margin: 10px 0;
  3722. border-radius: 5px;
  3723. cursor: pointer;
  3724. font-size: 16px;
  3725. }
  3726. .s_b_at_l_i_header > span:nth-child(2) {
  3727. display: block;
  3728. width: calc(100% - 30px);
  3729. overflow: hidden;
  3730. text-overflow: ellipsis;
  3731. white-space: nowrap;
  3732. }
  3733. .s_b_at_l_top > hover {
  3734. background-color: #3781fc;
  3735. color: #fff;
  3736. }
  3737. .s_b_at_l_top > hover > .s_b_at_l_i_h_icon1 {
  3738. background-image: url("../../../assets/icon/course/bDown2.png");
  3739. }
  3740. .s_b_at_l_i_header:hover {
  3741. background-color: #3781fc;
  3742. color: #fff;
  3743. }
  3744. .s_b_at_l_i_header:hover > .s_b_at_l_i_h_icon1 {
  3745. background-image: url("../../../assets/icon/course/bDown2.png");
  3746. }
  3747. .s_b_at_l_i_header:hover > .s_b_at_l_i_h_icon2 {
  3748. background-color: #fff;
  3749. }
  3750. .s_b_at_l_i_h_icon1 {
  3751. min-width: 15px;
  3752. min-height: 15px;
  3753. background-image: url("../../../assets/icon/course/down.png");
  3754. background-repeat: no-repeat;
  3755. background-size: 100% 100%;
  3756. /* transform: rotate(90deg); */
  3757. margin-right: 10px;
  3758. transition: 0.2s;
  3759. }
  3760. .s_b_at_l_i_h_icon2 {
  3761. min-width: 10px;
  3762. min-height: 10px;
  3763. background-color: #3681fc;
  3764. border-radius: 50%;
  3765. margin-right: 15px;
  3766. transition: 0.2s;
  3767. }
  3768. .s_b_at_l_i_content {
  3769. width: 100%;
  3770. box-sizing: border-box;
  3771. padding: 8px 35px;
  3772. height: 25;
  3773. display: flex;
  3774. align-items: center;
  3775. margin: 5px 0;
  3776. border-radius: 5px;
  3777. cursor: pointer;
  3778. font-size: 14px;
  3779. }
  3780. .s_b_at_l_i_content:hover {
  3781. background-color: #3781fc;
  3782. color: #fff;
  3783. }
  3784. .s_b_ab_user {
  3785. width: 100%;
  3786. height: 100px;
  3787. box-sizing: border-box;
  3788. border: solid 1px #3781fc;
  3789. display: flex;
  3790. justify-content: center;
  3791. align-items: center;
  3792. position: relative;
  3793. margin-bottom: 20px;
  3794. }
  3795. .s_b_ab_u_name {
  3796. width: 25%;
  3797. max-width: 25%;
  3798. box-sizing: border-box;
  3799. margin: 0 20px;
  3800. padding: 5px 10px;
  3801. display: flex;
  3802. justify-content: center;
  3803. align-items: center;
  3804. border: solid 1px #3781fc;
  3805. border-radius: 2px;
  3806. }
  3807. .s_b_ab_u_name > span {
  3808. max-width: 100%;
  3809. overflow: hidden;
  3810. text-overflow: ellipsis;
  3811. white-space: nowrap;
  3812. display: block;
  3813. font-size: 14px;
  3814. color: #3681fc;
  3815. }
  3816. .s_b_ab_u_message {
  3817. flex: 1;
  3818. height: 100%;
  3819. display: flex;
  3820. flex-direction: column;
  3821. justify-content: center;
  3822. box-sizing: border-box;
  3823. padding-top: 10px;
  3824. padding-right: 10px;
  3825. }
  3826. .s_b_ab_u_message > span {
  3827. font-size: 16px;
  3828. font-weight: bold;
  3829. display: flex;
  3830. align-items: flex-end;
  3831. flex: 1;
  3832. }
  3833. .s_b_ab_u_message > div {
  3834. width: 100%;
  3835. display: flex;
  3836. justify-content: space-between;
  3837. align-items: center;
  3838. font-size: 16px;
  3839. font-weight: bold;
  3840. flex: 1;
  3841. }
  3842. .s_b_ab_u_btnArea {
  3843. width: auto;
  3844. height: auto;
  3845. position: absolute;
  3846. right: 0;
  3847. top: 5px;
  3848. }
  3849. .s_b_ab_u_btnArea > span {
  3850. box-sizing: border-box;
  3851. color: #3681fc;
  3852. border: solid 1px #3681fc;
  3853. padding: 2px;
  3854. margin-left: 2px;
  3855. font-size: 14px;
  3856. cursor: pointer;
  3857. }
  3858. .s_b_ab_u_btnArea > span:hover {
  3859. color: #fff;
  3860. border: solid 1px #fff;
  3861. background-color: #3681fc;
  3862. }
  3863. .s_b_at_studentDetail {
  3864. width: 100%;
  3865. height: 25px;
  3866. margin: 0 0 10px 0;
  3867. display: flex;
  3868. align-items: center;
  3869. }
  3870. .s_b_at_studentDetail > img {
  3871. width: 20px;
  3872. height: 15px;
  3873. margin-right: 10px;
  3874. cursor: pointer;
  3875. }
  3876. .s_b_at_studentDetail > span {
  3877. font-weight: bold;
  3878. }
  3879. .s_b_at_studentList {
  3880. width: 100%;
  3881. height: calc(100% - 25px);
  3882. overflow: auto;
  3883. }
  3884. .s_b_at_sl_item {
  3885. width: 100%;
  3886. height: auto;
  3887. box-sizing: border-box;
  3888. border: solid 1px #36a9fc;
  3889. padding: 10px;
  3890. margin-bottom: 10px;
  3891. cursor: pointer;
  3892. }
  3893. .s_b_at_sl_item > .s_b_at_sl_message:nth-child(n + 1) {
  3894. margin-top: 10px;
  3895. }
  3896. .s_b_at_sl_phase {
  3897. width: 100%;
  3898. display: flex;
  3899. justify-content: flex-end;
  3900. margin-bottom: 10px;
  3901. margin-right: 10px;
  3902. font-size: 14px;
  3903. font-weight: bold;
  3904. }
  3905. .s_b_at_sl_message {
  3906. font-weight: bold;
  3907. margin: 10px;
  3908. }
  3909. .s_b_at_sl_message > div {
  3910. display: flex;
  3911. width: 100%;
  3912. margin: 10px;
  3913. }
  3914. .s_b_at_sl_message > div > span {
  3915. width: calc(100% - 50px);
  3916. text-overflow: ellipsis;
  3917. overflow: hidden;
  3918. white-space: nowrap;
  3919. display: block;
  3920. }
  3921. .s_b_at_sl_message > div > span > div {
  3922. margin: 5px 0;
  3923. white-space: wrap;
  3924. }
  3925. .s_t_addAsk {
  3926. width: 100%;
  3927. height: auto;
  3928. padding: 10px 20px;
  3929. display: flex;
  3930. flex-direction: column;
  3931. justify-content: center;
  3932. align-items: center;
  3933. box-sizing: border-box;
  3934. }
  3935. .s_t_addAsk > span {
  3936. box-sizing: border-box;
  3937. width: auto;
  3938. height: auto;
  3939. padding: 15px;
  3940. margin-bottom: 10px;
  3941. background-color: #f5f6f7;
  3942. border-radius: 10px;
  3943. cursor: pointer;
  3944. border: solid 1px #e8e9ec;
  3945. transition: 0.3s;
  3946. }
  3947. .s_t_addAsk > span:hover {
  3948. background-color: #e8e9ec;
  3949. }
  3950. .d_t_c_a_r_c_img:hover .download_image {
  3951. display: block;
  3952. }
  3953. .download_image {
  3954. position: absolute;
  3955. display: none;
  3956. right: 5px;
  3957. bottom: 5px;
  3958. width: 30px;
  3959. height: 30px;
  3960. cursor: pointer;
  3961. }
  3962. .download_image > img {
  3963. width: 100%;
  3964. height: 100%;
  3965. }
  3966. .choiceTopArea {
  3967. width: 100%;
  3968. display: flex;
  3969. flex-direction: column;
  3970. justify-content: space-between;
  3971. height: calc(100% - 130px);
  3972. }
  3973. .choiceTop {
  3974. width: 100%;
  3975. height: 100%;
  3976. overflow-x: hidden;
  3977. box-sizing: border-box;
  3978. display: flex;
  3979. flex-direction: column;
  3980. justify-content: space-between;
  3981. padding: 10px;
  3982. position: relative;
  3983. bottom: -76px;
  3984. padding-bottom: 30px;
  3985. background: linear-gradient(
  3986. 180deg,
  3987. rgba(255, 255, 255, 0) 0%,
  3988. rgba(54, 129, 252, 0.6) 100%
  3989. );
  3990. }
  3991. .choiceBottom {
  3992. width: 100%;
  3993. height: 5%;
  3994. display: flex;
  3995. align-items: center;
  3996. justify-content: flex-end;
  3997. }
  3998. .cb_btn {
  3999. margin: 0 10px;
  4000. }
  4001. .choiceRoleHeader {
  4002. width: 100%;
  4003. height: 100px;
  4004. display: flex;
  4005. /* margin: 10px; */
  4006. }
  4007. .choiceRoleHeader > div {
  4008. display: flex;
  4009. }
  4010. .choiceSelect {
  4011. width: 100%;
  4012. height: calc(50%);
  4013. display: flex;
  4014. flex-direction: column;
  4015. justify-content: flex-end;
  4016. align-items: center;
  4017. padding: 10px;
  4018. box-sizing: border-box;
  4019. border-radius: 10px;
  4020. }
  4021. .cs_type {
  4022. width: 100%;
  4023. height: 40px;
  4024. display: flex;
  4025. justify-content: flex-start;
  4026. overflow-y: hidden;
  4027. align-items: center;
  4028. }
  4029. .cs_type > span {
  4030. width: auto;
  4031. height: 100%;
  4032. padding: 0 10px;
  4033. display: flex;
  4034. justify-content: center;
  4035. align-items: center;
  4036. cursor: pointer;
  4037. position: relative;
  4038. transition: 0.2s;
  4039. }
  4040. .cs_typeActive {
  4041. font-weight: bold;
  4042. }
  4043. .cs_typeActive::after {
  4044. content: "";
  4045. width: 100%;
  4046. height: 4px;
  4047. background-color: #3681fc;
  4048. position: absolute;
  4049. bottom: 0;
  4050. left: 0;
  4051. }
  4052. .cs_box {
  4053. width: 100%;
  4054. height: calc(100% - 40px);
  4055. overflow-x: hidden;
  4056. box-sizing: border-box;
  4057. }
  4058. .cs_b_item {
  4059. width: 110px;
  4060. height: 150px;
  4061. border-radius: 8px;
  4062. background-color: #ffffffe5;
  4063. box-sizing: border-box;
  4064. border: solid 1px #ffffffe5;
  4065. display: flex;
  4066. flex-direction: column;
  4067. align-items: center;
  4068. justify-content: center;
  4069. float: left;
  4070. margin: 5px 0;
  4071. cursor: pointer;
  4072. transition: 0.2s;
  4073. }
  4074. .cs_b_i_avatar {
  4075. width: 50px;
  4076. height: 50px;
  4077. display: flex;
  4078. justify-content: center;
  4079. align-items: center;
  4080. background-color: #ffffffe5;
  4081. border-radius: 8px;
  4082. }
  4083. .cs_b_item:hover {
  4084. border-color: #3681fc;
  4085. }
  4086. .cs_b_i_name {
  4087. font-weight: bold;
  4088. color: #768196;
  4089. font-size: 14px;
  4090. }
  4091. .cs_b_i_des {
  4092. color: #768196;
  4093. margin-top: 5px;
  4094. font-size: 12px;
  4095. }
  4096. .cs_box > .cs_b_item:nth-of-type(3n + 2) {
  4097. margin: 5px 8px;
  4098. }
  4099. .cs_b_itemActive {
  4100. background: #e0eafb !important;
  4101. border-color: #3681fc;
  4102. }
  4103. .cs_b_itemActive > .cs_b_i_name {
  4104. color: black;
  4105. }
  4106. .cs_b_item > div {
  4107. margin-top: 10px;
  4108. white-space: nowrap;
  4109. width: 95%;
  4110. overflow: hidden;
  4111. text-align: center;
  4112. text-overflow: ellipsis;
  4113. }
  4114. .choiceSelect > .option {
  4115. width: 80px;
  4116. height: 100%;
  4117. border-radius: 5px;
  4118. margin-right: 10px;
  4119. display: flex;
  4120. justify-content: center;
  4121. align-items: center;
  4122. cursor: pointer;
  4123. }
  4124. .roleInput {
  4125. width: 100%;
  4126. height: 50px;
  4127. }
  4128. .roleBtn {
  4129. width: 100%;
  4130. height: 50px;
  4131. margin: 5px 0;
  4132. }
  4133. .roleListBox {
  4134. width: 100%;
  4135. height: calc(100% - 100px - 10px);
  4136. overflow-x: hidden;
  4137. display: flex;
  4138. flex-direction: column;
  4139. justify-content: flex-start;
  4140. align-items: center;
  4141. padding: 10px;
  4142. box-sizing: border-box;
  4143. }
  4144. .filterSubjects {
  4145. margin: 10px;
  4146. width: 100%;
  4147. height: auto;
  4148. }
  4149. .fs_box {
  4150. width: 100%;
  4151. display: flex;
  4152. flex-wrap: wrap;
  4153. margin-top: 10px;
  4154. }
  4155. .fs_b_item {
  4156. width: auto;
  4157. height: 35px;
  4158. font-size: 14px;
  4159. box-sizing: border-box;
  4160. padding: 0 9px;
  4161. background-color: #f3f7fd;
  4162. border: solid 1px #f3f7fd;
  4163. border-radius: 5px;
  4164. margin-right: 8px;
  4165. margin-bottom: 8px;
  4166. display: flex;
  4167. justify-content: center;
  4168. align-items: center;
  4169. cursor: pointer;
  4170. }
  4171. .fs_b_itemActive {
  4172. border: solid 1px #4d8ffc;
  4173. color: #4d8ffc;
  4174. background-color: #f3f7fd;
  4175. }
  4176. .roleList {
  4177. width: 100%;
  4178. height: auto;
  4179. margin: 10px;
  4180. }
  4181. .r_box {
  4182. width: 100%;
  4183. height: auto;
  4184. display: flex;
  4185. flex-wrap: wrap;
  4186. }
  4187. .r_b_item {
  4188. height: 40px;
  4189. font-size: 14px;
  4190. display: flex;
  4191. /* justify-content: center; */
  4192. align-items: center;
  4193. background-color: #f0f2f5;
  4194. border-radius: 5px;
  4195. margin: 5px;
  4196. cursor: pointer;
  4197. box-sizing: border-box;
  4198. padding: 0 4px;
  4199. border: solid 1px #f0f2f5;
  4200. }
  4201. .r_b_itemActive {
  4202. box-sizing: border-box;
  4203. border: solid 1px #aeccfe;
  4204. color: #4d8ffb;
  4205. }
  4206. .r_b_item > img {
  4207. min-width: 24px;
  4208. min-height: 24px;
  4209. width: 24px;
  4210. height: 24px;
  4211. border-radius: 50%;
  4212. margin-right: 10px;
  4213. /* margin-left: 10px; */
  4214. }
  4215. .characterBlock {
  4216. display: flex;
  4217. background: rgba(54, 169, 252, 1);
  4218. width: 100%;
  4219. height: auto;
  4220. padding: 10px 0;
  4221. margin: 0 auto;
  4222. border-radius: 10px;
  4223. margin-bottom: 15px;
  4224. cursor: pointer;
  4225. }
  4226. .characterBlock > .imgLeft {
  4227. width: 100px;
  4228. display: flex;
  4229. justify-content: center;
  4230. align-items: center;
  4231. }
  4232. .characterBlock > .imgLeft > .img {
  4233. width: 60px;
  4234. height: 60px;
  4235. overflow: hidden;
  4236. border-radius: 50%;
  4237. }
  4238. .characterBlock > .imgLeft > .img2 {
  4239. width: 70px;
  4240. height: 70px;
  4241. overflow: hidden;
  4242. border-radius: 50%;
  4243. }
  4244. .characterBlock > .txtRight {
  4245. flex: 1;
  4246. display: flex;
  4247. justify-content: flex-start;
  4248. align-items: center;
  4249. }
  4250. .characterBlock > .txtRight > .bir {
  4251. width: 170px;
  4252. height: 35px;
  4253. display: flex;
  4254. align-items: center;
  4255. background-color: #fff;
  4256. border-radius: 10px;
  4257. box-sizing: border-box;
  4258. padding: 5px 10px;
  4259. box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
  4260. margin-right: 10px;
  4261. white-space: nowrap;
  4262. overflow: hidden;
  4263. text-overflow: ellipsis;
  4264. }
  4265. .s_b_inputBtnArea {
  4266. width: auto;
  4267. height: 100%;
  4268. display: flex;
  4269. justify-content: space-between;
  4270. align-items: center;
  4271. /* margin: 0 5px; */
  4272. }
  4273. .s_b_inputBtnArea > span {
  4274. height: 40px;
  4275. padding: 0px 15px;
  4276. background: #f0f2f5;
  4277. border-radius: 100px;
  4278. display: flex;
  4279. justify-content: center;
  4280. align-items: center;
  4281. cursor: pointer;
  4282. margin: 0 5px;
  4283. }
  4284. .s_b_inputBtnArea > span > svg {
  4285. width: 24px;
  4286. height: 24px;
  4287. }
  4288. </style>