searchArea.vue 161 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954
  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
  485. v-else
  486. @click.stop="changeMegaphone()"
  487. width="20"
  488. height="20"
  489. viewBox="0 0 20 20"
  490. fill="none"
  491. xmlns="http://www.w3.org/2000/svg"
  492. >
  493. <path
  494. fill-rule="evenodd"
  495. clip-rule="evenodd"
  496. 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"
  497. fill="#3681FC"
  498. />
  499. <path
  500. fill-rule="evenodd"
  501. clip-rule="evenodd"
  502. 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"
  503. fill="#3681FC"
  504. />
  505. <path
  506. fill-rule="evenodd"
  507. clip-rule="evenodd"
  508. 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"
  509. fill="#3681FC"
  510. />
  511. </svg> </el-tooltip
  512. ></span>
  513. </div>
  514. <div class="s_b_bat_right">
  515. <!-- <img :src="require('../../../assets/icon/course/bulb.svg')"> -->
  516. <span v-if="!canShowTips">
  517. <svg
  518. width="20"
  519. height="20"
  520. viewBox="0 0 20 20"
  521. fill="none"
  522. xmlns="http://www.w3.org/2000/svg"
  523. >
  524. <path
  525. fill-rule="evenodd"
  526. clip-rule="evenodd"
  527. 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"
  528. fill="black"
  529. fill-opacity="0.6"
  530. />
  531. <path
  532. fill-rule="evenodd"
  533. clip-rule="evenodd"
  534. 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"
  535. fill="black"
  536. fill-opacity="0.6"
  537. />
  538. <path
  539. fill-rule="evenodd"
  540. clip-rule="evenodd"
  541. 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"
  542. fill="black"
  543. fill-opacity="0.6"
  544. />
  545. <path
  546. fill-rule="evenodd"
  547. clip-rule="evenodd"
  548. 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"
  549. fill="black"
  550. fill-opacity="0.6"
  551. />
  552. <path
  553. fill-rule="evenodd"
  554. clip-rule="evenodd"
  555. 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"
  556. fill="black"
  557. fill-opacity="0.6"
  558. />
  559. <path
  560. fill-rule="evenodd"
  561. clip-rule="evenodd"
  562. 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"
  563. fill="black"
  564. fill-opacity="0.6"
  565. />
  566. <path
  567. fill-rule="evenodd"
  568. clip-rule="evenodd"
  569. 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"
  570. fill="black"
  571. fill-opacity="0.6"
  572. />
  573. <path
  574. fill-rule="evenodd"
  575. clip-rule="evenodd"
  576. 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"
  577. fill="black"
  578. fill-opacity="0.6"
  579. />
  580. </svg>
  581. </span>
  582. <span v-else @click.stop="showTipsFn()">
  583. <svg
  584. width="20"
  585. height="21"
  586. viewBox="0 0 20 21"
  587. fill="none"
  588. xmlns="http://www.w3.org/2000/svg"
  589. >
  590. <circle cx="10" cy="10.0732" r="5" fill="#FFE607" />
  591. <path
  592. fill-rule="evenodd"
  593. clip-rule="evenodd"
  594. d="M10 6.32324C7.92893 6.32324 6.25 8.00217 6.25 10.0732C6.25 12.1443 7.92893 13.8232 10 13.8232C12.0711 13.8232 13.75 12.1443 13.75 10.0732C13.75 8.00217 12.0711 6.32324 10 6.32324ZM5 10.0732C5 7.31182 7.23858 5.07324 10 5.07324C12.7614 5.07324 15 7.31182 15 10.0732C15 12.8347 12.7614 15.0732 10 15.0732C7.23858 15.0732 5 12.8347 5 10.0732Z"
  595. fill="black"
  596. fill-opacity="0.9"
  597. />
  598. <path
  599. fill-rule="evenodd"
  600. clip-rule="evenodd"
  601. d="M10 1.32324C10.3452 1.32324 10.625 1.60306 10.625 1.94824V3.19824C10.625 3.54342 10.3452 3.82324 10 3.82324C9.65482 3.82324 9.375 3.54342 9.375 3.19824V1.94824C9.375 1.60306 9.65482 1.32324 10 1.32324Z"
  602. fill="black"
  603. fill-opacity="0.9"
  604. />
  605. <path
  606. fill-rule="evenodd"
  607. clip-rule="evenodd"
  608. d="M18.75 10.0732C18.75 10.4184 18.4702 10.6982 18.125 10.6982L16.875 10.6982C16.5298 10.6982 16.25 10.4184 16.25 10.0732C16.25 9.72806 16.5298 9.44824 16.875 9.44824L18.125 9.44824C18.4702 9.44824 18.75 9.72806 18.75 10.0732Z"
  609. fill="black"
  610. fill-opacity="0.9"
  611. />
  612. <path
  613. fill-rule="evenodd"
  614. clip-rule="evenodd"
  615. d="M3.75 10.0732C3.75 10.4184 3.47018 10.6982 3.125 10.6982L1.875 10.6982C1.52982 10.6982 1.25 10.4184 1.25 10.0732C1.25 9.72806 1.52982 9.44824 1.875 9.44824L3.125 9.44824C3.47018 9.44824 3.75 9.72806 3.75 10.0732Z"
  616. fill="black"
  617. fill-opacity="0.9"
  618. />
  619. <path
  620. fill-rule="evenodd"
  621. clip-rule="evenodd"
  622. d="M5.58052 5.65386C5.33644 5.89793 4.94071 5.89793 4.69664 5.65386L3.81275 4.76997C3.56867 4.52589 3.56867 4.13017 3.81275 3.88609C4.05683 3.64201 4.45256 3.64201 4.69664 3.88609L5.58052 4.76997C5.8246 5.01405 5.8246 5.40978 5.58052 5.65386Z"
  623. fill="black"
  624. fill-opacity="0.9"
  625. />
  626. <path
  627. fill-rule="evenodd"
  628. clip-rule="evenodd"
  629. d="M14.4194 5.65376C14.1753 5.40968 14.1753 5.01396 14.4194 4.76988L15.3033 3.88599C15.5473 3.64192 15.9431 3.64192 16.1872 3.88599C16.4312 4.13007 16.4312 4.5258 16.1872 4.76988L15.3033 5.65376C15.0592 5.89784 14.6635 5.89784 14.4194 5.65376Z"
  630. fill="black"
  631. fill-opacity="0.9"
  632. />
  633. <path
  634. fill-rule="evenodd"
  635. clip-rule="evenodd"
  636. d="M8.75 18.1982C8.75 17.8531 9.02982 17.5732 9.375 17.5732H10.625C10.9702 17.5732 11.25 17.8531 11.25 18.1982C11.25 18.5434 10.9702 18.8232 10.625 18.8232H9.375C9.02982 18.8232 8.75 18.5434 8.75 18.1982Z"
  637. fill="black"
  638. fill-opacity="0.9"
  639. />
  640. <path
  641. fill-rule="evenodd"
  642. clip-rule="evenodd"
  643. d="M7.5 16.3232C7.5 15.9781 7.77982 15.6982 8.125 15.6982H11.875C12.2202 15.6982 12.5 15.9781 12.5 16.3232C12.5 16.6684 12.2202 16.9482 11.875 16.9482H8.125C7.77982 16.9482 7.5 16.6684 7.5 16.3232Z"
  644. fill="black"
  645. fill-opacity="0.9"
  646. />
  647. </svg>
  648. </span>
  649. <div class="tips" v-if="showTips">
  650. <div class="tipsList">
  651. <div v-for="(item,index) in showTipsList" :key="index">{{ index+1 }}.{{ item }}</div>
  652. </div>
  653. <div class="tipsBottom">
  654. <div @click.stop="showTips = false">
  655. <svg
  656. width="20"
  657. height="20"
  658. viewBox="0 0 20 20"
  659. fill="none"
  660. xmlns="http://www.w3.org/2000/svg"
  661. >
  662. <circle cx="10" cy="10" r="5" fill="#FFE607" />
  663. <path
  664. fill-rule="evenodd"
  665. clip-rule="evenodd"
  666. 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"
  667. fill="black"
  668. fill-opacity="0.9"
  669. />
  670. <path
  671. fill-rule="evenodd"
  672. clip-rule="evenodd"
  673. 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"
  674. fill="black"
  675. fill-opacity="0.9"
  676. />
  677. <path
  678. fill-rule="evenodd"
  679. clip-rule="evenodd"
  680. 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"
  681. fill="black"
  682. fill-opacity="0.9"
  683. />
  684. <path
  685. fill-rule="evenodd"
  686. clip-rule="evenodd"
  687. 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"
  688. fill="black"
  689. fill-opacity="0.9"
  690. />
  691. <path
  692. fill-rule="evenodd"
  693. clip-rule="evenodd"
  694. 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"
  695. fill="black"
  696. fill-opacity="0.9"
  697. />
  698. <path
  699. fill-rule="evenodd"
  700. clip-rule="evenodd"
  701. 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"
  702. fill="black"
  703. fill-opacity="0.9"
  704. />
  705. <path
  706. fill-rule="evenodd"
  707. clip-rule="evenodd"
  708. 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"
  709. fill="black"
  710. fill-opacity="0.9"
  711. />
  712. <path
  713. fill-rule="evenodd"
  714. clip-rule="evenodd"
  715. 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"
  716. fill="black"
  717. fill-opacity="0.9"
  718. />
  719. </svg>
  720. <span>课堂小贴士</span>
  721. <svg
  722. width="16"
  723. height="16"
  724. viewBox="0 0 16 16"
  725. fill="none"
  726. xmlns="http://www.w3.org/2000/svg"
  727. >
  728. <path
  729. fill-rule="evenodd"
  730. clip-rule="evenodd"
  731. d="M12.8737 5.66782C13.0572 5.87421 13.0386 6.19025 12.8322 6.37371L8.33218 10.3737C8.14273 10.5421 7.85726 10.5421 7.66781 10.3737L3.16781 6.37371C2.96142 6.19025 2.94283 5.87421 3.12629 5.66782C3.30975 5.46143 3.62578 5.44284 3.83218 5.6263L7.99999 9.33103L12.1678 5.6263C12.3742 5.44284 12.6902 5.46143 12.8737 5.66782Z"
  732. fill="black"
  733. fill-opacity="0.6"
  734. />
  735. </svg>
  736. </div>
  737. </div>
  738. </div>
  739. <!-- <div></div> -->
  740. </div>
  741. </div>
  742. <div class="s_b_btnArea">
  743. <div
  744. :class="['s_b_ba-item', cardType == 1 ? 's_b_ba_active' : '']"
  745. @click.stop="choiceRole()"
  746. >
  747. <!-- <img
  748. style="width: 20px"
  749. src="../../../assets/icon/course/role.png"
  750. alt=""
  751. /> -->
  752. <svg
  753. width="16"
  754. height="16"
  755. style="margin-right: 5px"
  756. viewBox="0 0 16 16"
  757. fill="none"
  758. xmlns="http://www.w3.org/2000/svg"
  759. >
  760. <path
  761. fill-rule="evenodd"
  762. clip-rule="evenodd"
  763. 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"
  764. :fill="cardType == 1 ? '#fff' : 'black'"
  765. />
  766. <path
  767. 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"
  768. :fill="cardType == 1 ? '#fff' : 'black'"
  769. />
  770. </svg>
  771. 智能体
  772. </div>
  773. <div
  774. :class="['s_b_ba-item', sendType == 3 ? 's_b_ba_active' : '']"
  775. @click="chooseType(3)"
  776. >
  777. <!-- <img src="../../../assets/icon/course/sImg.png" style="margin-right: 5px;" alt="" v-if="sendType!=3">
  778. <img src="../../../assets/icon/course/sImg2.png" style="margin-right: 5px;" alt="" v-else> -->
  779. 生成图片
  780. </div>
  781. <div
  782. :class="['s_b_ba-item', sendType == 1 ? 's_b_ba_active' : '']"
  783. @click="chooseType(1)"
  784. >
  785. <!-- <img src="../../../assets/icon/course/sImg.png" style="margin-right: 5px;" alt="" v-if="sendType!=1">
  786. <img src="../../../assets/icon/course/sImg2.png" style="margin-right: 5px;" alt="" v-else> -->
  787. 搜索图片
  788. </div>
  789. <div
  790. :class="['s_b_ba-item', sendType == 2 ? 's_b_ba_active' : '']"
  791. @click="chooseType(2)"
  792. >
  793. <!-- <img src="../../../assets/icon/course/sRio.png" style="margin-right: 5px;" alt="" v-if="sendType!=2">
  794. <img src="../../../assets/icon/course/sRio2.png" style="margin-right: 5px;" alt="" v-else> -->
  795. 搜索视频
  796. </div>
  797. </div>
  798. <div class="s_b_atBox" v-if="openAtBox" v-loading="loading">
  799. <div class="s_b_at_tag">
  800. <span
  801. :class="[atTagIndex == 0 ? 's_b_at_tag_active' : '']"
  802. @click.stop="atTagIndex = 0"
  803. >任务</span
  804. >
  805. <span
  806. :class="[[1, 2].includes(atTagIndex) ? 's_b_at_tag_active' : '']"
  807. @click.stop="atTagIndex = 1"
  808. >成员</span
  809. >
  810. </div>
  811. <div class="s_b_at_list">
  812. <template v-if="atTagIndex == 0">
  813. <div v-for="(item1, index1) in taskList" :key="index1">
  814. <div
  815. class="s_b_at_l_top"
  816. v-if="item1.dyName"
  817. @click="
  818. atTask(`阶段${index1 + 1} ${item1.dyName} `, index1, 0, item1)
  819. "
  820. >
  821. <span>阶段{{ index1 + 1 }} {{ item1.dyName }}</span>
  822. <span
  823. class="s_b_at_l_i_h_icon1"
  824. :style="
  825. `${!item1.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  826. "
  827. @click.stop="item1.isOpen = !item1.isOpen"
  828. ></span>
  829. </div>
  830. <div
  831. class="s_b_at_l_item"
  832. v-for="(item2, index2) in item1.task"
  833. :key="index1 + '-' + index2"
  834. v-if="item1.isOpen"
  835. >
  836. <div
  837. class="s_b_at_l_i_header"
  838. v-if="item2.tool[0].tool != undefined"
  839. @click="
  840. atTask(
  841. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  842. item2.taskName
  843. } `,
  844. index2,
  845. 1,
  846. item2
  847. )
  848. "
  849. >
  850. <span
  851. class="s_b_at_l_i_h_icon1"
  852. :style="
  853. `${!item2.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  854. "
  855. @click.stop="item2.isOpen = !item2.isOpen"
  856. ></span>
  857. <span>任务{{ index2 + 1 }}:{{ item2.taskName }}</span>
  858. </div>
  859. <div
  860. class="s_b_at_l_i_header"
  861. v-else
  862. @click="
  863. atTask(
  864. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  865. item2.taskName
  866. } `,
  867. index2,
  868. 1,
  869. item2
  870. )
  871. "
  872. >
  873. <span
  874. class="s_b_at_l_i_h_icon2"
  875. :style="
  876. `${!item2.isOpen ? 'transform: rotate(-90deg);' : ''}'`
  877. "
  878. @click.stop="item2.isOpen = !item2.isOpen"
  879. ></span>
  880. <span>任务{{ index2 + 1 }}:{{ item2.taskName }}</span>
  881. </div>
  882. <div
  883. class="s_b_at_l_i_content"
  884. v-if="item2.tool[0].tool != undefined && item2.isOpen"
  885. v-for="(item3, index3) in item2.tool"
  886. :key="index1 + '-' + index2 + '-' + index3"
  887. @click="
  888. atTask(
  889. `阶段${index1 + 1} ${item1.dyName}-任务${index2 + 1}:${
  890. item2.taskName
  891. }-工具${index3 + 1}:${toolsList[item3.tool]} `,
  892. index3,
  893. 2,
  894. item3
  895. )
  896. "
  897. >
  898. <span>工具{{ index3 + 1 }}:{{ toolsList[item3.tool] }}</span>
  899. </div>
  900. </div>
  901. </div>
  902. </template>
  903. <template v-if="atTagIndex == 1 && workSum != 0">
  904. <div v-if="userList.length == 0">暂无成员...</div>
  905. <div
  906. class="s_b_ab_user"
  907. v-for="(item, index) in userList"
  908. :key="item.id"
  909. v-else
  910. >
  911. <div class="s_b_ab_u_name">
  912. <el-tooltip
  913. class="item"
  914. effect="light:"
  915. :content="item.username"
  916. placement="top"
  917. >
  918. <span>{{ item.username }}</span>
  919. </el-tooltip>
  920. </div>
  921. <div class="s_b_ab_u_message">
  922. <span>作业提交情况</span>
  923. <div>
  924. <span>已提交:{{ item.count }}</span>
  925. <span>未提交:{{ workSum - item.count }}</span>
  926. </div>
  927. </div>
  928. <div class="s_b_ab_u_btnArea">
  929. <span @click="sumUpStudent(item)">总结分析</span>
  930. <span @click.stop="lookStudentDetail(item)">作业详细</span>
  931. </div>
  932. </div>
  933. </template>
  934. <template v-if="atTagIndex == 2">
  935. <div class="s_b_at_studentDetail">
  936. <img
  937. :src="require('../../../assets/icon/course/back.svg')"
  938. @click.stop="atTagIndex = 1"
  939. />
  940. <span>学生:{{ lookStudentData.userName }}</span>
  941. </div>
  942. <div class="s_b_at_studentList">
  943. <div
  944. class="s_b_at_sl_item"
  945. v-if="[3, 2, 8].includes(item.type)"
  946. v-for="(item, index) in lookStudentData.list"
  947. @click.stop="sumUpStudent2(item)"
  948. >
  949. <div class="s_b_at_sl_phase">
  950. {{
  951. `阶段${item.stage + 1}/任务${item.task +
  952. 1}/工具${item.tool + 1}`
  953. }}
  954. </div>
  955. <div class="s_b_at_sl_message" v-if="item.type === 3">
  956. <div>
  957. 题目:
  958. <el-tooltip
  959. class="item"
  960. effect="light:"
  961. :content="item.content.answerTitle"
  962. placement="top"
  963. ><span>{{ item.content.answerTitle }}</span></el-tooltip
  964. >
  965. </div>
  966. <div>
  967. 答题:
  968. <span>{{ item.content.answer }}</span>
  969. </div>
  970. </div>
  971. <div
  972. class="s_b_at_sl_message"
  973. v-if="item.type === 8"
  974. v-for="(item1, index1) in item.content.testJson
  975. ? item.content.testJson.testJson
  976. : []"
  977. :key="index1"
  978. >
  979. <div>
  980. 题目:
  981. <el-tooltip
  982. class="item"
  983. effect="light:"
  984. :content="item1.teststitle"
  985. placement="top"
  986. ><span>{{ item1.teststitle }}</span></el-tooltip
  987. >
  988. </div>
  989. <div>
  990. 选项:
  991. <span>
  992. <div v-for="(item2, index2) in item1.checkList">
  993. {{ index2 + 1 }}、{{ item2.src ? item2.src : item2 }}
  994. </div>
  995. </span>
  996. </div>
  997. <div>
  998. 答案:{{ answerData(item1.checkList, item1.answer) }}
  999. </div>
  1000. <div>
  1001. 答题:
  1002. <span>{{
  1003. answerData(item1.checkList, item.content.anwer[index1])
  1004. }}</span>
  1005. </div>
  1006. </div>
  1007. <div
  1008. class="s_b_at_sl_message"
  1009. v-if="item.type === 2"
  1010. v-for="(item1, index1) in item.content.askJson
  1011. ? item.content.askJson.askJson
  1012. : []"
  1013. :key="index1"
  1014. >
  1015. <div>
  1016. 题目:
  1017. <el-tooltip
  1018. class="item"
  1019. effect="light:"
  1020. :content="item1.askstitle"
  1021. placement="top"
  1022. ><span>{{ item1.askstitle }}</span></el-tooltip
  1023. >
  1024. </div>
  1025. <div>
  1026. 选项:
  1027. <span>
  1028. <div v-for="(item2, index2) in item1.checkList">
  1029. {{ index2 + 1 }}、{{ item2.src ? item2.src : item2 }}
  1030. </div>
  1031. </span>
  1032. </div>
  1033. <div>
  1034. 答题:
  1035. <span>{{
  1036. answerData(item1.checkList, item.content.anwer[index1])
  1037. }}</span>
  1038. </div>
  1039. </div>
  1040. </div>
  1041. </div>
  1042. </template>
  1043. </div>
  1044. </div>
  1045. <div class="s_b_inputArea" v-if="cardType == 0">
  1046. <!-- <div class="s_b_tape" @click="goTape()"></div> -->
  1047. <div class="s_b_input">
  1048. <el-input
  1049. :disabled="loading || chatLoading || sendFnType == 1"
  1050. v-loading="loading || chatLoading"
  1051. v-if="sendFnType == 0"
  1052. @keyup.enter.native="send()"
  1053. :placeholder="
  1054. sendFnType == 0
  1055. ? '请在此输入您想了解的内容'
  1056. : '请点击录音按钮开始录音'
  1057. "
  1058. class="s_b_i_left"
  1059. v-model="text"
  1060. ref="textRef"
  1061. ></el-input>
  1062. <el-input
  1063. v-loading="loading"
  1064. v-if="sendFnType == 1 && isTalk"
  1065. :readonly="isReadonly"
  1066. @focus="setCursorToEnd"
  1067. placeholder="请说话"
  1068. class="s_b_i_left"
  1069. v-model="text"
  1070. ref="inputEndRef"
  1071. ></el-input>
  1072. <div
  1073. class="s_b_recorded"
  1074. @click.stop="talk()"
  1075. v-loading="loading"
  1076. v-if="sendFnType && !isTalk"
  1077. >
  1078. <span>点击说话</span>
  1079. </div>
  1080. <!-- <div class="s_b_i_right" @click="sendFile()">
  1081. <span></span>
  1082. </div> -->
  1083. </div>
  1084. <div class="s_b_inputBtnArea">
  1085. <el-tooltip
  1086. v-if="sendFnType == 0 && text == '' && !chatLoading"
  1087. class="item"
  1088. effect="light"
  1089. content="语音输入"
  1090. placement="top"
  1091. >
  1092. <span @click.stop="changeFnType(1)">
  1093. <svg
  1094. width="22"
  1095. height="22"
  1096. viewBox="0 0 22 22"
  1097. fill="none"
  1098. xmlns="http://www.w3.org/2000/svg"
  1099. >
  1100. <path
  1101. fill-rule="evenodd"
  1102. clip-rule="evenodd"
  1103. 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"
  1104. fill="black"
  1105. fill-opacity="0.9"
  1106. />
  1107. </svg>
  1108. </span>
  1109. </el-tooltip>
  1110. <el-tooltip
  1111. v-if="sendFnType == 1 && text == '' && !isTalk"
  1112. class="item"
  1113. effect="light"
  1114. content="文字输入"
  1115. placement="top"
  1116. >
  1117. <span @click.stop="changeFnType(0)">
  1118. <svg
  1119. width="22"
  1120. height="22"
  1121. viewBox="0 0 22 22"
  1122. fill="none"
  1123. xmlns="http://www.w3.org/2000/svg"
  1124. >
  1125. <path
  1126. fill-rule="evenodd"
  1127. clip-rule="evenodd"
  1128. 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"
  1129. fill="black"
  1130. fill-opacity="0.9"
  1131. />
  1132. <path
  1133. fill-rule="evenodd"
  1134. clip-rule="evenodd"
  1135. 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"
  1136. fill="black"
  1137. fill-opacity="0.9"
  1138. />
  1139. </svg>
  1140. </span>
  1141. </el-tooltip>
  1142. <el-tooltip
  1143. v-if="isTalk"
  1144. class="item"
  1145. effect="light"
  1146. content="结束录音"
  1147. placement="top"
  1148. >
  1149. <span @click.stop="stopTalk()">
  1150. <svg
  1151. width="22"
  1152. height="22"
  1153. viewBox="0 0 22 22"
  1154. fill="none"
  1155. xmlns="http://www.w3.org/2000/svg"
  1156. >
  1157. <path
  1158. 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"
  1159. fill="#EE3E3E"
  1160. />
  1161. <path
  1162. 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"
  1163. fill="#EE3E3E"
  1164. />
  1165. </svg>
  1166. </span>
  1167. </el-tooltip>
  1168. <el-tooltip
  1169. v-if="sendFnType == 0 && text != '' && !chatLoading"
  1170. class="item"
  1171. effect="light"
  1172. content="发送"
  1173. placement="top"
  1174. >
  1175. <span @click.stop="send()" style="background-color: #3681FC;">
  1176. <svg
  1177. width="22"
  1178. height="22"
  1179. viewBox="0 0 22 22"
  1180. fill="none"
  1181. xmlns="http://www.w3.org/2000/svg"
  1182. >
  1183. <path
  1184. 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"
  1185. fill="white"
  1186. />
  1187. </svg>
  1188. </span>
  1189. </el-tooltip>
  1190. <el-tooltip
  1191. v-if="chatLoading && sendFnType==0"
  1192. class="item"
  1193. effect="light"
  1194. content="停止发送"
  1195. placement="top"
  1196. >
  1197. <span @click.stop="stopSend()" style="background-color: #3681FC;">
  1198. <svg
  1199. width="22"
  1200. height="22"
  1201. viewBox="0 0 24 24"
  1202. fill="none"
  1203. xmlns="http://www.w3.org/2000/svg"
  1204. >
  1205. <path
  1206. 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"
  1207. fill="white"
  1208. fill-opacity="0.9"
  1209. />
  1210. </svg>
  1211. </span>
  1212. </el-tooltip>
  1213. <el-tooltip
  1214. v-if="text == '' && !isTalk"
  1215. class="item"
  1216. effect="light"
  1217. content="语音助手"
  1218. placement="top"
  1219. >
  1220. <span @click.stop="openPhone">
  1221. <svg
  1222. width="22"
  1223. height="22"
  1224. viewBox="0 0 22 22"
  1225. fill="none"
  1226. xmlns="http://www.w3.org/2000/svg"
  1227. >
  1228. <path
  1229. fill-rule="evenodd"
  1230. clip-rule="evenodd"
  1231. 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"
  1232. fill="#3681FC"
  1233. />
  1234. <path
  1235. fill-rule="evenodd"
  1236. clip-rule="evenodd"
  1237. 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"
  1238. fill="#3681FC"
  1239. />
  1240. </svg>
  1241. </span>
  1242. </el-tooltip>
  1243. </div>
  1244. <!-- <div class="voice_or_keyboard">
  1245. <el-tooltip
  1246. v-if="sendFnType == 0"
  1247. class="item"
  1248. effect="dark"
  1249. content="使用语音"
  1250. placement="top"
  1251. >
  1252. <img
  1253. :src="require('../../../assets/icon/course/voice.svg')"
  1254. @click.stop="changeFnType(1)"
  1255. />
  1256. </el-tooltip>
  1257. <el-tooltip
  1258. v-if="sendFnType == 1"
  1259. class="item"
  1260. effect="dark"
  1261. content="使用键盘"
  1262. placement="top"
  1263. >
  1264. <img
  1265. :src="require('../../../assets/icon/course/keyboard.svg')"
  1266. @click.stop="changeFnType(0)"
  1267. />
  1268. </el-tooltip>
  1269. </div> -->
  1270. <!-- <div class="s_b_btn" @click="send()" v-if="sendFnType == 0">
  1271. <span v-if="!loading && !chatLoading"></span>
  1272. <div v-else @click.stop="stopSend()">停止</div>
  1273. </div> -->
  1274. <!-- <div class="s_b_btn" v-if="sendFnType == 1">
  1275. <img
  1276. v-if="!loading && !chatLoading && !isTalk"
  1277. @click.stop="talk()"
  1278. :src="require('../../../assets/icon/course/voice2.svg')"
  1279. />
  1280. <img
  1281. style="width: 50px; height: 50px"
  1282. v-else-if="!loading && !chatLoading && isTalk"
  1283. @click.stop="stopTalk()"
  1284. :src="require('../../../assets/icon/course/isTape.svg')"
  1285. />
  1286. <div v-else @click.stop="stopSend()">停止</div>
  1287. </div> -->
  1288. <!-- <div class="s_b_btn2" @click.stop="openPhone">
  1289. <img :src="require('../../../assets/icon/course/phone.svg')" />
  1290. </div> -->
  1291. </div>
  1292. <div class="s_b_inputArea" v-if="cardType == 1">
  1293. <div class="s_b_input">
  1294. <el-input
  1295. placeholder="搜索想要的智能体"
  1296. class="s_b_i_left"
  1297. v-model="roleText"
  1298. ></el-input>
  1299. <!-- <div class="s_b_i_right" @click="sendFile()">
  1300. <span></span>
  1301. </div> -->
  1302. </div>
  1303. <div class="s_b_inputBtnArea">
  1304. <el-tooltip
  1305. class="item"
  1306. effect="light"
  1307. content="查询"
  1308. placement="top"
  1309. >
  1310. <span style="background-color: #3681FC;">
  1311. <svg
  1312. width="22"
  1313. height="22"
  1314. viewBox="0 0 22 22"
  1315. fill="none"
  1316. xmlns="http://www.w3.org/2000/svg"
  1317. >
  1318. <path
  1319. fill-rule="evenodd"
  1320. clip-rule="evenodd"
  1321. 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"
  1322. fill="white"
  1323. fill-opacity="0.9"
  1324. />
  1325. </svg>
  1326. </span>
  1327. </el-tooltip>
  1328. </div>
  1329. </div>
  1330. </div>
  1331. <iframe
  1332. allow="camera *; microphone *;display-capture;midi;encrypted-media;"
  1333. src="https://beta.cloud.cocorobo.cn/browser/public/index.html"
  1334. ref="iiframe"
  1335. v-show="false"
  1336. ></iframe>
  1337. <!-- 文字转语音-->
  1338. <iframe
  1339. allow="camera *; microphone *;display-capture;midi;encrypted-media;"
  1340. src="https://beta.cloud.cocorobo.cn/browser/public/index1.html"
  1341. ref="iiframe2"
  1342. v-show="false"
  1343. ></iframe>
  1344. </div>
  1345. </template>
  1346. <script>
  1347. import { v4 as uuidv4 } from "uuid";
  1348. import MarkdownIt from "markdown-it";
  1349. import { tools } from "../../../common/tools";
  1350. import { fetchEventSource } from "@microsoft/fetch-event-source";
  1351. var OpenCC = require("opencc-js");
  1352. let converter = OpenCC.Converter({
  1353. from: "hk",
  1354. to: "cn"
  1355. });
  1356. export default {
  1357. props: {
  1358. courseDetail: {
  1359. type: Object,
  1360. default: () => {}
  1361. },
  1362. recordType: {
  1363. type: Number,
  1364. default: 0
  1365. },
  1366. navList: {
  1367. type: Array,
  1368. default: () => []
  1369. },
  1370. tcid: {
  1371. type: String,
  1372. default: ""
  1373. },
  1374. fileId: {
  1375. type: Array,
  1376. default: () => []
  1377. },
  1378. openMegaphone: {
  1379. type: Boolean,
  1380. default: false
  1381. },
  1382. canShowTips: {
  1383. type: Boolean,
  1384. default: false
  1385. },
  1386. showTipsLoading: {
  1387. type: Boolean,
  1388. default: false
  1389. },
  1390. tipsList: {
  1391. type: Array,
  1392. default: () => []
  1393. },
  1394. },
  1395. data() {
  1396. return {
  1397. text: "",
  1398. ppage: 1,
  1399. sendType: 0,
  1400. sendFnType: 0,
  1401. isTalk: false,
  1402. loading: false,
  1403. chatLoading: false,
  1404. imageCheck: false,
  1405. videoCheck: false,
  1406. userid: this.$route.query.userid,
  1407. courseId: this.$route.query.courseId,
  1408. tcid2: this.$route.query.tcid,
  1409. imgNumList: ["U1", "U2", "U3", "U4"],
  1410. chatList: [],
  1411. nowChatList: [],
  1412. atTagIndex: 0,
  1413. source: null,
  1414. saveUid: "",
  1415. toolsList: {
  1416. 58: "模拟驾驶",
  1417. 59: "路径搜索",
  1418. 60: "深度学习",
  1419. 10: "倒计时",
  1420. 65: "挑人",
  1421. 7: "思维网格",
  1422. 1: "电子白板",
  1423. 52: "文档",
  1424. 3: "思维导图",
  1425. 48: "表格",
  1426. 49: "学生分组",
  1427. 4: "问卷调查",
  1428. 45: "选择题",
  1429. 15: "问答",
  1430. 16: "作业提交",
  1431. 50: "批量上传",
  1432. 41: "选择匹配",
  1433. 47: "排序",
  1434. 40: "个人评价",
  1435. 18: "训练平台",
  1436. 21: "AIoT Blockly",
  1437. 23: "AI Python",
  1438. 24: "AI Blockly",
  1439. 32: "源码编辑",
  1440. 57: "CocoPi",
  1441. 63: "海龟编程",
  1442. 28: "翻译",
  1443. 31: "数字画板",
  1444. 39: "GeoGebra",
  1445. 66: "公式编辑",
  1446. 67: "分子结构",
  1447. 68: "时间轴",
  1448. 69: "英语写作",
  1449. 70: "英语口语",
  1450. 25: "目标管理",
  1451. 26: "课程设计",
  1452. 62: "交互视频",
  1453. 71: "AI智能体"
  1454. },
  1455. lookStudentData: {},
  1456. taskList: [],
  1457. userList: [],
  1458. tools: JSON.parse(converter(JSON.stringify(tools))),
  1459. aiTalkList: [],
  1460. aiIsTalk: false,
  1461. aiTalkUid: "",
  1462. choseRoleItem: null,
  1463. cardType: 0,
  1464. roleList: [],
  1465. roleList2: [],
  1466. sortOption: 0, //切换角色 0我的 1 社区
  1467. roleText: "",
  1468. isReadonly: true,
  1469. showTips: false,
  1470. showTipsList:[],
  1471. languageSetting:0,
  1472. userName:"",
  1473. };
  1474. },
  1475. computed: {
  1476. showRoleList() {
  1477. let _result = [];
  1478. if (this.sortOption == 0) {
  1479. _result = this.roleList;
  1480. } else if (this.sortOption == 1) {
  1481. _result = this.roleList2;
  1482. }
  1483. if (this.roleText) {
  1484. _result = _result.filter(
  1485. i => i.assistantName.indexOf(this.roleText) != -1
  1486. );
  1487. }
  1488. return _result;
  1489. },
  1490. openAtBox() {
  1491. // return false;
  1492. if (this.text.length == 0) return false;
  1493. if (this.text.lastIndexOf("@") == this.text.length - 1) {
  1494. return true;
  1495. } else {
  1496. return false;
  1497. }
  1498. },
  1499. atTaskList() {
  1500. let _result = [];
  1501. this.taskList.forEach((item1, index1) => {
  1502. if (item1.dyName) {
  1503. _result.push({
  1504. name: `阶段${index1 + 1} ${item1.dyName}`,
  1505. tool: null,
  1506. type: 0
  1507. });
  1508. }
  1509. item1.task.forEach((item2, index2) => {
  1510. if (item2.taskName) {
  1511. _result.push({
  1512. name: `任务${index2 + 1}:${item2.taskName}`,
  1513. tool: null,
  1514. type: 1,
  1515. superiors: {
  1516. name: `阶段${index1 + 1} ${item1.dyName}`,
  1517. type: 0
  1518. }
  1519. });
  1520. }
  1521. item2.tool.forEach((item3, index3) => {
  1522. if (item3.tool != undefined) {
  1523. _result.push({
  1524. name: `工具${index3 + 1}:${this.toolsList[item3.tool]}`,
  1525. tool: item3.tool,
  1526. type: 2,
  1527. superiors: {
  1528. name: `任务${index2 + 1}:${item2.taskName}`,
  1529. type: 1,
  1530. superiors: {
  1531. name: `阶段${index1 + 1} ${item1.dyName}`,
  1532. type: 0
  1533. }
  1534. }
  1535. });
  1536. }
  1537. });
  1538. });
  1539. });
  1540. return _result;
  1541. },
  1542. pan() {
  1543. return content => {
  1544. try {
  1545. return JSON.parse(content);
  1546. } catch (error) {
  1547. return [];
  1548. }
  1549. };
  1550. },
  1551. htmlContent() {
  1552. const md = new MarkdownIt();
  1553. return _md => {
  1554. return md.render(_md);
  1555. };
  1556. },
  1557. answerData() {
  1558. return (checkList, answer) => {
  1559. if (typeof answer == "number") {
  1560. return answer + 1;
  1561. } else {
  1562. let _result = ``;
  1563. answer.forEach((item, index) => {
  1564. _result += `${item + 1}`;
  1565. if (index != answer.length - 1) {
  1566. _result += `、`;
  1567. }
  1568. });
  1569. return _result;
  1570. }
  1571. };
  1572. },
  1573. workSum() {
  1574. let sum = 0;
  1575. this.atTaskList.forEach(i => {
  1576. if (i.type != 2) return;
  1577. if ([4, 15, 45].includes(i.tool)) {
  1578. return (sum += 1);
  1579. }
  1580. });
  1581. return sum;
  1582. }
  1583. },
  1584. watch: {
  1585. navList() {
  1586. this.initTaskList();
  1587. },
  1588. atTagIndex(newValue) {
  1589. if (newValue != 2) {
  1590. this.lookStudentData = {};
  1591. }
  1592. }
  1593. },
  1594. methods: {
  1595. showTipsFn() {
  1596. this.showTipsList = this.tipsList[this.tipsList.length-1]
  1597. this.showTips = true;
  1598. this.$parent.getTipsListTime(5000)
  1599. },
  1600. insertMemorandum(_html) {
  1601. //保存行为操作
  1602. //variable
  1603. //btn
  1604. let params = [
  1605. {
  1606. uid: this.userid,
  1607. courseId: this.courseId + (this.tcid2 ? this.tcid2 : ""),
  1608. content: _html
  1609. }
  1610. ];
  1611. this.ajax
  1612. .post(
  1613. this.$store.state.api + "insert_systemOperation_countdownBehavior",
  1614. params
  1615. )
  1616. .then(res => {
  1617. if (res.data == 1) {
  1618. console.log("保存操作成功");
  1619. } else {
  1620. console.log("保存操作失败");
  1621. }
  1622. })
  1623. .catch(e => {
  1624. console.log("保存操作失败");
  1625. console.log(e);
  1626. });
  1627. },
  1628. openPhone() {
  1629. // this.$message.info("打开电话面板")
  1630. this.$parent.changeItemType(4);
  1631. },
  1632. setDefaultSrc(e) {
  1633. e.target.src = require("../../../assets/icon/course/404.png");
  1634. },
  1635. refresh(item) {
  1636. this.send(item.content);
  1637. },
  1638. changeFnType(newValue) {
  1639. if (this.isTalk) return this.$message.info("请先停止录音");
  1640. this.sendFnType = newValue;
  1641. },
  1642. chooseType(type) {
  1643. if (this.sendType == type) {
  1644. this.sendType = 0;
  1645. } else {
  1646. this.sendType = type;
  1647. }
  1648. },
  1649. talk() {
  1650. let iiframe = this.$refs["iiframe"];
  1651. iiframe.contentWindow.window.document.getElementById(
  1652. "languageOptions"
  1653. ).selectedIndex = 2; //普通话
  1654. iiframe.contentWindow.testdoContinuousPronunciationAssessment();
  1655. this.isTalk = true;
  1656. iiframe.contentWindow.onRecognizedResult = e => {
  1657. let _msg = e.privText;
  1658. console.log(_msg);
  1659. if (_msg) this.text += _msg;
  1660. };
  1661. // setTimeout(()=>this.text="珠穆朗玛峰的高度",3000)
  1662. },
  1663. stopTalk() {
  1664. if (!this.isTalk) return this.$message.info("请先开始录音");
  1665. let iiframe = this.$refs["iiframe"];
  1666. iiframe.contentWindow.window.document
  1667. .getElementById("scenarioStopButton")
  1668. .click();
  1669. iiframe.contentWindow.onSessionStopped = (s, e) => {
  1670. this.isTalk = false;
  1671. this.send();
  1672. };
  1673. },
  1674. resetImg(_text) {
  1675. this.ppage++;
  1676. let _uuid = uuidv4();
  1677. this.chatList.push({
  1678. role: "user",
  1679. content: `${_text}`,
  1680. uid: _uuid,
  1681. AI: "AI",
  1682. aiContent: "",
  1683. oldContent: "",
  1684. isShowSynchronization: false,
  1685. filename: "",
  1686. index: this.chatList.length,
  1687. is_mind_map: false,
  1688. loading: true
  1689. });
  1690. this.text = "";
  1691. let params = {
  1692. page: this.ppage,
  1693. pagesize: 6,
  1694. query: _text
  1695. };
  1696. // this.$message.info(_text);
  1697. this.chatList.push({
  1698. role: "user",
  1699. content: `getImage`,
  1700. uid: _uuid,
  1701. AI: "AI",
  1702. aiContent: "",
  1703. oldContent: "",
  1704. isShowSynchronization: false,
  1705. filename: "",
  1706. index: this.chatList.length,
  1707. is_mind_map: false,
  1708. loading: true
  1709. });
  1710. this.scrollBottom();
  1711. this.ajax
  1712. .post("https://gpt.cocorobo.cn/search_image", params)
  1713. .then(res => {
  1714. let data = res.data.FunctionResponse.result;
  1715. // console.log('res',res.data.FunctionResponse.result);
  1716. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  1717. data
  1718. );
  1719. this.chatList.find(i => i.uid == _uuid).loading = false;
  1720. this.chatLoading = false;
  1721. this.insertChat(_uuid);
  1722. });
  1723. },
  1724. stopSend() {
  1725. if (this.source) {
  1726. this.source.close();
  1727. if (this.chatList[this.chatList.length - 1].content == "wanSearch") {
  1728. this.chatList.pop();
  1729. }
  1730. this.loading = false;
  1731. this.chatLoading = false;
  1732. this.source = null;
  1733. this.insertChat(this.saveUid);
  1734. }
  1735. },
  1736. onCopy(content) {
  1737. // 创建临时textarea元素
  1738. const tempInput = document.createElement("textarea");
  1739. tempInput.value = content; // 设置要复制的内容
  1740. // 隐藏元素
  1741. tempInput.style.position = "absolute";
  1742. tempInput.style.left = "-9999px";
  1743. // 将元素添加到DOM中
  1744. document.body.appendChild(tempInput);
  1745. // 选中元素内容
  1746. tempInput.select();
  1747. // 执行复制操作
  1748. document.execCommand("copy");
  1749. // 移除临时元素
  1750. document.body.removeChild(tempInput);
  1751. this.$message({
  1752. message: "复制成功",
  1753. type: "success"
  1754. });
  1755. },
  1756. previewImg(url) {
  1757. this.$hevueImgPreview(url);
  1758. },
  1759. clear() {
  1760. // this.chatList = [];
  1761. this.$confirm("确定清空聊天记录吗?", "提示", {
  1762. confirmButtonText: "确定",
  1763. cancelButtonText: "取消",
  1764. type: "warning"
  1765. })
  1766. .then(_ => {
  1767. this.loading = true;
  1768. let params = {
  1769. user_id: this.userid,
  1770. id: "602def61-005d-11ee-91d8-005056b8q12w",
  1771. session_name: `${this.courseId}-studyStudent-md`
  1772. };
  1773. this.ajax
  1774. .post("https://gpt4.cocorobo.cn/delete_park_session", params)
  1775. .then(res => {
  1776. this.chatList = [];
  1777. this.stopSend();
  1778. this.$message.success("清除聊天记录成功");
  1779. this.loading = false;
  1780. })
  1781. .catch(err => {
  1782. this.loading = false;
  1783. this.$message.error("清除聊天记录失败");
  1784. });
  1785. })
  1786. .catch(_ => {});
  1787. },
  1788. atTask(name, index, type, data) {
  1789. let _result = name;
  1790. // if(type == 1){
  1791. // _result=`任务${index+1}:${name} `
  1792. // }else if(type==2){
  1793. // _result=`工具${index+1}:${name} `
  1794. // }else if(type==0){
  1795. // _result=`阶段${index+1} ${name} `
  1796. // }
  1797. this.text += _result;
  1798. this.$refs.textRef.focus();
  1799. },
  1800. send(_text = this.text, val = 0) {
  1801. this.ppage = 1;
  1802. if (this.loading || this.chatLoading) return this.$message.info("请稍等");
  1803. if (_text.trim().length == 0) return this.$message.info("请输入内容");
  1804. let _atRoleList = [];
  1805. if ((this.cardType = 1)) {
  1806. this.cardType = 0;
  1807. }
  1808. this.atTaskList.forEach(i => {
  1809. let _result = ``;
  1810. if (i.type == 0) {
  1811. _result = `${i.name} `;
  1812. } else if (i.type == 1) {
  1813. _result = `${i.superiors.name}-${i.name} `;
  1814. } else if (i.type == 2) {
  1815. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name} `;
  1816. }
  1817. if (_text.indexOf(`@${_result}`) != -1) {
  1818. _atRoleList.push(i);
  1819. }
  1820. });
  1821. if (_atRoleList.length > 0) {
  1822. return this.atSend(_text, _atRoleList);
  1823. }
  1824. let _msg = ``;
  1825. this.chatLoading = true;
  1826. let _uuid = uuidv4();
  1827. // if(this.sendType==3){
  1828. // _text = `帮我生成一张图片:`
  1829. // }
  1830. this.chatList.push({
  1831. role: "user",
  1832. content: `${this.sendType == 3 ? `帮我生成一张图片:${_text}` : _text}`,
  1833. uid: _uuid,
  1834. AI: "AI",
  1835. aiContent: "",
  1836. oldContent: "",
  1837. isShowSynchronization: false,
  1838. filename: this.choseRoleItem ? this.choseRoleItem.headUrl : "",
  1839. index: this.chatList.length,
  1840. is_mind_map: false,
  1841. loading: true
  1842. });
  1843. this.scrollBottom();
  1844. if (this.sendType == 2 || _text.indexOf("视频") != -1) {
  1845. this.insertMemorandum(`<span class="btn">搜索视频</span>`);
  1846. return this.ajax
  1847. .post(`https://gpt4.cocorobo.cn/get_network_search`, {
  1848. engine: "bilibili",//bilibili youtube
  1849. keyword: _text
  1850. })
  1851. .then(res => {
  1852. console.log(res);
  1853. let _dataList = res.data.FunctionResponse;
  1854. let _resultText = ``;
  1855. _dataList.forEach(i => {
  1856. i.title = i.title
  1857. .replaceAll('<em class="keyword">', "")
  1858. .replaceAll("</em>", "");
  1859. // bilibili👇
  1860. _resultText += `名称:${i.title}\n简介:${i.description}\n地址:[${i.arcurl}](${i.arcurl})\n\n`;
  1861. //youtube👇
  1862. // _resultText += `名称:${i.title}\n简介:${i.description}\n地址:[${i.link}](${i.link})\n\n`;
  1863. });
  1864. this.chatList.find(i => i.uid == _uuid).aiContent = _resultText;
  1865. this.chatList.find(i => i.uid == _uuid).loading = false;
  1866. this.chatLoading = false;
  1867. this.scrollBottom();
  1868. this.insertChat(_uuid);
  1869. this.text = "";
  1870. })
  1871. .catch(e => {
  1872. this.$message.error("获取视频失败");
  1873. this.chatLoading = false;
  1874. });
  1875. } else if (this.sendType == 3) {
  1876. this.insertMemorandum(`<span class="btn">生成图片</span>`);
  1877. this.text = "";
  1878. let params = {
  1879. n: 1,
  1880. prompt: _text,
  1881. quality: "standard",
  1882. size: "1024x1024",
  1883. style: "natural"
  1884. };
  1885. // this.$message.info(_text);
  1886. this.chatList.push({
  1887. role: "user",
  1888. content: `getImage`,
  1889. uid: _uuid,
  1890. AI: "AI",
  1891. aiContent: "",
  1892. oldContent: "",
  1893. isShowSynchronization: false,
  1894. filename: "",
  1895. index: this.chatList.length,
  1896. is_mind_map: false,
  1897. loading: true
  1898. });
  1899. this.ajax
  1900. .post("https://gpt4.cocorobo.cn/getImage", params)
  1901. .then(res => {
  1902. let data = res.data.FunctionResponse;
  1903. // console.log('res',res.data.FunctionResponse.result);
  1904. let _result = [];
  1905. if (!data.image_url_list.length) {
  1906. this.chatLoading = false;
  1907. this.chatList.pop();
  1908. this.chatList.pop();
  1909. return this.$message.error("生成图片失败");
  1910. }
  1911. data.image_url_list.forEach(i => {
  1912. _result.push({
  1913. image: i
  1914. });
  1915. });
  1916. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  1917. _result
  1918. );
  1919. this.chatList.find(i => i.uid == _uuid).loading = false;
  1920. console.log(this.chatList.find(i => i.uid == _uuid).aiContent);
  1921. this.chatLoading = false;
  1922. this.insertChat(_uuid);
  1923. this.scrollBottom();
  1924. })
  1925. .catch(e => {
  1926. this.chatLoading = false;
  1927. this.chatList.pop();
  1928. this.chatList.pop();
  1929. this.$message.error("生成失败");
  1930. });
  1931. return;
  1932. } else if (this.sendType == 1 || _text.indexOf("图片") != -1) {
  1933. this.insertMemorandum(`<span class="btn">搜索图片</span>`);
  1934. // console.log("图片");
  1935. this.text = "";
  1936. let params = {
  1937. page: this.ppage,
  1938. pagesize: 6,
  1939. query: _text
  1940. };
  1941. // this.$message.info(_text);
  1942. this.chatList.push({
  1943. role: "user",
  1944. content: `getImage`,
  1945. uid: _uuid,
  1946. AI: "AI",
  1947. aiContent: "",
  1948. oldContent: "",
  1949. isShowSynchronization: false,
  1950. filename: "",
  1951. index: this.chatList.length,
  1952. is_mind_map: false,
  1953. loading: true
  1954. });
  1955. this.ajax
  1956. .post("https://gpt.cocorobo.cn/search_image", params)
  1957. .then(res => {
  1958. let data = res.data.FunctionResponse.result;
  1959. // console.log('res',res.data.FunctionResponse.result);
  1960. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
  1961. data
  1962. );
  1963. console.log("👇");
  1964. console.log(this.chatList.find(i => i.uid == _uuid).aiContent);
  1965. this.chatList.find(i => i.uid == _uuid).loading = false;
  1966. this.chatLoading = false;
  1967. this.insertChat(_uuid);
  1968. // console.log('resresresres',res);
  1969. // if (res.data.FunctionResponse.result == "发送成功") {
  1970. // } else {
  1971. // this.$message.warning(res.data.FunctionResponse.result);
  1972. // }
  1973. });
  1974. return;
  1975. }
  1976. let history = [];
  1977. // this.nowChatList.forEach(i => {
  1978. // if (i.content == "wanSearch") {
  1979. // // history.push({
  1980. // // role:"assistant",
  1981. // // content: JSON.stringify(i.aiContent)
  1982. // // })
  1983. // return;
  1984. // } else if (i.content == "getImage") {
  1985. // // return history.push({
  1986. // // role: "user",
  1987. // // content: i.content
  1988. // // });
  1989. // } else if (i.content == "addAsk") {
  1990. // }
  1991. // if (i.content) {
  1992. // history.push({
  1993. // type: "text",
  1994. // text: i.content
  1995. // });
  1996. // }
  1997. // if (i.aiContent) {
  1998. // history.push({
  1999. // type: "text",
  2000. // text: i.aiContent
  2001. // });
  2002. // }
  2003. // });
  2004. // history.pop();
  2005. // if (_msg) {
  2006. // history.push({ type: "text", text: _msg });
  2007. // } else {
  2008. // history.push({ type: "text", text: _text });
  2009. // }
  2010. // history = history.map(i=>({
  2011. // type:i.type,
  2012. // text:`Language: ${this.getLang()}
  2013. // Language: ${this.getLang()}
  2014. // Language: ${this.getLang()}
  2015. // ${i.text}`
  2016. // }))
  2017. let _msg2 = `
  2018. Language: ${this.getLang()}
  2019. Language: ${this.getLang()}
  2020. Language: ${this.getLang()}
  2021. ${_text}
  2022. `
  2023. let params = {
  2024. assistant_id: this.choseRoleItem
  2025. ? this.choseRoleItem.assistant_id
  2026. : "b19f1a1a-7586-11ef-8ce0-12e77c4cb76b",
  2027. userId: this.userid,
  2028. message: _msg2,
  2029. session_name: `${this.courseId}-studyStudent-md`,
  2030. uid: _uuid,
  2031. file_ids: this.fileId,
  2032. // model: "gpt-4o-2024-11-20"
  2033. model:"gpt-4o-2024-11-20"
  2034. };
  2035. // let params = {
  2036. // model: "gpt-3.5-turbo",
  2037. // temperature: 0,
  2038. // max_tokens: 4096,
  2039. // top_p: 1,
  2040. // frequency_penalty: 0,
  2041. // presence_penalty: 0,
  2042. // messages: history,
  2043. // uid: _uuid,
  2044. // mind_map_question: _text
  2045. // };
  2046. // let params = {
  2047. // message: {
  2048. // anthropic_version: "bedrock-2023-05-31",
  2049. // max_tokens: 4096,
  2050. // temperature: 0,
  2051. // top_p: 1,
  2052. // messages: history
  2053. // },
  2054. // uid: _uuid,
  2055. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2056. // };
  2057. this.text = "";
  2058. this.ajax
  2059. // .post("https://claude3.cocorobo.cn/chat", params)
  2060. // .post("https://gpt4.cocorobo.cn/chat", params)
  2061. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  2062. .then(res => {
  2063. if (
  2064. converter(res.data.FunctionResponse.result) == converter("发送成功")
  2065. ) {
  2066. } else {
  2067. // this.$message.warning(res.data.FunctionResponse.result);
  2068. console.log(res.data.FunctionResponse.result);
  2069. this.chatLoading = false;
  2070. }
  2071. })
  2072. .catch(e => {
  2073. console.log(e);
  2074. this.chatLoading = false;
  2075. });
  2076. this.saveUid = _uuid;
  2077. this.getAtAuContent(_uuid);
  2078. },
  2079. atSend(_text, _atList) {
  2080. let _msg = ``;
  2081. let noAtText = _text;
  2082. _atList.forEach(i => {
  2083. let _result = ``;
  2084. if (i.type == 0) {
  2085. _result = `${i.name} `;
  2086. } else if (i.type == 1) {
  2087. _result = `${i.superiors.name}-${i.name} `;
  2088. } else if (i.type == 2) {
  2089. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name} `;
  2090. }
  2091. if (_text.indexOf(`@${_result}`) != -1) {
  2092. noAtText = noAtText.replaceAll(`@${_result}`, "");
  2093. }
  2094. });
  2095. this.chatLoading = true;
  2096. let _uuid = uuidv4();
  2097. this.chatList.push({
  2098. role: "user",
  2099. content: `${_text}`,
  2100. uid: _uuid,
  2101. AI: "AI",
  2102. aiContent: "",
  2103. oldContent: "",
  2104. isShowSynchronization: false,
  2105. filename: "",
  2106. index: this.chatList.length,
  2107. is_mind_map: false,
  2108. loading: true
  2109. });
  2110. this.scrollBottom();
  2111. _msg = `
  2112. NOTICE
  2113. 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.if the user speaks Chinese Traditional, the specific text of your answer should also be in Chinese Traditional.
  2114. ## 目的
  2115. 你是用户的课堂助手,你需要基于提供给你的课程相关信息,对用户的提问进行回答。
  2116. ---
  2117. ## 定义
  2118. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  2119. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  2120. 【阶段】:阶段表示课程的某一单独部分,通常包含一个或多个任务。
  2121. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  2122. 【工具】:工具通常是指学生要完成任务的手段。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。
  2123. ---
  2124. ## 工作流程
  2125. 1. 读取【课程信息】中的内容,了解课程说明、课程结构以及【任务】详情。
  2126. 2. 用户会询问你某个【任务】的具体信息,你需要总结该任务信息,并就用户的问题进行回答。
  2127. 3. 你的总结包括以下要点:
  2128. 3.1 任务从属于哪个阶段。
  2129. 3.2 任务包含哪些工具。
  2130. 3.3 该任务目标是什么,以及该任务的工具如何达成它的目标。
  2131. ---
  2132. ## 规则
  2133. 1.你和用户讨论的范围应当仅局限于课程相关内容。
  2134. 2.当用户的提问需要你对课程拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  2135. 3.你通常可以在【任务描述】中了解任务目标,但当【任务描述】不包含此内容的时候,你不需要总结这部分内容。
  2136. ---
  2137. ## 课程信息
  2138. ###课程说明与课程结构
  2139. 课程标题:${this.courseDetail.title ? this.courseDetail.title : ""}
  2140. 分类:${this.courseDetail.name ? this.courseDetail.name : "无"}
  2141. 学生年级:${this.courseDetail.classname ? this.courseDetail.classname : "无"}
  2142. 学习内容:${this.exportCourse()}
  2143. ## 要求
  2144. ${_atList
  2145. .map(i => {
  2146. let _result = ``;
  2147. if (i.type == 0) {
  2148. _result = `${i.name}`;
  2149. } else if (i.type == 1) {
  2150. _result = `${i.superiors.name}-${i.name}`;
  2151. } else if (i.type == 2) {
  2152. _result = `${i.superiors.superiors.name}-${i.superiors.name}-${i.name}`;
  2153. }
  2154. console.log(_result);
  2155. return _result;
  2156. })
  2157. .join(",")} ${noAtText}
  2158. `;
  2159. // this.chatLoading = false;
  2160. // console.log(_msg)
  2161. // return
  2162. // ${this._atList.map(i=>i.name).join(',')} ${noAtText}
  2163. let history = [];
  2164. this.nowChatList.forEach(i => {
  2165. if (i.content == "wanSearch") {
  2166. return;
  2167. } else if (i.content == "getImage") {
  2168. return history.push({
  2169. role: "assistant",
  2170. content: i.aiContent
  2171. });
  2172. }
  2173. if (i.content) {
  2174. history.push({
  2175. role: "user",
  2176. content: i.content
  2177. });
  2178. }
  2179. if (i.aiContent) {
  2180. history.push({
  2181. role: "assistant",
  2182. content: i.aiContent
  2183. });
  2184. }
  2185. });
  2186. // if (_msg) {
  2187. history.push({ role: "user", content: _msg });
  2188. // }
  2189. history.push({ role: "user", content: _text });
  2190. let params = {
  2191. assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
  2192. userId: this.userid,
  2193. message: _text,
  2194. session_name: `${this.courseId}-studyStudent-md`,
  2195. uid: _uuid,
  2196. file_ids: this.fileId,
  2197. model: "gpt-4o-2024-11-20"
  2198. };
  2199. // let params = {
  2200. // model: "gpt-3.5-turbo",
  2201. // temperature: 0,
  2202. // max_tokens: 4096,
  2203. // top_p: 1,
  2204. // frequency_penalty: 0,
  2205. // presence_penalty: 0,
  2206. // messages: history,
  2207. // uid: _uuid,
  2208. // mind_map_question: noAtText
  2209. // };
  2210. // let params = {
  2211. // message: {
  2212. // anthropic_version: "bedrock-2023-05-31",
  2213. // max_tokens: 4096,
  2214. // temperature: 0,
  2215. // top_p: 1,
  2216. // messages: history
  2217. // },
  2218. // uid: _uuid,
  2219. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2220. // };
  2221. this.text = "";
  2222. this.ajax
  2223. // .post("https://gpt4.cocorobo.cn/chat", params)
  2224. // .post("https://claude3.cocorobo.cn/chat", params)
  2225. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  2226. .then(res => {
  2227. if (
  2228. converter(res.data.FunctionResponse.result) == converter("发送成功")
  2229. ) {
  2230. } else {
  2231. // this.$message.warning(res.data.FunctionResponse.result);
  2232. console.log(res.data.FunctionResponse.result);
  2233. this.chatLoading = false;
  2234. }
  2235. })
  2236. .catch(e => {
  2237. console.log(e);
  2238. this.chatLoading = false;
  2239. });
  2240. this.saveUid = _uuid;
  2241. // this.getAiContent(_uuid);
  2242. this.getAtAuContent(_uuid);
  2243. },
  2244. exportCourse() {
  2245. 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>`;
  2246. const _chapInfo = JSON.parse(this.courseDetail.chapters);
  2247. let _chap = "";
  2248. for (let i = 0; i < _chapInfo.length; i++) {
  2249. _chap += `<div style="font-size:40px;margin-top:70px;"><span>第${i +
  2250. 1}阶段:${_chapInfo[i].dyName}</span></div>`;
  2251. let _task = _chapInfo[i].chapterInfo[0].taskJson;
  2252. for (let j = 0; j < _task.length; j++) {
  2253. _chap += `<div style="font-size:30px;margin-top:50px;"><span>任务${j +
  2254. 1}:${_task[j].task}</span></div>`;
  2255. if (_task[j].taskDetail) {
  2256. _chap += `<div style="font-size:25px;margin-top:40px;">任务描述</div>`;
  2257. _chap += `<div style="font-size:25px;margin-top:10px;">${_task[j].taskDetail}</div>`;
  2258. }
  2259. let _tool = _task[j].toolChoose;
  2260. if (_tool[0].tool.length) {
  2261. for (let z = 0; z < _tool.length; z++) {
  2262. _chap += `<div style="font-size:23px;margin-top:30px;"><span>步骤${z +
  2263. 1}:</span><span>${
  2264. tools[_tool[z].tool[0]] ? tools[_tool[z].tool[0]].name : ""
  2265. }</span></div>`;
  2266. if (_tool[z].toolDetail) {
  2267. _chap += `<div style="font-size:23px;margin-top:20px;">工具描述</div>`;
  2268. _chap += `<div style="font-size:23px;margin-top:10px;">${_tool[z].toolDetail}</div>`;
  2269. }
  2270. }
  2271. }
  2272. }
  2273. }
  2274. let _html = _user + _chap;
  2275. return _html;
  2276. },
  2277. // 获取ai对话
  2278. getAiContent(_uid) {
  2279. // this.source = new EventSource(
  2280. // `https://claude3.cocorobo.cn/streamChat/${_uid}`
  2281. // );
  2282. this.source = new EventSource(
  2283. `https://gpt4.cocorobo.cn/question/${_uid}`
  2284. );
  2285. // this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
  2286. let _allText = "";
  2287. let _mdText = "";
  2288. // const md = new MarkdownIt();
  2289. this.source.onmessage = _e => {
  2290. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  2291. //对话已经完成
  2292. _mdText = _mdText.replace("_", "");
  2293. this.source.close();
  2294. this.chatLoading = false;
  2295. this.scrollBottom();
  2296. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  2297. this.chatList.find(i => i.uid == _uid).isalltext = true;
  2298. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  2299. this.chatList.find(i => i.uid == _uid).loading = false;
  2300. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  2301. // this.addAsk(this.chatList.find(i => i.uid == _uid).content);
  2302. // 这里保存对话
  2303. this.insertChat(_uid);
  2304. return;
  2305. } else {
  2306. //对话还在继续
  2307. let _text = "";
  2308. _text = _e.data.replaceAll("'", "");
  2309. if (_allText == "") {
  2310. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  2311. } else {
  2312. _allText += _text;
  2313. }
  2314. _mdText = _allText + "_";
  2315. _mdText = _mdText.replace(/\\n/g, "\n");
  2316. _mdText = _mdText.replace(/\\/g, "");
  2317. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  2318. //转化返回的回复流数据
  2319. // _mdText = md.render(_mdText);
  2320. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  2321. this.chatList.find(i => i.uid == _uid).loading = false;
  2322. this.scrollBottom();
  2323. // 处理流数据
  2324. }
  2325. };
  2326. },
  2327. getAtAuContent(_uid) {
  2328. this.source = new EventSource(
  2329. `https://gpt4.cocorobo.cn/question/${_uid}`
  2330. );
  2331. //http://gpt4.cocorobo.cn:8011/question/ https://gpt4.cocorobo.cn/question/
  2332. let _allText = "";
  2333. let _mdText = "";
  2334. let _index = 0;
  2335. let _talkText = "";
  2336. // const md = new MarkdownIt();
  2337. this.source.onmessage = _e => {
  2338. let _eData = JSON.parse(_e.data);
  2339. if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
  2340. let _result = [];
  2341. if ("result" in _eData) {
  2342. _result = _eData.result;
  2343. for (let i = 0; i < _result.length; i++) {
  2344. _mdText = _mdText.replace(_result[i].text, _result[i].fileName);
  2345. }
  2346. }
  2347. _mdText = _mdText.replace("_", "");
  2348. if (this.openMegaphone && this.aiTalkUid == _uid) {
  2349. if (_talkText != "") {
  2350. let _resultText = this.removeMarkdown(_talkText);
  2351. this.aiTalkList.push(_resultText);
  2352. _talkText = "";
  2353. if (!this.aiIsTalk) this.aiTalk(1);
  2354. }
  2355. }
  2356. this.chatLoading = false;
  2357. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  2358. this.chatList.find(i => i.uid == _uid).isalltext = true;
  2359. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  2360. this.chatList.find(i => i.uid == _uid).loading = false;
  2361. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  2362. // this.addAsk(this.chatList.find(i => i.uid == _uid).content);
  2363. this.source.close();
  2364. this.insertChat(_uid);
  2365. } else {
  2366. _index += 1;
  2367. let _text = _eData.content.replace("'", "").replace("'", "");
  2368. if (_allText == "") {
  2369. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  2370. _talkText += _text.replace(/^\n+/, "");
  2371. } else {
  2372. _allText += _text;
  2373. _talkText += _text;
  2374. }
  2375. _mdText = _allText + "_";
  2376. _mdText = _mdText.replace(/\\n/g, "\n");
  2377. _mdText = _mdText.replace(/\\/g, "");
  2378. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  2379. //转化返回的回复流数据
  2380. // _mdText = md.render(_mdText);
  2381. if (_index == 10) {
  2382. this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
  2383. this.chatList.find(i => i.uid == _uid).loading = false;
  2384. this.$nextTick(() => {
  2385. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  2386. });
  2387. _index = 0;
  2388. }
  2389. if (this.openMegaphone && /[,。:;?!)]/.test(_talkText)) {
  2390. let _resultText = this.removeMarkdown(_talkText);
  2391. if (this.aiTalkUid != _uid) {
  2392. this.aiTalkList = [];
  2393. }
  2394. this.aiTalkList.push(_resultText);
  2395. _talkText = "";
  2396. if (this.aiTalkUid != _uid) {
  2397. this.aiTalkUid = _uid;
  2398. this.aiTalk(0);
  2399. } else if (!this.aiIsTalk) {
  2400. this.aiTalk(1);
  2401. }
  2402. }
  2403. // 处理流数据
  2404. }
  2405. };
  2406. },
  2407. getWAntSearchContent(_uid) {
  2408. // this.source = new EventSource(
  2409. // `https://claude3.cocorobo.cn/streamChat/${_uid}`
  2410. // );
  2411. let source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`);
  2412. // this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
  2413. let _allText = "";
  2414. let _mdText = "";
  2415. this.scrollBottom();
  2416. source.onmessage = _e => {
  2417. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  2418. //对话已经完成
  2419. _mdText = _mdText.replace("_", "");
  2420. _mdText = _mdText.replace("```json", "");
  2421. _mdText = _mdText.replace("```", "");
  2422. // 使用正则表达式匹配JSON数组
  2423. const regex = /\[\s*{[^]*}\s*\]/;
  2424. const match = _mdText.match(regex);
  2425. let _result = match[0];
  2426. source.close();
  2427. this.chatList.find(i => i.uid == _uid).aiContent = JSON.parse(
  2428. _result
  2429. );
  2430. this.chatList.find(i => i.uid == _uid).isalltext = true;
  2431. this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  2432. this.chatList.find(i => i.uid == _uid).loading = false;
  2433. this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
  2434. this.scrollBottom();
  2435. // 这里保存对话
  2436. return;
  2437. } else {
  2438. //对话还在继续
  2439. let _text = "";
  2440. _text = _e.data.replaceAll("'", "");
  2441. if (_allText == "") {
  2442. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  2443. } else {
  2444. _allText += _text;
  2445. }
  2446. _mdText = _allText + "_";
  2447. _mdText = _mdText.replace(/\\n/g, "\n");
  2448. _mdText = _mdText.replace(/\\/g, "");
  2449. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  2450. //转化返回的回复流数据
  2451. this.scrollBottom();
  2452. }
  2453. };
  2454. },
  2455. //保存消息
  2456. async insertChat(_uid) {
  2457. if (_uid == "") return;
  2458. let _data = this.chatList.find(i => i.uid == _uid);
  2459. if (!_data) return;
  2460. let params = {
  2461. userId: this.userid,
  2462. userName: this.userName?this.userName:await this.getUser(this.userid),
  2463. groupId: "602def61-005d-11ee-91d8-005056b8q12w",
  2464. answer: _data.aiContent,
  2465. problem: _data.content,
  2466. file_id: _data.fileid ? _data.fileid : "",
  2467. alltext: _data.aiContent,
  2468. type: "chat",
  2469. filename: _data.filename,
  2470. session_name: `${this.courseId}-studyStudent-md` //这是对话记录位置
  2471. };
  2472. this.saveUid = "";
  2473. this.ajax
  2474. .post("https://gpt4.cocorobo.cn/insert_chat", params)
  2475. .then(res => {});
  2476. },
  2477. getUser(uid) {
  2478. return new Promise(resolve => {
  2479. let params = { uid: uid };
  2480. this.ajax
  2481. .get(this.$store.state.api + "getUser", params)
  2482. .then(res => {
  2483. let data = res.data[0][0];
  2484. this.userName = data.username;
  2485. resolve(data.username)
  2486. })
  2487. .catch(err => {
  2488. console.error(err);
  2489. });
  2490. });
  2491. },
  2492. // 获取对应的聊天记录
  2493. getChatList() {
  2494. return new Promise((resolve, reject) => {
  2495. if (this.loading) return this.$message.info("请稍等...");
  2496. this.chatList = [];
  2497. this.loading = true;
  2498. let params = {
  2499. userid: this.userid,
  2500. groupid: "602def61-005d-11ee-91d8-005056b8q12w",
  2501. // session_name:``
  2502. session_name: `${this.courseId}-studyStudent-md`
  2503. };
  2504. this.ajax
  2505. .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
  2506. .then(res => {
  2507. let _data = JSON.parse(res.data.FunctionResponse).response;
  2508. if (_data.length > 0) {
  2509. let _chatList = [];
  2510. for (let i = 0; i < _data.length; i++) {
  2511. _chatList.push({
  2512. loading: false,
  2513. role: "user",
  2514. content: _data[i].problem,
  2515. uid: _data[i].id,
  2516. AI: "AI",
  2517. aiContent: _data[i].answer,
  2518. oldContent: _data[i].answer,
  2519. isShowSynchronization: false,
  2520. filename: _data[i].filename,
  2521. index: i,
  2522. is_mind_map: false,
  2523. fileid: _data[i].fileid
  2524. });
  2525. }
  2526. this.chatList = _chatList;
  2527. this.loading = false;
  2528. } else {
  2529. //没有对话记录
  2530. this.loading = false;
  2531. }
  2532. resolve();
  2533. })
  2534. .catch(err => {
  2535. console.log(err);
  2536. this.$message.error("获取对话记录失败");
  2537. this.loading = false;
  2538. resolve();
  2539. });
  2540. });
  2541. },
  2542. sendAiIdea(text) {
  2543. if (this.loading) return this.$message.info("请稍等");
  2544. this.send(text);
  2545. },
  2546. getWantSearch(_uuid2) {
  2547. // if(!this.$parent.getWangLoading){
  2548. // return this.getWantSearch(_uuid2)
  2549. // }
  2550. if(_uuid2 && this.$parent.getWangLoading){
  2551. return setTimeout(()=>{
  2552. console.log("等待获取")
  2553. this.getWantSearch(_uuid2)
  2554. },1000)
  2555. }else if(this.$parent.wangData && this.$parent.canUseWangData && _uuid2){
  2556. this.chatList.find(i => i.uid == _uuid2).aiContent = JSON.parse(
  2557. this.$parent.getWanData()
  2558. );
  2559. this.chatList.find(i => i.uid == _uuid2).isalltext = true;
  2560. this.chatList.find(i => i.uid == _uuid2).isShowSynchronization = true;
  2561. this.chatList.find(i => i.uid == _uuid2).loading = false;
  2562. return;
  2563. }
  2564. if(_uuid2 && !this.$parent.getWangLoading){
  2565. let _index = this.chatList.findIndex(i=>i.uid==_uuid2)
  2566. if(_index>-1){
  2567. this.chatList.splice(_index,1)
  2568. }
  2569. }
  2570. let _uuid = uuidv4();
  2571. let _msg = `
  2572. Language: ${this.getLang()}
  2573. ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
  2574. Instruction: Based on the context, follow "Format example", write content
  2575. ## 任务
  2576. 你的任务是根据“课程信息”,提供用户需要的搜索建议,将搜索建议的结果以有序列表的形式返回给用户。
  2577. ## 课程信息
  2578. #### 课程标题:${this.courseDetail.title ? this.courseDetail.title : ""}
  2579. #### 分类:${this.courseDetail.name ? this.courseDetail.name : "无"}
  2580. #### 学生年级:${
  2581. this.courseDetail.classname ? this.courseDetail.classname : "无"
  2582. }
  2583. ## 规则
  2584. 输出结果基于“课程信息”,避免提供无关的信息。
  2585. 搜索建议的结果符合伦理规范。
  2586. ## 输出
  2587. 输出应包括5个相关的搜索建议,每个搜索建议需要以问号的方式结束。
  2588. 请一步步思考如何根据现有信息推送搜索建议,但是不需要输出搜索建议以外的内
  2589. ## 输出格式
  2590. 搜索建议应以有序列表形式呈现,每个建议包括关键词和简短描述。输出JSON格式的
  2591. ## Format example
  2592. [{"index": 1,"title": "垃圾分类标准","label": "不同国家的垃圾分类标准和方法?"},{"index": 2,"title":"可回收垃圾处理","label": "可回收垃圾的处理流程和再利用方法?"},{ "index": 3, "title": "有害垃圾的影响", "label": "有害垃圾对环境和人体健康的潜在影响?"},{ "index": 4, "title": "垃圾分类标准", "label": "不同国家的垃圾分类标准和方法?"},{ "index": 5, "title": "可回收垃圾处理", "label": "可回收垃圾的处理流程和再利用方法?"},{ "index": 6, "title": "有害垃圾的影响", "label": "有害垃圾对环境和人体健康的潜在影响?"}]
  2593. `;
  2594. this.chatList.push({
  2595. role: "user",
  2596. content: `wanSearch`,
  2597. uid: _uuid,
  2598. AI: "AI",
  2599. aiContent: "",
  2600. oldContent: "",
  2601. isShowSynchronization: false,
  2602. filename: "",
  2603. index: this.chatList.length,
  2604. is_mind_map: false,
  2605. loading: true
  2606. });
  2607. this.scrollBottom();
  2608. if(this.$parent.getWangLoading){
  2609. return setTimeout(()=>{
  2610. this.getWantSearch(_uuid)
  2611. },1000)
  2612. }else if(this.$parent.wangData && this.$parent.canUseWangData){
  2613. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(
  2614. this.$parent.getWanData()
  2615. );
  2616. this.chatList.find(i => i.uid == _uuid).isalltext = true;
  2617. this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
  2618. this.chatList.find(i => i.uid == _uuid).loading = false;
  2619. return;
  2620. }
  2621. // let params = {
  2622. // model: "gpt-3.5-turbo",
  2623. // temperature: 0,
  2624. // max_tokens: 4096,
  2625. // top_p: 1,
  2626. // frequency_penalty: 0,
  2627. // presence_penalty: 0,
  2628. // messages: [{ role: "user", content: _msg }],
  2629. // uid: _uuid,
  2630. // mind_map_question: ""
  2631. // };
  2632. let params = {
  2633. assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
  2634. userId: this.userid,
  2635. message: [{ type: "text", text: _msg }],
  2636. session_name: _uuid,
  2637. // uid: _uuid,
  2638. file_ids: this.fileId,
  2639. model: "gpt-4o-2024-11-20",
  2640. stream:true
  2641. };
  2642. // let params = {
  2643. // message: {
  2644. // anthropic_version: "bedrock-2023-05-31",
  2645. // max_tokens: 4096,
  2646. // temperature: 0,
  2647. // top_p: 1,
  2648. // messages: [{ role: "user", content: _msg }]
  2649. // },
  2650. // uid: _uuid,
  2651. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2652. // };
  2653. this.text = "";
  2654. let _allText = "";
  2655. let _mdText = "";
  2656. const md = new MarkdownIt();
  2657. let _this = this;
  2658. // const curRequestController = new AbortController();
  2659. this.curRequestController = new AbortController();
  2660. fetchEventSource("https://gpt4.cocorobo.cn/ai_agent_park_chat_new_post_stream",{
  2661. method: "POST",
  2662. headers: {
  2663. "Content-Type": "application/json"
  2664. },
  2665. body: JSON.stringify(params),
  2666. signal: _this.curRequestController.signal,
  2667. onmessage(_e){
  2668. if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
  2669. //对话已经完成
  2670. _mdText = _mdText.replace("_", "");
  2671. _mdText = _mdText.replace("```json", "");
  2672. _mdText = _mdText.replace("```", "");
  2673. // 使用正则表达式匹配JSON数组
  2674. const regex = /\[\s*{[^]*}\s*\]/;
  2675. const match = _mdText.match(regex);
  2676. let _result = match[0];
  2677. source.close();
  2678. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(
  2679. _result
  2680. );
  2681. this.chatList.find(i => i.uid == _uuid).isalltext = true;
  2682. this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
  2683. this.chatList.find(i => i.uid == _uuid).loading = false;
  2684. this.nowChatList.push(this.chatList.find(i => i.uid == _uuid));
  2685. this.scrollBottom();
  2686. // 这里保存对话
  2687. return;
  2688. } else {
  2689. //对话还在继续
  2690. let _text = "";
  2691. _text = _e.data.replaceAll("'", "");
  2692. if (_allText == "") {
  2693. _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
  2694. } else {
  2695. _allText += _text;
  2696. }
  2697. _mdText = _allText + "_";
  2698. _mdText = _mdText.replace(/\\n/g, "\n");
  2699. _mdText = _mdText.replace(/\\/g, "");
  2700. if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
  2701. //转化返回的回复流数据
  2702. this.scrollBottom();
  2703. }
  2704. },
  2705. onclose(){
  2706. _this.$forceUpdate();
  2707. // _this.stopTalkToken = null;
  2708. // _this.faloading = false;
  2709. // _this.curRequestController = null;
  2710. // _this.chatList.find(i => i.uid == _uid).isalltext = true;
  2711. // _this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
  2712. _this.insertChat(_uuid);
  2713. console.log("连接关闭")
  2714. },
  2715. onerror(err){
  2716. console.log("连接错误",err)
  2717. }
  2718. })
  2719. // this.ajax
  2720. // // .post("https://gpt4.cocorobo.cn/chat", params)
  2721. // // .post("https://claude3.cocorobo.cn/chat", params)
  2722. // .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
  2723. // .then(res => {
  2724. // // console.log(res);
  2725. // let _data = res.data.FunctionResponse.message;
  2726. // _data = _data.replaceAll("```json", "").replaceAll("```", "");
  2727. // const match = _data.match(/\[\s*{[^]*}\s*\]/);
  2728. // // console.log(_data);
  2729. // // console.log(match);
  2730. // this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(
  2731. // match[0]
  2732. // );
  2733. // this.chatList.find(i => i.uid == _uuid).isalltext = true;
  2734. // this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
  2735. // this.chatList.find(i => i.uid == _uuid).loading = false;
  2736. // this.scrollBottom();
  2737. // // this.chatLoading = false;
  2738. // })
  2739. // .catch(e => {
  2740. // this.chatLoading = false;
  2741. // console.log(e);
  2742. // });
  2743. // this.getWAntSearchContent(_uuid);
  2744. },
  2745. addAsk(_text) {
  2746. // this.chatLoading = true;
  2747. let _uuid = uuidv4();
  2748. let _msg = `Language: ${this.getLang()}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\": \"有害垃圾对环境和人体健康的潜在影响?\"}]`;
  2749. _msg = _msg.replace(/[\r\n]/g, "");
  2750. this.chatList.push({
  2751. role: "user",
  2752. content: `addAsk`,
  2753. uid: _uuid,
  2754. AI: "AI",
  2755. aiContent: "",
  2756. oldContent: "",
  2757. isShowSynchronization: false,
  2758. filename: "",
  2759. index: this.chatList.length,
  2760. is_mind_map: false,
  2761. loading: true
  2762. });
  2763. this.scrollBottom();
  2764. let history = [];
  2765. // this.nowChatList.forEach(i => {
  2766. // if (i.content == "wanSearch") {
  2767. // // history.push({
  2768. // // role:"assistant",
  2769. // // content: JSON.stringify(i.aiContent)
  2770. // // })
  2771. // return;
  2772. // } else if (i.content == "getImage") {
  2773. // return history.push({
  2774. // role: "assistant",
  2775. // content: i.aiContent
  2776. // });
  2777. // }else if(i.content == "addAsk"){
  2778. // }
  2779. // if (i.content) {
  2780. // history.push({
  2781. // role: "user",
  2782. // content: i.content
  2783. // });
  2784. // }
  2785. // if (i.aiContent) {
  2786. // history.push({
  2787. // role: "assistant",
  2788. // content: i.aiContent
  2789. // });
  2790. // }
  2791. // });
  2792. history.push({ type: "text", text: _msg });
  2793. console.log(history);
  2794. // let params = {
  2795. // model: "gpt-3.5-turbo",
  2796. // temperature: 0,
  2797. // max_tokens: 4096,
  2798. // top_p: 1,
  2799. // frequency_penalty: 0,
  2800. // presence_penalty: 0,
  2801. // messages:history,
  2802. // stream: false,
  2803. // uid: _uuid,
  2804. // mind_map_question: ""
  2805. // };
  2806. let params = {
  2807. assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
  2808. userId: this.userid,
  2809. message: history,
  2810. session_name: _uuid,
  2811. // uid: _uuid,
  2812. file_ids: this.fileId,
  2813. model: "gpt-4o-2024-11-20"
  2814. };
  2815. // let params = {
  2816. // message: {
  2817. // anthropic_version: "bedrock-2023-05-31",
  2818. // max_tokens: 4096,
  2819. // temperature: 0,
  2820. // top_p: 1,
  2821. // messages: [{ role: "user", content: _msg }]
  2822. // },
  2823. // uid: _uuid,
  2824. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  2825. // };
  2826. this.text = "";
  2827. this.ajax
  2828. // .post("https://gpt4.cocorobo.cn/chat", params)
  2829. // .post("https://claude3.cocorobo.cn/chat", params)
  2830. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
  2831. .then(res => {
  2832. console.log(res);
  2833. let _data = res.data.FunctionResponse.message;
  2834. _data = _data.replaceAll("```json", "").replaceAll("```", "");
  2835. const match = _data.match(/\[\s*{[^]*}\s*\]/);
  2836. console.log(match[0]);
  2837. this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(
  2838. match[0]
  2839. );
  2840. this.chatList.find(i => i.uid == _uuid).isalltext = true;
  2841. this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
  2842. this.chatList.find(i => i.uid == _uuid).loading = false;
  2843. this.scrollBottom();
  2844. // this.chatLoading = false;
  2845. })
  2846. .catch(e => {
  2847. this.chatLoading = false;
  2848. this.chatList.find(i => i.uid == _uuid).loading = false;
  2849. console.log(e);
  2850. });
  2851. },
  2852. scrollBottom() {
  2853. this.$nextTick(() => {
  2854. this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
  2855. });
  2856. },
  2857. initTaskList() {
  2858. this.taskList = [];
  2859. this.taskList = JSON.parse(JSON.stringify(this.navList));
  2860. this.taskList.forEach(i1 => {
  2861. i1.isOpen = true;
  2862. i1.task.forEach(i2 => {
  2863. i2.isOpen = true;
  2864. i2.tool.forEach(i3 => {
  2865. i3.isOpen = true;
  2866. });
  2867. });
  2868. });
  2869. },
  2870. getWorkData() {
  2871. if (this.workSum == 0) return;
  2872. let params = {
  2873. cid: this.courseId,
  2874. classid: this.tcid
  2875. };
  2876. this.userList = [];
  2877. this.ajax
  2878. .get(this.$store.state.api + "selectWorkBycidAi", params)
  2879. .then(res => {
  2880. let _data = res.data[0];
  2881. console.log(_data);
  2882. if (_data.length > 0) {
  2883. this.userList = _data;
  2884. }
  2885. })
  2886. .catch(e => {
  2887. // this.$message.error()
  2888. this.userList = [];
  2889. console.log(e);
  2890. });
  2891. },
  2892. lookStudentDetail(_data) {
  2893. this.loading = true;
  2894. let params = {
  2895. cid: this.courseId,
  2896. uid: _data.userid
  2897. };
  2898. this.ajax
  2899. .get(this.$store.state.api + "selectWorkBycidAiByUid", params)
  2900. .then(res => {
  2901. let _result = res.data[0];
  2902. this.atTagIndex = 2;
  2903. this.loading = false;
  2904. _result.forEach(i => {
  2905. i.content = JSON.parse(i.content)[0];
  2906. });
  2907. this.lookStudentData = {
  2908. userName: _data.username,
  2909. list: _result ? _result : []
  2910. };
  2911. console.log(this.lookStudentData);
  2912. });
  2913. },
  2914. sumUpStudent(_data) {
  2915. let params = {
  2916. cid: this.courseId,
  2917. uid: _data.userid
  2918. };
  2919. this.loading = true;
  2920. this.ajax
  2921. .get(this.$store.state.api + "selectWorkBycidAiByUid", params)
  2922. .then(res => {
  2923. let _result = res.data[0];
  2924. console.log(_result);
  2925. console.log("👆");
  2926. this.text += `${_data.username} 总结分析`;
  2927. let _msg = ``;
  2928. this.chatLoading = true;
  2929. let _uuid = uuidv4();
  2930. this.chatList.push({
  2931. role: "user",
  2932. content: `${this.text}`,
  2933. uid: _uuid,
  2934. AI: "AI",
  2935. aiContent: "",
  2936. oldContent: "",
  2937. isShowSynchronization: false,
  2938. filename: "",
  2939. index: this.chatList.length,
  2940. is_mind_map: false,
  2941. loading: true
  2942. });
  2943. this.text = "";
  2944. let _wordData = "";
  2945. _result.forEach(i => {
  2946. if (i.type == 3) {
  2947. let content = JSON.parse(i.content)[0];
  2948. return (_wordData += `问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n\n`);
  2949. } else if (i.type == 8) {
  2950. let content = JSON.parse(i.content)[0];
  2951. _wordData += `选择题:\n`;
  2952. let _json = content.testJson ? content.testJson.testJson : [];
  2953. _json.forEach((i2, index2) => {
  2954. _wordData += `题目:${i2.teststitle}\n选项:\n`;
  2955. i2.checkList.forEach((item, index) => {
  2956. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  2957. });
  2958. if (typeof i2.answer != "number") {
  2959. i2.answer.forEach(a => {
  2960. a += 1;
  2961. });
  2962. content.anwer[index2].forEach(b => {
  2963. b += 1;
  2964. });
  2965. _wordData += `答案:${i2.answer.join("、")}`;
  2966. _wordData += `学生选择:${content.anwer[index2].join(
  2967. "、"
  2968. )}\n\n`;
  2969. } else {
  2970. _wordData += `答案:${i2.answer + 1}`;
  2971. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  2972. }
  2973. });
  2974. return _wordData;
  2975. } else if (i.type == 2) {
  2976. let content = JSON.parse(i.content)[0];
  2977. _wordData += `问卷:${content.askJson.askTitle}\n`;
  2978. let _json = content.askJson ? content.askJson.askJson : [];
  2979. _json.forEach((i2, index2) => {
  2980. _wordData += `题目:${i2.askstitle}\n选项:\n`;
  2981. i2.checkList.forEach((item, index) => {
  2982. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  2983. });
  2984. if (typeof content.anwer[index2] != "number") {
  2985. _wordData += `学生选择:${content.anwer[index2].join(
  2986. "、"
  2987. )}\n\n`;
  2988. } else {
  2989. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  2990. }
  2991. });
  2992. }
  2993. });
  2994. // console.log(_wordData)
  2995. // this.loading = false;
  2996. // return this.chatLoading = false;
  2997. _msg = `
  2998. NOTICE
  2999. Language: ${this.getLang()}
  3000. ## 目的
  3001. 你是教师用户的课堂助手,你需要基于提供给你的课程相关信息以及学生的作业数据,就某些具体作业对全班学生进行总结分析。
  3002. ---
  3003. ## 定义
  3004. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  3005. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  3006. 【阶段】:阶段表示课程的某一单独部分,包含一个或多个任务。
  3007. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  3008. 【工具】:工具通常是指学生的作业(在课上要具体做的事情)。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。工具中通常会包含学生的作业数据。
  3009. ---
  3010. ## 工作流程与规则
  3011. 1. 了解信息。读取【工具总览表格】以及【工具详情:总体数据】中的内容,了解学生作业详情。
  3012. 2. 确保信息的完整性和可解读性。当面对不确定信息时,你应当积极提问。这一点适用于以下两种情况:
  3013. 2.1 当用户的提问需要你对课程、任务或工具拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  3014. 2.2 当你不理解某个工具的设置时(比如当你发现题目、选项的表述不完整或者有不符合中文表达规则的符号;又比如你发现缺乏必要的统计信息),你应当积极向用户询问。
  3015. 2.3 **例外情况**:在告知用户并征得同意的情况下,你可以忽视上述问题并执行后续流程。
  3016. 3. 进行总结。
  3017. 3.1 对表格信息进行简单总结。包括任务、阶段、工具及其内容。
  3018. 3.2 进行结果分析。对于每一个工具,都从全班的角度出发进行简单总结。
  3019. 3.3 进行错因分析。仅仅针对于某些错误率较高的题目,从全班的角度出发,进行错因分析。
  3020. 4. 提供扩展题目。针对错误的题目,向用户提供同等水平的题目以起到举一反三的练习效果。
  3021. 5. 回答问题。当用户询问你某个【工具】的具体信息,这部分信息通常将就是学生的作业。你需要简单总结该部分信息,并就用户的问题进行回答。
  3022. ---
  3023. ## 做题信息
  3024. 学生名称:${_data.username}
  3025. ${_wordData}
  3026. `;
  3027. console.log(_msg);
  3028. // this.chatLoading = false;
  3029. // return;
  3030. let history = [];
  3031. this.nowChatList.forEach(i => {
  3032. if (i.content == "wanSearch") {
  3033. return;
  3034. } else if (i.content == "getImage") {
  3035. return history.push({
  3036. role: "assistant",
  3037. content: i.aiContent
  3038. });
  3039. }
  3040. if (i.content) {
  3041. history.push({
  3042. role: "user",
  3043. content: i.content
  3044. });
  3045. }
  3046. if (i.aiContent) {
  3047. history.push({
  3048. role: "assistant",
  3049. content: i.aiContent
  3050. });
  3051. }
  3052. });
  3053. // if (_msg) {
  3054. history.push({ role: "user", content: _msg });
  3055. let params = {
  3056. assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
  3057. userId: this.userid,
  3058. message: _text,
  3059. session_name: `${this.courseId}-studyStudent-md`,
  3060. uid: _uuid,
  3061. file_ids: this.fileId,
  3062. model: "gpt-4o-2024-11-20"
  3063. };
  3064. // let params = {
  3065. // model: "gpt-3.5-turbo",
  3066. // temperature: 0,
  3067. // max_tokens: 4096,
  3068. // top_p: 1,
  3069. // frequency_penalty: 0,
  3070. // presence_penalty: 0,
  3071. // messages: history,
  3072. // uid: _uuid,
  3073. // mind_map_question: _text
  3074. // };
  3075. // let params = {
  3076. // message: {
  3077. // anthropic_version: "bedrock-2023-05-31",
  3078. // max_tokens: 4096,
  3079. // temperature: 0,
  3080. // top_p: 1,
  3081. // messages: history
  3082. // },
  3083. // uid: _uuid,
  3084. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  3085. // };
  3086. this.ajax
  3087. // .post("https://gpt4.cocorobo.cn/chat", params)
  3088. // .post("https://claude3.cocorobo.cn/chat", params)
  3089. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  3090. .then(res => {
  3091. if (
  3092. converter(res.data.FunctionResponse.result) ==
  3093. converter("发送成功")
  3094. ) {
  3095. this.loading = false;
  3096. } else {
  3097. // this.$message.warning(res.data.FunctionResponse.result);
  3098. console.log(res.data.FunctionResponse.result);
  3099. this.chatLoading = false;
  3100. this.loading = false;
  3101. }
  3102. })
  3103. .catch(e => {
  3104. console.log(e);
  3105. this.chatLoading = false;
  3106. this.loading = false;
  3107. });
  3108. this.saveUid = _uuid;
  3109. // this.getAiContent(_uuid);
  3110. this.getAtAuContent(_uuid);
  3111. });
  3112. },
  3113. sumUpStudent2(_data) {
  3114. this.text += `${_data.username} 作业分析`;
  3115. let _msg = ``;
  3116. this.chatLoading = true;
  3117. let _uuid = uuidv4();
  3118. this.chatList.push({
  3119. role: "user",
  3120. content: `${this.text}`,
  3121. uid: _uuid,
  3122. AI: "AI",
  3123. aiContent: "",
  3124. oldContent: "",
  3125. isShowSynchronization: false,
  3126. filename: "",
  3127. index: this.chatList.length,
  3128. is_mind_map: false,
  3129. loading: true
  3130. });
  3131. this.text = "";
  3132. let _wordData = "";
  3133. let content = _data.content;
  3134. if (_data.type == 3) {
  3135. _wordData += `问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n\n`;
  3136. } else if (_data.type == 8) {
  3137. _wordData += `选择题:\n`;
  3138. let _json = content.testJson ? content.testJson.testJson : [];
  3139. _json.forEach((i2, index2) => {
  3140. _wordData += `题目:${i2.teststitle}\n选项:\n`;
  3141. i2.checkList.forEach((item, index) => {
  3142. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  3143. });
  3144. if (typeof i2.answer != "number") {
  3145. i2.answer.forEach(a => {
  3146. a += 1;
  3147. });
  3148. content.anwer[index2].forEach(b => {
  3149. b += 1;
  3150. });
  3151. _wordData += `答案:${i2.answer.join("、")}`;
  3152. _wordData += `学生选择:${content.anwer[index2].join("、")}\n\n`;
  3153. } else {
  3154. _wordData += `答案:${i2.answer + 1}`;
  3155. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  3156. }
  3157. });
  3158. _wordData;
  3159. } else if (_data.type == 2) {
  3160. _wordData += `问卷:${content.askJson.askTitle}\n`;
  3161. let _json = content.askJson ? content.askJson.askJson : [];
  3162. _json.forEach((i2, index2) => {
  3163. _wordData += `题目:${i2.askstitle}\n选项:\n`;
  3164. i2.checkList.forEach((item, index) => {
  3165. _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
  3166. });
  3167. if (typeof content.anwer[index2] != "number") {
  3168. _wordData += `学生选择:${content.anwer[index2].join("、")}\n\n`;
  3169. } else {
  3170. _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
  3171. }
  3172. });
  3173. }
  3174. // if(_data.type==3){
  3175. // _wordData+=`问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n`
  3176. // }else if(_data.type==8){
  3177. // _wordData+=`选择题:\n`
  3178. // content.testJson.testJson.forEach((i2,index2)=>{
  3179. // _wordData += `题目:${i2.teststitle}\n选项:\n`
  3180. // i2.checkList.forEach((item,index)=>{
  3181. // _wordData+=`${index+1}:${item}\n`
  3182. // })
  3183. // _wordData +=`答案:${i2.answer}`
  3184. // _wordData +=`学生选择:${(content.anwer[index2])+1}\n`
  3185. // })
  3186. // }
  3187. // console.log("👇👇👇")
  3188. // console.log(_wordData)
  3189. // this.chatLoading = false;
  3190. // this.loading = false;
  3191. // return
  3192. _msg = `
  3193. NOTICE
  3194. Language: ${this.getLang()}
  3195. ## 目的
  3196. 你是教师用户的课堂助手,你需要基于提供给你的课程相关信息以及学生的作业数据,就某些具体作业对全班学生进行总结分析。
  3197. ---
  3198. ## 定义
  3199. 给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
  3200. 【课程】:课程通常是一个完整的项目,有一个或多个阶段。
  3201. 【阶段】:阶段表示课程的某一单独部分,包含一个或多个任务。
  3202. 【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
  3203. 【工具】:工具通常是指学生的作业(在课上要具体做的事情)。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。工具中通常会包含学生的作业数据。
  3204. ---
  3205. ## 工作流程与规则
  3206. 1. 了解信息。读取【工具总览表格】以及【工具详情:总体数据】中的内容,了解学生作业详情。
  3207. 2. 确保信息的完整性和可解读性。当面对不确定信息时,你应当积极提问。这一点适用于以下两种情况:
  3208. 2.1 当用户的提问需要你对课程、任务或工具拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
  3209. 2.2 当你不理解某个工具的设置时(比如当你发现题目、选项的表述不完整或者有不符合中文表达规则的符号;又比如你发现缺乏必要的统计信息),你应当积极向用户询问。
  3210. 2.3 **例外情况**:在告知用户并征得同意的情况下,你可以忽视上述问题并执行后续流程。
  3211. 3. 进行总结。
  3212. 3.1 对表格信息进行简单总结。包括任务、阶段、工具及其内容。
  3213. 3.2 进行结果分析。对于每一个工具,都从全班的角度出发进行简单总结。
  3214. 3.3 进行错因分析。仅仅针对于某些错误率较高的题目,从全班的角度出发,进行错因分析。
  3215. 4. 提供扩展题目。针对错误的题目,向用户提供同等水平的题目以起到举一反三的练习效果。
  3216. 5. 回答问题。当用户询问你某个【工具】的具体信息,这部分信息通常将就是学生的作业。你需要简单总结该部分信息,并就用户的问题进行回答。
  3217. ---
  3218. ## 做题信息
  3219. 学生名称:${_data.username}
  3220. ${_wordData}
  3221. `;
  3222. console.log(_msg);
  3223. let history = [];
  3224. this.nowChatList.forEach(i => {
  3225. if (i.content == "wanSearch") {
  3226. return;
  3227. } else if (i.content == "getImage") {
  3228. return history.push({
  3229. role: "assistant",
  3230. content: i.aiContent
  3231. });
  3232. }
  3233. if (i.content) {
  3234. history.push({
  3235. role: "user",
  3236. content: i.content
  3237. });
  3238. }
  3239. if (i.aiContent) {
  3240. history.push({
  3241. role: "assistant",
  3242. content: i.aiContent
  3243. });
  3244. }
  3245. });
  3246. // if (_msg) {
  3247. history.push({ role: "user", content: _msg });
  3248. let params = {
  3249. assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
  3250. userId: this.userid,
  3251. message: _text,
  3252. session_name: `${this.courseId}-studyStudent-md`,
  3253. uid: _uuid,
  3254. file_ids: this.fileId,
  3255. model: "gpt-4o-2024-11-20"
  3256. };
  3257. // let params = {
  3258. // model: "gpt-3.5-turbo",
  3259. // temperature: 0,
  3260. // max_tokens: 4096,
  3261. // top_p: 1,
  3262. // frequency_penalty: 0,
  3263. // presence_penalty: 0,
  3264. // messages: history,
  3265. // uid: _uuid,
  3266. // mind_map_question: _text
  3267. // };
  3268. // let params = {
  3269. // message: {
  3270. // anthropic_version: "bedrock-2023-05-31",
  3271. // max_tokens: 4096,
  3272. // temperature: 0,
  3273. // top_p: 1,
  3274. // messages: history
  3275. // },
  3276. // uid: _uuid,
  3277. // model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
  3278. // };
  3279. this.ajax
  3280. // .post("https://gpt4.cocorobo.cn/chat", params)
  3281. // .post("https://claude3.cocorobo.cn/chat", params)
  3282. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
  3283. .then(res => {
  3284. if (
  3285. converter(res.data.FunctionResponse.result) == converter("发送成功")
  3286. ) {
  3287. } else {
  3288. // this.$message.warning(res.data.FunctionResponse.result);
  3289. console.log(res.data.FunctionResponse.result);
  3290. this.chatLoading = false;
  3291. }
  3292. })
  3293. .catch(e => {
  3294. console.log(e);
  3295. this.chatLoading = false;
  3296. });
  3297. this.saveUid = _uuid;
  3298. // this.getAiContent(_uuid);
  3299. this.getAtAuContent(_uuid);
  3300. },
  3301. download(_url) {
  3302. let xhr = new XMLHttpRequest();
  3303. xhr.open("GET", _url, true);
  3304. xhr.responseType = "blob";
  3305. xhr.onload = () => {
  3306. if (xhr.status === 200) {
  3307. let blob = xhr.response;
  3308. // const _blob = new Blob([blob], { type: fileType });
  3309. const downloadElement = document.createElement("a");
  3310. const url = window.URL.createObjectURL(blob);
  3311. downloadElement.href = url;
  3312. downloadElement.download = "Image.jpg";
  3313. downloadElement.click();
  3314. window.URL.revokeObjectURL(url); // 释放内存
  3315. } else {
  3316. this.$message.error("此图片不支持下载");
  3317. }
  3318. };
  3319. xhr.onerror = e => {
  3320. console.log(e);
  3321. this.$message.error("此图片不支持下载");
  3322. };
  3323. xhr.send();
  3324. },
  3325. removeMarkdown(text) {
  3326. return text
  3327. .replace(/[#*_~`>+\-]/g, "") // 移除 #、*、_、~、`、>、+、- 符号
  3328. .replace(/!\[.*?\]\(.*?\)/g, "") // 移除图片
  3329. .replace(/\[.*?\]\(.*?\)/g, "") // 移除链接
  3330. .replace(/```[\s\S]*?```/g, "") // 移除代码块(不使用 s 标志)
  3331. .replace(/`[^`]*`/g, "") // 移除行内代码
  3332. .replace(/\d+\./g, "") // 移除有序列表
  3333. .replace(/^\s*[-*+]\s+/gm, "") // 移除无序列表
  3334. .replace(/\s+/g, " ") // 将多个空白字符替换为一个空格
  3335. .trim(); // 去除字符串两端的空白字符
  3336. },
  3337. aiTalk(type = 0) {
  3338. //0 新的 1继续
  3339. if (type == 0 && this.aiIsTalk) {
  3340. let _talkTextIiframe2 = this.$refs.iiframe2;
  3341. try {
  3342. _talkTextIiframe2.contentWindow.pausesynthesizer();
  3343. _talkTextIiframe2.contentWindow.closesynthesizer();
  3344. this.aiIsTalk = false;
  3345. if (this.aiTalkList.length) this.aiTalk(0);
  3346. else this.aiTalkUid = "";
  3347. } catch (error) {
  3348. // console.log("error")
  3349. this.aiIsTalk = false;
  3350. if (this.aiTalkList.length) this.aiTalk(0);
  3351. else this.aiTalkUid = "";
  3352. }
  3353. } else {
  3354. let _text = this.aiTalkList.shift();
  3355. let _talkTextIiframe2 = this.$refs.iiframe2;
  3356. if (_text) {
  3357. this.aiIsTalk = true;
  3358. // console.log("👇说👇");
  3359. // console.log(_text);
  3360. _talkTextIiframe2.contentWindow.texttospeech(
  3361. _text,
  3362. () => {
  3363. this.aiTalk(1);
  3364. },
  3365. () => {
  3366. this.aiTalk(0);
  3367. }
  3368. );
  3369. } else {
  3370. try {
  3371. _talkTextIiframe2.contentWindow.closesynthesizer();
  3372. } catch (error) {
  3373. return;
  3374. }
  3375. }
  3376. }
  3377. // if(_text){
  3378. // this.aiIsTalk = true;
  3379. // }
  3380. },
  3381. changeMegaphone() {
  3382. this.$parent.changeMegaphone();
  3383. if (this.aiIsTalk) {
  3384. try {
  3385. this.aiTalkList = [];
  3386. let _talkTextIiframe2 = this.$refs.iiframe2;
  3387. _talkTextIiframe2.contentWindow.pausesynthesizer();
  3388. _talkTextIiframe2.contentWindow.closesynthesizer();
  3389. this.aiIsTalk = false;
  3390. } catch (error) {
  3391. this.aiTalkList = [];
  3392. this.aiIsTalk = false;
  3393. }
  3394. }
  3395. },
  3396. aiTalkAll(item) {
  3397. if (this.aiTalkUid == item.uid && this.aiIsTalk) {
  3398. try {
  3399. this.aiTalkList = [];
  3400. let _talkTextIiframe2 = this.$refs.iiframe2;
  3401. _talkTextIiframe2.contentWindow.pausesynthesizer();
  3402. _talkTextIiframe2.contentWindow.closesynthesizer();
  3403. this.aiIsTalk = false;
  3404. } catch (error) {
  3405. this.aiTalkList = [];
  3406. this.aiIsTalk = false;
  3407. }
  3408. } else {
  3409. let _resultText = this.removeMarkdown(item.aiContent);
  3410. this.aiTalkUid = item.uid;
  3411. this.aiTalkList = [];
  3412. this.aiTalkList.push(_resultText);
  3413. this.aiTalk(0);
  3414. }
  3415. },
  3416. choseRole(item) {
  3417. if (
  3418. this.choseRoleItem &&
  3419. this.choseRoleItem.assistant_id == item.assistant_id
  3420. ) {
  3421. return (this.choseRoleItem = null);
  3422. }
  3423. this.choseRoleItem = item;
  3424. this.changeRole();
  3425. console.log("选择角色", this.choseRoleItem);
  3426. // this.scrollBottom();
  3427. },
  3428. noChangeRole() {
  3429. this.cardType = 0;
  3430. this.choseRoleItem = null;
  3431. this.scrollBottom();
  3432. },
  3433. changeRole() {
  3434. this.cardType = 0;
  3435. if (this.choseRoleItem && this.choseRoleItem.assistant_id) {
  3436. this.chatList = [];
  3437. this.nowChatList = [];
  3438. let _uuid = uuidv4();
  3439. this.chatList.push({
  3440. role: "user",
  3441. content: `您好,${this.choseRoleItem.assistantName}`,
  3442. uid: _uuid,
  3443. AI: "AI",
  3444. aiContent: this.choseRoleItem.prologue
  3445. ? this.choseRoleItem.prologue
  3446. : "您好,有什么需要我帮忙的吗?",
  3447. oldContent: "",
  3448. isShowSynchronization: false,
  3449. filename: this.choseRoleItem.headUrl,
  3450. index: this.chatList.length,
  3451. is_mind_map: false,
  3452. loading: false
  3453. });
  3454. this.scrollBottom();
  3455. this.insertMemorandum(
  3456. `选择智能体<span class="variable">${this.choseRoleItem.assistantName}</span>`
  3457. );
  3458. }
  3459. },
  3460. optBtn(val) {
  3461. this.sortOption = val;
  3462. },
  3463. getRoleList() {
  3464. this.roleList = [];
  3465. let params = {
  3466. userId: this.userid
  3467. };
  3468. this.ajax
  3469. .post("https://gpt4.cocorobo.cn/get_ai_agent_assistant_list", params)
  3470. .then(res => {
  3471. let _data = res.data.FunctionResponse.result;
  3472. if (_data.length == 0) return;
  3473. if (_data) {
  3474. this.roleList = JSON.parse(_data);
  3475. }
  3476. })
  3477. .catch(e => {
  3478. console.log("获取角色列表失败");
  3479. this.roleList = [];
  3480. });
  3481. },
  3482. getPublicRoleList() {
  3483. this.roleList2 = [];
  3484. let params = {
  3485. userId: this.userid,
  3486. // organizeid: this.org,
  3487. organizeid: "45facc0a-1211-11ec-80ad-005056b86db5"
  3488. };
  3489. this.ajax
  3490. .post(
  3491. "https://gpt4.cocorobo.cn/get_ai_agent_assistant_share_list",
  3492. params
  3493. )
  3494. .then(res => {
  3495. let _data = res.data.FunctionResponse.result;
  3496. if (_data.length == 0) return;
  3497. if (_data) {
  3498. this.roleList2 = JSON.parse(_data);
  3499. }
  3500. })
  3501. .catch(e => {
  3502. this.roleList2 = [];
  3503. console.log("获取公共角色失败", e);
  3504. });
  3505. },
  3506. choiceRole() {
  3507. if (this.loading) return this.$message.info("请稍等");
  3508. this.cardType = this.cardType == 1 ? 0 : 1;
  3509. },
  3510. setCursorToEnd(event) {
  3511. // 获取输入框的原生 DOM 元素
  3512. const inputElement = event.target;
  3513. // 将光标设置到输入框内容的末尾
  3514. inputElement.setSelectionRange(this.text.length, this.text.length);
  3515. },
  3516. getLang(){
  3517. let lang = ''
  3518. if(this.languageSetting == 0){
  3519. lang = 'Chinese.'
  3520. }else if(this.languageSetting == 1){
  3521. lang = 'Traditional Chinese.'
  3522. }else if(this.languageSetting == 2){
  3523. lang = 'English.'
  3524. }
  3525. return lang
  3526. },
  3527. },
  3528. mounted() {
  3529. this.getChatList().then(_ => {
  3530. this.scrollBottom();
  3531. this.getWantSearch();
  3532. });
  3533. this.nowChatList = [];
  3534. this.sendType = 0;
  3535. this.initTaskList();
  3536. this.getWorkData();
  3537. this.getPublicRoleList();
  3538. this.getRoleList();
  3539. this.insertMemorandum(`打开<span class="btn">对话</span>面板`);
  3540. let setting = this.courseDetail.setting;
  3541. if(setting){
  3542. setting = JSON.parse(setting);
  3543. if(setting.languageSetting){
  3544. this.languageSetting = setting.languageSetting;
  3545. }
  3546. }
  3547. }
  3548. };
  3549. </script>
  3550. <style scoped>
  3551. .search {
  3552. width: 100%;
  3553. height: 100%;
  3554. box-sizing: border-box;
  3555. position: relative;
  3556. display: flex;
  3557. flex-direction: column;
  3558. justify-content: flex-end;
  3559. }
  3560. .checkboxCss {
  3561. color: #fff;
  3562. background-color: #76a7f5 !important;
  3563. }
  3564. .imgNumberBlock {
  3565. width: 100%;
  3566. height: 30px;
  3567. display: flex;
  3568. justify-content: space-between;
  3569. box-sizing: border-box;
  3570. /* padding: 5px 10px; */
  3571. }
  3572. .imgNumberBlock > .imgNumber {
  3573. width: 18%;
  3574. height: 30px;
  3575. white-space: initial;
  3576. background: rgba(224, 234, 251, 1);
  3577. border-radius: 5px;
  3578. display: flex;
  3579. align-items: center;
  3580. cursor: pointer;
  3581. justify-content: center;
  3582. }
  3583. .s_top {
  3584. width: 100%;
  3585. height: calc(100% - 56px);
  3586. overflow-x: hidden;
  3587. box-sizing: border-box;
  3588. padding: 20px 0;
  3589. position: absolute;
  3590. padding-bottom: 70px;
  3591. top: 0;
  3592. }
  3593. .s_t_chat {
  3594. width: 100%;
  3595. display: flex;
  3596. box-sizing: border-box;
  3597. padding: 10px;
  3598. flex-direction: column;
  3599. }
  3600. .s_t_chat > div {
  3601. display: flex;
  3602. align-items: flex-start;
  3603. width: 100%;
  3604. }
  3605. .s_t_c_user {
  3606. box-sizing: border-box;
  3607. padding-left: 35px;
  3608. }
  3609. .s_t_c_u_left {
  3610. width: 90%;
  3611. height: auto;
  3612. }
  3613. .s_t_c_u_l_content {
  3614. width: auto;
  3615. max-width: 100%;
  3616. height: auto;
  3617. box-sizing: border-box;
  3618. padding: 15px 10px;
  3619. color: white;
  3620. background-color: #3681fc;
  3621. border-radius: 8px 2px 8px 8px;
  3622. white-space: pre-line;
  3623. word-break: break-all;
  3624. }
  3625. .s_t_c_a_r_contentImage > span {
  3626. display: block;
  3627. }
  3628. .s_t_c_a_r_contentImage > img {
  3629. width: 45%;
  3630. height: 125px;
  3631. margin: 1% 1.5%;
  3632. border-radius: 5px;
  3633. cursor: pointer;
  3634. }
  3635. .s_t_c_a_r_contentImage {
  3636. width: auto;
  3637. max-width: 100%;
  3638. height: auto;
  3639. box-sizing: border-box;
  3640. padding: 15px 10px;
  3641. background-color: #f6f8ff;
  3642. border-radius: 2px 8px 8px 8px;
  3643. white-space: pre-line;
  3644. word-break: break-all;
  3645. }
  3646. .s_t_c_u_l_time {
  3647. width: 100%;
  3648. display: flex;
  3649. justify-content: flex-end;
  3650. font-size: 12px;
  3651. color: #9f9f9f;
  3652. margin-top: 5px;
  3653. }
  3654. .s_t_c_u_right {
  3655. width: 35px;
  3656. height: 35px;
  3657. display: flex;
  3658. justify-content: center;
  3659. margin-left: 5px;
  3660. }
  3661. .s_t_c_u_right > span {
  3662. width: 32px;
  3663. height: 32px;
  3664. display: flex;
  3665. justify-content: center;
  3666. align-items: center;
  3667. color: white;
  3668. background-color: #3681fc;
  3669. border-radius: 50%;
  3670. }
  3671. .s_t_c_ai {
  3672. box-sizing: border-box;
  3673. padding-right: 35px;
  3674. position: relative;
  3675. margin-top: 10px;
  3676. }
  3677. .aiCopy {
  3678. position: absolute;
  3679. right: -35px;
  3680. bottom: 0%;
  3681. display: flex;
  3682. flex-direction: column;
  3683. justify-content: center;
  3684. align-items: center;
  3685. /* transform: translate(0, -30%); */
  3686. }
  3687. .aiCopy > img {
  3688. margin-right: 5px;
  3689. cursor: pointer;
  3690. }
  3691. .aiCopy > svg {
  3692. margin-right: 6px;
  3693. cursor: pointer;
  3694. }
  3695. .s_t_c_a_right {
  3696. min-width: 90%;
  3697. height: auto;
  3698. position: relative;
  3699. }
  3700. .s_t_c_a_r_content {
  3701. width: auto;
  3702. max-width: 100%;
  3703. height: auto;
  3704. box-sizing: border-box;
  3705. padding: 10px;
  3706. background-color: #f6f8ff;
  3707. border-radius: 2px 8px 8px 8px;
  3708. /* white-space: pre-line; */
  3709. word-break: break-all;
  3710. }
  3711. .s_t_c_a_r_content >>> ul {
  3712. margin-left: 20px;
  3713. }
  3714. .s_t_c_a_r_content >>> li{
  3715. margin: 1.5em 0;
  3716. }
  3717. /* .s_t_c_a_r_content>>> ol{
  3718. margin-left: 20px;
  3719. } */
  3720. .s_t_c_a_r_content2 {
  3721. background-color: #f6f8ff;
  3722. width: 100%;
  3723. height: auto;
  3724. box-sizing: border-box;
  3725. padding: 10px;
  3726. border-radius: 2px 8px 8px 8px;
  3727. box-shadow: 0 0px 10px #c5cbee;
  3728. }
  3729. .s_t_c_a_r_c_title {
  3730. display: flex;
  3731. align-items: center;
  3732. }
  3733. .s_t_c_a_r_c_title > img {
  3734. width: 16px;
  3735. height: 16px;
  3736. }
  3737. .s_t_c_a_r_c_item {
  3738. width: 100%;
  3739. height: auto;
  3740. box-sizing: border-box;
  3741. padding: 10px;
  3742. background-color: #ffffff;
  3743. border-radius: 5px;
  3744. margin-top: 10px;
  3745. color: #666666;
  3746. font-size: 14px;
  3747. cursor: pointer;
  3748. border: solid #ffffff 1px;
  3749. box-shadow: 0 0 5px 2px #ffffff;
  3750. }
  3751. .s_t_c_a_r_c_item:hover {
  3752. border: solid #b8d2fe 1px;
  3753. box-shadow: 0 0 5px 2px #b8d2fe;
  3754. }
  3755. .s_t_c_a_r_c_title > span {
  3756. font-weight: bold;
  3757. }
  3758. .s_t_c_a_r_time {
  3759. width: 100%;
  3760. display: flex;
  3761. justify-content: flex-start;
  3762. font-size: 12px;
  3763. color: #9f9f9f;
  3764. margin-top: 5px;
  3765. }
  3766. .s_t_c_a_left {
  3767. width: 35px;
  3768. height: 35px;
  3769. display: flex;
  3770. justify-content: center;
  3771. margin-right: 5px;
  3772. }
  3773. .s_t_c_a_left > img {
  3774. width: 35px;
  3775. height: 35px;
  3776. border-radius: 50%;
  3777. }
  3778. .s_t_c_a_left > span {
  3779. width: 32px;
  3780. height: 32px;
  3781. display: flex;
  3782. justify-content: center;
  3783. align-items: center;
  3784. color: white;
  3785. background-color: #3681fc;
  3786. border-radius: 50%;
  3787. }
  3788. .s_bottom {
  3789. width: 100%;
  3790. height: 130px;
  3791. display: flex;
  3792. flex-direction: column;
  3793. justify-content: flex-end;
  3794. position: relative;
  3795. }
  3796. .s_b_btnAreaTop {
  3797. width: 100%;
  3798. height: 35px;
  3799. margin-bottom: 5px;
  3800. display: flex;
  3801. align-items: center;
  3802. box-sizing: border-box;
  3803. padding: 0 10px;
  3804. /* overflow: auto; */
  3805. display: flex;
  3806. justify-content: space-between;
  3807. }
  3808. .s_b_bat_left {
  3809. width: auto;
  3810. height: 100%;
  3811. display: flex;
  3812. align-items: flex-end;
  3813. }
  3814. .s_b_bat_left > img {
  3815. width: 25px;
  3816. height: 25px;
  3817. cursor: pointer;
  3818. margin-right: 5px;
  3819. }
  3820. .s_b_bat_left > span {
  3821. padding: 3px 10px;
  3822. background: #fff;
  3823. box-shadow: 0px 2px 5px 0px #1d398314;
  3824. box-shadow: 0.5px 0.5px 10px 2px #1d39830d;
  3825. border: 0.5px solid #e0eafb;
  3826. border-radius: 50px;
  3827. cursor: pointer;
  3828. display: flex;
  3829. justify-content: center;
  3830. align-items: center;
  3831. margin-right: 15px;
  3832. }
  3833. .s_b_bat_left > span > svg {
  3834. width: 20px;
  3835. height: 20px;
  3836. }
  3837. .s_b_bat_right {
  3838. position: relative;
  3839. }
  3840. .s_b_bat_right > span {
  3841. padding: 3px 10px;
  3842. background: #fff;
  3843. box-shadow: 0px 2px 5px 0px #1d398314;
  3844. box-shadow: 0.5px 0.5px 10px 2px #1d39830d;
  3845. border: 0.5px solid #e0eafb;
  3846. border-radius: 50px;
  3847. margin-left: 15px;
  3848. display: flex;
  3849. justify-content: center;
  3850. align-items: center;
  3851. cursor: pointer;
  3852. position: relative;
  3853. }
  3854. .s_b_bat_right > span > svg {
  3855. width: 20px;
  3856. height: 20px;
  3857. }
  3858. .s_b_bat_right {
  3859. width: auto;
  3860. height: 100%;
  3861. display: flex;
  3862. align-items: flex-end;
  3863. }
  3864. .s_b_bat_right > img {
  3865. width: 25px;
  3866. height: 25px;
  3867. /* cursor: pointer; */
  3868. margin-right: 5px;
  3869. }
  3870. .tips {
  3871. width: 380px;
  3872. position: absolute;
  3873. bottom: 0;
  3874. right: 0;
  3875. box-sizing: border-box;
  3876. padding:20px 15px 12px 15px;
  3877. border-radius: 8px;
  3878. background: #ffffff;
  3879. border: 1px solid #f0f2f5;
  3880. display: flex;
  3881. flex-direction: column;
  3882. justify-content: space-between;
  3883. box-shadow: 0px 8px 10px -5px #00000014;
  3884. box-shadow: 0px 16px 24px 2px #0000000a;
  3885. box-shadow: 0px 6px 30px 5px #0000000d;
  3886. z-index: 2001;
  3887. }
  3888. .tipsList{
  3889. width: 100%;
  3890. height: auto;
  3891. }
  3892. .tipsList>div{
  3893. margin-bottom:20px;
  3894. width: 100%;
  3895. height: auto;
  3896. }
  3897. .tipsBottom {
  3898. width: 100%;
  3899. height: auto;
  3900. display: flex;
  3901. justify-content: flex-end;
  3902. }
  3903. .tipsBottom>div{
  3904. display: flex;
  3905. justify-content: center;
  3906. align-items: center;
  3907. cursor: pointer;
  3908. }
  3909. .tipsBottom>div>span{
  3910. margin: 0 5px
  3911. }
  3912. .s_b_btnArea {
  3913. width: 100%;
  3914. height: 30px;
  3915. display: flex;
  3916. align-items: center;
  3917. box-sizing: border-box;
  3918. padding: 0 10px;
  3919. overflow: auto;
  3920. margin-bottom: 5px;
  3921. }
  3922. .s_b_ba-item {
  3923. width: auto;
  3924. box-sizing: border-box;
  3925. padding: 0 10px;
  3926. height: 25px;
  3927. background-color: white;
  3928. display: flex;
  3929. justify-content: center;
  3930. align-items: center;
  3931. /* 阴影 */
  3932. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
  3933. border-radius: 15px;
  3934. font-size: 14px;
  3935. cursor: pointer;
  3936. margin-right: 10px;
  3937. white-space: nowrap;
  3938. }
  3939. .s_b_ba_active {
  3940. background-color: #3781fc;
  3941. color: #fff;
  3942. }
  3943. .s_b_inputArea {
  3944. width: 100%;
  3945. height: 55px;
  3946. box-sizing: border-box;
  3947. border-top: solid 1px #ededed;
  3948. display: flex;
  3949. justify-content: space-between;
  3950. align-items: center;
  3951. padding-right: 10px;
  3952. }
  3953. .s_b_tape {
  3954. width: 35px;
  3955. height: 35px;
  3956. background: url("../../../assets/icon/course/tape.png") no-repeat;
  3957. background-size: 50% 60%;
  3958. background-position: center;
  3959. cursor: pointer;
  3960. }
  3961. .s_b_input {
  3962. /* width: 65%; */
  3963. flex: 1;
  3964. height: 40px;
  3965. background-color: #f3f3f3;
  3966. border-radius: 50px;
  3967. margin: 0 10px;
  3968. display: flex;
  3969. align-items: center;
  3970. overflow: hidden;
  3971. }
  3972. .s_b_i_left {
  3973. width: 100%;
  3974. line-height: 45px;
  3975. height: 100%;
  3976. display: flex;
  3977. align-items: center;
  3978. }
  3979. .s_b_recorded {
  3980. width: 100%;
  3981. height: 100%;
  3982. display: flex;
  3983. justify-content: center;
  3984. align-items: center;
  3985. color: #00000066;
  3986. cursor: pointer;
  3987. }
  3988. .s_b_i_left >>> .el-input__inner {
  3989. border: none;
  3990. background-color: #f3f3f3;
  3991. outline: none;
  3992. border-radius: 50px 0 0 50px;
  3993. }
  3994. .s_b_i_right {
  3995. width: 45px;
  3996. height: 45px;
  3997. display: flex;
  3998. justify-content: center;
  3999. align-items: center;
  4000. }
  4001. .s_b_i_right > span {
  4002. width: 35px;
  4003. height: 35px;
  4004. background: url("../../../assets/icon/course/file.png") no-repeat;
  4005. background-size: 50% 60%;
  4006. background-position: center;
  4007. cursor: pointer;
  4008. }
  4009. .voice_or_keyboard {
  4010. width: 35px;
  4011. height: 35px;
  4012. margin-right: 10px;
  4013. }
  4014. .voice_or_keyboard > img {
  4015. width: 100%;
  4016. height: 100%;
  4017. cursor: pointer;
  4018. }
  4019. .s_b_btn {
  4020. width: 40px;
  4021. height: 40px;
  4022. background-color: #3681fc;
  4023. display: flex;
  4024. justify-content: center;
  4025. align-items: center;
  4026. border-radius: 50%;
  4027. cursor: pointer;
  4028. }
  4029. .s_b_btn > div {
  4030. width: 100%;
  4031. height: 100%;
  4032. display: flex;
  4033. justify-content: center;
  4034. align-items: center;
  4035. color: #fff;
  4036. }
  4037. .s_b_btn > span {
  4038. width: 30px;
  4039. height: 30px;
  4040. background: url("../../../assets/icon/course/send.png") no-repeat;
  4041. background-size: 70% 70%;
  4042. background-position: center;
  4043. }
  4044. .s_b_btn > img {
  4045. width: 30px;
  4046. height: 30px;
  4047. }
  4048. .s_b_btn2 {
  4049. width: 40px;
  4050. height: 40px;
  4051. background-color: #fff;
  4052. display: flex;
  4053. justify-content: center;
  4054. align-items: center;
  4055. border-radius: 50%;
  4056. cursor: pointer;
  4057. box-sizing: 0 0 2px 2px gray;
  4058. margin-left: 10px;
  4059. }
  4060. .s_b_btn2 > img {
  4061. width: 30px;
  4062. height: 30px;
  4063. }
  4064. .s_b_atBox {
  4065. width: 95%;
  4066. height: 450px;
  4067. position: absolute;
  4068. bottom: calc(100% - 30px);
  4069. left: 0;
  4070. max-height: 450px;
  4071. box-sizing: border-box;
  4072. border: solid 1px #d8d8d8;
  4073. box-shadow: 0 4px 4px 0 #00000040;
  4074. margin-left: 1.5%;
  4075. background-color: #fff;
  4076. }
  4077. .s_b_at_tag {
  4078. width: 100%;
  4079. height: 35px;
  4080. border-bottom: 1px solid #d8d8d8;
  4081. display: flex;
  4082. align-items: center;
  4083. padding: 0 10px;
  4084. box-sizing: border-box;
  4085. position: relative;
  4086. }
  4087. .s_b_at_tag > span {
  4088. margin: 0 10px;
  4089. font-weight: bold;
  4090. cursor: pointer;
  4091. transition: 0.1s;
  4092. position: relative;
  4093. }
  4094. .s_b_at_tag_active {
  4095. color: #3681fc;
  4096. }
  4097. .s_b_at_tag_active::after {
  4098. content: "";
  4099. width: 100%;
  4100. height: 3px;
  4101. border-radius: 3px;
  4102. bottom: -8px;
  4103. left: 0px;
  4104. background-color: #3681fc;
  4105. position: absolute;
  4106. }
  4107. .s_b_at_list {
  4108. width: 100%;
  4109. max-height: calc(100% - 35px);
  4110. overflow: auto;
  4111. box-sizing: border-box;
  4112. padding: 10px;
  4113. }
  4114. .s_b_at_l_top {
  4115. width: 100%;
  4116. box-sizing: border-box;
  4117. padding: 12px 10px;
  4118. height: 30px;
  4119. display: flex;
  4120. align-items: center;
  4121. justify-content: space-between;
  4122. margin: 10px 0;
  4123. border-radius: 5px;
  4124. cursor: pointer;
  4125. font-size: 16px;
  4126. border-bottom: solid 1px #e2f5fc;
  4127. }
  4128. .s_b_at_l_top > span:nth-child(1) {
  4129. display: block;
  4130. width: calc(100% - 30px);
  4131. overflow: hidden;
  4132. text-overflow: ellipsis;
  4133. white-space: nowrap;
  4134. }
  4135. .s_b_at_l_i_header {
  4136. width: 100%;
  4137. box-sizing: border-box;
  4138. padding: 10px 10px;
  4139. height: 30px;
  4140. display: flex;
  4141. align-items: center;
  4142. margin: 10px 0;
  4143. border-radius: 5px;
  4144. cursor: pointer;
  4145. font-size: 16px;
  4146. }
  4147. .s_b_at_l_i_header > span:nth-child(2) {
  4148. display: block;
  4149. width: calc(100% - 30px);
  4150. overflow: hidden;
  4151. text-overflow: ellipsis;
  4152. white-space: nowrap;
  4153. }
  4154. .s_b_at_l_top > hover {
  4155. background-color: #3781fc;
  4156. color: #fff;
  4157. }
  4158. .s_b_at_l_top > hover > .s_b_at_l_i_h_icon1 {
  4159. background-image: url("../../../assets/icon/course/bDown2.png");
  4160. }
  4161. .s_b_at_l_i_header:hover {
  4162. background-color: #3781fc;
  4163. color: #fff;
  4164. }
  4165. .s_b_at_l_i_header:hover > .s_b_at_l_i_h_icon1 {
  4166. background-image: url("../../../assets/icon/course/bDown2.png");
  4167. }
  4168. .s_b_at_l_i_header:hover > .s_b_at_l_i_h_icon2 {
  4169. background-color: #fff;
  4170. }
  4171. .s_b_at_l_i_h_icon1 {
  4172. min-width: 15px;
  4173. min-height: 15px;
  4174. background-image: url("../../../assets/icon/course/down.png");
  4175. background-repeat: no-repeat;
  4176. background-size: 100% 100%;
  4177. /* transform: rotate(90deg); */
  4178. margin-right: 10px;
  4179. transition: 0.2s;
  4180. }
  4181. .s_b_at_l_i_h_icon2 {
  4182. min-width: 10px;
  4183. min-height: 10px;
  4184. background-color: #3681fc;
  4185. border-radius: 50%;
  4186. margin-right: 15px;
  4187. transition: 0.2s;
  4188. }
  4189. .s_b_at_l_i_content {
  4190. width: 100%;
  4191. box-sizing: border-box;
  4192. padding: 8px 35px;
  4193. height: 25;
  4194. display: flex;
  4195. align-items: center;
  4196. margin: 5px 0;
  4197. border-radius: 5px;
  4198. cursor: pointer;
  4199. font-size: 14px;
  4200. }
  4201. .s_b_at_l_i_content:hover {
  4202. background-color: #3781fc;
  4203. color: #fff;
  4204. }
  4205. .s_b_ab_user {
  4206. width: 100%;
  4207. height: 100px;
  4208. box-sizing: border-box;
  4209. border: solid 1px #3781fc;
  4210. display: flex;
  4211. justify-content: center;
  4212. align-items: center;
  4213. position: relative;
  4214. margin-bottom: 20px;
  4215. }
  4216. .s_b_ab_u_name {
  4217. width: 25%;
  4218. max-width: 25%;
  4219. box-sizing: border-box;
  4220. margin: 0 20px;
  4221. padding: 5px 10px;
  4222. display: flex;
  4223. justify-content: center;
  4224. align-items: center;
  4225. border: solid 1px #3781fc;
  4226. border-radius: 2px;
  4227. }
  4228. .s_b_ab_u_name > span {
  4229. max-width: 100%;
  4230. overflow: hidden;
  4231. text-overflow: ellipsis;
  4232. white-space: nowrap;
  4233. display: block;
  4234. font-size: 14px;
  4235. color: #3681fc;
  4236. }
  4237. .s_b_ab_u_message {
  4238. flex: 1;
  4239. height: 100%;
  4240. display: flex;
  4241. flex-direction: column;
  4242. justify-content: center;
  4243. box-sizing: border-box;
  4244. padding-top: 10px;
  4245. padding-right: 10px;
  4246. }
  4247. .s_b_ab_u_message > span {
  4248. font-size: 16px;
  4249. font-weight: bold;
  4250. display: flex;
  4251. align-items: flex-end;
  4252. flex: 1;
  4253. }
  4254. .s_b_ab_u_message > div {
  4255. width: 100%;
  4256. display: flex;
  4257. justify-content: space-between;
  4258. align-items: center;
  4259. font-size: 16px;
  4260. font-weight: bold;
  4261. flex: 1;
  4262. }
  4263. .s_b_ab_u_btnArea {
  4264. width: auto;
  4265. height: auto;
  4266. position: absolute;
  4267. right: 0;
  4268. top: 5px;
  4269. }
  4270. .s_b_ab_u_btnArea > span {
  4271. box-sizing: border-box;
  4272. color: #3681fc;
  4273. border: solid 1px #3681fc;
  4274. padding: 2px;
  4275. margin-left: 2px;
  4276. font-size: 14px;
  4277. cursor: pointer;
  4278. }
  4279. .s_b_ab_u_btnArea > span:hover {
  4280. color: #fff;
  4281. border: solid 1px #fff;
  4282. background-color: #3681fc;
  4283. }
  4284. .s_b_at_studentDetail {
  4285. width: 100%;
  4286. height: 25px;
  4287. margin: 0 0 10px 0;
  4288. display: flex;
  4289. align-items: center;
  4290. }
  4291. .s_b_at_studentDetail > img {
  4292. width: 20px;
  4293. height: 15px;
  4294. margin-right: 10px;
  4295. cursor: pointer;
  4296. }
  4297. .s_b_at_studentDetail > span {
  4298. font-weight: bold;
  4299. }
  4300. .s_b_at_studentList {
  4301. width: 100%;
  4302. height: calc(100% - 25px);
  4303. overflow: auto;
  4304. }
  4305. .s_b_at_sl_item {
  4306. width: 100%;
  4307. height: auto;
  4308. box-sizing: border-box;
  4309. border: solid 1px #36a9fc;
  4310. padding: 10px;
  4311. margin-bottom: 10px;
  4312. cursor: pointer;
  4313. }
  4314. .s_b_at_sl_item > .s_b_at_sl_message:nth-child(n + 1) {
  4315. margin-top: 10px;
  4316. }
  4317. .s_b_at_sl_phase {
  4318. width: 100%;
  4319. display: flex;
  4320. justify-content: flex-end;
  4321. margin-bottom: 10px;
  4322. margin-right: 10px;
  4323. font-size: 14px;
  4324. font-weight: bold;
  4325. }
  4326. .s_b_at_sl_message {
  4327. font-weight: bold;
  4328. margin: 10px;
  4329. }
  4330. .s_b_at_sl_message > div {
  4331. display: flex;
  4332. width: 100%;
  4333. margin: 10px;
  4334. }
  4335. .s_b_at_sl_message > div > span {
  4336. width: calc(100% - 50px);
  4337. text-overflow: ellipsis;
  4338. overflow: hidden;
  4339. white-space: nowrap;
  4340. display: block;
  4341. }
  4342. .s_b_at_sl_message > div > span > div {
  4343. margin: 5px 0;
  4344. white-space: wrap;
  4345. }
  4346. .s_t_addAsk {
  4347. width: 100%;
  4348. height: auto;
  4349. padding: 10px 20px;
  4350. display: flex;
  4351. flex-direction: column;
  4352. justify-content: center;
  4353. align-items: center;
  4354. box-sizing: border-box;
  4355. }
  4356. .s_t_addAsk > span {
  4357. box-sizing: border-box;
  4358. width: auto;
  4359. height: auto;
  4360. padding: 15px;
  4361. margin-bottom: 10px;
  4362. background-color: #f5f6f7;
  4363. border-radius: 10px;
  4364. cursor: pointer;
  4365. border: solid 1px #e8e9ec;
  4366. transition: 0.3s;
  4367. }
  4368. .s_t_addAsk > span:hover {
  4369. background-color: #e8e9ec;
  4370. }
  4371. .d_t_c_a_r_c_img:hover .download_image {
  4372. display: block;
  4373. }
  4374. .download_image {
  4375. position: absolute;
  4376. display: none;
  4377. right: 5px;
  4378. bottom: 5px;
  4379. width: 30px;
  4380. height: 30px;
  4381. cursor: pointer;
  4382. }
  4383. .download_image > img {
  4384. width: 100%;
  4385. height: 100%;
  4386. }
  4387. .choiceTopArea {
  4388. width: 100%;
  4389. display: flex;
  4390. flex-direction: column;
  4391. justify-content: space-between;
  4392. height: calc(100% - 130px);
  4393. }
  4394. .choiceTop {
  4395. width: 100%;
  4396. height: 100%;
  4397. overflow-x: hidden;
  4398. box-sizing: border-box;
  4399. display: flex;
  4400. flex-direction: column;
  4401. justify-content: space-between;
  4402. padding: 10px;
  4403. position: relative;
  4404. bottom: -76px;
  4405. padding-bottom: 30px;
  4406. background: linear-gradient(
  4407. 180deg,
  4408. rgba(255, 255, 255, 0) 0%,
  4409. rgba(54, 129, 252, 0.6) 100%
  4410. );
  4411. }
  4412. .choiceBottom {
  4413. width: 100%;
  4414. height: 5%;
  4415. display: flex;
  4416. align-items: center;
  4417. justify-content: flex-end;
  4418. }
  4419. .cb_btn {
  4420. margin: 0 10px;
  4421. }
  4422. .choiceRoleHeader {
  4423. width: 100%;
  4424. height: 100px;
  4425. display: flex;
  4426. /* margin: 10px; */
  4427. }
  4428. .choiceRoleHeader > div {
  4429. display: flex;
  4430. }
  4431. .choiceSelect {
  4432. width: 100%;
  4433. height: calc(50%);
  4434. display: flex;
  4435. flex-direction: column;
  4436. justify-content: flex-end;
  4437. align-items: center;
  4438. padding: 10px;
  4439. box-sizing: border-box;
  4440. border-radius: 10px;
  4441. }
  4442. .cs_type {
  4443. width: 100%;
  4444. height: 40px;
  4445. display: flex;
  4446. justify-content: flex-start;
  4447. overflow-y: hidden;
  4448. align-items: center;
  4449. }
  4450. .cs_type > span {
  4451. width: auto;
  4452. height: 100%;
  4453. padding: 0 10px;
  4454. display: flex;
  4455. justify-content: center;
  4456. align-items: center;
  4457. cursor: pointer;
  4458. position: relative;
  4459. transition: 0.2s;
  4460. }
  4461. .cs_typeActive {
  4462. font-weight: bold;
  4463. }
  4464. .cs_typeActive::after {
  4465. content: "";
  4466. width: 100%;
  4467. height: 4px;
  4468. background-color: #3681fc;
  4469. position: absolute;
  4470. bottom: 0;
  4471. left: 0;
  4472. }
  4473. .cs_box {
  4474. width: 100%;
  4475. height: calc(100% - 40px);
  4476. overflow-x: hidden;
  4477. box-sizing: border-box;
  4478. }
  4479. .cs_b_item {
  4480. width: 110px;
  4481. height: 150px;
  4482. border-radius: 8px;
  4483. background-color: #ffffffe5;
  4484. box-sizing: border-box;
  4485. border: solid 1px #ffffffe5;
  4486. display: flex;
  4487. flex-direction: column;
  4488. align-items: center;
  4489. justify-content: center;
  4490. float: left;
  4491. margin: 5px 0;
  4492. cursor: pointer;
  4493. transition: 0.2s;
  4494. }
  4495. .cs_b_i_avatar {
  4496. width: 50px;
  4497. height: 50px;
  4498. display: flex;
  4499. justify-content: center;
  4500. align-items: center;
  4501. background-color: #ffffffe5;
  4502. border-radius: 8px;
  4503. }
  4504. .cs_b_item:hover {
  4505. border-color: #3681fc;
  4506. }
  4507. .cs_b_i_name {
  4508. font-weight: bold;
  4509. color: #768196;
  4510. font-size: 14px;
  4511. }
  4512. .cs_b_i_des {
  4513. color: #768196;
  4514. margin-top: 5px;
  4515. font-size: 12px;
  4516. }
  4517. .cs_box > .cs_b_item:nth-of-type(3n + 2) {
  4518. margin: 5px 8px;
  4519. }
  4520. .cs_b_itemActive {
  4521. background: #e0eafb !important;
  4522. border-color: #3681fc;
  4523. }
  4524. .cs_b_itemActive > .cs_b_i_name {
  4525. color: black;
  4526. }
  4527. .cs_b_item > div {
  4528. margin-top: 10px;
  4529. white-space: nowrap;
  4530. width: 95%;
  4531. overflow: hidden;
  4532. text-align: center;
  4533. text-overflow: ellipsis;
  4534. }
  4535. .choiceSelect > .option {
  4536. width: 80px;
  4537. height: 100%;
  4538. border-radius: 5px;
  4539. margin-right: 10px;
  4540. display: flex;
  4541. justify-content: center;
  4542. align-items: center;
  4543. cursor: pointer;
  4544. }
  4545. .roleInput {
  4546. width: 100%;
  4547. height: 50px;
  4548. }
  4549. .roleBtn {
  4550. width: 100%;
  4551. height: 50px;
  4552. margin: 5px 0;
  4553. }
  4554. .roleListBox {
  4555. width: 100%;
  4556. height: calc(100% - 100px - 10px);
  4557. overflow-x: hidden;
  4558. display: flex;
  4559. flex-direction: column;
  4560. justify-content: flex-start;
  4561. align-items: center;
  4562. padding: 10px;
  4563. box-sizing: border-box;
  4564. }
  4565. .filterSubjects {
  4566. margin: 10px;
  4567. width: 100%;
  4568. height: auto;
  4569. }
  4570. .fs_box {
  4571. width: 100%;
  4572. display: flex;
  4573. flex-wrap: wrap;
  4574. margin-top: 10px;
  4575. }
  4576. .fs_b_item {
  4577. width: auto;
  4578. height: 35px;
  4579. font-size: 14px;
  4580. box-sizing: border-box;
  4581. padding: 0 9px;
  4582. background-color: #f3f7fd;
  4583. border: solid 1px #f3f7fd;
  4584. border-radius: 5px;
  4585. margin-right: 8px;
  4586. margin-bottom: 8px;
  4587. display: flex;
  4588. justify-content: center;
  4589. align-items: center;
  4590. cursor: pointer;
  4591. }
  4592. .fs_b_itemActive {
  4593. border: solid 1px #4d8ffc;
  4594. color: #4d8ffc;
  4595. background-color: #f3f7fd;
  4596. }
  4597. .roleList {
  4598. width: 100%;
  4599. height: auto;
  4600. margin: 10px;
  4601. }
  4602. .r_box {
  4603. width: 100%;
  4604. height: auto;
  4605. display: flex;
  4606. flex-wrap: wrap;
  4607. }
  4608. .r_b_item {
  4609. height: 40px;
  4610. font-size: 14px;
  4611. display: flex;
  4612. /* justify-content: center; */
  4613. align-items: center;
  4614. background-color: #f0f2f5;
  4615. border-radius: 5px;
  4616. margin: 5px;
  4617. cursor: pointer;
  4618. box-sizing: border-box;
  4619. padding: 0 4px;
  4620. border: solid 1px #f0f2f5;
  4621. }
  4622. .r_b_itemActive {
  4623. box-sizing: border-box;
  4624. border: solid 1px #aeccfe;
  4625. color: #4d8ffb;
  4626. }
  4627. .r_b_item > img {
  4628. min-width: 24px;
  4629. min-height: 24px;
  4630. width: 24px;
  4631. height: 24px;
  4632. border-radius: 50%;
  4633. margin-right: 10px;
  4634. /* margin-left: 10px; */
  4635. }
  4636. .characterBlock {
  4637. display: flex;
  4638. background: rgba(54, 169, 252, 1);
  4639. width: 100%;
  4640. height: auto;
  4641. padding: 10px 0;
  4642. margin: 0 auto;
  4643. border-radius: 10px;
  4644. margin-bottom: 15px;
  4645. cursor: pointer;
  4646. }
  4647. .characterBlock > .imgLeft {
  4648. width: 100px;
  4649. display: flex;
  4650. justify-content: center;
  4651. align-items: center;
  4652. }
  4653. .characterBlock > .imgLeft > .img {
  4654. width: 60px;
  4655. height: 60px;
  4656. overflow: hidden;
  4657. border-radius: 50%;
  4658. }
  4659. .characterBlock > .imgLeft > .img2 {
  4660. width: 70px;
  4661. height: 70px;
  4662. overflow: hidden;
  4663. border-radius: 50%;
  4664. }
  4665. .characterBlock > .txtRight {
  4666. flex: 1;
  4667. display: flex;
  4668. justify-content: flex-start;
  4669. align-items: center;
  4670. }
  4671. .characterBlock > .txtRight > .bir {
  4672. width: 170px;
  4673. height: 35px;
  4674. display: flex;
  4675. align-items: center;
  4676. background-color: #fff;
  4677. border-radius: 10px;
  4678. box-sizing: border-box;
  4679. padding: 5px 10px;
  4680. box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
  4681. margin-right: 10px;
  4682. white-space: nowrap;
  4683. overflow: hidden;
  4684. text-overflow: ellipsis;
  4685. }
  4686. .s_b_inputBtnArea {
  4687. width: auto;
  4688. height: 100%;
  4689. display: flex;
  4690. justify-content: space-between;
  4691. align-items: center;
  4692. /* margin: 0 5px; */
  4693. }
  4694. .s_b_inputBtnArea > span {
  4695. height: 40px;
  4696. padding: 0px 15px;
  4697. background: #f0f2f5;
  4698. border-radius: 100px;
  4699. display: flex;
  4700. justify-content: center;
  4701. align-items: center;
  4702. cursor: pointer;
  4703. margin: 0 5px;
  4704. }
  4705. .s_b_inputBtnArea > span > svg {
  4706. width: 24px;
  4707. height: 24px;
  4708. }
  4709. </style>