choiceQuestionDetailDialog.vue 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249
  1. <template>
  2. <div class="choiceQuestionDetailDialog">
  3. <div class="content" :style="{
  4. width: slideWidth + 'px',
  5. height: slideHeight + 'px',
  6. }">
  7. <span v-show="false" class="closeIcon" @click="closeSlideIndex()">
  8. <img src="../../../assets/img/close.png" />
  9. </span>
  10. <!-- 选择题 -->
  11. <div class="c_t45" v-if="workDetail && workDetail.type === '45' && props.showData">
  12. <div class="c_t45_title">
  13. <div v-if="props.showData.choiceQuestionListData[props.showData.workIndex]">{{
  14. props.showData.choiceQuestionListData[props.showData.workIndex]
  15. .teststitle
  16. }}</div>
  17. <div class="c_t45_msg">
  18. <div>{{ lang.ssAnswerCount }} {{ props.showData.workArray.length }}<span
  19. v-if="props.showData.unsubmittedStudents.length > 0">/{{ props.showData.workArray.length +
  20. props.showData.unsubmittedStudents.length
  21. }}</span></div>
  22. <span v-if="props.showData.unsubmittedStudents.length > 0" @click="viewUnsubmittedStudents()">{{
  23. lang.ssViewSubmitStatus2 }}</span>
  24. </div>
  25. <!--<span class="c_t45_t_btn" :class="{'c_t45_t_btn_noActive': props.showData.workIndex <= 0}" @click="changeWorkIndex(0)">{{ lang.ssPrevQ }}</span>-->
  26. <!--<span class="c_t45_t_btn" :class="{'c_t45_t_btn_noActive': props.showData.workIndex >= props.showData.choiceQuestionListData.length - 1}" @click="changeWorkIndex(1)">{{ lang.ssNextQ }}</span>-->
  27. </div>
  28. <img class="c_t45_img" :src="props.showData.choiceQuestionListData[props.showData.workIndex]
  29. .timuList[0].src
  30. " v-if="props.showData.choiceQuestionListData[props.showData.workIndex] &&
  31. props.showData.choiceQuestionListData[props.showData.workIndex]
  32. .timuList.length > 0
  33. " @click="previewImageToolRef.previewImage(props.showData.choiceQuestionListData[props.showData.workIndex]
  34. .timuList[0].src)" />
  35. <!-- <span class="c_t45_type" v-if="
  36. props.showData.choiceQuestionListData[props.showData.workIndex]
  37. .type === '1'
  38. ">{{ lang.ssSingleSel }}</span>
  39. <span class="c_t45_type" v-if="
  40. props.showData.choiceQuestionListData[props.showData.workIndex]
  41. .type === '2'
  42. ">{{ lang.ssMultiOpt }}</span> -->
  43. <!-- <span class="c_t45_type">{{ lang.ssChoiceQuestion }}</span> -->
  44. <div class="c_t45_echarts" :style="{
  45. width: slideWidth - 40 + 'px',
  46. }">
  47. <div id="echartsArea1" ref="echartsArea1"></div>
  48. </div>
  49. <div class="aiAnalysis" v-if="props.workArray.length > 0">
  50. <div class="ai_header">
  51. <div class="ai_title">
  52. <svg viewBox="0 0 1024 1024" width="200" height="200">
  53. <path
  54. d="M512 170.666667C323.477333 170.666667 170.666667 323.477333 170.666667 512s152.810667 341.333333 341.333333 341.333333 341.333333-152.810667 341.333333-341.333333S700.522667 170.666667 512 170.666667zM85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z">
  55. </path>
  56. <path
  57. d="M693.013333 330.986667a42.666667 42.666667 0 0 1 10.304 43.648l-75.413333 226.282666a42.666667 42.666667 0 0 1-26.986667 26.986667l-226.282666 75.413333a42.666667 42.666667 0 0 1-53.973334-53.973333l75.434667-226.261333a42.666667 42.666667 0 0 1 26.986667-26.986667l226.282666-75.413333a42.666667 42.666667 0 0 1 43.648 10.304z m-222.72 139.306666l-41.685333 125.098667 125.077333-41.706667 41.706667-125.077333-125.077333 41.706667z">
  58. </path>
  59. </svg>{{ lang.ssAnalysis }}
  60. </div>
  61. <div class="ai_refresh" :class="{ 'disabled': currentAnalysis && currentAnalysis.loading }"
  62. @click="aiAnalysisRefresh45()">
  63. {{ lang.ssAIGenerate }}
  64. <svg viewBox="0 0 1024 1024" width="200" height="200">
  65. <path
  66. d="M875 483c-33.4 0-60.5 27.1-60.5 60.5v0.1C814.4 710.3 678.8 846 512 846S209.5 710.3 209.5 543.5 345.2 241 512 241c36.8 0 71.7 7.6 104.4 19.7-32 3-57.4 29.1-57.4 61.9 0 34.8 28.2 63 63 63h201.9c34.8 0 63-28.2 63-63V120c0-34.8-28.2-63-63-63s-63 28.2-63 63v81.4C691 150.5 605.2 120 512 120 278.1 120 88.5 309.6 88.5 543.5S278.1 967 512 967s423.5-189.6 423.5-423.5c0-33.4-27.1-60.5-60.5-60.5z">
  67. </path>
  68. </svg>
  69. </div>
  70. </div>
  71. <div class="ai_content" v-if="currentAnalysis && currentAnalysis.json">
  72. {{ currentAnalysis.json.text }}
  73. </div>
  74. <div class="ai_echartsData" v-if="currentAnalysis && currentAnalysis.json.keyword">
  75. {{ currentAnalysis.json.keyword }}
  76. </div>
  77. <div class="generatingContent" v-if="currentAnalysis && currentAnalysis.loading">
  78. {{ lang.ssGeneratingContent }}...</div>
  79. <div class="ai_updateTime" v-if="currentAnalysis">{{ lang.ssUpdateTime }}:{{ currentAnalysis.update_at }}
  80. </div>
  81. </div>
  82. <div class="cq_changeBtn" v-if="props.showData.choiceQuestionListData.length > 1">
  83. <div :class="{ cq_cb_disabled: props.showData.workIndex <= 0 }" @click="changeWorkIndex(0)">
  84. <svg style="transform: rotate(-90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200">
  85. <path
  86. d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z"
  87. fill=""></path>
  88. </svg>
  89. </div>
  90. <span>{{ props.showData.workIndex + 1 }}/{{ props.showData.choiceQuestionListData.length }}</span>
  91. <div :class="{ cq_cb_disabled: props.showData.workIndex >= props.showData.choiceQuestionListData.length - 1 }"
  92. @click="changeWorkIndex(1)">
  93. <svg style="transform: rotate(90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200">
  94. <path
  95. d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z"
  96. fill=""></path>
  97. </svg>
  98. </div>
  99. </div>
  100. </div>
  101. <!-- 投票 -->
  102. <div class="c_t45" v-if="workDetail && workDetail.type === '78' && props.showData">
  103. <div class="c_t45_title">
  104. <div v-if="props.showData.choiceQuestionListData[props.showData.workIndex]">{{
  105. props.showData.choiceQuestionListData[props.showData.workIndex]
  106. .teststitle
  107. }}</div>
  108. <div class="c_t45_msg">
  109. <div>{{ lang.ssAnswerCount }} {{ props.showData.workArray.length }}<span
  110. v-if="props.showData.unsubmittedStudents.length > 0">/{{ props.showData.workArray.length +
  111. props.showData.unsubmittedStudents.length
  112. }}</span></div>
  113. <span v-if="props.showData.unsubmittedStudents.length > 0" @click="viewUnsubmittedStudents()">{{
  114. lang.ssViewSubmitStatus2 }}</span>
  115. </div>
  116. <!--<span class="c_t45_t_btn" :class="{'c_t45_t_btn_noActive': props.showData.workIndex <= 0}" @click="changeWorkIndex(0)">{{ lang.ssPrevQ }}</span>-->
  117. <!--<span class="c_t45_t_btn" :class="{'c_t45_t_btn_noActive': props.showData.workIndex >= props.showData.choiceQuestionListData.length - 1}" @click="changeWorkIndex(1)">{{ lang.ssNextQ }}</span>-->
  118. </div>
  119. <img class="c_t45_img" :src="props.showData.choiceQuestionListData[props.showData.workIndex]
  120. .timuList[0].src
  121. " v-if="props.showData.choiceQuestionListData[props.showData.workIndex] &&
  122. props.showData.choiceQuestionListData[props.showData.workIndex]
  123. .timuList.length > 0
  124. " @click="previewImageToolRef.previewImage(props.showData.choiceQuestionListData[props.showData.workIndex]
  125. .timuList[0].src)" />
  126. <!-- <span class="c_t45_type" v-if="
  127. props.showData.choiceQuestionListData[props.showData.workIndex]
  128. .type === '1'
  129. ">{{ lang.ssSingleSel }}</span>
  130. <span class="c_t45_type" v-if="
  131. props.showData.choiceQuestionListData[props.showData.workIndex]
  132. .type === '2'
  133. ">{{ lang.ssMultiOpt }}</span> -->
  134. <!-- <span class="c_t45_type">{{ lang.ssChoiceQuestion }}</span> -->
  135. <div class="c_t45_echarts" :style="{
  136. width: slideWidth - 40 + 'px',
  137. }">
  138. <div id="echartsArea1" ref="echartsArea1"></div>
  139. </div>
  140. <div class="aiAnalysis" v-if="props.workArray.length > 0">
  141. <div class="ai_header">
  142. <div class="ai_title">
  143. <svg viewBox="0 0 1024 1024" width="200" height="200">
  144. <path
  145. d="M512 170.666667C323.477333 170.666667 170.666667 323.477333 170.666667 512s152.810667 341.333333 341.333333 341.333333 341.333333-152.810667 341.333333-341.333333S700.522667 170.666667 512 170.666667zM85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z">
  146. </path>
  147. <path
  148. d="M693.013333 330.986667a42.666667 42.666667 0 0 1 10.304 43.648l-75.413333 226.282666a42.666667 42.666667 0 0 1-26.986667 26.986667l-226.282666 75.413333a42.666667 42.666667 0 0 1-53.973334-53.973333l75.434667-226.261333a42.666667 42.666667 0 0 1 26.986667-26.986667l226.282666-75.413333a42.666667 42.666667 0 0 1 43.648 10.304z m-222.72 139.306666l-41.685333 125.098667 125.077333-41.706667 41.706667-125.077333-125.077333 41.706667z">
  149. </path>
  150. </svg>{{ lang.ssAnalysis }}
  151. </div>
  152. <div class="ai_refresh" :class="{ 'disabled': currentAnalysis && currentAnalysis.loading }"
  153. @click="aiAnalysisRefresh78()">
  154. {{ lang.ssAIGenerate }}
  155. <svg viewBox="0 0 1024 1024" width="200" height="200">
  156. <path
  157. d="M875 483c-33.4 0-60.5 27.1-60.5 60.5v0.1C814.4 710.3 678.8 846 512 846S209.5 710.3 209.5 543.5 345.2 241 512 241c36.8 0 71.7 7.6 104.4 19.7-32 3-57.4 29.1-57.4 61.9 0 34.8 28.2 63 63 63h201.9c34.8 0 63-28.2 63-63V120c0-34.8-28.2-63-63-63s-63 28.2-63 63v81.4C691 150.5 605.2 120 512 120 278.1 120 88.5 309.6 88.5 543.5S278.1 967 512 967s423.5-189.6 423.5-423.5c0-33.4-27.1-60.5-60.5-60.5z">
  158. </path>
  159. </svg>
  160. </div>
  161. </div>
  162. <div class="ai_content" v-if="currentAnalysis && currentAnalysis.json">
  163. {{ currentAnalysis.json.text }}
  164. </div>
  165. <div class="ai_echartsData" v-if="currentAnalysis && currentAnalysis.json.keyword">
  166. {{ currentAnalysis.json.keyword }}
  167. </div>
  168. <div class="generatingContent" v-if="currentAnalysis && currentAnalysis.loading">
  169. {{ lang.ssGeneratingContent }}...</div>
  170. <div class="ai_updateTime" v-if="currentAnalysis">{{ lang.ssUpdateTime }}:{{ currentAnalysis.update_at }}
  171. </div>
  172. </div>
  173. <div class="cq_changeBtn" v-if="props.showData.choiceQuestionListData.length > 1">
  174. <div :class="{ cq_cb_disabled: props.showData.workIndex <= 0 }" @click="changeWorkIndex(0)">
  175. <svg style="transform: rotate(-90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200">
  176. <path
  177. d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z"
  178. fill=""></path>
  179. </svg>
  180. </div>
  181. <span>{{ props.showData.workIndex + 1 }}/{{ props.showData.choiceQuestionListData.length }}</span>
  182. <div :class="{ cq_cb_disabled: props.showData.workIndex >= props.showData.choiceQuestionListData.length - 1 }"
  183. @click="changeWorkIndex(1)">
  184. <svg style="transform: rotate(90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200">
  185. <path
  186. d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z"
  187. fill=""></path>
  188. </svg>
  189. </div>
  190. </div>
  191. </div>
  192. <!-- 问答题 -->
  193. <div class="c_t15" v-if="workDetail && workDetail.type === '15' && props.showData">
  194. <div class="c_t15_title">{{ workDetail.json.answerQ }}</div>
  195. <span class="c_t15_type">{{ lang.ssQATest }}</span>
  196. <div class="c_t15_content" v-show="!lookWorkData">
  197. <div class="c_t15_c_item" v-for="item in processedWorkArray" :key="item.id" @click="lookWork(item.id)">
  198. <div class="c_t15_c_i_top">
  199. <span>S</span>
  200. <div>{{ item.name }}</div>
  201. </div>
  202. <div class="c_t15_c_i_bottom">
  203. <span v-html="item.content.answer"></span>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="aiAnalysis" style="margin-top:1rem ;"
  208. v-if="processedWorkArray.length > 0 && lookWorkData === null && workDetail.type === '15'">
  209. <div class="ai_header">
  210. <div class="ai_title">
  211. <svg viewBox="0 0 1024 1024" width="200" height="200">
  212. <path
  213. d="M512 170.666667C323.477333 170.666667 170.666667 323.477333 170.666667 512s152.810667 341.333333 341.333333 341.333333 341.333333-152.810667 341.333333-341.333333S700.522667 170.666667 512 170.666667zM85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z">
  214. </path>
  215. <path
  216. d="M693.013333 330.986667a42.666667 42.666667 0 0 1 10.304 43.648l-75.413333 226.282666a42.666667 42.666667 0 0 1-26.986667 26.986667l-226.282666 75.413333a42.666667 42.666667 0 0 1-53.973334-53.973333l75.434667-226.261333a42.666667 42.666667 0 0 1 26.986667-26.986667l226.282666-75.413333a42.666667 42.666667 0 0 1 43.648 10.304z m-222.72 139.306666l-41.685333 125.098667 125.077333-41.706667 41.706667-125.077333-125.077333 41.706667z">
  217. </path>
  218. </svg>{{ lang.ssAnalysis }}
  219. </div>
  220. <div class="ai_refresh" :class="{ 'disabled': currentAnalysis && currentAnalysis.loading }"
  221. @click="aiAnalysisRefresh15()">
  222. {{ lang.ssAIGenerate }}
  223. <svg viewBox="0 0 1024 1024" width="200" height="200">
  224. <path
  225. d="M875 483c-33.4 0-60.5 27.1-60.5 60.5v0.1C814.4 710.3 678.8 846 512 846S209.5 710.3 209.5 543.5 345.2 241 512 241c36.8 0 71.7 7.6 104.4 19.7-32 3-57.4 29.1-57.4 61.9 0 34.8 28.2 63 63 63h201.9c34.8 0 63-28.2 63-63V120c0-34.8-28.2-63-63-63s-63 28.2-63 63v81.4C691 150.5 605.2 120 512 120 278.1 120 88.5 309.6 88.5 543.5S278.1 967 512 967s423.5-189.6 423.5-423.5c0-33.4-27.1-60.5-60.5-60.5z">
  226. </path>
  227. </svg>
  228. </div>
  229. </div>
  230. <div class="ai_content" v-if="currentAnalysis && currentAnalysis.json">
  231. {{ currentAnalysis.json.text }}
  232. </div>
  233. <div class="ai_echartsData" v-if="currentAnalysis && currentAnalysis.json.keyword">
  234. <div class="title">{{ lang.ssKeyword }}:</div>
  235. <span v-for="(item, index) in currentAnalysis.json.keyword" :key="index">{{ item }}</span>
  236. <div class="btn" @click="openEchatsDialog()">{{ lang.ssViewKeywordCloud }}</div>
  237. </div>
  238. <div class="generatingContent" v-if="currentAnalysis && currentAnalysis.generatingContent">{{
  239. lang.ssGeneratingContent }}...</div>
  240. <div class="ai_updateTime" v-if="currentAnalysis">{{ lang.ssUpdateTime }}:{{ currentAnalysis.update_at }}
  241. </div>
  242. </div>
  243. <div class="c_t15_workDetail" v-if="lookWorkData">
  244. <div class="c_t15_wd_top">
  245. <img src="../../../assets/img/arrow_left.png" @click="lookWork('')" />
  246. <span>S</span>
  247. <div>{{ lookWorkData.name }}</div>
  248. </div>
  249. <div class="c_t15_wd_content">
  250. <span v-html="lookWorkData.content.answer"></span>
  251. <div class="c_t15_wd_c_imageList" v-if="lookWorkData.content.fileList.length > 0">
  252. <img v-for="item in lookWorkData.content.fileList" :src="item.url" :key="item.uploadTime"
  253. @click="lookImage(item.url)" />
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. <!-- AI应用 -->
  259. <div class="c_t72" v-if="props.showData && props.showData.toolType === 72">
  260. <div class="c_t72_title">{{ lang.ssAiApp }}</div>
  261. <span class="c_t72_type">{{ lang.ssAiApp }}</span>
  262. <div class="c_t72_content" v-show="!lookWorkData">
  263. <div class="c_t72_c_item" v-for="item in processedWorkArray" :key="item.id" @click="lookWork(item.id)">
  264. <div class="c_t72_c_i_top">
  265. <span>S</span>
  266. <div>{{ item.name }}</div>
  267. </div>
  268. </div>
  269. </div>
  270. <div class="aiAnalysis" style="margin-top:1rem ;"
  271. v-if="processedWorkArray.length > 0 && lookWorkData === null && props.showData.toolType === 72">
  272. <div class="ai_header">
  273. <div class="ai_title">
  274. <svg viewBox="0 0 1024 1024" width="200" height="200">
  275. <path
  276. d="M512 170.666667C323.477333 170.666667 170.666667 323.477333 170.666667 512s152.810667 341.333333 341.333333 341.333333 341.333333-152.810667 341.333333-341.333333S700.522667 170.666667 512 170.666667zM85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z">
  277. </path>
  278. <path
  279. d="M693.013333 330.986667a42.666667 42.666667 0 0 1 10.304 43.648l-75.413333 226.282666a42.666667 42.666667 0 0 1-26.986667 26.986667l-226.282666 75.413333a42.666667 42.666667 0 0 1-53.973334-53.973333l75.434667-226.261333a42.666667 42.666667 0 0 1 26.986667-26.986667l226.282666-75.413333a42.666667 42.666667 0 0 1 43.648 10.304z m-222.72 139.306666l-41.685333 125.098667 125.077333-41.706667 41.706667-125.077333-125.077333 41.706667z">
  280. </path>
  281. </svg>{{ lang.ssAnalysis }}
  282. </div>
  283. <div class="ai_refresh" :class="{ 'disabled': currentAnalysis && currentAnalysis.loading }"
  284. @click="aiAnalysisRefresh72()">
  285. {{ lang.ssAIGenerate }}
  286. <svg viewBox="0 0 1024 1024" width="200" height="200">
  287. <path
  288. d="M875 483c-33.4 0-60.5 27.1-60.5 60.5v0.1C814.4 710.3 678.8 846 512 846S209.5 710.3 209.5 543.5 345.2 241 512 241c36.8 0 71.7 7.6 104.4 19.7-32 3-57.4 29.1-57.4 61.9 0 34.8 28.2 63 63 63h201.9c34.8 0 63-28.2 63-63V120c0-34.8-28.2-63-63-63s-63 28.2-63 63v81.4C691 150.5 605.2 120 512 120 278.1 120 88.5 309.6 88.5 543.5S278.1 967 512 967s423.5-189.6 423.5-423.5c0-33.4-27.1-60.5-60.5-60.5z">
  289. </path>
  290. </svg>
  291. </div>
  292. </div>
  293. <div class="ai_content" v-if="currentAnalysis && currentAnalysis.json">
  294. {{ currentAnalysis.json.text }}
  295. </div>
  296. <div class="ai_updateTime" v-if="currentAnalysis">{{ lang.ssUpdateTime }}:{{ currentAnalysis.update_at }}
  297. </div>
  298. </div>
  299. <div class="c_t72_workDetail" v-if="lookWorkData">
  300. <div class="c_t72_wd_top">
  301. <img src="../../../assets/img/arrow_left.png" @click="lookWork('')" />
  302. <span>S</span>
  303. <div>{{ lookWorkData.name }}</div>
  304. </div>
  305. <div class="c_t72_wd_content">
  306. <template v-for="(item, index) in lookWorkData.content" :key="item.id">
  307. <div class="messageNodeArea" v-if="item.messages || item.imageUrls">
  308. <div class="messageNode">
  309. <div class="mn_title">{{ lang.ssNodeTitle.replace(/\*/g, String(index + 1)) }}</div>
  310. <div class="mn_content">
  311. <template v-for="(item2, index2) in item.messages" :key="`${index}-${index2}`">
  312. <div>
  313. <div class="na_m_item" v-if="item2.role == 'user' && item2.content">
  314. <div class="na_m_i_name">
  315. {{ item2.sender }}
  316. </div>
  317. <div class="na_m_i_content" v-html="item2.content"></div>
  318. </div>
  319. <div class="na_m_item" v-if="item2.role == 'assistant' && item2.content">
  320. <div class="na_m_i_name aiName">
  321. {{ item2.sender }}
  322. </div>
  323. <div class="na_m_i_content" v-html="item2.content"></div>
  324. </div>
  325. </div>
  326. </template>
  327. <template v-if="item.imageUrls" v-for="(item3, index3) in item.imageUrls"
  328. :key="`${index}-${index3}`">
  329. <div class="na_m_item">
  330. <div class="na_m_i_name">
  331. {{ item.type }}
  332. </div>
  333. <div class="na_m_i_content">
  334. <img @click="lookImage(item3)" style="height: 100px;width: auto;cursor: pointer;" :src="item3" />
  335. </div>
  336. </div>
  337. </template>
  338. </div>
  339. </div>
  340. </div>
  341. </template>
  342. </div>
  343. </div>
  344. </div>
  345. <!-- H5页面 -->
  346. <div class="c_t73" v-if="props.showData && props.showData.toolType === 73">
  347. <div class="c_t73_title">{{ lang.ssPageImage }}</div>
  348. <span class="c_t73_type">{{ lang.ssHPage }}</span>
  349. <div class="c_t73_content" v-show="!lookWorkData">
  350. <div class="c_t73_c_item" v-for="item in processedWorkArray" :key="item.id" @click="lookWork(item.id)">
  351. <div class="c_t73_c_i_top">
  352. <span>S</span>
  353. <div>{{ item.name }}</div>
  354. </div>
  355. <div class="c_t73_c_i_bottom">
  356. <img :src="item.content" />
  357. </div>
  358. </div>
  359. </div>
  360. <div class="c_t73_workDetail" v-if="lookWorkData">
  361. <div class="c_t73_wd_top">
  362. <img src="../../../assets/img/arrow_left.png" @click="lookWork('')" />
  363. <span>S</span>
  364. <div>{{ lookWorkData.name }}</div>
  365. </div>
  366. <div class="c_t73_wd_content">
  367. <img :src="lookWorkData.content" />
  368. </div>
  369. </div>
  370. </div>
  371. </div>
  372. <previewImageTool ref="previewImageToolRef" />
  373. <selectUserDialog ref="selectUserDialogRef" />
  374. <echartsDialog ref="echartsDialogRef" />
  375. </div>
  376. </template>
  377. <script setup lang="ts">
  378. import { computed, ref, watch, onUnmounted, nextTick, onMounted } from 'vue'
  379. import * as echarts from 'echarts'
  380. import previewImageTool from '../../components/tool/previewImageTool.vue'
  381. import MarkdownIt from 'markdown-it'
  382. import useImport from '@/hooks/useImport'
  383. import { lang } from '@/main'
  384. import selectUserDialog from './selectUserDialog.vue'
  385. import echartsDialog from './echartsDialog.vue'
  386. import { chat_stream, chat_no_stream } from '@/tools/aiChat'
  387. import axios from '@/services/config'
  388. const props = defineProps<{
  389. visible: number[];
  390. workIndex: number;
  391. slideWidth: number;
  392. slideHeight: number;
  393. slideIndex: number;
  394. showData: any;
  395. workArray: any[];
  396. courseDetail: any;
  397. userId: string;
  398. workId: string;
  399. cid: string;
  400. }>()
  401. const emit = defineEmits<{
  402. (e: 'update:visible', v: number[]): void;
  403. (e: 'changeWorkIndex', v: number): void;
  404. }>()
  405. const visible = computed({
  406. get: () => props.visible,
  407. set: (v: number[]) => emit('update:visible', v),
  408. })
  409. const workDetail = computed(() => {
  410. if (props.showData) {
  411. return props.showData.workDetail
  412. }
  413. return null
  414. })
  415. // 预览图片组件
  416. const previewImageToolRef = ref<any>(null)
  417. // 选择用户组件
  418. const selectUserDialogRef = ref<any>(null)
  419. // 词云图组件
  420. const echartsDialogRef = ref<any>(null)
  421. // ai分析数据
  422. const aiAnalysisData = ref<Array<any>>([])
  423. const md = new MarkdownIt()
  424. const { getFile } = useImport()
  425. // 判断是否是 URL 链接
  426. const isUrl = (str: string): boolean => {
  427. try {
  428. const url = new URL(str)
  429. return (url.protocol === 'http:' || url.protocol === 'https:') && str.includes('json')
  430. }
  431. catch {
  432. return false
  433. }
  434. }
  435. // 从链接获取文件内容
  436. const loadContentFromUrl = async (url: string): Promise<string> => {
  437. try {
  438. const fileData = await getFile(url)
  439. if (fileData && fileData.data) {
  440. // 将 ArrayBuffer 转为字符串
  441. const uint8Array = new Uint8Array(fileData.data)
  442. const jsonStr = new TextDecoder('utf-8').decode(uint8Array)
  443. return jsonStr
  444. }
  445. return ''
  446. }
  447. catch (error) {
  448. console.error('获取文件内容失败:', error)
  449. return ''
  450. }
  451. }
  452. // 处理单个作业内容
  453. const processWorkContent = async (content: string, toolType: number): Promise<any> => {
  454. let contentToParse = content
  455. // 如果是链接,先获取文件内容
  456. if (isUrl(content)) {
  457. contentToParse = await loadContentFromUrl(content)
  458. }
  459. if (!contentToParse) {
  460. return null
  461. }
  462. try {
  463. if ([45, 15, 78].includes(toolType)) {
  464. return JSON.parse(decodeURIComponent(contentToParse))
  465. }
  466. else if (toolType === 72) {
  467. const parsed = JSON.parse(contentToParse)
  468. if (Array.isArray(parsed)) {
  469. parsed.forEach((item: any) => {
  470. if (item.messages && item.messages.length) {
  471. item.messages.forEach((item2: any) => {
  472. // 如果已经包含html标签则不再渲染
  473. if (
  474. !/^(\s*<[^>]+>.*<\/[^>]+>\s*|<[^>]+\/>\s*)$/s.test(
  475. item2.content.trim()
  476. )
  477. ) {
  478. item2.content = item2.content.replace(/&lt;/g, '<').replace(/&quot;/g, '"').replace(/&gt;/g, '>')
  479. item2.content = md.render(item2.content)
  480. }
  481. })
  482. }
  483. })
  484. }
  485. return parsed
  486. }
  487. return contentToParse
  488. }
  489. catch (error) {
  490. console.error('解析内容失败:', error)
  491. return null
  492. }
  493. }
  494. const processedWorkArray = ref<any[]>([])
  495. // 监听 workArray 和 showData 变化
  496. watch(
  497. () => [props.workArray, props.showData?.toolType],
  498. async () => {
  499. if (props.workArray && props.showData) {
  500. const _workArray = JSON.parse(JSON.stringify(props.workArray))
  501. // 处理每个作业内容
  502. for (const i of _workArray) {
  503. if (i.content) {
  504. const processedContent = await processWorkContent(i.content, props.showData.toolType)
  505. if (processedContent !== null) {
  506. i.content = processedContent
  507. }
  508. }
  509. }
  510. processedWorkArray.value = _workArray
  511. }
  512. else {
  513. processedWorkArray.value = []
  514. }
  515. },
  516. { immediate: true, deep: true }
  517. )
  518. // 关闭对应的作业详细页面
  519. const closeSlideIndex = () => {
  520. visible.value = visible.value.filter((v) => v !== props.slideIndex)
  521. }
  522. // 切换题目
  523. const changeWorkIndex = (type: number) => {
  524. emit('changeWorkIndex', type)
  525. // console.log(props.workIndex, props.showData.choiceQuestionListData.length)
  526. // if (type === 0 && props.workIndex > 0) {
  527. // emit('changeWorkIndex', 0)
  528. // }
  529. // else if (type === 1 && props.workIndex < props.showData.choiceQuestionListData.length) {
  530. // emit('changeWorkIndex', props.workIndex + 1)
  531. // }
  532. }
  533. // 选择题图表div
  534. const echartsArea1 = ref<any>(null)
  535. // 查看的作业详细id
  536. const lookWorkDetail = ref<string>('')
  537. // 查看作业详细的数据
  538. const lookWorkData = computed(() => {
  539. let _result = null
  540. if (lookWorkDetail.value && processedWorkArray.value.length > 0) {
  541. const _workFind = processedWorkArray.value.find(
  542. (i: any) => i.id === lookWorkDetail.value
  543. )
  544. if (_workFind) {
  545. _result = _workFind
  546. }
  547. }
  548. return _result
  549. })
  550. // 查看图片
  551. const lookImage = (url: string) => {
  552. if (previewImageToolRef.value) {
  553. previewImageToolRef.value.previewImage(url)
  554. }
  555. }
  556. // 查看作业
  557. const lookWork = (id: string) => {
  558. lookWorkDetail.value = id
  559. }
  560. // 选择题图表实例
  561. const myChart = ref<any>(null)
  562. // resize防抖定时器
  563. let resizeTimer: ReturnType<typeof setTimeout> | null = null
  564. // 处理ECharts resize
  565. const handleChartResize = () => {
  566. // 清除之前的定时器
  567. if (resizeTimer) {
  568. clearTimeout(resizeTimer)
  569. }
  570. resizeTimer = setTimeout(() => {
  571. nextTick(() => {
  572. if (
  573. myChart.value &&
  574. typeof myChart.value.resize === 'function' &&
  575. !myChart.value.isDisposed()
  576. ) {
  577. try {
  578. myChart.value.resize()
  579. }
  580. catch (e) {
  581. // console.error('myChart resize error:', e)
  582. // 如果resize失败,重新初始化图表
  583. if (
  584. props.showData &&
  585. props.showData.workDetail &&
  586. (props.showData.workDetail.type === '45' || props.showData.workDetail.type === '78')
  587. ) {
  588. setEchartsArea1()
  589. }
  590. }
  591. }
  592. })
  593. }, 200) // 防抖延迟200ms
  594. }
  595. // 设置选择题图表
  596. const setEchartsArea1 = () => {
  597. // 如果已有实例且未销毁,先销毁
  598. if (myChart.value && !myChart.value.isDisposed()) {
  599. myChart.value.dispose()
  600. }
  601. if (echartsArea1.value) {
  602. myChart.value = echarts.init(echartsArea1.value)
  603. }
  604. else {
  605. myChart.value = null
  606. }
  607. if (myChart.value) {
  608. const _work =
  609. props.showData.choiceQuestionListData[props.showData.workIndex]
  610. console.log('_work', _work)
  611. // 修正版,处理xAxis.data内为图片对象的case,formatter始终只拿到src或自定义label,保证无[object Object]问题
  612. const option = {
  613. tooltip: {
  614. show: false, // 禁用鼠标移动到柱体时的内容显示
  615. },
  616. yAxis: {
  617. show: false, // 不显示最左边的y轴
  618. },
  619. xAxis: {
  620. data: [],
  621. axisLabel: {
  622. color: 'rgba(0, 0, 0, 0.9)',
  623. fontWeight: 600,
  624. fontSize: 17,
  625. lineHeight: 20,
  626. interval: 0,
  627. formatter: function(value: any, idx: number) {
  628. // 如果是字符串且格式为JSON(图片),则解析处理
  629. if (typeof value === 'string') {
  630. try {
  631. const obj = JSON.parse(value)
  632. if (obj && typeof obj === 'object' && obj.imgType && obj.src) {
  633. return '{img' + idx + '|}'
  634. }
  635. }
  636. catch (e) {
  637. // 非JSON字符串,直接返回
  638. // 如果文本文字超过8个字,换行
  639. if (typeof value === 'string') {
  640. // 判断value是否全是英文
  641. const isAllEnglish = /^[a-zA-Z0-9\s\p{P}]+$/u.test(value)
  642. let displayValue = value
  643. const maxLength = isAllEnglish ? 30 : 20
  644. const lineLength = isAllEnglish ? 16 : 8
  645. if (value.length > maxLength) {
  646. displayValue = value.substr(0, maxLength) + '...'
  647. }
  648. // 换行处理
  649. let output = ''
  650. for (let i = 0; i < displayValue.length; i += lineLength) {
  651. output += displayValue.substr(i, lineLength)
  652. if (i + lineLength < displayValue.length) {
  653. output += '\n'
  654. }
  655. }
  656. return output
  657. }
  658. return value
  659. }
  660. return value
  661. }
  662. // 兼容老格式(容错):value本身是对象,并有图片信息
  663. if (
  664. value &&
  665. typeof value === 'object' &&
  666. value.imgType &&
  667. value.src
  668. ) {
  669. return '{img' + idx + '|}'
  670. }
  671. // 其他类型直接空
  672. return ''
  673. },
  674. rich: (() => {
  675. // 动态生成所有图片的 rich 格式
  676. const richObj: any = {}
  677. _work.choiceUser.forEach((op: any, idx: number) => {
  678. if (
  679. op.option &&
  680. typeof op.option === 'object' &&
  681. op.option.imgType &&
  682. op.option.src
  683. ) {
  684. richObj['img' + idx] = {
  685. height: 40,
  686. width: 40,
  687. align: 'center',
  688. backgroundColor: {
  689. image: op.option.src,
  690. },
  691. }
  692. }
  693. })
  694. return richObj
  695. })(),
  696. },
  697. },
  698. series: [
  699. {
  700. name: '',
  701. type: 'bar',
  702. data: [],
  703. barMaxWidth: 80, // 柱体最宽80px,数量多则自适应
  704. itemStyle: {
  705. color: 'rgba(252, 207, 0, 1)',
  706. },
  707. label: {
  708. show: true,
  709. position: 'top',
  710. color: 'rgba(116, 139, 115, 1)',
  711. fontSize: 22,
  712. fontWeight: 500,
  713. lineHeight: 24,
  714. },
  715. },
  716. ],
  717. }
  718. _work.choiceUser.forEach((i: any, idx: number) => {
  719. // 如果是图片,存src对象,否则为字符串
  720. if (
  721. i.option &&
  722. typeof i.option === 'object' &&
  723. i.option.imgType &&
  724. i.option.src
  725. ) {
  726. (option.xAxis.data as any[]).push(
  727. JSON.stringify({ imgType: i.option.imgType, src: i.option.src })
  728. ) // 仅保留相关字段
  729. }
  730. else if (typeof i.option === 'string') {
  731. (option.xAxis.data as any[]).push(i.option)
  732. }
  733. else {
  734. (option.xAxis.data as any[]).push('')
  735. }
  736. (option.series[0].data as any[]).push(i.user.length)
  737. })
  738. // console.log(option)
  739. // {
  740. // title: {
  741. // text: 'ECharts 入门示例'
  742. // },
  743. // tooltip: {},
  744. // xAxis: {
  745. // data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
  746. // },
  747. // yAxis: {},
  748. // series: [
  749. // {
  750. // name: '销量',
  751. // type: 'bar',
  752. // data: [5, 20, 36, 10, 10, 20]
  753. // }
  754. // ]
  755. // }
  756. myChart.value.setOption(option)
  757. myChart.value.off('click')
  758. myChart.value.on('click', (params: any) => {
  759. const idx = params.dataIndex
  760. const selectedOption = _work.choiceUser[idx]
  761. if (selectedOption && selectUserDialogRef.value) {
  762. // console.log(selectedOption)
  763. console.log('selectedOption', selectedOption)
  764. selectUserDialogRef.value.open(`${lang.ssSelectUser.replace('{a}', '<span>' + selectedOption.index + '</span>')}`, selectedOption)
  765. }
  766. })
  767. }
  768. }
  769. // 获取分析
  770. const getAnalysis = () => {
  771. if (!props.workId) {
  772. return
  773. }
  774. console.log('props.workId', props.workId)
  775. const params = {
  776. pid: props.workId + (props.cid ? ',' + props.cid : ''),
  777. }
  778. axios.get('https://pbl.cocorobo.cn/api/pbl/select_pptAnalysisByPid?pid=' + params.pid).then(res => {
  779. const data = res[0]
  780. if (data.length) {
  781. data.forEach((item: any) => {
  782. try {
  783. item.json = JSON.parse(item.json)
  784. }
  785. catch (error) {
  786. item.json = { text: item.json, echartsData: '' }
  787. }
  788. })
  789. aiAnalysisData.value = data
  790. }
  791. else {
  792. aiAnalysisData.value = []
  793. }
  794. }).catch(err => {
  795. console.log('get_pptAnalysis_err', err)
  796. })
  797. }
  798. // 监听选择题数据变化
  799. watch(
  800. () => props.showData,
  801. (newVal, oldVal) => {
  802. console.log('发生变化,showData')
  803. if (
  804. newVal &&
  805. newVal.choiceQuestionListData[newVal.workIndex] &&
  806. (props.showData.workDetail.type === '45' || props.showData.workDetail.type === '78')
  807. ) {
  808. if (
  809. oldVal &&
  810. newVal.choiceQuestionListData[newVal.workIndex] &&
  811. oldVal.choiceQuestionListData[oldVal.workIndex]
  812. ) {
  813. if (
  814. JSON.stringify(newVal.choiceQuestionListData[newVal.workIndex]) !==
  815. JSON.stringify(oldVal.choiceQuestionListData[oldVal.workIndex])
  816. ) {
  817. setEchartsArea1()
  818. }
  819. }
  820. }
  821. else {
  822. myChart.value = null
  823. }
  824. // console.log('newVal', newVal)
  825. // if(newVal && newVal.workDetail && newVal.workDetail.id){
  826. // getAnalysis()
  827. // }
  828. // getAnalysis()
  829. },
  830. { immediate: true, deep: true }
  831. )
  832. // 监听作业变化
  833. watch(
  834. () => props.showData?.choiceQuestionListData,
  835. (newVal, oldVal) => {
  836. console.log('choiceQuestionListData变化了')
  837. if (
  838. (newVal || newVal === 0) &&
  839. props.showData.workDetail &&
  840. (props.showData.workDetail.type === '45' || props.showData.workDetail.type === '78')
  841. ) {
  842. if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
  843. setEchartsArea1()
  844. }
  845. else {
  846. console.log('choiceQuestionListData没有变化')
  847. }
  848. }
  849. else {
  850. myChart.value = null
  851. }
  852. },
  853. { deep: true }
  854. )
  855. // 监听作业变化
  856. watch(
  857. () => props.showData?.workIndex,
  858. (newVal) => {
  859. if (
  860. (newVal || newVal === 0) &&
  861. props.showData.workDetail &&
  862. (props.showData.workDetail.type === '45' || props.showData.workDetail.type === '78')
  863. ) {
  864. setEchartsArea1()
  865. }
  866. else {
  867. myChart.value = null
  868. }
  869. }
  870. )
  871. // 监听echartsArea1变化
  872. watch(
  873. () => echartsArea1.value,
  874. (newVal) => {
  875. if (
  876. newVal &&
  877. props.showData &&
  878. props.showData.workDetail &&
  879. (props.showData.workDetail.type === '45' || props.showData.workDetail.type === '78')
  880. ) {
  881. setEchartsArea1()
  882. }
  883. else {
  884. myChart.value = null
  885. }
  886. }
  887. )
  888. // 监听页面宽度变化
  889. watch(
  890. () => props.slideWidth,
  891. (newVal) => {
  892. if (
  893. newVal &&
  894. props.showData &&
  895. props.showData.workDetail &&
  896. (props.showData.workDetail.type === '45' || props.showData.workDetail.type === '78')
  897. ) {
  898. handleChartResize()
  899. }
  900. }
  901. )
  902. // 查看未提交学生
  903. const viewUnsubmittedStudents = () => {
  904. selectUserDialogRef.value.open(lang.ssSubmitStatus, { user: props.showData.unsubmittedStudents.map((item: any) => item.name), notFiledUser: props.showData.unsubmittedStudents.map((item: any) => item.name), isSubmitUser: props.workArray.map((item: any) => item.name) })
  905. // if (props.unsubmittedStudents.length > 0) {
  906. // unsubmittedStudentsDialogRef.value.open(props.unsubmittedStudents)
  907. // }
  908. }
  909. // ai生成选择题分析 选择题
  910. const aiAnalysisRefresh45 = () => {
  911. const _work = props.showData.choiceQuestionListData[props.showData.workIndex]
  912. const msg = `# CONTEXT #
  913. 你是K-12阶段的AI教育课堂分析助手,基于上传的课件、逐字稿,以及当页的学生答题数据(选择题/问答题/智能体对话)进行智能分析。
  914. # OBJECTIVE #
  915. 输出当前学生答题的分析报告:整体表现、核心发现(共性问题/误区)、教学优化(改进方向),为教师提供教学策略的建议和支持。
  916. #INPUT#
  917. 课程数据:
  918. - 课程名称:${props.courseDetail.title}
  919. - 课程学科:${props.courseDetail.name}
  920. 当前页面答题数据(选择题):【分析重点】
  921. - 选择题题目:${_work.teststitle}
  922. - 选项数据:${JSON.stringify(_work.choiceUser)}
  923. - 题目图片:${_work.timuList.lenght ? _work.timuList[0].src : ''}
  924. - 未提交学生:${JSON.stringify(props.showData.unsubmittedStudents.map((item: any) => item.name))}
  925. # ANALYSIS RULES #
  926. 1. **问题定位**:明确指出哪个知识点/概念/步骤掌握不佳
  927. 2. **建议具体**:给出可执行的教学动作(如“增加XX实例演练”“补充XX对比图”)
  928. # RESPONSE #
  929. 采用段落叙述,数据量化呈现,突出可操作建议,严格控制输出为80词内。采用三段式论述:
  930. 1. 整体表现-1句话
  931. 2. 核心发现-1-2句,指出共性问题+典型案例
  932. 3. 改进建议-1句话,提出具体教学动作
  933. # EXAMPLES #
  934. 样例:
  935. 选择题正确率62%,核心概念“机器学习三步骤”(输入数据→训练模型→预测结果)掌握尚可,但“训练与预测区分”混淆率达38%;建议强化训练vs预测对比教学。`
  936. if (!currentAnalysis.value) {
  937. aiAnalysisData.value.push({
  938. pid: props.workId + (props.cid ? ',' + props.cid : ''),
  939. index: props.showData.workIndex,
  940. loading: true,
  941. generatingContent: true,
  942. json: { text: '', echartsData: '' },
  943. noEnd: true,
  944. update_at: '',
  945. create_at: '',
  946. })
  947. }
  948. else {
  949. aiAnalysisData.value.find((item: any) => {
  950. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  951. }).loading = true
  952. aiAnalysisData.value.find((item: any) => {
  953. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  954. }).json = { text: '', echartsData: '' }
  955. }
  956. chat_stream(msg, 'a7741704-ba56-40b7-a6b8-62a423ef9376', props.userId, lang.lang, (event) => {
  957. if (event.type === 'message') {
  958. aiAnalysisData.value.find((item: any) => {
  959. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  960. }).json.text = event.data
  961. aiAnalysisData.value.find((item: any) => {
  962. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  963. }).loading = false
  964. }
  965. else if (event.type === 'messageEnd') {
  966. aiAnalysisData.value.find((item: any) => {
  967. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  968. }).json.text = event.data
  969. aiAnalysisData.value.find((item: any) => {
  970. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  971. }).noEnd = false
  972. aiAnalysisData.value.find((item: any) => {
  973. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  974. }).update_at = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }).replace(/\//g, '-')
  975. saveAnalysis()
  976. }
  977. }).catch(err => {
  978. console.log('err', err)
  979. })
  980. }
  981. // ai生成投票分析 投票
  982. const aiAnalysisRefresh78 = () => {
  983. const _work = props.showData.choiceQuestionListData[props.showData.workIndex]
  984. const msg = `# CONTEXT #
  985. 你是K-12阶段的AI教育课堂分析助手,基于上传的课件、逐字稿,以及当页的学生答题数据(选择题/问答题/智能体对话/投票)进行智能分析。
  986. # OBJECTIVE #
  987. 输出当前学生答题的分析报告:整体表现、核心发现(共性问题/误区)、教学优化(改进方向),为教师提供教学策略的建议和支持。
  988. #INPUT#
  989. 课程数据:
  990. - 课程名称:${props.courseDetail.title}
  991. - 课程学科:${props.courseDetail.name}
  992. 当前页面答题数据(投票):【分析重点】
  993. - 投票题目:${_work.teststitle}
  994. - 选项数据:${JSON.stringify(_work.choiceUser)}
  995. - 题目图片:${_work.timuList.lenght ? _work.timuList[0].src : ''}
  996. - 未提交学生:${JSON.stringify(props.showData.unsubmittedStudents.map((item: any) => item.name))}
  997. # ANALYSIS RULES #
  998. 1. **问题定位**:明确指出哪个知识点/概念/步骤掌握不佳
  999. 2. **建议具体**:给出可执行的教学动作(如“增加XX实例演练”“补充XX对比图”)
  1000. # RESPONSE #
  1001. 采用段落叙述,数据量化呈现,突出可操作建议,严格控制输出为80词内。采用三段式论述:
  1002. 1. 整体表现-1句话
  1003. 2. 核心发现-1-2句,指出共性问题+典型案例
  1004. 3. 改进建议-1句话,提出具体教学动作
  1005. # EXAMPLES #
  1006. 样例:
  1007. 选择题正确率62%,核心概念“机器学习三步骤”(输入数据→训练模型→预测结果)掌握尚可,但“训练与预测区分”混淆率达38%;建议强化训练vs预测对比教学。`
  1008. if (!currentAnalysis.value) {
  1009. aiAnalysisData.value.push({
  1010. pid: props.workId + (props.cid ? ',' + props.cid : ''),
  1011. index: props.showData.workIndex,
  1012. loading: true,
  1013. generatingContent: true,
  1014. json: { text: '', echartsData: '' },
  1015. noEnd: true,
  1016. update_at: '',
  1017. create_at: '',
  1018. })
  1019. }
  1020. else {
  1021. aiAnalysisData.value.find((item: any) => {
  1022. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1023. }).loading = true
  1024. aiAnalysisData.value.find((item: any) => {
  1025. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1026. }).json = { text: '', echartsData: '' }
  1027. }
  1028. chat_stream(msg, 'a7741704-ba56-40b7-a6b8-62a423ef9376', props.userId, lang.lang, (event) => {
  1029. if (event.type === 'message') {
  1030. aiAnalysisData.value.find((item: any) => {
  1031. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1032. }).json.text = event.data
  1033. aiAnalysisData.value.find((item: any) => {
  1034. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1035. }).loading = false
  1036. }
  1037. else if (event.type === 'messageEnd') {
  1038. aiAnalysisData.value.find((item: any) => {
  1039. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1040. }).json.text = event.data
  1041. aiAnalysisData.value.find((item: any) => {
  1042. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1043. }).noEnd = false
  1044. aiAnalysisData.value.find((item: any) => {
  1045. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1046. }).update_at = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }).replace(/\//g, '-')
  1047. saveAnalysis()
  1048. }
  1049. }).catch(err => {
  1050. console.log('err', err)
  1051. })
  1052. }
  1053. // 问答题
  1054. const aiAnalysisRefresh15 = () => {
  1055. let flag = 0
  1056. const msg = `# CONTEXT #
  1057. 你是K-12阶段的AI教育课堂分析助手,基于上传的课件、逐字稿,以及当页的学生答题数据(选择题/问答题/智能体对话)进行智能分析。
  1058. # OBJECTIVE #
  1059. 输出当前学生答题的分析报告:整体表现、核心发现(共性问题/误区)、教学优化(改进方向),为教师提供教学策略的建议和支持。
  1060. #INPUT#
  1061. 课程数据:
  1062. - 课程名称:${props.courseDetail.title}
  1063. - 课程学科:${props.courseDetail.name}
  1064. 当前页面答题数据(问答题):【分析重点】
  1065. - 问答题题目:${props.showData.workDetail.json.answerQ}
  1066. - 回答数据:${JSON.stringify(processedWorkArray.value.map((i) => ({ user: i.name, answer: i.content.answer })))}
  1067. - 未提交学生:${JSON.stringify(props.showData.unsubmittedStudents.map((item: any) => item.name))}
  1068. # ANALYSIS RULES #
  1069. 1. **问题定位**:明确指出哪个知识点/概念/步骤掌握不佳
  1070. 2. **建议具体**:给出可执行的教学动作(如“增加XX实例演练”“补充XX对比图”)
  1071. # RESPONSE #
  1072. 采用段落叙述,数据量化呈现,突出可操作建议,严格控制输出为80词内。采用三段式论述:
  1073. 1. 整体表现-1句话
  1074. 2. 核心发现-1-2句,指出共性问题+典型案例
  1075. 3. 改进建议-1句话,提出具体教学动作
  1076. # EXAMPLES #
  1077. 样例:
  1078. 30人中15人提交问答题(参与率50%),核心概念“同理心地图”掌握薄弱。发现学生13在智能体对话中6次答“不知道”,需单独辅导设计思维基础概念。建议课程增加POV框架实例演练,强化痛点识别能力训练。`
  1079. if (!currentAnalysis.value) {
  1080. aiAnalysisData.value.push({
  1081. pid: props.workId + (props.cid ? ',' + props.cid : ''),
  1082. index: props.showData.workIndex,
  1083. loading: true,
  1084. generatingContent: true,
  1085. json: { text: '', echartsData: '' },
  1086. noEnd: true,
  1087. update_at: '',
  1088. create_at: '',
  1089. })
  1090. }
  1091. else {
  1092. aiAnalysisData.value.find((item: any) => {
  1093. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1094. }).loading = true
  1095. aiAnalysisData.value.find((item: any) => {
  1096. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1097. }).json = { text: '', echartsData: '' }
  1098. aiAnalysisData.value.find((item: any) => {
  1099. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1100. }).generatingContent = true
  1101. }
  1102. getWordCloud15().then((res) => {
  1103. flag += 1
  1104. aiAnalysisData.value.find((item: any) => {
  1105. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1106. }).generatingContent = false
  1107. if (flag == 2) {
  1108. saveAnalysis()
  1109. }
  1110. })
  1111. chat_stream(msg, 'a7741704-ba56-40b7-a6b8-62a423ef9376', props.userId, lang.lang, (event) => {
  1112. console.log(event)
  1113. if (event.type === 'message') {
  1114. aiAnalysisData.value.find((item: any) => {
  1115. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1116. }).json.text = event.data
  1117. aiAnalysisData.value.find((item: any) => {
  1118. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1119. }).loading = false
  1120. }
  1121. else if (event.type === 'messageEnd') {
  1122. aiAnalysisData.value.find((item: any) => {
  1123. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1124. }).json.text = event.data
  1125. aiAnalysisData.value.find((item: any) => {
  1126. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1127. }).noEnd = false
  1128. aiAnalysisData.value.find((item: any) => {
  1129. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1130. }).update_at = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }).replace(/\//g, '-')
  1131. flag += 1
  1132. if (flag == 2) {
  1133. saveAnalysis()
  1134. }
  1135. }
  1136. }).catch(err => {
  1137. console.log('err', err)
  1138. })
  1139. }
  1140. // 打开词云图弹窗
  1141. const openEchatsDialog = () => {
  1142. if (echartsDialogRef.value && currentAnalysis.value.json.echartsData) {
  1143. echartsDialogRef.value.open(lang.ssKeywordCloud, currentAnalysis.value.json.echartsData)
  1144. }
  1145. }
  1146. // 问答题获取词云图与关键词
  1147. const getWordCloud15 = () => {
  1148. return new Promise((resolve,) => {
  1149. const msg = `## 任务
  1150. 请针对文本中学生提交的问答题回答内容进行深度分析,提炼出 10 - 30 个核心关键词,用于绘制词云图。
  1151. ## 提取准则
  1152. 1. 聚焦内容主体:仅从学生的具体回答文本中提取关键词。
  1153. 2. 严格排除杂质:禁止提取任何属于系统元数据或固定格式的词汇,包括但不限于:“课程数据”、“学生姓名”、“回答结果”、“课程标题”、“提交时间”、“作业名称”、“分数”等。
  1154. 3. 语义去重:将意思相近的词进行合并(例如“高效”与“效率高”),保留最具代表性的词条。
  1155. 4. 涵盖核心:关键词应准确反映学生回答中的核心观点、关键知识点、高频论据或情感倾向。
  1156. ## 任务要求
  1157. 1. 词频统计:计算每个有效关键字在回答内容中出现的频率。
  1158. 2. 词汇大小:根据词频,确定每个关键字在词云中的权重。词频越高,数值越大,范围 1 - 100。
  1159. 3. 输出格式:请严格按照 JSON 格式输出,包含关键词、词频及对应的词汇大小。
  1160. ## 文本
  1161. 课程数据:
  1162. - 课程名称:${props.courseDetail.title}
  1163. - 课程学科:${props.courseDetail.name}
  1164. 当前页面答题数据(问答题):【分析重点】
  1165. - 问答题题目:${props.showData.workDetail.json.answerQ}
  1166. - 回答数据:${JSON.stringify(processedWorkArray.value.map((i) => ({ answer: i.content.answer })))}
  1167. ## 输出示例
  1168. {"tooltip":{"show":false},"series":[{"type":"wordCloud","sizeRange":[14,38],"rotationRange":[0,0],"keepAspect":false,"shape":"circle","left":"center","top":"center","right":null,"bottom":null,"width":"100%","height":"100%","rotationStep":20,"data":[{"value":"词汇大小,数值范围1-100","name":"词汇","textStyle":{"color":"词汇颜色(16进制)"}},{"value":"词汇大小,数值范围1-100","name":"词汇","textStyle":{"color":"(16进制)"}}]}]}`
  1169. chat_no_stream(msg, 'a7741704-ba56-40b7-a6b8-62a423ef9376', props.userId, lang.lang).promise.then((res) => {
  1170. aiAnalysisData.value.find((item: any) => {
  1171. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1172. }).json.echartsData = JSON.parse(res)
  1173. resolve(1)
  1174. }).catch(err => {
  1175. console.log('err', err)
  1176. resolve(0)
  1177. })
  1178. })
  1179. }
  1180. // ai应用
  1181. const aiAnalysisRefresh72 = async () => {
  1182. let chatMsg = ``
  1183. processedWorkArray.value.forEach((i) => {
  1184. i.content.forEach(j => {
  1185. if (j.messages) {
  1186. j.messages.forEach((a) => {
  1187. chatMsg += `\n${a.sender}:
  1188. ${a.content}\n`
  1189. })
  1190. }
  1191. if (j.imageUrls) {
  1192. j.imageUrls.forEach((a) => {
  1193. chatMsg += `\n${a}\n`
  1194. })
  1195. }
  1196. })
  1197. })
  1198. // - 未提交学生:${JSON.stringify(props.showData.unsubmittedStudents.map((item: any) => item.name))}
  1199. const msg = `# CONTEXT #
  1200. 你是K-12阶段的AI教育课堂分析助手,基于上传的课件、逐字稿,以及当页的学生答题数据(选择题/问答题/智能体对话)进行智能分析。
  1201. # OBJECTIVE #
  1202. 输出当前学生答题的分析报告:整体表现、核心发现(共性问题/误区)、教学优化(改进方向),为教师提供教学策略的建议和支持。
  1203. #INPUT#
  1204. 课程数据:
  1205. - 课程名称:${props.courseDetail.title}
  1206. - 课程学科:${props.courseDetail.name}
  1207. 当前页面答题数据(问答题):【分析重点】
  1208. - AI应用
  1209. - 对话数据:${chatMsg}
  1210. # ANALYSIS RULES #
  1211. 1. **问题定位**:明确指出哪个知识点/概念/步骤掌握不佳
  1212. 2. **建议具体**:给出可执行的教学动作(如“增加XX实例演练”“补充XX对比图”)
  1213. # RESPONSE #
  1214. 采用段落叙述,数据量化呈现,突出可操作建议,严格控制输出为80词内。采用三段式论述:
  1215. 1. 整体表现-1句话
  1216. 2. 核心发现-1-2句,指出共性问题+典型案例
  1217. 3. 改进建议-1句话,提出具体教学动作
  1218. # EXAMPLES #
  1219. 样例:
  1220. 智能体对话显示学生对“模型训练”概念模糊,多次询问“为什么不能直接告诉机器答案”。针对概念混淆学生,补充“人类学习类比”相关解释,巩固“从数据中学习规律”核心认知。`
  1221. console.log('cs', msg)
  1222. if (!currentAnalysis.value) {
  1223. aiAnalysisData.value.push({
  1224. pid: props.workId + (props.cid ? ',' + props.cid : ''),
  1225. index: props.showData.workIndex,
  1226. loading: true,
  1227. json: { text: '', echartsData: '' },
  1228. noEnd: true,
  1229. update_at: '',
  1230. create_at: '',
  1231. })
  1232. }
  1233. else {
  1234. aiAnalysisData.value.find((item: any) => {
  1235. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1236. }).loading = true
  1237. aiAnalysisData.value.find((item: any) => {
  1238. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1239. }).json = { text: '', echartsData: '' }
  1240. }
  1241. chat_stream(msg, 'a7741704-ba56-40b7-a6b8-62a423ef9376', props.userId, lang.lang, (event) => {
  1242. if (event.type === 'message') {
  1243. aiAnalysisData.value.find((item: any) => {
  1244. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1245. }).json.text = event.data
  1246. aiAnalysisData.value.find((item: any) => {
  1247. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1248. }).loading = false
  1249. }
  1250. else if (event.type === 'messageEnd') {
  1251. aiAnalysisData.value.find((item: any) => {
  1252. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1253. }).json.text = event.data
  1254. aiAnalysisData.value.find((item: any) => {
  1255. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1256. }).noEnd = false
  1257. aiAnalysisData.value.find((item: any) => {
  1258. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1259. }).update_at = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }).replace(/\//g, '-')
  1260. saveAnalysis()
  1261. }
  1262. }).catch(err => {
  1263. console.log('err', err)
  1264. })
  1265. }
  1266. // 当前分析
  1267. const currentAnalysis = computed(() => {
  1268. const _result = aiAnalysisData.value.find((item: any) => {
  1269. return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
  1270. })
  1271. if (_result?.json?.echartsData) {
  1272. _result.json.keyword = _result.json.echartsData?.series?.[0]?.data?.slice(0, 5).map((item: any) => item.name)
  1273. }
  1274. if (_result) {
  1275. return _result
  1276. }
  1277. return null
  1278. })
  1279. // 保存分析
  1280. const saveAnalysis = () => {
  1281. if (!currentAnalysis.value) {
  1282. return
  1283. }
  1284. const params = [{
  1285. pid: props.workId + (props.cid ? ',' + props.cid : ''),
  1286. idx: props.showData.workIndex,
  1287. json: JSON.stringify(currentAnalysis.value.json),
  1288. }]
  1289. console.log(params)
  1290. axios.post('https://pbl.cocorobo.cn/api/pbl/insert_pptAnalysis', params).then(res => {
  1291. if (res == 1) {
  1292. console.log('保存成功')
  1293. }
  1294. }).catch(err => {
  1295. console.log('insert_pptAnalysis_err', err)
  1296. })
  1297. }
  1298. // 监听 props.showData.workDetail.id 变化
  1299. watch(
  1300. () => props.showData?.workDetail,
  1301. (newId, oldId) => {
  1302. if (newId && newId !== oldId) {
  1303. getAnalysis()
  1304. }
  1305. },
  1306. { immediate: true }
  1307. )
  1308. // onMounted(()=>{
  1309. // getAnalysis()
  1310. // })
  1311. // 组件卸载时清理ECharts实例
  1312. onUnmounted(() => {
  1313. // 清除定时器
  1314. if (resizeTimer) {
  1315. clearTimeout(resizeTimer)
  1316. resizeTimer = null
  1317. }
  1318. // 销毁ECharts实例
  1319. if (myChart.value && !myChart.value.isDisposed()) {
  1320. myChart.value.dispose()
  1321. myChart.value = null
  1322. }
  1323. })
  1324. </script>
  1325. <style lang="scss" scoped>
  1326. .choiceQuestionDetailDialog {
  1327. background: none;
  1328. position: relative;
  1329. width: 100%;
  1330. height: 100%;
  1331. z-index: 1;
  1332. .content {
  1333. width: 100%;
  1334. height: 100%;
  1335. position: relative;
  1336. background: #fff;
  1337. box-sizing: border-box;
  1338. padding: 40px;
  1339. overflow: auto;
  1340. .closeIcon {
  1341. position: absolute;
  1342. right: 20px;
  1343. top: 20px;
  1344. cursor: pointer;
  1345. width: 20px;
  1346. height: 20px;
  1347. img {
  1348. width: 100%;
  1349. height: 100%;
  1350. }
  1351. }
  1352. .c_t45 {
  1353. width: 100%;
  1354. min-height: 100%;
  1355. display: flex;
  1356. // align-items: center;
  1357. flex-direction: column;
  1358. height: auto;
  1359. .c_t45_title {
  1360. color: rgba(0, 0, 0, 0.9);
  1361. font-weight: 600;
  1362. font-size: 24px;
  1363. line-height: 24px;
  1364. position: relative;
  1365. width: 100%;
  1366. display: flex;
  1367. flex-direction: column;
  1368. // align-items: center;
  1369. // justify-content: center;
  1370. user-select: none;
  1371. gap: .4rem;
  1372. &>div {
  1373. max-width: calc(100%);
  1374. }
  1375. &>span {
  1376. position: absolute;
  1377. top: 20px;
  1378. cursor: pointer;
  1379. &:nth-of-type(1) {
  1380. left: 0;
  1381. }
  1382. &:nth-of-type(2) {
  1383. right: 0;
  1384. }
  1385. }
  1386. .c_t45_t_btn_noActive {
  1387. color: #CCCCCC;
  1388. }
  1389. .c_t45_msg {
  1390. display: flex;
  1391. align-items: center;
  1392. font-size: .9rem;
  1393. font-weight: 400;
  1394. gap: 1rem;
  1395. &>span {
  1396. text-decoration: underline;
  1397. cursor: pointer;
  1398. }
  1399. }
  1400. }
  1401. .c_t45_img {
  1402. max-width: 200px;
  1403. max-height: 200px;
  1404. object-fit: cover;
  1405. margin-top: 20px;
  1406. }
  1407. .c_t45_type {
  1408. font-weight: 400;
  1409. font-size: 15px;
  1410. line-height: 21px;
  1411. letter-spacing: 0.5px;
  1412. color: rgba(0, 0, 0, 1);
  1413. opacity: 0.5;
  1414. margin-top: 20px;
  1415. }
  1416. .c_t45_echarts {
  1417. width: 100%;
  1418. max-width: 100%;
  1419. flex: 1;
  1420. min-height: 400px;
  1421. display: flex;
  1422. align-items: center;
  1423. box-sizing: border-box;
  1424. &>div {
  1425. width: 100%;
  1426. height: 400px;
  1427. }
  1428. }
  1429. .cq_changeBtn {
  1430. display: flex;
  1431. align-items: center;
  1432. gap: 1.5rem;
  1433. margin: 1rem auto;
  1434. &>div {
  1435. padding: .6rem;
  1436. border-radius: .5rem;
  1437. border: solid 2px #F6C82B;
  1438. display: flex;
  1439. justify-content: center;
  1440. align-items: center;
  1441. cursor: pointer;
  1442. &>svg {
  1443. fill: #F6C82D;
  1444. width: 1rem;
  1445. height: 1rem;
  1446. }
  1447. &.cq_cb_disabled {
  1448. cursor: not-allowed !important;
  1449. border-color: #FEF8E9 !important;
  1450. }
  1451. &.cq_cb_disabled>svg {
  1452. fill: #A3A3A3 !important;
  1453. }
  1454. }
  1455. &>span {
  1456. font-weight: 500;
  1457. }
  1458. }
  1459. }
  1460. .c_t15 {
  1461. width: 100%;
  1462. min-height: 100%;
  1463. display: flex;
  1464. align-items: center;
  1465. flex-direction: column;
  1466. height: auto;
  1467. padding: 40px;
  1468. .c_t15_title {
  1469. color: rgba(0, 0, 0, 0.9);
  1470. font-weight: 600;
  1471. font-size: 24px;
  1472. line-height: 24px;
  1473. }
  1474. .c_t15_type {
  1475. font-weight: 400;
  1476. font-size: 15px;
  1477. line-height: 21px;
  1478. letter-spacing: 0.5px;
  1479. color: rgba(0, 0, 0, 1);
  1480. opacity: 0.5;
  1481. margin-top: 20px;
  1482. }
  1483. .c_t15_content {
  1484. width: 100%;
  1485. height: auto;
  1486. display: grid;
  1487. grid-template-columns: repeat(3, 1fr);
  1488. gap: 20px;
  1489. margin-top: 40px;
  1490. .c_t15_c_item {
  1491. width: 100%;
  1492. height: auto;
  1493. box-shadow: 2px 4px 20px 0px rgba(0, 0, 0, 0.2);
  1494. box-sizing: border-box;
  1495. border-radius: 12px;
  1496. padding: 16px;
  1497. background: rgba(255, 255, 255, 0.6);
  1498. transition: 0.3s;
  1499. cursor: pointer;
  1500. &:hover {
  1501. box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
  1502. background: rgba(255, 255, 255, 0.6);
  1503. }
  1504. .c_t15_c_i_top {
  1505. display: flex;
  1506. align-items: center;
  1507. gap: 10px;
  1508. &>span {
  1509. display: block;
  1510. width: 25px;
  1511. height: 25px;
  1512. display: flex;
  1513. align-items: center;
  1514. justify-content: center;
  1515. background: rgba(252, 207, 0, 1);
  1516. border-radius: 4px;
  1517. color: rgba(255, 255, 255, 1);
  1518. font-weight: bold;
  1519. font-size: 14px;
  1520. }
  1521. &>div {
  1522. color: rgba(0, 0, 0, 0.7);
  1523. font-weight: 800;
  1524. }
  1525. }
  1526. .c_t15_c_i_bottom {
  1527. margin-top: 15px;
  1528. font-weight: 300;
  1529. font-size: 14px;
  1530. height: 40px;
  1531. max-width: 100%;
  1532. overflow: hidden;
  1533. text-overflow: ellipsis;
  1534. display: -webkit-box;
  1535. -webkit-line-clamp: 2;
  1536. -webkit-box-orient: vertical;
  1537. }
  1538. }
  1539. }
  1540. .c_t15_workDetail {
  1541. width: 100%;
  1542. height: auto;
  1543. margin-top: 40px;
  1544. box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
  1545. box-sizing: border-box;
  1546. padding: 16px;
  1547. border-radius: 12px;
  1548. display: flex;
  1549. flex-direction: column;
  1550. .c_t15_wd_top {
  1551. width: 100%;
  1552. display: flex;
  1553. align-items: center;
  1554. gap: 15px;
  1555. &>img {
  1556. width: 25px;
  1557. height: 25px;
  1558. cursor: pointer;
  1559. }
  1560. &>span {
  1561. display: block;
  1562. width: 30px;
  1563. height: 30px;
  1564. display: flex;
  1565. align-items: center;
  1566. justify-content: center;
  1567. background: rgba(252, 207, 0, 1);
  1568. border-radius: 4px;
  1569. color: rgba(255, 255, 255, 1);
  1570. font-weight: bold;
  1571. font-size: 16px;
  1572. }
  1573. &>div {
  1574. color: rgba(0, 0, 0, 0.7);
  1575. font-weight: 800;
  1576. font-size: 18px;
  1577. }
  1578. }
  1579. .c_t15_wd_content {
  1580. width: 100%;
  1581. margin-top: 20px;
  1582. max-height: 100%;
  1583. overflow: auto;
  1584. flex-wrap: wrap;
  1585. .c_t15_wd_c_imageList {
  1586. width: 100%;
  1587. gap: 20px;
  1588. margin-top: 20px;
  1589. &>img {
  1590. width: 100px;
  1591. height: auto;
  1592. cursor: pointer;
  1593. margin-right: 20px;
  1594. object-fit: cover;
  1595. }
  1596. }
  1597. }
  1598. }
  1599. }
  1600. .c_t72 {
  1601. width: 100%;
  1602. min-height: 100%;
  1603. display: flex;
  1604. align-items: center;
  1605. flex-direction: column;
  1606. height: auto;
  1607. padding: 40px;
  1608. .c_t72_title {
  1609. color: rgba(0, 0, 0, 0.9);
  1610. font-weight: 600;
  1611. font-size: 24px;
  1612. line-height: 24px;
  1613. }
  1614. .c_t72_type {
  1615. font-weight: 400;
  1616. font-size: 15px;
  1617. line-height: 21px;
  1618. letter-spacing: 0.5px;
  1619. color: rgba(0, 0, 0, 1);
  1620. opacity: 0.5;
  1621. margin-top: 20px;
  1622. }
  1623. .c_t72_content {
  1624. width: 100%;
  1625. height: auto;
  1626. display: grid;
  1627. grid-template-columns: repeat(4, 1fr);
  1628. gap: 20px;
  1629. margin-top: 40px;
  1630. .c_t72_c_item {
  1631. width: 100%;
  1632. height: auto;
  1633. box-shadow: 2px 4px 20px 0px rgba(0, 0, 0, 0.2);
  1634. box-sizing: border-box;
  1635. border-radius: 12px;
  1636. padding: 16px;
  1637. background: rgba(255, 255, 255, 0.6);
  1638. transition: 0.3s;
  1639. cursor: pointer;
  1640. &:hover {
  1641. box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
  1642. background: rgba(255, 255, 255, 0.6);
  1643. }
  1644. .c_t72_c_i_top {
  1645. display: flex;
  1646. align-items: center;
  1647. gap: 10px;
  1648. &>span {
  1649. display: block;
  1650. width: 25px;
  1651. height: 25px;
  1652. display: flex;
  1653. align-items: center;
  1654. justify-content: center;
  1655. background: rgba(252, 207, 0, 1);
  1656. border-radius: 4px;
  1657. color: rgba(255, 255, 255, 1);
  1658. font-weight: bold;
  1659. font-size: 14px;
  1660. }
  1661. &>div {
  1662. color: rgba(0, 0, 0, 0.7);
  1663. font-weight: 800;
  1664. }
  1665. }
  1666. .c_t72_c_i_bottom {
  1667. margin-top: 15px;
  1668. font-weight: 300;
  1669. font-size: 14px;
  1670. // height: 40px;
  1671. max-width: 100%;
  1672. overflow: hidden;
  1673. text-overflow: ellipsis;
  1674. display: -webkit-box;
  1675. -webkit-line-clamp: 2;
  1676. -webkit-box-orient: vertical;
  1677. img {
  1678. width: 100%;
  1679. max-height: 200px;
  1680. object-fit: cover;
  1681. }
  1682. }
  1683. }
  1684. }
  1685. .c_t72_workDetail {
  1686. width: 100%;
  1687. height: auto;
  1688. margin-top: 40px;
  1689. box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
  1690. box-sizing: border-box;
  1691. padding: 16px;
  1692. border-radius: 12px;
  1693. display: flex;
  1694. flex-direction: column;
  1695. .c_t72_wd_top {
  1696. width: 100%;
  1697. display: flex;
  1698. align-items: center;
  1699. gap: 15px;
  1700. &>img {
  1701. width: 25px;
  1702. height: 25px;
  1703. cursor: pointer;
  1704. }
  1705. &>span {
  1706. display: block;
  1707. width: 30px;
  1708. height: 30px;
  1709. display: flex;
  1710. align-items: center;
  1711. justify-content: center;
  1712. background: rgba(252, 207, 0, 1);
  1713. border-radius: 4px;
  1714. color: rgba(255, 255, 255, 1);
  1715. font-weight: bold;
  1716. font-size: 16px;
  1717. }
  1718. &>div {
  1719. color: rgba(0, 0, 0, 0.7);
  1720. font-weight: 800;
  1721. font-size: 18px;
  1722. }
  1723. }
  1724. .c_t72_wd_content {
  1725. width: 100%;
  1726. margin-top: 20px;
  1727. max-height: 100%;
  1728. overflow: auto;
  1729. flex-wrap: wrap;
  1730. display: flex;
  1731. align-items: center;
  1732. justify-content: center;
  1733. .na_m_item {
  1734. width: 100%;
  1735. height: auto;
  1736. margin: 10px 0;
  1737. }
  1738. .na_m_i_name {
  1739. width: fit-content;
  1740. max-width: 100%;
  1741. height: auto;
  1742. box-sizing: border-box;
  1743. padding: 10px 10px;
  1744. display: flex;
  1745. align-items: center;
  1746. border-radius: 10px 10px 0 0;
  1747. background-color: #9747ff;
  1748. color: #fff;
  1749. text-overflow: ellipsis;
  1750. overflow: hidden;
  1751. white-space: nowrap;
  1752. }
  1753. .aiName {
  1754. background-color: #0560fc;
  1755. }
  1756. .na_m_i_content {
  1757. padding: 10px;
  1758. border: solid 1px #e7e7e7;
  1759. box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.1);
  1760. border-radius: 0 0 12px 12px;
  1761. background-color: #fff;
  1762. :deep(img) {
  1763. max-width: 100%;
  1764. }
  1765. }
  1766. .messageNode {
  1767. width: 100%;
  1768. height: auto;
  1769. box-sizing: border-box;
  1770. padding: 10px 10px;
  1771. border: 0.5px solid #e7e7e7;
  1772. border-radius: 12px;
  1773. gap: 10px;
  1774. margin-top: 20px;
  1775. }
  1776. .messageNodeArea {
  1777. width: 100%;
  1778. height: auto;
  1779. }
  1780. }
  1781. }
  1782. }
  1783. .c_t73 {
  1784. width: 100%;
  1785. min-height: 100%;
  1786. display: flex;
  1787. align-items: center;
  1788. flex-direction: column;
  1789. height: auto;
  1790. padding: 40px;
  1791. .c_t73_title {
  1792. color: rgba(0, 0, 0, 0.9);
  1793. font-weight: 600;
  1794. font-size: 24px;
  1795. line-height: 24px;
  1796. }
  1797. .c_t73_type {
  1798. font-weight: 400;
  1799. font-size: 15px;
  1800. line-height: 21px;
  1801. letter-spacing: 0.5px;
  1802. color: rgba(0, 0, 0, 1);
  1803. opacity: 0.5;
  1804. margin-top: 20px;
  1805. }
  1806. .c_t73_content {
  1807. width: 100%;
  1808. height: auto;
  1809. display: grid;
  1810. grid-template-columns: repeat(4, 1fr);
  1811. gap: 20px;
  1812. margin-top: 40px;
  1813. .c_t73_c_item {
  1814. width: 100%;
  1815. height: auto;
  1816. box-shadow: 2px 4px 20px 0px rgba(0, 0, 0, 0.2);
  1817. box-sizing: border-box;
  1818. border-radius: 12px;
  1819. padding: 16px;
  1820. background: rgba(255, 255, 255, 0.6);
  1821. transition: 0.3s;
  1822. cursor: pointer;
  1823. &:hover {
  1824. box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
  1825. background: rgba(255, 255, 255, 0.6);
  1826. }
  1827. .c_t73_c_i_top {
  1828. display: flex;
  1829. width: 100%;
  1830. align-items: center;
  1831. gap: 10px;
  1832. &>span {
  1833. display: block;
  1834. width: 25px;
  1835. height: 25px;
  1836. display: flex;
  1837. align-items: center;
  1838. justify-content: center;
  1839. background: rgba(252, 207, 0, 1);
  1840. border-radius: 4px;
  1841. color: rgba(255, 255, 255, 1);
  1842. font-weight: bold;
  1843. font-size: 14px;
  1844. }
  1845. &>div {
  1846. color: rgba(0, 0, 0, 0.7);
  1847. font-weight: 800;
  1848. }
  1849. }
  1850. .c_t73_c_i_bottom {
  1851. margin-top: 15px;
  1852. font-weight: 300;
  1853. font-size: 14px;
  1854. // height: 40px;
  1855. max-width: 100%;
  1856. overflow: hidden;
  1857. text-overflow: ellipsis;
  1858. display: -webkit-box;
  1859. -webkit-line-clamp: 2;
  1860. -webkit-box-orient: vertical;
  1861. img {
  1862. width: 100%;
  1863. max-height: 200px;
  1864. object-fit: cover;
  1865. }
  1866. }
  1867. }
  1868. }
  1869. .c_t73_workDetail {
  1870. width: 100%;
  1871. height: auto;
  1872. margin-top: 40px;
  1873. box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
  1874. box-sizing: border-box;
  1875. padding: 16px;
  1876. border-radius: 12px;
  1877. display: flex;
  1878. flex-direction: column;
  1879. .c_t73_wd_top {
  1880. width: 100%;
  1881. display: flex;
  1882. align-items: center;
  1883. gap: 15px;
  1884. &>img {
  1885. width: 25px;
  1886. height: 25px;
  1887. cursor: pointer;
  1888. }
  1889. &>span {
  1890. display: block;
  1891. width: 30px;
  1892. height: 30px;
  1893. display: flex;
  1894. align-items: center;
  1895. justify-content: center;
  1896. background: rgba(252, 207, 0, 1);
  1897. border-radius: 4px;
  1898. color: rgba(255, 255, 255, 1);
  1899. font-weight: bold;
  1900. font-size: 16px;
  1901. }
  1902. &>div {
  1903. color: rgba(0, 0, 0, 0.7);
  1904. font-weight: 800;
  1905. font-size: 18px;
  1906. }
  1907. }
  1908. .c_t73_wd_content {
  1909. width: 100%;
  1910. margin-top: 20px;
  1911. max-height: 100%;
  1912. overflow: auto;
  1913. flex-wrap: wrap;
  1914. display: flex;
  1915. align-items: center;
  1916. justify-content: center;
  1917. &>img {
  1918. max-width: 100%;
  1919. object-fit: cover;
  1920. }
  1921. }
  1922. }
  1923. }
  1924. }
  1925. }
  1926. .aiAnalysis {
  1927. width: 100%;
  1928. height: auto;
  1929. display: flex;
  1930. flex-direction: column;
  1931. padding: 1rem;
  1932. border: solid 1px #F6C82B;
  1933. border-left-width: 4px;
  1934. border-radius: 1rem;
  1935. gap: 1rem;
  1936. &>.ai_header {
  1937. display: flex;
  1938. align-items: center;
  1939. justify-content: space-between;
  1940. gap: 1rem;
  1941. &>div {
  1942. display: flex;
  1943. align-items: center;
  1944. gap: .5rem;
  1945. &>svg {
  1946. width: 1rem;
  1947. height: 1rem;
  1948. }
  1949. }
  1950. &>.ai_title {
  1951. color: #F7CD49;
  1952. font-weight: 500;
  1953. &>svg {
  1954. fill: #F7CD49;
  1955. width: 1.2rem;
  1956. height: 1.2rem;
  1957. }
  1958. }
  1959. &>.ai_refresh {
  1960. padding: .5rem 1rem;
  1961. border-radius: .5rem;
  1962. background: #F6C82B;
  1963. display: flex;
  1964. justify-content: center;
  1965. align-items: center;
  1966. cursor: pointer;
  1967. color: #000;
  1968. font-weight: bold;
  1969. font-size: .8rem;
  1970. gap: .5rem;
  1971. &>svg {
  1972. fill: #000;
  1973. width: .8rem;
  1974. height: .8rem;
  1975. }
  1976. &.disabled {
  1977. cursor: not-allowed !important;
  1978. background: #FEF8E9 !important;
  1979. }
  1980. }
  1981. }
  1982. &>.ai_content {
  1983. font-size: 1rem;
  1984. font-weight: 500;
  1985. }
  1986. &>.ai_echartsData {
  1987. display: flex;
  1988. flex-wrap: wrap;
  1989. gap: .5rem;
  1990. &>span {
  1991. padding: .2rem .5rem;
  1992. border-radius: .25rem;
  1993. background: #E6F4FF;
  1994. display: flex;
  1995. justify-content: center;
  1996. align-items: center;
  1997. color: #141517;
  1998. font-size: .75rem;
  1999. }
  2000. &>.title {
  2001. font-weight: 600;
  2002. }
  2003. &>.btn {
  2004. font-size: .9rem;
  2005. text-decoration: underline;
  2006. color: #F6C82B;
  2007. cursor: pointer;
  2008. }
  2009. }
  2010. &>.ai_updateTime {
  2011. font-size: .8rem;
  2012. font-weight: 500;
  2013. }
  2014. }
  2015. </style>