index.vue 121 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365
  1. <template>
  2. <div class="pb_content" style="background: #f0f2f5;" v-loading="loading">
  3. <div class="pb_content_body" style="position: relative; margin: 0">
  4. <div class="right">
  5. <div class="courseTop">
  6. <div class="stepsNav">
  7. <el-breadcrumb separator-class="el-icon-arrow-right">
  8. <el-breadcrumb-item :to="{
  9. path:
  10. '/test?userid=' +
  11. userid +
  12. '&oid=' +
  13. oid +
  14. '&org=' +
  15. org +
  16. '&role=' +
  17. role,
  18. }">表单管理</el-breadcrumb-item>
  19. <el-breadcrumb-item>
  20. <span style="color: rgb(15, 126, 255)">查看表单</span>
  21. </el-breadcrumb-item>
  22. </el-breadcrumb>
  23. </div>
  24. <div v-if="!peopleId" class="r_pub_button_retrun" @click="retrunCourse">返回</div>
  25. </div>
  26. <div class="step_box" ref="stepBox" v-loading="pdfLoading">
  27. <div class="boxSticky" ref="boxSticky">
  28. <div class="test_title" :style="!isDesktop?'justify-content: center;':''">
  29. <div class="left">
  30. <div class="title">{{ testJson.title }}</div>
  31. <div class="info" v-if="isDesktop">
  32. <div class="info_box" v-if="testJson.typeN">
  33. <span>类型:</span>
  34. <span>{{ testJson.typeN }}</span>
  35. </div>
  36. <div class="info_box">
  37. <span>填写范围:</span>
  38. <span>{{ testJson.juriP ? testJson.juriP : '所有人' }}</span>
  39. </div>
  40. <div class="info_box" v-if="testJson.overtime">
  41. <span>截止时间:</span>
  42. <span>{{ testJson.overtime }}</span>
  43. </div>
  44. </div>
  45. </div>
  46. <div v-if="!peopleId">
  47. <div class="right" v-if="isDesktop">
  48. <div class="data_box">
  49. <span>提交数量</span>
  50. <!-- <span><span class="big">{{ works.length }}</span>份</span> -->
  51. <span><span class="big">{{ worksArray.length }}</span>份</span>
  52. </div>
  53. <div class="data_box" v-if="testJson.juriP">
  54. <span>表单完成率</span>
  55. <span><span class="big">{{ (iscount / pcount * 100).toFixed(0) }}</span>%</span>
  56. </div>
  57. <div class="data_box" v-if="testJson.juriP">
  58. <span>未完成人数</span>
  59. <span><span class="big">{{ pcount - iscount }}</span></span>
  60. </div>
  61. <div class="btn_box" @click="dialogVisibleShare = true">
  62. <span></span>
  63. <span>提醒</span>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <!-- pc端 查看切换 isDesktop-->
  69. <div class="search_nav" v-if="isDesktop">
  70. <div class="right">
  71. <span :class="{ active: stype == 1 }" @click="checkDataType(1)" v-if="!peopleId">按题目查看</span>
  72. <span :class="{ active: stype == 2 }" @click="checkDataType(2)">按人员查看</span>
  73. <span :class="{ active: stype == 3 }" @click="checkDataType(3)" v-show="false">按数量查看</span>
  74. </div>
  75. <div class="left" v-if="isDesktop">
  76. <!-- <div style="margin-right: 10px;position: relative;" v-if="stype == 2 || stype == 3"> -->
  77. <!-- <div style="margin-right: 10px;position: relative;">
  78. <el-select v-model="TeachingValue" @change="searchCourse" placeholder="按教研室">
  79. <el-option
  80. label="全部"
  81. value="">
  82. </el-option>
  83. <el-option
  84. v-for="item in TeachingOptions"
  85. :key="item.id"
  86. :label="item.name"
  87. :value="item.id">
  88. </el-option>
  89. </el-select>
  90. </div> -->
  91. <div style="margin-right: 10px;position: relative;" v-if="stype == 2 || stype == 3">
  92. <el-date-picker
  93. v-model="SubmitTime"
  94. type="date"
  95. @change="searchCourse"
  96. value-format="yyyy-MM-dd"
  97. placeholder="选择日期">
  98. </el-date-picker>
  99. <!-- <el-select v-model="SubmitTime" placeholder="按提交时间筛选">
  100. <el-option
  101. label="全部"
  102. value="">
  103. </el-option>
  104. <el-option
  105. v-for="item in SubmitTimeOptions"
  106. :key="item.id"
  107. :label="item.name"
  108. :value="item.id">
  109. </el-option>
  110. </el-select> -->
  111. </div>
  112. <div style="margin-right: 10px;position: relative;" v-if="stype == 2 || stype == 3">
  113. <el-input v-model="courseName" class="student_input" :disabled="!(!peopleId)" placeholder="请输入需要搜索的姓名"></el-input>
  114. <span class="serach_icon" @click="searchCourse" ></span>
  115. </div>
  116. <div class="btnA" v-if="stype == 1 && !pdfLoading" @click="exportPDF">导出PDF</div>
  117. <div class="btnA" v-if="stype == 2" @mouseenter="btnDisplay = true" @mouseleave="btnDisplay = false">
  118. 导出数据
  119. <div v-show="btnDisplay" class="buttonBox">
  120. <div type="primary" @click="exportExcel">下载汇总表格</div>
  121. <div type="primary" @click="exportAllWord">导出人员数据</div>
  122. <div type="primary" v-if="stype == 2" @click="exportWordData">word导出</div>
  123. </div>
  124. </div>
  125. <div class="btnA" v-if="stype == 3" @click="exportAllWord2">导出人员数据</div>
  126. <div class="btnA" @click="openChat" v-if="this.worksArray.length && !peopleId">AI分析</div><!--v-if="this.worksArray.length"-->
  127. </div>
  128. </div>
  129. <!-- 手机端 查看切换 isDesktop-->
  130. <div class="search_nav" style="display:flex;justify-content:space-evenly;border: none;" v-if="!isDesktop">
  131. <div class="right">
  132. <span :class="{ active2: stype == 1 }" @click="checkDataType(1)">按题目查看</span>
  133. <span :class="{ active2: stype == 2 }" @click="checkDataType(2)">按人员查看</span>
  134. <span :class="{ active2: stype == 3 }" @click="checkDataType(3)" v-show="false">按数量查看</span>
  135. </div>
  136. </div>
  137. </div>
  138. <!-- 按题目pc端 isDesktop-->
  139. <div class="title_content" v-if="stype == 1 && isDesktop" v-loading="isLoading">
  140. <div class="title_box" v-if="!testArray.length"
  141. style="display: flex;align-items: center;justify-content: center;height: 500px;">
  142. 暂无内容
  143. </div>
  144. <div class="title_box" v-for="(item, index) in testArray" :key="index">
  145. <div class="title">
  146. <el-tooltip :content="selectType(item)" placement="top" effect="dark">
  147. <span class="test_icon"
  148. :class="{ test_icon_check: item.type == 1 && item.atype == 2, test_icon_checkO: item.type == 1 && item.atype == 1, test_icon_gap: item.type == 3, test_icon_file: item.type == 5, test_course_file: item.type == 6 || item.type == 11, test_eva_file: item.type == 7,test_icon_time: item.type == 8 }"></span>
  149. </el-tooltip>
  150. <span style="line-height: 25px;">{{ item.title }}</span>
  151. <el-button v-if="item.type == 5 && item.array.length>0" class="title_downBtn" type="primary" size="small" @click.stop="downloadFileType5(item.array,item.title,index)">批量下载附件</el-button>
  152. <div v-if="item.type==7" style="right:0;position: absolute;">平均分:{{ getAverageScore(index) }}</div>
  153. </div>
  154. <div class="detail" v-if="item.detail">{{ item.detail }}</div>
  155. <div class="content1" v-if="item.type == 1">
  156. <div class="left">
  157. <div class="title">
  158. <span>选项</span>
  159. <span>小计</span>
  160. <span>比例</span>
  161. </div>
  162. <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  163. <span>
  164. <el-tooltip :content="data.name" placement="top" effect="dark">
  165. <!-- content to trigger tooltip here -->
  166. <span>{{ data.name }}</span>
  167. </el-tooltip>
  168. </span>
  169. <span>{{ data.count }}</span>
  170. <span>
  171. <el-progress style="display: flex;align-items: center;" :stroke-width="12" color="#3681fc"
  172. :percentage="data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0"></el-progress>
  173. </span>
  174. </div>
  175. </div>
  176. <div class="right">
  177. <checkPie :dataJ="item.array"></checkPie>
  178. </div>
  179. </div>
  180. <div class="content2" v-if="item.type == 3">
  181. <div class="left">
  182. <div class="title">
  183. <span>序号</span>
  184. <span>词频</span>
  185. <span>答案文本</span>
  186. </div>
  187. <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  188. <span>{{ index2 + 1 }}</span>
  189. <span>{{ data.count }}次</span>
  190. <el-tooltip :content="data.name" placement="top" effect="dark">
  191. <!-- content to trigger tooltip here -->
  192. <span>{{ data.name }}</span>
  193. </el-tooltip>
  194. </div>
  195. </div>
  196. <div class="right">
  197. <wordcloud :data="item.array" nameKey="name" valueKey="count" :showTooltip="false"
  198. :wordClick="wordClickHandler">
  199. </wordcloud>
  200. </div>
  201. </div>
  202. <div class="content3" :style="{'position': 'relative','overflow': (fileLoading[index].bool ? 'hidden':'auto')}" v-if="item.type == 5">
  203. <div class="file" v-for="(file, index2) in item.array" :key="index + '-' + index2"
  204. @click.stop="checkFile(file)">
  205. <img class="download" src="../../../../assets/icon/fileIcon/download.png"
  206. @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
  207. <img class="img" :src="wordIcon" alt="" v-if="file.type == 1" />
  208. <img class="img" :src="videoIcon" alt="" v-if="file.type == 2" />
  209. <img class="img" :src="file.url" alt="" v-if="file.type == 3" />
  210. <img class="img" :src="wordIcon" alt="" v-if="file.type == 4" />
  211. <img class="img" :src="fileIcon" alt="" v-if="file.type == 5" />
  212. <div class="name">
  213. <el-tooltip :content="file.name" placement="top" effect="dark">
  214. <span>{{ file.name }}</span>
  215. </el-tooltip>
  216. </div>
  217. </div>
  218. <div v-if="
  219. fileLoading[index].bool
  220. " class="mask">
  221. <div class="progressBox">
  222. <div class="lbox">
  223. <img src="../../../../assets/loading.gif" />打包中,请稍后
  224. </div>
  225. <div style="margin-bottom: 10px">
  226. <span>{{
  227. fileLoading[index].load
  228. }}</span>
  229. /
  230. <span>{{
  231. fileLoading[index].count
  232. }}</span>
  233. </div>
  234. <el-progress :text-inside="true" :stroke-width="20" :percentage=" fileLoading[index].progress
  235. ? fileLoading[index].progress
  236. : 0
  237. " style="width: 80%"></el-progress>
  238. </div>
  239. </div>
  240. </div>
  241. <div class="content4" v-if="item.type == 6">
  242. <div class="out_box" v-for="(item, index) in item.courseArray" :key="index + '-' + index2">
  243. <div class="tup">
  244. <img :src="item.cover != null && item.cover != ''
  245. ? JSON.parse(item.cover).length > 0
  246. ? JSON.parse(item.cover)[0].url
  247. : mr
  248. : mr
  249. " alt />
  250. <div class="bottom_box">
  251. <div>
  252. <el-tooltip :content="item.title" popper-class="text_tooltip" placement="top" effect="dark">
  253. <span>{{ item.title }}</span>
  254. </el-tooltip>
  255. </div>
  256. <div class="kc_t">
  257. <span>{{ item.username }}</span>
  258. <span>{{ item.state == 1 ? '阶段模式' : item.state == 2 ? '任务模式' : '极简模式' }}</span>
  259. </div>
  260. <div class="kc_time">
  261. <span style="color: #717C8D">创建日期:</span>{{ item.time }}
  262. </div>
  263. <div class="kc_time">
  264. <span style="color: #717C8D">修改日期:</span>{{ item.update_at }}
  265. </div>
  266. </div>
  267. </div>
  268. </div>
  269. <!-- <div class="courses" v-for="(courses, index2) in item.array" :key="index + '-' + index2">
  270. {{ courses }}
  271. </div> -->
  272. </div>
  273. <div class="content1" v-if="item.type == 7">
  274. <div class="left">
  275. <div class="title">
  276. <span>评分</span>
  277. <span>小计</span>
  278. <span>比例</span>
  279. </div>
  280. <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  281. <span>
  282. <span>{{ data.name }}</span>
  283. </span>
  284. <span>{{ data.count }}</span>
  285. <span>
  286. <el-progress style="display: flex;align-items: center;" :stroke-width="12" color="#3681fc"
  287. :percentage="data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0"></el-progress>
  288. </span>
  289. </div>
  290. </div>
  291. <div class="right">
  292. <checkPie :dataJ="item.array"></checkPie>
  293. </div>
  294. </div>
  295. <div class="content2" v-if="item.type == 8">
  296. <div class="left">
  297. <div class="title">
  298. <span>序号</span>
  299. <span>词频</span>
  300. <span>日期</span>
  301. </div>
  302. <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  303. <span>{{ index2 + 1 }}</span>
  304. <span>{{ data.count }}次</span>
  305. <el-tooltip :content="data.name" placement="top" effect="dark">
  306. <!-- content to trigger tooltip here -->
  307. <span>{{ data.name }}</span>
  308. </el-tooltip>
  309. </div>
  310. </div>
  311. <div class="right">
  312. <wordcloud :data="item.array" nameKey="name" valueKey="count" :showTooltip="false"
  313. :wordClick="wordClickHandler">
  314. </wordcloud>
  315. </div>
  316. </div>
  317. <div class="content4" v-if="item.type == 11">
  318. <div class="out_box" v-for="(item, index) in item.courseArray" :key="index + '-' + index2">
  319. <div class="tup">
  320. <img :src="item.cover != null && item.cover != ''
  321. ? JSON.parse(item.cover).length > 0
  322. ? JSON.parse(item.cover)[0].url
  323. : mr
  324. : mr
  325. " alt />
  326. <div class="bottom_box">
  327. <div>
  328. <el-tooltip :content="item.title" popper-class="text_tooltip" placement="top" effect="dark">
  329. <span>{{ item.title }}</span>
  330. </el-tooltip>
  331. </div>
  332. <div class="kc_t">
  333. <span>{{ item.username }}</span>
  334. <span>{{ item.state == 1 ? '阶段模式' : item.state == 2 ? '任务模式' : '极简模式' }}</span>
  335. </div>
  336. <div class="kc_time">
  337. <span style="color: #717C8D">创建日期:</span>{{ item.time }}
  338. </div>
  339. <div class="kc_time">
  340. <span style="color: #717C8D">修改日期:</span>{{ item.update_at }}
  341. </div>
  342. </div>
  343. </div>
  344. </div>
  345. <!-- <div class="courses" v-for="(courses, index2) in item.array" :key="index + '-' + index2">
  346. {{ courses }}
  347. </div> -->
  348. </div>
  349. </div>
  350. </div>
  351. <!-- 按题目手机端 !isDesktop-->
  352. <div class="title_content" v-if="stype == 1 && !isDesktop" v-loading="isLoading">
  353. <div class="title_box" v-if="!testArray.length"
  354. style="display: flex;align-items: center;justify-content: center;height: 500px;">
  355. 暂无内容
  356. </div>
  357. <div class="title_box" v-for="(item, index) in testArray" :key="index">
  358. <div class="title" style="font-size: 16px;display: flex;justify-content: space-between;align-items: center;">
  359. <!-- <el-tooltip :content="selectType(item)" placement="top" effect="dark">
  360. <span class="test_icon"
  361. :class="{ test_icon_check: item.type == 1 && item.atype == 2, test_icon_checkO: item.type == 1 && item.atype == 1, test_icon_gap: item.type == 3, test_icon_file: item.type == 5, test_course_file: item.type == 6, test_eva_file: item.type == 7,test_icon_time: item.type == 8 }"></span>
  362. </el-tooltip> -->
  363. <div style="display: flex;">
  364. <div class="topicTitCss">第{{ index+1 }}题:</div>
  365. <el-tooltip :content="item.title" placement="top" effect="dark">
  366. <div style="width: 100px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ item.title }}</div>
  367. </el-tooltip>
  368. </div>
  369. <div style="display: flex;">
  370. <!-- <div v-if="item.type==7" style="right:0;position: absolute;">平均分:{{ getAverageScore(index) }}</div> -->
  371. <div style="color: rgba(0, 0, 0, 0.4);display: flex;align-items: center;">[{{ selectType(item) }}]</div>
  372. <!-- <el-button style="padding: 5px;" v-if="item.type == 5 && item.array.length>0" class="title_downBtn" type="primary" size="small" @click.stop="downloadFileType5(item.array,item.title)">批量下载附件</el-button> -->
  373. </div>
  374. </div>
  375. <div class="detail" v-if="item.detail">{{ item.detail }}</div>
  376. <div class="content1" style="width:100%;display: block;" v-if="item.type == 1">
  377. <div class="left" style="width:100%" v-if="!item.cut">
  378. <div class="isDesktopTitle">
  379. <div>选项</div>
  380. <div>小计</div>
  381. <div>比例</div>
  382. </div>
  383. <div class="isDesktopTitle" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  384. <!-- <span> -->
  385. <el-tooltip :content="data.name" placement="top" effect="dark">
  386. <!-- content to trigger tooltip here -->
  387. <div>{{ data.name }}</div>
  388. </el-tooltip>
  389. <!-- </span> -->
  390. <div>{{ data.count }}</div>
  391. <div>
  392. {{ data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0 }}
  393. <!-- <el-progress style="display: flex;align-items: center;" :stroke-width="12" color="#3681fc"
  394. :percentage="data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0"></el-progress> -->
  395. </div>
  396. </div>
  397. </div>
  398. <div class="right isDesktopRight" v-if="item.cut">
  399. <checkPie :dataJ="item.array"></checkPie>
  400. </div>
  401. <div class="cutBtnBlockCss">
  402. <div class="cutBtnCss" @click="item.cut=!item.cut">{{ item.cut?'查看详情':'查看视图' }}</div>
  403. </div>
  404. </div>
  405. <div class="content2" style="width:100%;display: block;" v-if="item.type == 3">
  406. <div class="left" style="width:100%" v-if="!item.cut">
  407. <div class="title">
  408. <span>序号</span>
  409. <span>词频</span>
  410. <span>答案文本</span>
  411. </div>
  412. <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  413. <span>{{ index2 + 1 }}</span>
  414. <span>{{ data.count }}次</span>
  415. <el-tooltip :content="data.name" placement="top" effect="dark">
  416. <!-- content to trigger tooltip here -->
  417. <span>{{ data.name }}</span>
  418. </el-tooltip>
  419. </div>
  420. </div>
  421. <div class="right isDesktopRight" v-if="item.cut">
  422. <wordcloud :data="item.array" nameKey="name" valueKey="count" :showTooltip="false"
  423. :wordClick="wordClickHandler">
  424. </wordcloud>
  425. </div>
  426. <div class="cutBtnBlockCss">
  427. <div class="cutBtnCss" @click="item.cut=!item.cut">{{ item.cut?'查看详情':'查看视图' }}</div>
  428. </div>
  429. </div>
  430. <div class="content3" v-if="item.type == 5">
  431. <div class="file" v-for="(file, index2) in item.array" :key="index + '-' + index2"
  432. @click.stop="checkFile(file)">
  433. <img class="download" src="../../../../assets/icon/fileIcon/download.png"
  434. @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
  435. <img class="img" :src="wordIcon" alt="" v-if="file.type == 1" />
  436. <img class="img" :src="videoIcon" alt="" v-if="file.type == 2" />
  437. <img class="img" :src="file.url" alt="" v-if="file.type == 3" />
  438. <img class="img" :src="wordIcon" alt="" v-if="file.type == 4" />
  439. <img class="img" :src="fileIcon" alt="" v-if="file.type == 5" />
  440. <div class="name">
  441. <el-tooltip :content="file.name" placement="top" effect="dark">
  442. <span>{{ file.name }}</span>
  443. </el-tooltip>
  444. </div>
  445. </div>
  446. </div>
  447. <div class="content4" v-if="item.type == 6">
  448. <div class="out_box" v-for="(item, index) in item.courseArray" :key="index + '-' + index2">
  449. <div class="tup">
  450. <img :src="item.cover != null && item.cover != ''
  451. ? JSON.parse(item.cover).length > 0
  452. ? JSON.parse(item.cover)[0].url
  453. : mr
  454. : mr
  455. " alt />
  456. <div class="bottom_box">
  457. <div>
  458. <el-tooltip :content="item.title" popper-class="text_tooltip" placement="top" effect="dark">
  459. <span>{{ item.title }}</span>
  460. </el-tooltip>
  461. </div>
  462. <div class="kc_t">
  463. <span>{{ item.username }}</span>
  464. <span>{{ item.state == 1 ? '阶段模式' : item.state == 2 ? '任务模式' : '极简模式' }}</span>
  465. </div>
  466. <div class="kc_time">
  467. <span style="color: #717C8D">创建日期:</span>{{ item.time }}
  468. </div>
  469. <div class="kc_time">
  470. <span style="color: #717C8D">修改日期:</span>{{ item.update_at }}
  471. </div>
  472. </div>
  473. </div>
  474. </div>
  475. <!-- <div class="courses" v-for="(courses, index2) in item.array" :key="index + '-' + index2">
  476. {{ courses }}
  477. </div> -->
  478. </div>
  479. <div class="content1" style="width:100%;display: block;" v-if="item.type == 7">
  480. <div class="left" style="width:100%" v-if="!item.cut">
  481. <div class="isDesktopTitle">
  482. <div>评分</div>
  483. <div>小计</div>
  484. <div style="width: 120px;">比例</div>
  485. </div>
  486. <div class="isDesktopTitle" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  487. <!-- <span> -->
  488. <div>{{ data.name }}</div>
  489. <!-- </span> -->
  490. <div>{{ data.count }}</div>
  491. <div style="width: 120px;">
  492. {{ data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0 }}
  493. <!-- <el-progress style="display: flex;align-items: center;" :stroke-width="12" color="#3681fc"
  494. :percentage="data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0"></el-progress> -->
  495. </div>
  496. </div>
  497. </div>
  498. <div class="right isDesktopRight" v-if="item.cut">
  499. <checkPie :dataJ="item.array"></checkPie>
  500. </div>
  501. <div class="cutBtnBlockCss">
  502. <div class="cutBtnCss" @click="item.cut=!item.cut">{{ item.cut?'查看详情':'查看视图' }}</div>
  503. </div>
  504. </div>
  505. <div class="content2" style="width:100%;display: block;" v-if="item.type == 8">
  506. <div class="left" style="width:100%" v-if="!item.cut">
  507. <div class="title">
  508. <span>序号</span>
  509. <span>词频</span>
  510. <span>日期</span>
  511. </div>
  512. <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  513. <span>{{ index2 + 1 }}</span>
  514. <span>{{ data.count }}次</span>
  515. <el-tooltip :content="data.name" placement="top" effect="dark">
  516. <!-- content to trigger tooltip here -->
  517. <span>{{ data.name }}</span>
  518. </el-tooltip>
  519. </div>
  520. </div>
  521. <div class="right isDesktopRight" v-if="item.cut">
  522. <wordcloud :data="item.array" nameKey="name" valueKey="count" :showTooltip="false"
  523. :wordClick="wordClickHandler">
  524. </wordcloud>
  525. </div>
  526. <div class="cutBtnBlockCss">
  527. <div class="cutBtnCss" @click="item.cut=!item.cut">{{ item.cut?'查看详情':'查看视图' }}</div>
  528. </div>
  529. </div>
  530. <div class="content4" v-if="item.type == 11">
  531. <div class="out_box" v-for="(item, index) in item.courseArray" :key="index + '-' + index2">
  532. <div class="tup">
  533. <img :src="item.cover != null && item.cover != ''
  534. ? JSON.parse(item.cover).length > 0
  535. ? JSON.parse(item.cover)[0].url
  536. : mr
  537. : mr
  538. " alt />
  539. <div class="bottom_box">
  540. <div>
  541. <el-tooltip :content="item.title" popper-class="text_tooltip" placement="top" effect="dark">
  542. <span>{{ item.title }}</span>
  543. </el-tooltip>
  544. </div>
  545. <div class="kc_t">
  546. <span>{{ item.username }}</span>
  547. <span>{{ item.state == 1 ? '阶段模式' : item.state == 2 ? '任务模式' : '极简模式' }}</span>
  548. </div>
  549. <div class="kc_time">
  550. <span style="color: #717C8D">创建日期:</span>{{ item.time }}
  551. </div>
  552. <div class="kc_time">
  553. <span style="color: #717C8D">修改日期:</span>{{ item.update_at }}
  554. </div>
  555. </div>
  556. </div>
  557. </div>
  558. <!-- <div class="courses" v-for="(courses, index2) in item.array" :key="index + '-' + index2">
  559. {{ courses }}
  560. </div> -->
  561. </div>
  562. </div>
  563. </div>
  564. <div class="aiBoxRight" ref="aiBoxRightDivRef" v-show="aiChatV && isDesktop" v-if="!peopleId">
  565. <aiBoxRight :courseId="cid" :worksArray="[{name:testJson.title,worksArray:worksArray}]" ref="aiChat"></aiBoxRight>
  566. </div>
  567. <!-- 按人员pc端 isDesktop-->
  568. <div class="table_content" v-if="stype == 2 && isDesktop">
  569. <el-table class="el-table" ref="table" :data="worksArray" border :fit="true" :key="2" v-loading="isLoading"
  570. style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
  571. @filter-change="handleFilterChange">
  572. <el-table-column fixed label="序号" width="80px" align="left">
  573. <template slot-scope="scope">
  574. {{ scope.$index + 1 }}
  575. </template>
  576. </el-table-column>
  577. <el-table-column fixed prop="name" label="提交人" width="120px" align="left">
  578. </el-table-column>
  579. <el-table-column prop="time" label="提交时间" width="170px" align="left">
  580. <template slot-scope="scope">
  581. <span :style="`${testJson.overtime&&new Date(testJson.overtime)<new Date(scope.row.time)?'color:#d12920':''}`">{{ scope.row.time }}</span>
  582. </template>
  583. </el-table-column>
  584. <el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title"
  585. :min-width="item.type == 5 ? 200 : 150" align="left"
  586. :filters="item.type == 1 ? item.nameFilters : (item.type == 6 || item.type == 11)? item.nameFilters : item.type==8?getTimeFilterText(item,index):null"
  587. :filter-method="item.type == 1 ? (value, row) => { return filterName(value, row, index) } : (item.type == 6 || item.type == 11)?(value, row) => { return filterCourse(value, row, index)}:item.type==8?(value,row)=>{return filterTime(value,row,index)}:null"
  588. :filter-placement="item.type == 8 ||item.type == 1 || item.type ==6|| item.type ==11 ? filterPlacement : null">
  589. <template slot-scope="scope">
  590. <div v-if="scope.row.array[index].type == 1" style="display: flex; flex-wrap: wrap;">
  591. <span class="answer_type" v-for="(answer2, index2) in scope.row.array[index].json.answer2"
  592. :key="index + '-' + index2">{{ scope.row.array[index].json.array[answer2].option }}</span>
  593. </div>
  594. <div v-if="scope.row.array[index].type == 3 || scope.row.array[index].type == 8" style="display: flex; flex-wrap: wrap;">
  595. {{ scope.row.array[index].json.answer2 }}
  596. </div>
  597. <div v-if="scope.row.array[index].type == 5" style="display: flex; flex-wrap: wrap;"
  598. class="table_file">
  599. <div class="file" v-for="(file, index2) in scope.row.array[index].json.file"
  600. :key="index + '-' + index2" @click.stop="checkFile(file)">
  601. <img class="download" src="../../../../assets/icon/fileIcon/download.png"
  602. @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
  603. <img class="img" :src="wordIcon" alt="" v-if="file.type == 1" />
  604. <img class="img" :src="videoIcon" alt="" v-if="file.type == 2" />
  605. <img class="img" :src="file.url" alt="" v-if="file.type == 3" />
  606. <img class="img" :src="wordIcon" alt="" v-if="file.type == 4" />
  607. <img class="img" :src="fileIcon" alt="" v-if="file.type == 5" />
  608. <div class="name">
  609. <el-tooltip :content="file.name" placement="top" effect="dark">
  610. <span>{{ file.name }}</span>
  611. </el-tooltip>
  612. </div>
  613. </div>
  614. </div>
  615. <div v-if="scope.row.array[index].type == 6" style="display: flex; flex-wrap: wrap;">
  616. {{ scope.row.array[index].json.answer2}}
  617. </div>
  618. <div v-if="scope.row.array[index].type == 7" style="display: flex; flex-wrap: wrap;">
  619. {{ getScore(scope.row.array[index].json) }}
  620. </div>
  621. <div v-if="scope.row.array[index].type == 11" style="display: flex; flex-wrap: wrap;">
  622. {{ scope.row.array[index].json.answer2}}
  623. </div>
  624. </template>
  625. </el-table-column>
  626. <el-table-column label="操作" width="200px" fixed="right" v-if="isN!=1">
  627. <template slot-scope="scope">
  628. <el-button @click="getTest(scope.row)" type="primary" size="small">查看</el-button>
  629. <!-- <el-button @click="setWordHtml(scope.row)" type="primary" size="small">导出答题信息</el-button>
  630. <el-button @click="setWordTemplate(scope.row)" type="primary" size="small">word导出</el-button> -->
  631. <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
  632. </template>
  633. </el-table-column>
  634. </el-table>
  635. </div>
  636. <!-- 按人员手机端 !isDesktop-->
  637. <div class="table_content" v-if="stype == 2 && !isDesktop">
  638. <div v-for="(i,index) in worksArray" :key="i.id" class="isDesktopTable_content">
  639. <div class="isDTitle CutCss">
  640. <div style="font-size: 16px;font-weight: 600;">{{ i.name }}</div>
  641. <div :style="'font-size: 14px'+i.cut?'color:rgba(54, 129, 252, 1)':'color: rgba(0, 0, 0, 0.6);'">{{ i.time }}</div>
  642. <div @click="i.cut=!i.cut">
  643. <img v-if="!i.cut" src="../../../../assets/icon/fileIcon/downImg.png" alt="">
  644. <img v-else src="../../../../assets/icon/fileIcon/upImg.png" alt="">
  645. </div>
  646. </div>
  647. <div v-if="i.cut">
  648. <div class="isDBri">
  649. <div>序号:{{ i.time }}</div>
  650. <div>提交时间:{{ i.time }}</div>
  651. <div>评课人:{{ i.uteaName }}</div>
  652. </div>
  653. <div style="height: 1px;background-color: #717C8D;width: 100%;margin-bottom: 10px;"></div>
  654. <div>
  655. <div v-for="(k,kin) in chapters" :key="k.id" class="isCTiBlc">
  656. <div v-if="k.type == 1">
  657. <div class="isDTitle2">
  658. <div style="display: flex;justify-content: space-between;">
  659. <div style="display: flex;">
  660. <span class="topicTitCss">第{{kin+1}}题:</span>
  661. <div class="isDTitle2JsonTit">
  662. {{ k.json.title }}
  663. </div>
  664. </div>
  665. <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
  666. </div>
  667. <div class="IsDAnswer">
  668. <div v-for="(r, index2) in i.array[kin].json.answer2"
  669. :key="index + '-' + index2">
  670. {{ i.array[kin].json.array[r].option }}
  671. </div>
  672. </div>
  673. </div>
  674. </div>
  675. <div v-if="k.type == 3 || k.type == 8">
  676. <div class="isDTitle2">
  677. <div style="display: flex;justify-content: space-between;">
  678. <div style="display: flex;">
  679. <span class="topicTitCss">第{{kin+1}}题:</span>
  680. <div class="isDTitle2JsonTit">
  681. {{ k.json.title }}
  682. </div>
  683. </div>
  684. <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
  685. </div>
  686. <div class="IsDAnswer">
  687. {{ i.array[kin].json.answer2 }}
  688. </div>
  689. </div>
  690. </div>
  691. <div v-if="k.type == 5">
  692. <div class="isDTitle2">
  693. <div style="display: flex;justify-content: space-between;">
  694. <div style="display: flex;">
  695. <span class="topicTitCss">第{{kin+1}}题:</span>
  696. <div class="isDTitle2JsonTit">
  697. {{ k.json.title }}
  698. </div>
  699. </div>
  700. <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
  701. </div>
  702. <div class="IsDAnswer">
  703. <div class="IsDFile" v-for="(file, index2) in i.array[kin].json.file"
  704. :key="index + '-' + index2" @click.stop="checkFile(file)">
  705. <img class="IsDownload" src="../../../../assets/icon/fileIcon/download.png"
  706. @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
  707. <img class="IsDImg" :src="wordIcon" alt="" v-if="file.type == 1" />
  708. <img class="IsDImg" :src="videoIcon" alt="" v-if="file.type == 2" />
  709. <img class="IsDImg" :src="file.url" alt="" v-if="file.type == 3" />
  710. <img class="IsDImg" :src="wordIcon" alt="" v-if="file.type == 4" />
  711. <img class="IsDImg" :src="fileIcon" alt="" v-if="file.type == 5" />
  712. <div class="name" style="height: 30px;background-color: #f9f9f9;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  713. <!-- <el-tooltip :content="file.name" placement="top" effect="dark"> -->
  714. {{ file.name }}
  715. <!-- </el-tooltip> -->
  716. </div>
  717. </div>
  718. </div>
  719. </div>
  720. </div>
  721. <div v-if="k.type.type == 6">
  722. <div class="isDTitle2">
  723. <div style="display: flex;justify-content: space-between;">
  724. <div style="display: flex;">
  725. <span class="topicTitCss">第{{kin+1}}题:</span>
  726. <div class="isDTitle2JsonTit">
  727. {{ k.json.title }}
  728. </div>
  729. </div>
  730. <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
  731. </div>
  732. <div class="IsDAnswer">
  733. {{ i.array[kin].json.answer2 }}
  734. </div>
  735. </div>
  736. </div>
  737. <div v-if="k.type == 7">
  738. <div class="isDTitle2">
  739. <div style="display: flex;justify-content: space-between;">
  740. <div style="display: flex;">
  741. <span class="topicTitCss">第{{kin+1}}题:</span>
  742. <div class="isDTitle2JsonTit">
  743. {{ k.json.title }}
  744. </div>
  745. </div>
  746. <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
  747. </div>
  748. <div class="IsDAnswer">
  749. {{ getScore(i.array[index].json) }}
  750. </div>
  751. </div>
  752. </div>
  753. <div v-if="k.type.type == 11">
  754. <div class="isDTitle2">
  755. <div style="display: flex;justify-content: space-between;">
  756. <div style="display: flex;">
  757. <span class="topicTitCss">第{{kin+1}}题:</span>
  758. <div class="isDTitle2JsonTit">
  759. {{ k.json.title }}
  760. </div>
  761. </div>
  762. <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
  763. </div>
  764. <div class="IsDAnswer">
  765. {{ i.array[kin].json.answer2 }}
  766. </div>
  767. </div>
  768. </div>
  769. </div>
  770. </div>
  771. <div style="width: 100%;display: flex;justify-content: end;">
  772. <div @click="i.cut=!i.cut" style="display: flex;flex-direction: column;align-items: center">
  773. <img src="../../../../assets/icon/fileIcon/retractImg.png" alt="">
  774. <div style="color: rgba(0, 0, 0, 0.4);font-size: 16px;">收起</div>
  775. </div>
  776. </div>
  777. </div>
  778. <div style="height: 1px;background-color: #717C8D;width: 100%;margin-bottom: 10px;"></div>
  779. </div>
  780. <!-- <el-table class="el-table" ref="table" :data="worksArray" border :fit="true" :key="2" v-loading="isLoading"
  781. style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
  782. @filter-change="handleFilterChange">
  783. <el-table-column fixed label="序号" width="80px" align="left">
  784. <template slot-scope="scope">
  785. {{ scope.$index + 1 }}
  786. </template>
  787. </el-table-column>
  788. <el-table-column fixed prop="name" label="提交人" width="120px" align="left">
  789. </el-table-column>
  790. <el-table-column prop="time" label="提交时间" width="170px" align="left">
  791. <template slot-scope="scope">
  792. <span :style="`${testJson.overtime&&new Date(testJson.overtime)<new Date(scope.row.time)?'color:#d12920':''}`">{{ scope.row.time }}</span>
  793. </template>
  794. </el-table-column>
  795. <el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title"
  796. :min-width="item.type == 5 ? 200 : 150" align="left" :filters="item.type == 1 ? item.nameFilters : item.type == 6? item.nameFilters : null"
  797. :filter-method="item.type == 1 ? (value, row) => { return filterName(value, row, index) } : item.type == 6?(value, row) => { return filterCourse(value, row, index)}:null"
  798. :filter-placement="item.type == 1 || item.type ==6 ? filterPlacement : null">
  799. <template slot-scope="scope">
  800. <div v-if="scope.row.array[index].type == 1" style="display: flex; flex-wrap: wrap;">
  801. <span class="answer_type" v-for="(answer2, index2) in scope.row.array[index].json.answer2"
  802. :key="index + '-' + index2">{{ scope.row.array[index].json.array[answer2].option }}</span>
  803. </div>
  804. <div v-if="scope.row.array[index].type == 3 || scope.row.array[index].type == 8" style="display: flex; flex-wrap: wrap;">
  805. {{ scope.row.array[index].json.answer2 }}
  806. </div>
  807. <div v-if="scope.row.array[index].type == 5" style="display: flex; flex-wrap: wrap;"
  808. class="table_file">
  809. <div class="file" v-for="(file, index2) in scope.row.array[index].json.file"
  810. :key="index + '-' + index2" @click.stop="checkFile(file)">
  811. <img class="download" src="../../../../assets/icon/fileIcon/download.png"
  812. @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
  813. <img class="img" :src="wordIcon" alt="" v-if="file.type == 1" />
  814. <img class="img" :src="videoIcon" alt="" v-if="file.type == 2" />
  815. <img class="img" :src="file.url" alt="" v-if="file.type == 3" />
  816. <img class="img" :src="wordIcon" alt="" v-if="file.type == 4" />
  817. <img class="img" :src="fileIcon" alt="" v-if="file.type == 5" />
  818. <div class="name">
  819. <el-tooltip :content="file.name" placement="top" effect="dark">
  820. <span>{{ file.name }}</span>
  821. </el-tooltip>
  822. </div>
  823. </div>
  824. </div>
  825. <div v-if="scope.row.array[index].type == 6" style="display: flex; flex-wrap: wrap;">
  826. {{ scope.row.array[index].json.answer2}}
  827. </div>
  828. <div v-if="scope.row.array[index].type == 7" style="display: flex; flex-wrap: wrap;">
  829. {{ getScore(scope.row.array[index].json) }}
  830. </div>
  831. </template>
  832. </el-table-column>
  833. <el-table-column label="操作" width="300px" fixed="right" v-if="isN!=1">
  834. <template slot-scope="scope">
  835. <el-button @click="getTest(scope.row)" type="primary" size="small">查看</el-button>
  836. <el-button @click="setWordHtml(scope.row)" type="primary" size="small">导出答题信息</el-button>
  837. <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
  838. </template>
  839. </el-table-column>
  840. </el-table> -->
  841. </div>
  842. <div class="table_content" v-if="stype == 3">
  843. <div class="student_table">
  844. <el-table ref="table" :data="tableData" border :fit="true" v-loading="isLoading" style="width: 100%"
  845. :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }" :row-class-name="tableRowClassName">
  846. <el-table-column prop="username" label="提交人" min-width="15" align="center">
  847. </el-table-column>
  848. <el-table-column prop="time" label="提交时间" min-width="15" align="center">
  849. </el-table-column>
  850. <el-table-column label="是否批改" min-width="15" align="center">
  851. <template slot-scope="scope">
  852. <div>{{ scope.row.type == 3 ? '是' : '否' }}</div>
  853. </template>
  854. </el-table-column>
  855. <el-table-column label="操作" width="300px" v-if="isDesktop">
  856. <template slot-scope="scope" >
  857. <el-button @click="getTest(scope.row)" type="primary" size="small">查看</el-button>
  858. <el-button @click="setWordHtml2(scope.row)" type="primary" size="small">导出答题信息</el-button>
  859. <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
  860. </template>
  861. </el-table-column>
  862. </el-table>
  863. </div>
  864. <div class="student_page">
  865. <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
  866. @current-change="handleCurrentChange">
  867. </el-pagination>
  868. </div>
  869. </div>
  870. </div>
  871. </div>
  872. </div>
  873. <share-box :testJson="testJson" :TeachingValue="TeachingValue" :TeachName="TeachNameCpt" :dialogVisibleShare.sync="dialogVisibleShare"></share-box>
  874. <wpdf :dialogVisiblePdf.sync="dialogVisiblePdf" :url="wurl"></wpdf>
  875. <wVideo :dialogVisibleVideo.sync="dialogVisibleVideo" :url="wurl"></wVideo>
  876. <wOffice :dialogVisibleOffice.sync="dialogVisibleOffice" :url="wurl"></wOffice>
  877. <docxTemplateDialog ref="docxTemplateDialogRef" @changeCover="changeCover"/>
  878. </div>
  879. </template>
  880. <script>
  881. import shareBox from '../shareBox/index.vue'
  882. import videoIcon from '../../../../assets/icon/fileIcon/isVideo.png'
  883. import wordIcon from '../../../../assets/icon/fileIcon/isWord.png'
  884. import fileIcon from '../../../../assets/icon/fileIcon/word2.png'
  885. import wVideo from "../file/wVideo.vue";
  886. import wpdf from "../file/wPdf2.vue";
  887. import wOffice from "../file/wOffice.vue";
  888. import wordcloud from 'vue-wordcloud';
  889. import checkPie from '../data/checkPie.vue';
  890. import { downloadPDF } from '../../../tools/pdf'
  891. import JSZip from "jszip";
  892. import FileSaver from "file-saver";
  893. import XLSX from "xlsx-js-style";
  894. import aiBoxRight from './aiBoxRight.vue'
  895. // word模板
  896. import docxTemplateDialog from './docxTemplateDialog'
  897. const getFile = (url) => {
  898. return new Promise((resolve, reject) => {
  899. var credentials = {
  900. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  901. secretAccessKey: "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",
  902. }; //秘钥形式的登录上传
  903. window.AWS.config.update(credentials);
  904. window.AWS.config.region = "cn-northwest-1"; //设置区域
  905. let url2 = url;
  906. let _url2 = "";
  907. if (
  908. url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
  909. ) {
  910. _url2 = url2.split(
  911. "https://view.officeapps.live.com/op/view.aspx?src="
  912. )[1];
  913. } else {
  914. _url2 = url2;
  915. }
  916. var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
  917. let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1].replace(/\+/g, ' '))
  918. var params = {
  919. Bucket: "ccrb",
  920. Key: name
  921. };
  922. s3.getObject(params, function (err, data) {
  923. if (err) {
  924. console.log(err, err.stack)
  925. resolve({ data: 1 });
  926. } else {
  927. resolve({ data: data.Body });
  928. console.log(data);
  929. } // sxuccessful response
  930. });
  931. // axios({
  932. });
  933. };
  934. export default {
  935. components: {
  936. shareBox,
  937. wVideo,
  938. wpdf,
  939. wOffice,
  940. checkPie,
  941. wordcloud,
  942. aiBoxRight,
  943. docxTemplateDialog
  944. },
  945. data() {
  946. return {
  947. userid: this.$route.query.userid,
  948. oid: this.$route.query.oid,
  949. org: this.$route.query.org,
  950. role: this.$route.query.role,
  951. cid: this.$route.query.cid,
  952. isN: this.$route.query.isN,
  953. peopleId: this.$route.query.peopleId,
  954. screenWidth: window.innerWidth,
  955. isDesktop: false,
  956. aiChatV: false,
  957. title: "",
  958. testType: [],
  959. see: false,
  960. cJson: [],
  961. loading: false,
  962. look: "",
  963. TeachingOptions:[],
  964. TeachingValue :'',
  965. SubmitTimeOptions: [],
  966. SubmitTime: '',
  967. tableHeight: 500,
  968. isLoading: false,
  969. pageSize: 10,
  970. total: 0,
  971. page: 1,
  972. tableData: [],
  973. testJson: {},
  974. works: [],
  975. iscount: 0,
  976. pcount: 0,
  977. stype: 1,
  978. courseName: "",
  979. dialogVisibleShare: false,
  980. worksArray: [],
  981. testArray: [],
  982. options2: {
  983. 1: "选择题",
  984. // 2: "问答题",
  985. 3: "问答题",
  986. 4: "添加文档",
  987. 5: "附件"
  988. },
  989. videoIcon: videoIcon,
  990. wordIcon: wordIcon,
  991. fileIcon: fileIcon,
  992. dialogVisiblePdf: false,
  993. dialogVisibleVideo: false,
  994. dialogVisibleOffice: false,
  995. wurl: "",
  996. chapters: [],
  997. filterPlacement: 'bottom-end',
  998. pdfLoading: false,
  999. btnDisplay: false,
  1000. fileLoading: [],
  1001. // fileLoadCount: [],
  1002. // fileLoadNum: [],
  1003. // infoprogress: [],
  1004. };
  1005. },
  1006. watch: {},
  1007. computed: {
  1008. TeachNameCpt: function () {
  1009. // `this` 指向 vm 实例
  1010. return this.TeachingOptions.filter(i => {return i.id == this.TeachingValue})
  1011. },
  1012. // vcWords() {
  1013. // return function (array) {
  1014. // let _array = [];
  1015. // if (array.length) {
  1016. // for (var i = 0; i < array.length; i++) {
  1017. // _array.push(
  1018. // {
  1019. // text: array[i].name,
  1020. // weight: array[i].count,
  1021. // }
  1022. // )
  1023. // }
  1024. // }
  1025. // console.log(_array);
  1026. // return array.length ? _array : [];
  1027. // };
  1028. // },
  1029. getScore() {
  1030. return function (item) {
  1031. let array = []
  1032. for (var i = parseInt(item.small); i <= parseInt(item.big); i++) {
  1033. array.push(i)
  1034. }
  1035. return item.answer2 ? array[item.answer2] : ''
  1036. };
  1037. },
  1038. selectType() {
  1039. return function (item) {
  1040. if (item.type == 1 && item.atype == 2) {
  1041. return '多选题'
  1042. } else if (item.type == 1 && item.atype == 1) {
  1043. return '单选题'
  1044. } else if (item.type == 3) {
  1045. return '问答题'
  1046. } else if (item.type == 5) {
  1047. return '附件'
  1048. } else if (item.type == 6 || item.type == 11) {
  1049. return '课程'
  1050. } else if (item.type == 7) {
  1051. return '评分'
  1052. } else if (item.type == 8) {
  1053. return '日期'
  1054. }
  1055. };
  1056. },
  1057. selectType2() {
  1058. return function (val1,val2) {
  1059. if (val1 == 1 && val2 == 2) {
  1060. return '多选题'
  1061. } else if (val1 == 1 && val2 == 1) {
  1062. return '单选题'
  1063. } else if (val1 == 3) {
  1064. return '问答题'
  1065. } else if (val1 == 5) {
  1066. return '附件'
  1067. } else if (val1 == 6) {
  1068. return '课程'
  1069. } else if (val1 == 7) {
  1070. return '评分'
  1071. } else if (val1 == 8) {
  1072. return '日期'
  1073. }
  1074. };
  1075. },
  1076. // 获取评分的平均分
  1077. getAverageScore(){
  1078. return (_index)=>{
  1079. let _result = 0;
  1080. let _sum = 0;
  1081. this.worksArray.forEach(i1=>{
  1082. _result+=i1.array[_index].json.answer2
  1083. _sum+=1;
  1084. })
  1085. _result = _sum ? (_result/_sum).toFixed(2) : 0
  1086. return _result ? _result : 0;
  1087. }
  1088. },
  1089. getTimeFilterText(){
  1090. return (item,index)=>{
  1091. let _result = [];
  1092. if(item.type==8){
  1093. let array = []
  1094. this.worksArray.forEach(i=>{
  1095. if(i.array[index].type == 8){
  1096. let _data = i.array[index].json.answer2;
  1097. if(!array.map(r=>r.value).includes(_data)){
  1098. array.push({text:_data,value:_data})
  1099. }
  1100. }
  1101. })
  1102. array.sort((a, b) =>{
  1103. const dateA = new Date((a.value.replace(/年|月/g, '-')).replace(/日/g,""));
  1104. const dateB = new Date((b.value.replace(/年|月/g, '-')).replace(/日/g,""));
  1105. return dateB - dateA; // 从小到大排序
  1106. });
  1107. console.log("👉排序:",array)
  1108. _result=array;
  1109. }
  1110. return _result;
  1111. }
  1112. }
  1113. },
  1114. methods: {
  1115. openChat(){
  1116. this.aiChatV = !this.aiChatV;
  1117. this.$nextTick(() => {
  1118. const boxStickyHeight = this.$refs.boxSticky ? this.$refs.boxSticky.offsetHeight : 0;
  1119. const chatHeight = `calc(100% - ${boxStickyHeight}px - 46px)`;
  1120. // this.$refs.aiChat.$el.style.height = chatHeight;
  1121. this.$refs.aiBoxRightDivRef.style.height = chatHeight;
  1122. });
  1123. },
  1124. fileClose(done){
  1125. done()
  1126. },
  1127. //获取教研室列表
  1128. getClass2() {
  1129. let params = {
  1130. oid: this.oid,
  1131. };
  1132. this.ajax
  1133. .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
  1134. .then((res) => {
  1135. console.log('this.TeachingOptions',this.TeachingOptions);
  1136. console.log(res.data);
  1137. let data = res.data[0];
  1138. this.TeachingOptions.forEach(e=>{
  1139. data.forEach(i=>{
  1140. if (e.id == i.id) {
  1141. e.name = i.name
  1142. }
  1143. })
  1144. })
  1145. })
  1146. .catch((err) => {
  1147. this.isLoading = false;
  1148. console.error(err);
  1149. });
  1150. },
  1151. getClass3() {
  1152. let params = {
  1153. oid: this.oid,
  1154. };
  1155. this.ajax
  1156. .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
  1157. .then((res) => {
  1158. console.log(res.data);
  1159. this.TeachingOptions = res.data[0].filter(item=>{
  1160. return item.parentid == '6'
  1161. });
  1162. // console.log('this.TeachingOptions',this.TeachingOptions);
  1163. })
  1164. .catch((err) => {
  1165. this.isLoading = false;
  1166. console.error(err);
  1167. });
  1168. },
  1169. filterName(value, row, index) {
  1170. let name = []
  1171. for (var i = 0; i < row.array[index].json.answer2.length; i++) {
  1172. name.push(row.array[index].json.array[row.array[index].json.answer2[i]].option)
  1173. }
  1174. console.log(name.indexOf(value) != -1);
  1175. return name.indexOf(value) != -1;
  1176. },
  1177. // 筛选课程
  1178. filterCourse(value, row, index) {
  1179. return row.array[index].json.answer2.indexOf(value) != -1;
  1180. },
  1181. //筛选日期
  1182. filterTime(value, row, index){
  1183. return row.array[index].json.answer2.indexOf(value)!=-1;
  1184. },
  1185. wordClickHandler(name, value) {
  1186. // this.$notify({
  1187. // title: name,
  1188. // message: "数量:"+value
  1189. // });
  1190. },
  1191. retrunCourse() {
  1192. this.goTo(
  1193. "/test?userid=" +
  1194. this.userid +
  1195. "&oid=" +
  1196. this.oid +
  1197. "&org=" +
  1198. this.org +
  1199. "&role=" +
  1200. this.role
  1201. );
  1202. },
  1203. goTo(path) {
  1204. this.$router.push(path);
  1205. },
  1206. tableRowClassName({ row, rowIndex }) {
  1207. if ((rowIndex + 1) % 2 === 0) {
  1208. return "even_row";
  1209. } else {
  1210. return "";
  1211. }
  1212. },
  1213. changeHeight() {
  1214. if (this.stype == 1) {
  1215. return
  1216. }
  1217. this.tableHeight = this.$refs.stepBox.offsetHeight - 120;
  1218. if (this.tableHeight <= 530) {
  1219. this.tableHeight = 530;
  1220. }
  1221. // 监听窗口大小变化
  1222. let self = this;
  1223. window.onresize = function () {
  1224. if (self.stype == 1) {
  1225. return
  1226. }
  1227. self.tableHeight = this.$refs.stepBox.offsetHeight - 120;
  1228. if (self.tableHeight <= 530) {
  1229. self.tableHeight = 530;
  1230. }
  1231. };
  1232. // this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
  1233. },
  1234. handleCurrentChange(val) {
  1235. this.page = val;
  1236. this.getData2();
  1237. },
  1238. getTest(row) {
  1239. this.$router.push(
  1240. "/checkTest2?cid=" +
  1241. row.courseid +
  1242. "&userid=" +
  1243. this.userid +
  1244. "&userid2=" +
  1245. row.userid +
  1246. "&tid=" +
  1247. row.id +
  1248. "&oid=" +
  1249. this.oid +
  1250. "&org=" +
  1251. this.org +
  1252. "&type=2" +
  1253. "&role=" +
  1254. this.role
  1255. );
  1256. },
  1257. checkDataType(type) {
  1258. this.TeachingValue = ''
  1259. if (this.stype != type) {
  1260. this.stype = type
  1261. this.courseName = ''
  1262. if (type == 3) {
  1263. this.getData2();
  1264. } else {
  1265. this.getData();
  1266. }
  1267. this.changeHeight();
  1268. }
  1269. },
  1270. searchCourse() {
  1271. if (this.stype == 3) {
  1272. this.getData2()
  1273. } else {
  1274. this.getData()
  1275. }
  1276. },
  1277. getData() {
  1278. this.isLoading = true;
  1279. let params = {
  1280. cid: this.cid,
  1281. cn: this.courseName,
  1282. tim : !this.SubmitTime? '' : this.SubmitTime,
  1283. tea: this.TeachingValue
  1284. };
  1285. this.ajax
  1286. .get(this.$store.state.api + "getTestWorksNoPageCopy", params)
  1287. .then(async (res) => {
  1288. this.testJson = res.data[0][0]
  1289. console.log('this.testJson',JSON.parse(JSON.stringify(this.testJson)));
  1290. let a = ''
  1291. if(this.testJson.juriP){
  1292. a = this.testJson.juriP
  1293. }
  1294. if(this.testJson.juriP2){
  1295. if(a){
  1296. a = this.testJson.juriP+','+this.testJson.juriP2
  1297. }else {
  1298. a = this.testJson.juriP2
  1299. }
  1300. }
  1301. this.testJson.juriP = a
  1302. if (this.testJson.juriP) {
  1303. let ajuri2 = this.testJson.juri2.split (',');
  1304. this.TeachingOptions = ajuri2.map((key, index) => ({
  1305. id : key,
  1306. name: ''
  1307. }));
  1308. this.getClass2()
  1309. }else{
  1310. this.getClass3()
  1311. }
  1312. // console.log('dddd',this.TeachingOptions);
  1313. this.works = res.data[1]
  1314. this.iscount = res.data[2][0].count
  1315. this.pcount = res.data[3][0].count
  1316. let chapters = this.setJSON(this.setJson2(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
  1317. this.chapters = this.setFilter(this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
  1318. let courseCount11 = []
  1319. let testArray = []
  1320. let array = []
  1321. let courseIds = []; // 初始化一个空数组来存储所有的courseId
  1322. for (let i = 0; i < this.works.length; i++) {
  1323. let cJson = this.setJSON(JSON.parse(JSON.stringify(JSON.parse(this.works[i].courseJson))))
  1324. if (JSON.stringify(cJson) == JSON.stringify(chapters)) {
  1325. let _json = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(this.works[i].courseJson))))
  1326. for (var ja = 0; ja < _json.length; ja++) {
  1327. let _json2 = _json[ja].json;
  1328. if (_json[ja].type == 6) {
  1329. let courseId = _json2.answer2;
  1330. courseIds.push(courseId); // 将type为6的courseId添加到数组中
  1331. }
  1332. if (_json[ja].type == 11) {
  1333. let _answer = _json2.answer2;
  1334. _answer.length ? courseCount11 = courseCount11.concat(_answer) : '';
  1335. _json[ja].json.courseId = _answer ? _answer : [];
  1336. courseIds = courseIds.concat(_answer); // 将type为11的courseId添加到数组中
  1337. }
  1338. }
  1339. }
  1340. }
  1341. // 将所有的courseId去重
  1342. courseIds = Array.from(new Set(courseIds));
  1343. // 使用一个数组来存储所有的courseId后,执行getCourseInfoTestAll
  1344. let courseTitles = {}; // 初始化一个空对象来存储所有的courseTitles
  1345. let params2 = [{
  1346. cid: courseIds.join(",")
  1347. }]
  1348. let data2 = await this.ajax.post(this.$store.state.api + 'getCourseInfoTestAll2', params2);
  1349. let result2 = data2.data[0];
  1350. result2.forEach(i => {
  1351. // _title.push(i.title);
  1352. courseTitles[i.courseId] = i.title;
  1353. });
  1354. for (let i = 0; i < this.works.length; i++) {
  1355. let cJson = this.setJSON(JSON.parse(JSON.stringify(JSON.parse(this.works[i].courseJson))))
  1356. if (JSON.stringify(cJson) == JSON.stringify(chapters)) {
  1357. let _json = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(this.works[i].courseJson))))
  1358. _json.forEach(item => {
  1359. if (item.type == 11) {
  1360. let cid = item.json.answer2
  1361. let _title = []
  1362. for(var i = 0; i < cid.length; i++){
  1363. _title.push(courseTitles[cid[i]])
  1364. }
  1365. item.json.answer2 = _title.length ? _title.join(",") : '';
  1366. }
  1367. if (item.type == 6) {
  1368. let courseId = item.json.answer2;
  1369. item.json.answer2 = courseTitles[courseId] || '';
  1370. }
  1371. });
  1372. // 更新对应的_json对象的answer2
  1373. array.push({
  1374. courseid: this.works[i].courseid,
  1375. id: this.works[i].id,
  1376. userid: this.works[i].userid,
  1377. name: this.works[i].username ? this.works[i].username : '匿名',
  1378. time: this.works[i].time,
  1379. array: _json,
  1380. cut:0,
  1381. uteaName: this.works[i].uteaName,
  1382. courseJson: JSON.parse(this.works[i].courseJson),
  1383. })
  1384. }
  1385. }
  1386. let allCourseIds = [];
  1387. for (var i = 0; i < this.chapters.length; i++) {
  1388. let el = this.chapters[i]
  1389. let topic = {
  1390. type: el.type,
  1391. cut: 0,
  1392. title: el.json ? el.json.title : '',
  1393. detail: el.json ? el.json.detail : '',
  1394. atype: el.json ? el.json.type : '',
  1395. choice: el.json ? el.json.array : '',
  1396. array: [],
  1397. answer: el.json ? el.json.answer : '',
  1398. answer2: '',
  1399. count: 0,
  1400. courses: el.json ? el.json.courses : [],
  1401. small: el.json ? el.json.small : '',
  1402. big: el.json ? el.json.big : '',
  1403. }
  1404. if (topic.type == 1) {
  1405. for (var t = 0; t < topic.choice.length; t++) {
  1406. topic.array.push({
  1407. name: topic.choice[t].option,
  1408. count: 0
  1409. })
  1410. }
  1411. } else if (topic.type == 3) {
  1412. } else if (topic.type == 5) {
  1413. } else if (topic.type == 6) {
  1414. let _answer = topic.array
  1415. allCourseIds = allCourseIds.concat(_answer);
  1416. } else if (topic.type == 7) {
  1417. for (var t = parseInt(topic.small); t <= parseInt(topic.big); t++) {
  1418. topic.array.push({
  1419. name: t,
  1420. count: 0
  1421. })
  1422. }
  1423. } else if (topic.type == 11) {
  1424. const uniqueArray = courseCount11.filter((item, index) => courseCount11.indexOf(item) === index);
  1425. let _answer = uniqueArray
  1426. allCourseIds = allCourseIds.concat(_answer);
  1427. }
  1428. for (var j = 0; j < array.length; j++) {
  1429. let el2 = array[j]
  1430. if (topic.type == 1) {
  1431. let _answer = el2.array[i].json.answer2
  1432. for (var k = 0; k < _answer.length; k++) {
  1433. topic.array[_answer[k]].count++
  1434. topic.count++
  1435. }
  1436. } else if (topic.type == 3 || topic.type == 8) {
  1437. let type3 = 1
  1438. let _answer = el2.array[i].json.answer2
  1439. if (_answer) {
  1440. for (var k = 0; k < topic.array.length; k++) {
  1441. if (topic.array[k].name == _answer) {
  1442. topic.array[k].count++
  1443. type3 = 2
  1444. topic.count++
  1445. break;
  1446. }
  1447. }
  1448. if (type3 == 1) {
  1449. topic.array.push({
  1450. name: _answer,
  1451. count: 1
  1452. })
  1453. }
  1454. }
  1455. } else if (topic.type == 5) {
  1456. let _answer = el2.array[i].json.file ? el2.array[i].json.file : []
  1457. let _user = {userid:el2.userid,username:el2.name}
  1458. for (var k = 0; k < _answer.length; k++) {
  1459. topic.array.push({..._answer[k],..._user})
  1460. }
  1461. } else if (topic.type == 7) {
  1462. if(el2.array[i].json.answer2){
  1463. let _answer = el2.array[i].json.answer2
  1464. topic.array[_answer].count++
  1465. topic.count++
  1466. }
  1467. }else if (topic.type == 6) {
  1468. if(el2.array[i].json.courses){
  1469. let _answer = el2.array[i].json.courses.length ? el2.array[i].json.courses.join(",") : ''
  1470. topic.answer2 = _answer
  1471. }
  1472. } else if (topic.type == 11) {
  1473. const uniqueArray = courseCount11.filter((item, index) => courseCount11.indexOf(item) === index);
  1474. let _answer = uniqueArray
  1475. topic.answer2 = _answer
  1476. }
  1477. }
  1478. console.log('topictopictopictopic',topic)
  1479. testArray.push(topic)
  1480. this.fileLoading.push({bool:false,count:0,load:0,progress:0})
  1481. }
  1482. // 去重courseId
  1483. allCourseIds = Array.from(new Set(allCourseIds));
  1484. let params = [{
  1485. cid: allCourseIds.join(",")
  1486. }]
  1487. let data = await this.ajax.post(this.$store.state.api + 'getCourseInfoTestAll2',params);
  1488. let result = data.data[0]
  1489. for (var i = 0; i < this.chapters.length; i++) {
  1490. let el = this.chapters[i]
  1491. let topic = testArray[i]
  1492. if (topic.type == 6 || topic.type == 11) {
  1493. result.forEach(i=>{
  1494. i.update_at = new Date(i.update_at).toLocaleString('zh-CN', {year: 'numeric',month: '2-digit',day: '2-digit',hour: '2-digit',minute: '2-digit',second: '2-digit',hour12: false}).replace(/\//g,'-')
  1495. })
  1496. if(topic.type == 6){
  1497. result.forEach(elc=>{
  1498. if(this.chapters.find(f=>f.type==6).nameFilters.find(c=>c.value==elc.title)==undefined && topic.answer2.includes(elc.courseId)){
  1499. this.chapters.find(c=>c.type==6).nameFilters.push({text:elc.title,value:elc.title})
  1500. }
  1501. })
  1502. }else if(topic.type == 11){
  1503. result.forEach(elc=>{
  1504. if(this.chapters.find((f, index)=>index==i).nameFilters.find(c=>c.value==elc.title)==undefined && topic.answer2.includes(elc.courseId)){
  1505. this.chapters.find((c, index)=>index==i).nameFilters.push({text:elc.title,value:elc.title})
  1506. }
  1507. })
  1508. }
  1509. // this.chapters.find(i=>i.type==6 || i.type==11).nameFilters = result.map(r=>{return{text:r.title,value:r.courseId}})
  1510. if(topic.answer2.length){
  1511. let _answer = topic.answer2
  1512. topic.courseArray = result.filter(el => {
  1513. return _answer.includes(el.courseId)
  1514. });
  1515. }else{
  1516. topic.courseArray = []
  1517. }
  1518. // topic.courseArray = result
  1519. }
  1520. }
  1521. this.testArray = testArray
  1522. this.worksArray = array
  1523. this.isLoading = false;
  1524. })
  1525. .catch((err) => {
  1526. console.error(err);
  1527. });
  1528. },
  1529. getData2() {
  1530. this.isLoading = true;
  1531. let params = {
  1532. cid: this.cid,
  1533. page: this.page,
  1534. pageSize: this.pageSize,
  1535. cn: this.courseName
  1536. };
  1537. this.ajax
  1538. .get(this.$store.state.api + "getTestWorksPage3", params)
  1539. .then((res) => {
  1540. this.isLoading = false;
  1541. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  1542. this.tableData = res.data[0];
  1543. })
  1544. .catch((err) => {
  1545. console.error(err);
  1546. });
  1547. },
  1548. setJSON(json) {
  1549. return json.filter((item) => {
  1550. if (item.array) {
  1551. item.array = item.array.filter((item2) => {
  1552. if (item2.ttype == 1 && item2.json) {
  1553. delete item2.json.answer2
  1554. delete item2.json.score2
  1555. delete item2.json.file
  1556. }
  1557. if (item2.array) {
  1558. item2.array = item2.array.filter((item3) => {
  1559. if (item3.ttype == 1 && item3.json) {
  1560. delete item3.json.answer2
  1561. delete item3.json.score2
  1562. delete item3.json.file
  1563. }
  1564. return item3;
  1565. });
  1566. }
  1567. return item2;
  1568. });
  1569. } else if (item.ttype == 1 && item.json) {
  1570. delete item.json.answer2
  1571. delete item.json.score2
  1572. delete item.json.file
  1573. }
  1574. return item
  1575. console.log(item.array);
  1576. });
  1577. },
  1578. setJson2(json) {
  1579. let _json = json;
  1580. // this.type = _json[0].ttype;
  1581. let checkArray = _json.filter((item) => {
  1582. if (item.array) {
  1583. item.array = item.array.filter((item2) => {
  1584. if (item2.ttype == 1 && item2.json && !item2.json.answer2) {
  1585. item2.json.answer2 = [];
  1586. }
  1587. if (item2.array) {
  1588. item2.array = item2.array.filter((item3) => {
  1589. if (item3.ttype == 1 && item3.json && !item3.json.answer2) {
  1590. item3.json.answer2 = [];
  1591. }
  1592. return item3;
  1593. });
  1594. }
  1595. return (
  1596. (item2.ttype != 1 && item2.array.length > 0) || item2.ttype == 1
  1597. );
  1598. });
  1599. }
  1600. if (item.ttype == 1 && item.json && !item.json.answer2) {
  1601. item.json.answer2 = [];
  1602. }
  1603. console.log(item.array);
  1604. return (item.ttype != 1 && item.array.length > 0) || item.ttype == 1;
  1605. });
  1606. console.log(checkArray);
  1607. return checkArray;
  1608. },
  1609. JSONSetting(json) {
  1610. let _json = json
  1611. let array = []
  1612. _json.filter((item) => {
  1613. if (item.array) {
  1614. item.array = item.array.filter((item2) => {
  1615. if (item2.ttype == 1 && item2.json) {
  1616. array.push(item2)
  1617. }
  1618. if (item2.array) {
  1619. item2.array = item2.array.filter((item3) => {
  1620. if (item3.ttype == 1 && item3.json) {
  1621. array.push(item3)
  1622. }
  1623. return item3;
  1624. });
  1625. }
  1626. return item2;
  1627. });
  1628. }
  1629. if (item.ttype == 1 && item.json) {
  1630. array.push(item)
  1631. }
  1632. console.log(item.array);
  1633. return item;
  1634. });
  1635. console.log(array);
  1636. return array;
  1637. },
  1638. setFilter(json) {
  1639. let _json = json
  1640. let array = []
  1641. _json.filter((item) => {
  1642. item.nameFilters = [],
  1643. item.filterParams = {
  1644. name: [],
  1645. }
  1646. if (item.type == 1) {
  1647. for (var i = 0; i < item.json.array.length; i++) {
  1648. item.nameFilters.push({ text: item.json.array[i].option, value: item.json.array[i].option })
  1649. }
  1650. }
  1651. array.push(item)
  1652. return item;
  1653. });
  1654. return array
  1655. },
  1656. checkFile(item) {
  1657. if (item.type == 3) {
  1658. this.$hevueImgPreview(item.url);
  1659. } else if (item.type == 5) {
  1660. this.downloadFile(item);
  1661. } else if (item.type == 1) {
  1662. this.dialogVisibleOffice = true
  1663. this.wurl = item.url
  1664. } else if (item.type == 2) {
  1665. this.dialogVisibleVideo = true
  1666. this.wurl = item.url
  1667. } else if (item.type == 4) {
  1668. this.dialogVisiblePdf = true
  1669. this.wurl = item.url
  1670. }
  1671. },
  1672. downloadFile(f) {
  1673. var credentials = {
  1674. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  1675. secretAccessKey: "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",
  1676. }; //秘钥形式的登录上传
  1677. window.AWS.config.update(credentials);
  1678. window.AWS.config.region = "cn-northwest-1"; //设置区域
  1679. let url2 = f.url;
  1680. let _url2 = "";
  1681. if (
  1682. url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
  1683. ) {
  1684. _url2 = url2.split(
  1685. "https://view.officeapps.live.com/op/view.aspx?src="
  1686. )[1];
  1687. } else {
  1688. _url2 = url2;
  1689. }
  1690. let _this = this;
  1691. _this.downLoading = _url2
  1692. var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
  1693. let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1].replace(/\+/g, ' '))
  1694. var params = {
  1695. Bucket: "ccrb",
  1696. Key: name
  1697. };
  1698. s3.getObject(params, function (err, data) {
  1699. _this.downLoading = ''
  1700. if (err) console.log(err, err.stack); // an error occurred
  1701. else {
  1702. let url = window.URL.createObjectURL(new Blob([data.Body]));
  1703. let a = document.createElement("a");
  1704. a.name = f.name;
  1705. a.href = url;
  1706. a.download = f.name;
  1707. a.click();
  1708. console.log(data);
  1709. } // sxuccessful response
  1710. });
  1711. },
  1712. deleteTest(tid) {
  1713. let _this = this
  1714. _this
  1715. .$confirm("确定删除此提交的表单么?", "提示", {
  1716. confirmButtonText: "确定",
  1717. cancelButtonText: "取消",
  1718. type: "warning",
  1719. })
  1720. .then(() => {
  1721. let params = [{
  1722. tid: tid,
  1723. }];
  1724. _this.ajax
  1725. .post(_this.$store.state.api + "deleteTestCourseWorks", params)
  1726. .then((res) => {
  1727. _this.$message.success("删除成功");
  1728. if (_this.stype == 3) {
  1729. _this.getData2();
  1730. } else {
  1731. _this.getData();
  1732. }
  1733. })
  1734. .catch((err) => {
  1735. console.error(err);
  1736. });
  1737. })
  1738. .catch(() => {
  1739. return;
  1740. });
  1741. },
  1742. exportPDF() {
  1743. this.pdfLoading = true
  1744. var a = document.getElementsByTagName("img")
  1745. for (var i = 0; i < a.length; i++) { a[i].crossOrigin = "*" }
  1746. downloadPDF(this.$refs.stepBox, this.testJson.title, () => {
  1747. var _a = document.getElementsByTagName("img")
  1748. for (var i = 0; i < _a.length; i++) {
  1749. _a[i].removeAttribute("crossorigin")
  1750. }
  1751. setTimeout(() => {
  1752. this.pdfLoading = false
  1753. }, 2000);
  1754. })
  1755. },
  1756. score(json) {
  1757. let score = 0
  1758. json.forEach(el => {
  1759. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  1760. el.array.forEach(item => {
  1761. if (item.ttype == 2 && item.array.length > 0) {
  1762. item.array.forEach(item2 => {
  1763. if (item2.ttype == 1 && item2.json) {
  1764. score += item2.json.score ? parseFloat(item2.json.score) : 0
  1765. }
  1766. })
  1767. } else if (item.ttype == 1 && item.json) {
  1768. score += item.json.score ? parseFloat(item.json.score) : 0
  1769. }
  1770. })
  1771. } else if (el.ttype == 1 && el.json) {
  1772. score += el.json.score ? parseFloat(el.json.score) : 0
  1773. }
  1774. })
  1775. return score > 0 ? score + '分' : ''
  1776. },
  1777. score2(json) {
  1778. let score = 0
  1779. // let type = 1
  1780. json.forEach(el => {
  1781. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  1782. el.array.forEach(item => {
  1783. if (item.ttype == 2 && item.array.length > 0) {
  1784. item.array.forEach(item2 => {
  1785. if (item2.ttype == 1 && item2.json) {
  1786. score += item2.json.score2 ? parseFloat(item2.json.score2) : 0
  1787. }
  1788. })
  1789. } else if (item.ttype == 1 && item.json) {
  1790. score += item.json.score2 ? parseFloat(item.json.score2) : 0
  1791. }
  1792. })
  1793. } else if (el.ttype == 1 && el.json) {
  1794. score += el.json.score2 ? parseFloat(el.json.score2) : 0
  1795. }
  1796. })
  1797. return score + '分'
  1798. },
  1799. setWordHtml(data) {
  1800. let _data = data
  1801. let _title = `<div style="font-size:30px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
  1802. let score = this.score(data.courseJson)
  1803. let isScore = this.score2(data.courseJson)
  1804. let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
  1805. let _content = `<div style="text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.name}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
  1806. let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
  1807. let _test = `<div style='margin-top:40px;'>`
  1808. for (let i = 0; i < _data.array.length; i++) {
  1809. let item = _data.array[i]
  1810. let _div = `<div style='margin-top:20px;font-weight:bold;'>${i + 1}、${item.json.title}</div>`
  1811. _test += _div
  1812. if (item.type == 1) {
  1813. for (let j = 0; j < item.json.array.length; j++) {
  1814. let check = item.json.array[j]
  1815. let _option = `<div style='margin:10px 0 0 40px;'>${(item.json.answer2 && item.json.answer2.indexOf(j) !== -1) ? '☑' : '☐'} ${check.option}</div>`
  1816. _test += _option
  1817. }
  1818. } else if (item.type == 3 && item.json.answer2) {
  1819. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1820. _test += _option
  1821. } else if (item.type == 5 && item.json.file) {
  1822. for (let j = 0; j < item.json.file.length; j++) {
  1823. let check = item.json.file[j]
  1824. let _option = `<div style='margin:10px 0 0 40px;'>${check.name} <a href='${check.url}'>${check.url}</a></div>`
  1825. _test += _option
  1826. }
  1827. } else if (item.type == 6 && item.json.answer2) {
  1828. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1829. _test += _option
  1830. } else if (item.type == 7 && item.json.answer2 ) {
  1831. let _score = this.getScore2(item.json)
  1832. let _option = `<div style='margin:10px 0 0 40px;'>打分:${_score}分</div>`
  1833. _test += _option
  1834. } else if (item.type == 8 && item.json.answer2) {
  1835. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1836. _test += _option
  1837. } else if (item.type == 11 && item.json.answer2) {
  1838. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1839. _test += _option
  1840. }
  1841. }
  1842. _test += `</div>`
  1843. let _html = _title + _content + _detail + _test;
  1844. this.exportToWord(_data.name + '-' + _data.time, _html);
  1845. },
  1846. setWordHtml2(data) {
  1847. let _data = data
  1848. _data.array = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(data.courseJson))))
  1849. let _title = `<div style="font-size:30px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
  1850. let score = this.score(JSON.parse(data.courseJson))
  1851. let isScore = this.score2(JSON.parse(data.courseJson))
  1852. let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
  1853. let _content = `<div style="text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.username ? _data.username : '匿名'}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
  1854. let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
  1855. let _test = `<div style='margin-top:40px;'>`
  1856. for (let i = 0; i < _data.array.length; i++) {
  1857. let item = _data.array[i]
  1858. let _div = `<div style='margin-top:20px;font-weight:bold;'>${i + 1}、${item.json.title}</div>`
  1859. _test += _div
  1860. if (item.type == 1) {
  1861. for (let j = 0; j < item.json.array.length; j++) {
  1862. let check = item.json.array[j]
  1863. let _option = `<div style='margin:10px 0 0 40px;'>${(item.json.answer2 && item.json.answer2.indexOf(j) !== -1) ? '☑' : '☐'} ${check.option}</div>`
  1864. _test += _option
  1865. }
  1866. } else if (item.type == 3 && item.json.answer2) {
  1867. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1868. _test += _option
  1869. } else if (item.type == 5 && item.json.file) {
  1870. for (let j = 0; j < item.json.file.length; j++) {
  1871. let check = item.json.file[j]
  1872. let _option = `<div style='margin:10px 0 0 40px;'>${check.name} <a href='${check.url}'>${check.url}</a></div>`
  1873. _test += _option
  1874. }
  1875. } else if (item.type == 6 && item.json.answer2) {
  1876. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1877. _test += _option
  1878. } else if (item.type == 7 && item.json.answer2 ) {
  1879. let _score = this.getScore2(item.json)
  1880. let _option = `<div style='margin:10px 0 0 40px;'>打分:${_score}分</div>`
  1881. _test += _option
  1882. } else if (item.type == 8 && item.json.answer2) {
  1883. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1884. _test += _option
  1885. } else if (item.type == 11 && item.json.answer2) {
  1886. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1887. _test += _option
  1888. }
  1889. }
  1890. _test += `</div>`
  1891. let _html = _title + _content + _detail + _test;
  1892. this.exportToWord(_data.username ? _data.username : '匿名' + '-' + _data.time, _html);
  1893. },
  1894. async exportToWord(a, html) {
  1895. // 将html文件中需要用到的数据挂载到store上
  1896. const content = `<!DOCTYPE html>
  1897. <html lang="en">
  1898. <head>
  1899. <meta charset="UTF-8">
  1900. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  1901. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  1902. <title>${a}</title>
  1903. <style>
  1904. </style>
  1905. </head>
  1906. <body>
  1907. ${html}
  1908. </body>
  1909. </html>`;
  1910. // debugger
  1911. // 生成报告
  1912. const link = document.createElement("a");
  1913. let dname = a + ".doc";
  1914. // link.download = "报告.html"; // 文件名
  1915. link.download = dname; // 文件名
  1916. link.style.display = "none";
  1917. // 创建文件流
  1918. // 创建bolb实例时,内容一定要放在[]中
  1919. const blob = new Blob([content], {
  1920. type: "text/plain;charset='utf-8'",
  1921. });
  1922. link.href = window.URL.createObjectURL(blob);
  1923. document.body.appendChild(link);
  1924. link.click();
  1925. document.body.removeChild(link);
  1926. },
  1927. setWordHtmlAll(data) {
  1928. let _data = data
  1929. let _title = `<div style="font-size:30px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
  1930. let score = this.score(data.courseJson)
  1931. let isScore = this.score2(data.courseJson)
  1932. let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
  1933. let _content = `<div style="text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.name}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
  1934. let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
  1935. let _test = `<div style='margin-top:40px;'>`
  1936. for (let i = 0; i < _data.array.length; i++) {
  1937. let item = _data.array[i]
  1938. let _div = `<div style='margin-top:20px;font-weight:bold;'>${i + 1}、${item.json.title}</div>`
  1939. _test += _div
  1940. if (item.type == 1) {
  1941. for (let j = 0; j < item.json.array.length; j++) {
  1942. let check = item.json.array[j]
  1943. let _option = `<div style='margin:10px 0 0 40px;'>${(item.json.answer2 && item.json.answer2.indexOf(j) !== -1) ? '☑' : '☐'} ${check.option}</div>`
  1944. _test += _option
  1945. }
  1946. } else if (item.type == 3 && item.json.answer2) {
  1947. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1948. _test += _option
  1949. } else if (item.type == 5 && item.json.file) {
  1950. for (let j = 0; j < item.json.file.length; j++) {
  1951. let check = item.json.file[j]
  1952. let _option = `<div style='margin:10px 0 0 40px;'>${check.name} <a href='${check.url}'>${check.url}</a></div>`
  1953. _test += _option
  1954. }
  1955. } else if (item.type == 6 && item.json.answer2) {
  1956. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1957. _test += _option
  1958. } else if (item.type == 7 && item.json.answer2 ) {
  1959. let _score = this.getScore2(item.json)
  1960. let _option = `<div style='margin:10px 0 0 40px;'>打分:${_score}分</div>`
  1961. _test += _option
  1962. } else if (item.type == 8 && item.json.answer2) {
  1963. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1964. _test += _option
  1965. } else if (item.type == 11 && item.json.answer2) {
  1966. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1967. _test += _option
  1968. }
  1969. }
  1970. _test += `</div>`
  1971. let _html = _title + _content + _detail + _test;
  1972. return this.exportToWordAll(_data.name + '-' + _data.time, _html);
  1973. },
  1974. async setWordHtmlAll2(data) {
  1975. let _data = data
  1976. _data.array = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(data.courseJson))))
  1977. let _title = `<div style="font-size:30px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
  1978. let score = this.score(JSON.parse(data.courseJson))
  1979. let isScore = this.score2(JSON.parse(data.courseJson))
  1980. let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
  1981. let _content = `<div style="text-align:center;margin-top: 20px;"><b style="margin-right:40px">(答题人)${_data.username ? _data.username : '匿名'}</b>${scoreContent}(填写范围)${this.testJson.juriP ? this.testJson.juriP : '所有人'}(提交时间)${_data.time}</div>`
  1982. let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
  1983. let _test = `<div style='margin-top:40px;'>`
  1984. for (let i = 0; i < _data.array.length; i++) {
  1985. let item = _data.array[i]
  1986. let _div = `<div style='margin-top:20px;font-weight:bold;'>${i + 1}、${item.json.title}</div>`
  1987. _test += _div
  1988. if (item.type == 1) {
  1989. for (let j = 0; j < item.json.array.length; j++) {
  1990. let check = item.json.array[j]
  1991. let _option = `<div style='margin:10px 0 0 40px;'>${(item.json.answer2 && item.json.answer2.indexOf(j) !== -1) ? '☑' : '☐'} ${check.option}</div>`
  1992. _test += _option
  1993. }
  1994. } else if (item.type == 3 && item.json.answer2) {
  1995. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1996. _test += _option
  1997. } else if (item.type == 5 && item.json.file) {
  1998. for (let j = 0; j < item.json.file.length; j++) {
  1999. let check = item.json.file[j]
  2000. let _option = `<div style='margin:10px 0 0 40px;'>${check.name} <a href='${check.url}'>${check.url}</a></div>`
  2001. _test += _option
  2002. }
  2003. } else if (item.type == 6 && item.json.answer2) {
  2004. let _cjson = await this.getCourse(item.json.answer2)
  2005. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${ _cjson ? _cjson.title : ''}</div>`
  2006. _test += _option
  2007. } else if (item.type == 7 && item.json.answer2 ) {
  2008. let _score = this.getScore2(item.json)
  2009. let _option = `<div style='margin:10px 0 0 40px;'>打分:${_score}分</div>`
  2010. _test += _option
  2011. } else if (item.type == 8 && item.json.answer2) {
  2012. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  2013. _test += _option
  2014. } else if (item.type == 11 && item.json.answer2 && item.json.answer2.length) {
  2015. let _answer = item.json.answer2
  2016. _answer.length ? courseCount11 = courseCount11.concat(_answer) : ''
  2017. _json[ja].json.courseId = _answer ? _answer : [];
  2018. let params = [{
  2019. cid:_answer.length ? _answer.join(",") : ''
  2020. }]
  2021. let data = await this.ajax.post(this.$store.state.api + 'getCourseInfoTestAll2',params);
  2022. let result = data.data[0]
  2023. let _title = []
  2024. // this.chapters.find(i=>i.type==6).nameFilters = result.map(r=>{return{text:r.title,value:r.courseId}})
  2025. result.forEach(i=>{
  2026. _title.push(i.title)
  2027. })
  2028. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${ _title.length ? _title.join(',') : '' }</div>`
  2029. _test += _option
  2030. }
  2031. }
  2032. _test += `</div>`
  2033. let _html = _title + _content + _detail + _test;
  2034. return this.exportToWordAll(_data.username ? _data.username : '匿名' + '-' + _data.time, _html);
  2035. },
  2036. async exportToWordAll(a, html) {
  2037. // 将html文件中需要用到的数据挂载到store上
  2038. const content = `<!DOCTYPE html>
  2039. <html lang="en">
  2040. <head>
  2041. <meta charset="UTF-8">
  2042. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  2043. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  2044. <title>${a}</title>
  2045. <style>
  2046. </style>
  2047. </head>
  2048. <body>
  2049. ${html}
  2050. </body>
  2051. </html>`;
  2052. // debugger
  2053. // 生成报告
  2054. const link = document.createElement("a");
  2055. let dname = a + ".doc";
  2056. // link.download = "报告.html"; // 文件名
  2057. link.download = dname; // 文件名
  2058. link.style.display = "none";
  2059. // 创建文件流
  2060. // 创建bolb实例时,内容一定要放在[]中
  2061. const blob = new Blob([content], {
  2062. type: "text/plain;charset='utf-8'",
  2063. });
  2064. return blob;
  2065. },
  2066. exportAllWord() {
  2067. this.pdfLoading = true;
  2068. const _chapInfo = this.worksArray;
  2069. let url = [];
  2070. for (let i = 0; i < _chapInfo.length; i++) {
  2071. url.push({
  2072. name: _chapInfo[i].name + '-' + _chapInfo[i].time,
  2073. blob: this.setWordHtmlAll(_chapInfo[i]),
  2074. });
  2075. }
  2076. console.log(url);
  2077. this.downLoadAll(url);
  2078. },
  2079. exportAllWord2() {
  2080. this.pdfLoading = true;
  2081. let params = {
  2082. cid: this.cid,
  2083. page: 1,
  2084. pageSize: 999,
  2085. cn: this.courseName
  2086. };
  2087. this.ajax
  2088. .get(this.$store.state.api + "getTestWorksPage3", params)
  2089. .then((res) => {
  2090. const _chapInfo = res.data[0];
  2091. let url = [];
  2092. for (let i = 0; i < _chapInfo.length; i++) {
  2093. url.push({
  2094. name: _chapInfo[i].username + '-' + _chapInfo[i].time,
  2095. blob: this.setWordHtmlAll2(_chapInfo[i]),
  2096. });
  2097. }
  2098. console.log(url);
  2099. this.downLoadAll(url);
  2100. })
  2101. .catch((err) => {
  2102. console.error(err);
  2103. });
  2104. },
  2105. downLoadAll(url) {
  2106. const data = url; // 需要下载打包的路径, 可以是本地相对路径, 也可以是跨域的全路径
  2107. const zip = new JSZip();
  2108. const cache = {};
  2109. data.forEach((item) => {
  2110. // 下载文件, 并存成ArrayBuffer对象
  2111. const file_name = item.name; // 获取文件名
  2112. zip.file(file_name + '.doc', item.blob, { binary: true }); // 逐个添加文件
  2113. cache[file_name] = item.blob;
  2114. });
  2115. zip.generateAsync({ type: "blob" }).then((content) => {
  2116. // 生成二进制流
  2117. FileSaver.saveAs(content, this.testJson.title + ".zip"); // 利用file-saver保存文件 自定义文件名
  2118. setTimeout(() => {
  2119. this.pdfLoading = false;
  2120. }, 2000);
  2121. });
  2122. },
  2123. handleFilterChange() {
  2124. console.log(this.$refs.table.store.states.data);
  2125. },
  2126. exportExcel() {
  2127. let res = this.$refs.table.store.states.data
  2128. if (!res.length) {
  2129. this.$message.error('无导出数据')
  2130. return
  2131. }
  2132. this.isLoading = true;
  2133. let chapters = this.chapters
  2134. var array = [];
  2135. for (var i = 0; i < res.length; i++) {
  2136. var _json = {};
  2137. _json["序号"] = i + 1;
  2138. _json["提交人"] = res[i].name ? res[i].name : '匿名';
  2139. _json["提交时间"] = res[i].time;
  2140. for (var j = 0; j < chapters.length; j++) {
  2141. _json[j + 1 + "." + chapters[j].json.title] = '';
  2142. if (res[i].array[j].type == 1 && res[i].array[j].json.answer2) {
  2143. let a = []
  2144. for (var answer2 = 0; answer2 < res[i].array[j].json.answer2.length; answer2++) {
  2145. a.push(res[i].array[j].json.array[res[i].array[j].json.answer2[answer2]].option)
  2146. }
  2147. _json[j + 1 + "." + chapters[j].json.title] = a.join('、')
  2148. } else if (res[i].array[j].type == 3 && res[i].array[j].json.answer2) {
  2149. _json[j + 1 + "." + chapters[j].json.title] = res[i].array[j].json.answer2
  2150. } else if (res[i].array[j].type == 5 && res[i].array[j].json.file) {
  2151. let files = []
  2152. for (let file = 0; file < res[i].array[j].json.file.length; file++) {
  2153. let check = res[i].array[j].json.file[file]
  2154. files.push(file + 1 + '.' + check.name + '----' + check.url)
  2155. }
  2156. _json[j + 1 + "." + chapters[j].json.title] = files.join('\n')
  2157. } else if (res[i].array[j].type == 6 && res[i].array[j].json.answer2) {
  2158. _json[j + 1 + "." + chapters[j].json.title] = res[i].array[j].json.answer2
  2159. } else if (res[i].array[j].type == 7 && res[i].array[j].json.answer2) {
  2160. let _score = this.getScore2(res[i].array[j].json)
  2161. _json[j + 1 + "." + chapters[j].json.title] = _score
  2162. } else if (res[i].array[j].type == 8 && res[i].array[j].json.answer2) {
  2163. _json[j + 1 + "." + chapters[j].json.title] = res[i].array[j].json.answer2
  2164. } else if (res[i].array[j].type == 11 && res[i].array[j].json.answer2) {
  2165. _json[j + 1 + "." + chapters[j].json.title] = res[i].array[j].json.answer2
  2166. }
  2167. }
  2168. array.push(_json);
  2169. }
  2170. let widthJson = []
  2171. let widthArray = Object.keys(array[0])
  2172. for (let i = 0; i < widthArray.length; i++) {
  2173. if (i == 0) {
  2174. widthJson.push({ wch: 5 })
  2175. } else {
  2176. widthJson.push({ wch: 30 })
  2177. }
  2178. }
  2179. const workbook = XLSX.utils.book_new(); //创建一个新的工作簿对象
  2180. let ws = XLSX.utils.json_to_sheet(array); //将json对象数组转化成工作表
  2181. ws["!cols"] = widthJson;
  2182. const styleObj = {
  2183. alignment: {
  2184. horizontal: "center",
  2185. vertical: "center" // 设置垂直居中
  2186. }
  2187. }; // 设置居中对齐和加粗样式
  2188. for (let cell in ws) {
  2189. if (!cell[0].startsWith("!")) {
  2190. ws[cell]["s"] = styleObj;
  2191. }
  2192. }
  2193. XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
  2194. XLSX.writeFile(workbook, this.testJson.title + ".xlsx");
  2195. this.isLoading = false;
  2196. this.$message({
  2197. message: "导出成功",
  2198. type: "success"
  2199. });
  2200. },
  2201. async getCourse(id) {
  2202. let params = {
  2203. cid: id,
  2204. };
  2205. let res = await this.ajax.get(this.$store.state.api + "getCourseInfoTest", params)
  2206. return res.data[0][0]
  2207. },
  2208. getScore2(item) {
  2209. let array = []
  2210. for (var i = parseInt(item.small); i <= parseInt(item.big); i++) {
  2211. array.push(i)
  2212. }
  2213. return item.answer2 ? array[item.answer2] : ''
  2214. },
  2215. checkScreenSize() {
  2216. this.screenWidth = window.innerWidth;
  2217. this.isDesktop = this.screenWidth > 750; // 你可以根据需要调整这个阈值
  2218. },
  2219. downloadFileType5(fileData,title="附件",index){
  2220. this.fileLoading[index].bool = true
  2221. this.fileLoading[index].count = 0
  2222. this.fileLoading[index].load = 0
  2223. this.fileLoading[index].progress = 0
  2224. let data = fileData;
  2225. const zip = new JSZip();
  2226. let downFileArray = [];
  2227. let uniqueArr = data.filter((v,i,a)=>a.map(mb=>mb.userid).indexOf(v.userid)==i);
  2228. uniqueArr.forEach(i=>{
  2229. downFileArray.push({userid:i.userid,username:i.username ? i.username : '匿名',urlList:data.filter(d=>d.userid==i.userid).map(m=>m)});
  2230. })
  2231. let promises = [];
  2232. console.log('downFileArray',downFileArray);
  2233. downFileArray.forEach(e=>{
  2234. this.fileLoading[index].count += e.urlList.length
  2235. })
  2236. if(downFileArray.length==1){//只有一位老师的情况
  2237. if(downFileArray[0].urlList.length>1){//多个文件的情况
  2238. const folder = zip.folder(`${downFileArray[0].username}`);
  2239. downFileArray[0].urlList.forEach(i=>{
  2240. const promise = getFile(i.url).then((data) => {
  2241. if (data.data != 1) {
  2242. // 下载文件, 并存成ArrayBuffer对象
  2243. const file_name = i.name; // 获取文件名
  2244. folder.file(file_name, data.data, { binary: true }); // 逐个添加文件
  2245. }
  2246. this.fileLoading[index].load+=1
  2247. this.fileLoading[index].progress = parseInt((this.fileLoading[index].load / this.fileLoading[index].count) * 100);
  2248. if (this.fileLoading[index].load == this.fileLoading[index].count) {
  2249. this.fileLoading[index].bool=false
  2250. }
  2251. });
  2252. promises.push(promise)
  2253. })
  2254. }else{//只有一个文件的情况
  2255. promises.push(getFile(downFileArray[0].urlList[0].url).then((data) => {
  2256. if (data.data != 1) {
  2257. // 下载文件, 并存成ArrayBuffer对象
  2258. const file_name = `${downFileArray[0].username}-${downFileArray[0].urlList[0].name}`; // 获取文件名
  2259. zip.file(file_name, data.data, { binary: true }); // 逐个添加文件
  2260. }
  2261. this.fileLoading[index].load+=1
  2262. this.fileLoading[index].progress = parseInt((this.fileLoading[index].load / this.fileLoading[index].count) * 100);
  2263. if (this.fileLoading[index].load == this.fileLoading[index].count) {
  2264. this.fileLoading[index].bool=false
  2265. }
  2266. }))
  2267. }
  2268. }else if(downFileArray.length>1){//有多位老师的情况
  2269. downFileArray.forEach(i=>{
  2270. if(i.urlList.length==1){//只有一个文件的情况
  2271. promises.push(getFile(i.urlList[0].url).then((data) => {
  2272. if (data.data != 1) {
  2273. // 下载文件, 并存成ArrayBuffer对象
  2274. const file_name = `${i.username ? i.username : '匿名'}-${i.urlList[0].name}`; // 获取文件名
  2275. zip.file(file_name, data.data, { binary: true }); // 逐个添加文件
  2276. }
  2277. this.fileLoading[index].load+=1
  2278. this.fileLoading[index].progress = parseInt((this.fileLoading[index].load / this.fileLoading[index].count) * 100);
  2279. if (this.fileLoading[index].load == this.fileLoading[index].count) {
  2280. this.fileLoading[index].bool=false
  2281. }
  2282. }))
  2283. }else if(i.urlList.length>1){//有多个文件的
  2284. const folder = zip.folder(`${i.username ? i.username : '匿名'}`);
  2285. i.urlList.forEach(ui=>{
  2286. const promise = getFile(ui.url).then((data) => {
  2287. if (data.data != 1) {
  2288. // 下载文件, 并存成ArrayBuffer对象
  2289. const file_name = ui.name; // 获取文件名
  2290. folder.file(file_name, data.data, { binary: true }); // 逐个添加文件
  2291. }
  2292. this.fileLoading[index].load+=1
  2293. this.fileLoading[index].progress = parseInt((this.fileLoading[index].load / this.fileLoading[index].count) * 100);
  2294. if (this.fileLoading[index].load == this.fileLoading[index].count) {
  2295. this.fileLoading[index].bool=false
  2296. }
  2297. })
  2298. promises.push(promise)
  2299. })
  2300. }
  2301. })
  2302. }
  2303. Promise.all(promises).then(() => {
  2304. zip.generateAsync({ type: "blob" }).then((content) => {
  2305. // 生成二进制流
  2306. FileSaver.saveAs(content, `${this.testJson.title}-${title}.zip`); // 利用file-saver保存文件 自定义文件名
  2307. });
  2308. });
  2309. },
  2310. getUserInfo() {
  2311. let params = {
  2312. uid: this.peopleId,
  2313. };
  2314. this.ajax
  2315. .get(this.$store.state.api + "selectTestUser", params)
  2316. .then((res) => {
  2317. console.log('111111111111111111111',res.data[0][0]);
  2318. // 用于存储归类后的数据的对象
  2319. // this.checkDataType(2)
  2320. this.stype = 2
  2321. this.courseName = res.data[0][0].name
  2322. this.searchCourse()
  2323. })
  2324. .catch((err) => {
  2325. console.error(err);
  2326. });
  2327. },
  2328. setWordTemplate(item){
  2329. this.$refs.docxTemplateDialogRef.open({fileData:this.testJson.cover?JSON.parse(this.testJson.cover):null,testJson:this.testJson,courseId:this.testJson.courseId,formData:[item]})//这里可以传数据
  2330. },
  2331. changeCover(data){
  2332. this.testJson.cover = data
  2333. },
  2334. exportWordData(){
  2335. this.$refs.docxTemplateDialogRef.open({fileData:this.testJson.cover?JSON.parse(this.testJson.cover):null,testJson:this.testJson,courseId:this.testJson.courseId,formData:this.worksArray})//这里可以传数据
  2336. }
  2337. },
  2338. beforeDestroy() {
  2339. document.getElementsByTagName('html')[0].style.overflow = '';
  2340. window.removeEventListener("resize", this.checkScreenSize);
  2341. },
  2342. mounted() {
  2343. this.checkScreenSize();
  2344. window.addEventListener("resize", this.checkScreenSize);
  2345. document.getElementsByTagName('html')[0].scrollTop = 0
  2346. document.getElementsByTagName('html')[0].style.overflow = 'hidden'
  2347. this.$nextTick(function () {
  2348. if(this.peopleId){
  2349. this.getUserInfo();
  2350. }else{
  2351. this.getData();
  2352. }
  2353. // this.getClass2()
  2354. this.changeHeight()
  2355. });
  2356. },
  2357. };
  2358. </script>
  2359. <style scoped>
  2360. .pb_content {
  2361. height: 100% !important;
  2362. /* margin: 0 20px 0 20px; */
  2363. }
  2364. .cutBtnBlockCss{
  2365. width: 100%;display: flex;justify-content: end;
  2366. }
  2367. .cutBtnCss{
  2368. width: 68px;
  2369. height: 27px;
  2370. font-size: 14px;
  2371. border-radius: 5px;
  2372. display: flex;
  2373. color: rgba(54, 129, 252, 1);
  2374. justify-content: center;
  2375. align-items: center;
  2376. margin-top: 10px;
  2377. border: 1px rgba(54, 129, 252, 1) solid;
  2378. }
  2379. .isDesktopRight{
  2380. width:100% !important;
  2381. margin:0 !important;
  2382. height: 300px !important;
  2383. border: none !important;
  2384. }
  2385. .isDTitle2JsonTit{
  2386. width: 130px;
  2387. color: rgba(0, 0, 0, 0.9);
  2388. overflow: hidden;
  2389. white-space: nowrap;
  2390. text-overflow: ellipsis;
  2391. }
  2392. .IsDAnswer{
  2393. margin: 20px 0 30px;color: rgba(0, 0, 0, 0.6);
  2394. }
  2395. .CutCss{
  2396. height: 60px;
  2397. line-height: 60px;
  2398. }
  2399. .topicTitCss{
  2400. color: rgba(0, 0, 0, 0.9);
  2401. font-weight: 600;
  2402. margin-right: 5px;
  2403. }
  2404. .IsDFile{
  2405. width: 150px;
  2406. height: 120px;
  2407. border-radius: 10px;
  2408. position: relative;
  2409. display: flex;
  2410. flex-direction: column;
  2411. overflow: hidden;
  2412. margin-bottom: 5px;
  2413. }
  2414. .IsDownload{
  2415. position: absolute;
  2416. width: 30px;
  2417. top: 5px;
  2418. right: 5px;
  2419. }
  2420. .IsDImg{
  2421. width: 100%;
  2422. height: 70px;
  2423. flex: 1;
  2424. }
  2425. .pb_content_body {
  2426. width: 100% !important;
  2427. height: 100%;
  2428. }
  2429. .pb_content_body>.right {
  2430. height: 100%;
  2431. width: 100%;
  2432. display: flex;
  2433. overflow: hidden;
  2434. flex-direction: column;
  2435. }
  2436. .basic_box {
  2437. margin: 0 auto;
  2438. position: relative;
  2439. padding: 0 20px 0 20px;
  2440. }
  2441. .courseTop {
  2442. display: flex;
  2443. flex-direction: row;
  2444. justify-content: space-between;
  2445. align-items: center;
  2446. width: calc(100% - 40px);
  2447. margin: 0 auto;
  2448. padding: 10px 0;
  2449. }
  2450. .stepsNav {
  2451. display: flex;
  2452. flex-direction: row;
  2453. justify-content: flex-start;
  2454. align-items: center;
  2455. }
  2456. .step_box {
  2457. width: calc(100% - 40px);
  2458. margin: 0 auto;
  2459. height: calc(100% - 50px);
  2460. overflow: auto;
  2461. background: #ffff;
  2462. border-radius: 5px;
  2463. }
  2464. .el-table>>>.even_row {
  2465. background-color: #f1f1f1 !important;
  2466. }
  2467. .student_page {
  2468. margin-top: 10px;
  2469. }
  2470. .test_title {
  2471. display: flex;
  2472. padding: 15px 15px;
  2473. width: 100%;
  2474. box-sizing: border-box;
  2475. justify-content: space-between;
  2476. align-items: center;
  2477. flex-wrap: wrap;
  2478. margin-bottom: 10px;
  2479. }
  2480. .test_title .left {
  2481. max-width: 100%;
  2482. margin-top: 10px
  2483. }
  2484. .test_title .left .title {
  2485. width: 100%;
  2486. font-size: 24px;
  2487. font-weight: 700;
  2488. overflow: hidden;
  2489. text-overflow: ellipsis;
  2490. white-space: nowrap;
  2491. }
  2492. .test_title .left .info {
  2493. display: flex;
  2494. margin-top: 15px;
  2495. }
  2496. .test_title .left .info .info_box {
  2497. font-size: 14px;
  2498. }
  2499. .test_title .left .info .info_box+.info_box {
  2500. margin-left: 20px;
  2501. padding-left: 20px;
  2502. border-left: 1px solid #E7E7E7;
  2503. }
  2504. .test_title .left .info .info_box span:nth-child(1) {
  2505. color: #00000099;
  2506. }
  2507. .test_title .left .info .info_box span:nth-child(2) {}
  2508. .test_title .right {
  2509. display: flex;
  2510. align-items: center;
  2511. margin-top: 10px;
  2512. max-width: 100%;
  2513. }
  2514. .test_title .right .data_box {
  2515. margin-right: 15px;
  2516. width: 150px;
  2517. border: 1px solid #e7e7e7;
  2518. border-radius: 5px;
  2519. padding: 0 10px;
  2520. height: 57px;
  2521. font-size: 14px;
  2522. color: #00000099;
  2523. display: flex;
  2524. justify-content: space-between;
  2525. align-items: center;
  2526. }
  2527. .test_title .right .data_box span:nth-child(1) {}
  2528. .test_title .right .data_box span:nth-child(2) {}
  2529. .test_title .right .data_box span:nth-child(2) .big {
  2530. font-size: 22px;
  2531. }
  2532. .test_title .right .btn_box {
  2533. display: flex;
  2534. flex-direction: column;
  2535. width: 57px;
  2536. height: 57px;
  2537. background: #3681fc;
  2538. border-radius: 5px;
  2539. font-size: 14px;
  2540. cursor: pointer;
  2541. align-items: center;
  2542. justify-content: center;
  2543. color: #fff;
  2544. }
  2545. .test_title .right .btn_box span:nth-child(1) {
  2546. display: block;
  2547. width: 12px;
  2548. height: 14px;
  2549. margin-bottom: 5px;
  2550. background-image: url('../../../../assets/icon/test/icon_share.png');
  2551. background-size: 100% 100%;
  2552. }
  2553. .test_title .right .btn_box span:nth-child(2) {}
  2554. .search_nav {
  2555. border-bottom: 1px solid #E7E7E7;
  2556. width: 100%;
  2557. box-sizing: border-box;
  2558. padding: 0 15px 10px;
  2559. display: flex;
  2560. align-items: flex-end;
  2561. height: 50px;
  2562. }
  2563. .search_nav>.right {
  2564. display: flex;
  2565. align-items: center;
  2566. }
  2567. .search_nav>.right>span {
  2568. height: 24px;
  2569. font-size: 14px;
  2570. color: #000;
  2571. cursor: pointer;
  2572. position: relative;
  2573. }
  2574. .search_nav>.isDesktopRightCut{
  2575. display: flex;
  2576. justify-content: space-between;
  2577. width: 60%;
  2578. }
  2579. .search_nav>.right>span+span {
  2580. margin-left: 35px;
  2581. }
  2582. .search_nav>.right>span.active {
  2583. color: #3681FC;
  2584. font-weight: 600;
  2585. }
  2586. .search_nav>.right>span.active::before {
  2587. content: "";
  2588. position: absolute;
  2589. bottom: -10px;
  2590. width: 15px;
  2591. height: 3px;
  2592. background: #3681fc;
  2593. left: 50%;
  2594. transform: translateX(-50%);
  2595. }
  2596. .search_nav>.left {
  2597. display: flex;
  2598. align-items: center;
  2599. margin-left: auto;
  2600. }
  2601. .search_nav>.right>span.active2 {
  2602. color: #3681FC;
  2603. font-weight: 600;
  2604. }
  2605. .search_nav>.right>span.active2::before {
  2606. content: "";
  2607. position: absolute;
  2608. bottom: -10px;
  2609. width: 100%;
  2610. height: 3px;
  2611. background: #3681fc;
  2612. left: 50%;
  2613. transform: translateX(-50%);
  2614. }
  2615. .student_input>>>.el-input__inner {
  2616. height: 40px;
  2617. width: 190px;
  2618. font-size: 13px;
  2619. padding: 0 35px 0 10px;
  2620. }
  2621. .serach_icon {
  2622. position: absolute;
  2623. right: 12px;
  2624. top: 50%;
  2625. transform: translateY(-50%);
  2626. width: 13px;
  2627. height: 13px;
  2628. background: url("../../../../assets/icon/test/test_search.png") no-repeat;
  2629. background-size: 100% 100%;
  2630. cursor: pointer;
  2631. }
  2632. .title_content {
  2633. padding-bottom: 10px;
  2634. }
  2635. .title_content>.title_box {
  2636. width: calc(100% - 48px);
  2637. margin: 20px auto 0;
  2638. }
  2639. .title_content>.title_box>.title {
  2640. font-size: 18px;
  2641. display: flex;
  2642. min-height: 35px;
  2643. white-space: pre-line;
  2644. position: relative;
  2645. }
  2646. .title_content>.title_box>.title>.test_icon {
  2647. min-width: 20px;
  2648. height: 20px;
  2649. }
  2650. .title_content>.title_box>.detail {
  2651. font-size: 14px;
  2652. color: #00000099;
  2653. margin-top: 8px;
  2654. white-space: pre-line;
  2655. }
  2656. .title_content>.title_box>.content1 {
  2657. display: flex;
  2658. width: 100%;
  2659. margin-top: 10px;
  2660. }
  2661. .title_content>.title_box>.content1>>>.el-progress__text {
  2662. color: #3681FC;
  2663. min-width: 55px;
  2664. font-size: 16px !important;
  2665. }
  2666. .title_content>.title_box>.content1>.left {
  2667. width: calc(100% - 620px);
  2668. border: 1px solid #e7e7e7;
  2669. }
  2670. .title_content>.title_box>.content1>.left>div+div {
  2671. border-top: 1px solid #e7e7e7;
  2672. }
  2673. .title_content>.title_box>.content1>.left>.title,
  2674. .title_content>.title_box>.content1>.left>.data {
  2675. display: flex;
  2676. height: 40px;
  2677. align-items: center;
  2678. width: 100%;
  2679. padding: 0 15px;
  2680. box-sizing: border-box;
  2681. line-height: 16px;
  2682. }
  2683. .title_content>.title_box>.content1>.left>.title>span,
  2684. .title_content>.title_box>.content1>.left>.data>span {
  2685. overflow: hidden;
  2686. text-overflow: ellipsis;
  2687. white-space: nowrap;
  2688. }
  2689. .title_content>.title_box>.content1>.left>.title>span:nth-child(1),
  2690. .title_content>.title_box>.content1>.left>.data>span:nth-child(1) {
  2691. width: calc(100% - 320px - 110px);
  2692. }
  2693. .title_content>.title_box>.content1>.left>.title>span:nth-child(2),
  2694. .title_content>.title_box>.content1>.left>.data>span:nth-child(2) {
  2695. width: 110px;
  2696. }
  2697. .title_content>.title_box>.content1>.left>.title>span:nth-child(3),
  2698. .title_content>.title_box>.content1>.left>.data>span:nth-child(3) {
  2699. width: 320px;
  2700. }
  2701. .isDesktopTitle{
  2702. display: flex;
  2703. justify-content: space-around;
  2704. }
  2705. .isDesktopTitle >div {
  2706. width: 60px;
  2707. height: 30px;
  2708. line-height: 30px;
  2709. overflow: hidden;
  2710. white-space: nowrap;
  2711. text-overflow: ellipsis;
  2712. }
  2713. /* .isDesktopTitle:nth-child(1){
  2714. width: 60px;
  2715. }
  2716. .isDesktopTitle:nth-child(2){
  2717. width: 60px;
  2718. }
  2719. .isDesktopTitle:nth-child(3){
  2720. flex: 1;
  2721. } */
  2722. .title_content>.title_box>.content1>.left>.title {
  2723. font-weight: 700;
  2724. background: #F9FAFB;
  2725. }
  2726. .title_content>.title_box>.content1>.right {
  2727. width: 600px;
  2728. margin-left: 20px;
  2729. border: 1px solid #e7e7e7;
  2730. min-height: 300px;
  2731. }
  2732. .title_content>.title_box>.content2 {
  2733. display: flex;
  2734. width: 100%;
  2735. margin-top: 10px;
  2736. }
  2737. .title_content>.title_box>.content2>.left {
  2738. width: calc(100% - 620px);
  2739. border: 1px solid #e7e7e7;
  2740. }
  2741. .title_content>.title_box>.content2>.left>div+div {
  2742. border-top: 1px solid #e7e7e7;
  2743. }
  2744. .title_content>.title_box>.content2>.left>.title,
  2745. .title_content>.title_box>.content2>.left>.data {
  2746. display: flex;
  2747. height: 40px;
  2748. align-items: center;
  2749. width: 100%;
  2750. padding: 0 15px;
  2751. box-sizing: border-box;
  2752. line-height: 16px;
  2753. }
  2754. .title_content>.title_box>.content2>.left>.title>span,
  2755. .title_content>.title_box>.content2>.left>.data>span {
  2756. overflow: hidden;
  2757. text-overflow: ellipsis;
  2758. white-space: nowrap;
  2759. }
  2760. .title_content>.title_box>.content2>.left>.title>span:nth-child(1),
  2761. .title_content>.title_box>.content2>.left>.data>span:nth-child(1) {
  2762. width: 55px;
  2763. }
  2764. .title_content>.title_box>.content2>.left>.title>span:nth-child(2),
  2765. .title_content>.title_box>.content2>.left>.data>span:nth-child(2) {
  2766. width: 110px;
  2767. }
  2768. .title_content>.title_box>.content2>.left>.title>span:nth-child(3),
  2769. .title_content>.title_box>.content2>.left>.data>span:nth-child(3) {
  2770. max-width: calc(100% - 110px - 55px);
  2771. }
  2772. .title_content>.title_box>.content2>.left>.title {
  2773. font-weight: 700;
  2774. background: #F9FAFB;
  2775. }
  2776. .title_content>.title_box>.content2>.right {
  2777. width: 600px;
  2778. margin-left: 20px;
  2779. border: 1px solid #e7e7e7;
  2780. }
  2781. .title_content>.title_box>.content2>.right>>>.wordCloud {
  2782. height: auto;
  2783. min-height: 300px;
  2784. }
  2785. .title_content>.title_box>.content3 {
  2786. display: flex;
  2787. width: 100%;
  2788. overflow: auto;
  2789. }
  2790. .title_content>.title_box>.content3>.file {
  2791. min-width: 200px;
  2792. width: 200px;
  2793. height: 140px;
  2794. margin: 10px 10px 10px 0px;
  2795. border-radius: 15px;
  2796. box-shadow: rgb(223, 218, 218) 0px 0px 6px 1px;
  2797. overflow: hidden;
  2798. margin-right: 15px;
  2799. position: relative;
  2800. display: flex;
  2801. flex-direction: column;
  2802. }
  2803. .title_content>.title_box>.content3>.file>.img {
  2804. width: 100%;
  2805. height: calc(100% - 35px);
  2806. object-fit: cover;
  2807. cursor: pointer;
  2808. }
  2809. .title_content>.title_box>.content3>.file>.del {
  2810. position: absolute;
  2811. width: 25px;
  2812. top: 10px;
  2813. right: 10px;
  2814. cursor: pointer;
  2815. }
  2816. .title_content>.title_box>.content3>.file>.download {
  2817. position: absolute;
  2818. width: 25px;
  2819. top: 10px;
  2820. right: 35px;
  2821. cursor: pointer;
  2822. opacity: .8;
  2823. }
  2824. .title_content>.title_box>.content3>.file>.name {
  2825. height: 35px;
  2826. width: 100%;
  2827. background: #f9f9f9;
  2828. display: flex;
  2829. align-items: center;
  2830. padding: 0 10px;
  2831. box-sizing: border-box;
  2832. }
  2833. .title_content>.title_box>.content3>.file>.name>span {
  2834. display: block;
  2835. text-overflow: ellipsis;
  2836. max-width: 100%;
  2837. white-space: nowrap;
  2838. overflow: hidden;
  2839. }
  2840. .table_content {
  2841. /* width: calc(100% - 48px);
  2842. margin: 20px auto 0; */
  2843. padding: 20px 24px;
  2844. width: 100%;
  2845. box-sizing: border-box;
  2846. }
  2847. .table_content>>>.el-table td {
  2848. padding: 5px 0;
  2849. }
  2850. .isDesktopTable_content{
  2851. width: 100%;
  2852. }
  2853. .isDTitle{
  2854. display: flex;
  2855. justify-content: space-between;
  2856. }
  2857. .isDBri{
  2858. display: flex;
  2859. padding: 15px 0;
  2860. font-size: 14px;
  2861. color: rgba(0, 0, 0, 0.4);
  2862. flex-direction: column;
  2863. height: 80px;
  2864. justify-content: space-between;
  2865. }
  2866. .answer_type {
  2867. background: #F0F2F5;
  2868. padding: 5px 10px;
  2869. display: block;
  2870. border-radius: 3px;
  2871. margin: 5px;
  2872. }
  2873. .table_file>.file {
  2874. min-width: 100px;
  2875. width: 100px;
  2876. height: 70px;
  2877. margin: 10px 10px 10px 0px;
  2878. border-radius: 5px;
  2879. box-shadow: rgb(223, 218, 218) 0px 0px 6px 1px;
  2880. overflow: hidden;
  2881. margin-right: 15px;
  2882. position: relative;
  2883. display: flex;
  2884. flex-direction: column;
  2885. }
  2886. .table_file>.file>.img {
  2887. width: 100%;
  2888. height: calc(100% - 20px);
  2889. object-fit: cover;
  2890. cursor: pointer;
  2891. }
  2892. .table_file>.file>.del {
  2893. position: absolute;
  2894. width: 25px;
  2895. top: 10px;
  2896. right: 10px;
  2897. cursor: pointer;
  2898. }
  2899. .table_file>.file>.download {
  2900. position: absolute;
  2901. width: 25px;
  2902. top: 10px;
  2903. right: 35px;
  2904. cursor: pointer;
  2905. opacity: .8;
  2906. }
  2907. .table_file>.file>.name {
  2908. height: 20px;
  2909. width: 100%;
  2910. background: #f9f9f9;
  2911. display: flex;
  2912. align-items: center;
  2913. padding: 0 10px;
  2914. box-sizing: border-box;
  2915. font-size: 12px;
  2916. }
  2917. .table_file>.file>.name>span {
  2918. display: block;
  2919. text-overflow: ellipsis;
  2920. max-width: 100%;
  2921. white-space: nowrap;
  2922. overflow: hidden;
  2923. }
  2924. .btnA {
  2925. color: #fff;
  2926. background-color: #0061FF;
  2927. padding: 0 24px;
  2928. font-size: 14px;
  2929. min-width: 64px;
  2930. font-weight: 500;
  2931. border-radius: 4px;
  2932. box-sizing: border-box;
  2933. border: none;
  2934. cursor: pointer;
  2935. transition: all 0.2s ease-in-out;
  2936. height: 36px;
  2937. display: flex;
  2938. align-items: center;
  2939. justify-content: center;
  2940. line-height: 1;
  2941. margin-right: 10px;
  2942. position: relative;
  2943. }
  2944. .buttonBox {
  2945. position: absolute;
  2946. bottom: -0;
  2947. transform: translateY(100%);
  2948. background: #fff;
  2949. border-radius: 5px;
  2950. box-shadow: 0 0 3px 1px #e3e3e3;
  2951. width: 100%;
  2952. z-index: 999;
  2953. }
  2954. .buttonBox>div {
  2955. height: 40px;
  2956. line-height: 40px;
  2957. width: 100%;
  2958. text-align: center;
  2959. color: #000;
  2960. box-sizing: border-box;
  2961. }
  2962. .buttonBox>div+div {
  2963. border-top: 1px solid #e0e0e0;
  2964. }
  2965. .buttonBox>div:hover {
  2966. background: #f6f8ff;
  2967. }
  2968. .content4 {
  2969. width: 100%;
  2970. height: auto;
  2971. display: flex;
  2972. flex-wrap: nowrap;
  2973. overflow: auto;
  2974. }
  2975. .out_box {
  2976. display: flex;
  2977. flex-direction: column;
  2978. flex-wrap: nowrap;
  2979. /* width: 200px; */
  2980. min-width: 280px;
  2981. width: 280px;
  2982. background: #fff;
  2983. /* background-color: white; */
  2984. margin-right: 15px;
  2985. /* border: 1px solid #ccc; */
  2986. height: fit-content;
  2987. box-sizing: border-box;
  2988. border-radius: 0px 0px 5px 5px;
  2989. /* overflow: hidden; */
  2990. margin-bottom: 15px;
  2991. position: relative;
  2992. border-radius: 8px;
  2993. box-sizing: border-box;
  2994. overflow: hidden;
  2995. border: 1px solid #3682fc00;
  2996. cursor: pointer;
  2997. border: 1px solid #6a9ff5;
  2998. height: auto;
  2999. }
  3000. .out_boxActive {
  3001. box-sizing: border-box;
  3002. border: 3px solid #3681FC !important;
  3003. }
  3004. .out_box:hover {
  3005. border: 1px solid #3681FC;
  3006. }
  3007. .bottom_box {
  3008. width: 100%;
  3009. display: flex;
  3010. padding: 10px;
  3011. flex-direction: column;
  3012. box-sizing: border-box;
  3013. height: 121px;
  3014. flex-wrap: nowrap;
  3015. justify-content: space-evenly;
  3016. }
  3017. .bottom_box>div:nth-child(1) {
  3018. width: 100%;
  3019. /* overflow: hidden;
  3020. text-overflow: ellipsis;
  3021. white-space: nowrap;
  3022. font-weight: bold; */
  3023. display: flex;
  3024. align-items: center;
  3025. justify-content: space-between;
  3026. }
  3027. .bottom_box>div:nth-child(1)>span:nth-child(1) {
  3028. max-width: 100%;
  3029. overflow: hidden;
  3030. text-overflow: ellipsis;
  3031. white-space: nowrap;
  3032. font-weight: bold;
  3033. }
  3034. .bottom_box>div:nth-child(1)>span:nth-child(2) {
  3035. min-width: fit-content;
  3036. font-size: 14px;
  3037. color: #8c8c8c;
  3038. }
  3039. .tup {
  3040. width: 100%;
  3041. height: auto;
  3042. margin: 0 auto;
  3043. overflow: hidden;
  3044. display: flex;
  3045. flex-direction: column;
  3046. align-items: center;
  3047. padding: 10px;
  3048. box-sizing: border-box;
  3049. }
  3050. .tup>img {
  3051. width: 100%;
  3052. /* height: 100%; */
  3053. height: 150px;
  3054. /* object-fit: cover; */
  3055. object-fit: contain;
  3056. }
  3057. .kc_time {
  3058. margin-top: 8px;
  3059. font-size: 14px;
  3060. color: #717C8D;
  3061. }
  3062. .kc_time+.kc_time {
  3063. margin-top: 0;
  3064. }
  3065. .kc_t {
  3066. margin-top: 5px;
  3067. width: 100%;
  3068. white-space: nowrap;
  3069. overflow: hidden;
  3070. text-overflow: ellipsis;
  3071. display: flex;
  3072. align-items: center;
  3073. justify-content: space-between;
  3074. }
  3075. .kc_t>span:nth-child(1) {
  3076. max-width: 100%;
  3077. overflow: hidden;
  3078. text-overflow: ellipsis;
  3079. white-space: nowrap;
  3080. }
  3081. .kc_t>span:nth-child(2) {
  3082. min-width: fit-content;
  3083. font-size: 14px;
  3084. color: #8c8c8c;
  3085. }
  3086. .title_box>.title>.title_downBtn{
  3087. position: absolute;
  3088. right: 10px;
  3089. top: 0;
  3090. }
  3091. .fileLoadDiv >>> .el-dialog__header{
  3092. display: none;
  3093. }
  3094. .fileLoadDiv >>> .el-dialog__body{
  3095. display: flex;
  3096. justify-content: center;
  3097. }
  3098. .fileLoadDiv >>> .el-dialog{
  3099. margin-top: 60vh !important;
  3100. width: 200px !important;
  3101. height: 80px;
  3102. display: flex;
  3103. justify-content: center;
  3104. align-items: center;
  3105. border-radius: 15px;
  3106. }
  3107. .mask {
  3108. background-color: rgb(0 0 0 / 30%);
  3109. /* position: fixed; */
  3110. position: absolute;
  3111. top: 0;
  3112. left: 0;
  3113. width: 100%;
  3114. height: 100%;
  3115. z-index: 90;
  3116. display: flex;
  3117. align-items: center;
  3118. justify-content: center;
  3119. }
  3120. .progressBox {
  3121. width: 300px;
  3122. height: 150px;
  3123. background: #fff;
  3124. border-radius: 10px;
  3125. box-shadow: 0 0 6px 1px #bfbfbf;
  3126. display: flex;
  3127. align-items: center;
  3128. justify-content: center;
  3129. flex-direction: column;
  3130. position: relative;
  3131. color: #6c6c6c;
  3132. }
  3133. .progressBox>>>.el-progress-bar__outer {
  3134. background-color: #d1dfff !important;
  3135. }
  3136. .progressBox .lbox {
  3137. height: 50px;
  3138. font-size: 19px;
  3139. display: flex;
  3140. align-items: center;
  3141. color: #747474;
  3142. }
  3143. .progressBox .lbox img {
  3144. width: 40px;
  3145. margin-right: 20px;
  3146. }
  3147. .boxSticky{
  3148. position: sticky;
  3149. top: 0;
  3150. z-index: 999;
  3151. background: #fff;
  3152. }
  3153. .aiBoxRight{
  3154. height: calc(100% - 158px - 46px);
  3155. width: 500px;
  3156. margin: 0 auto;
  3157. position: fixed;
  3158. z-index: 999;
  3159. right: 30px;
  3160. bottom: 10px;
  3161. box-shadow: 0 0 5px 2px #00000045;
  3162. border-radius: 5px;
  3163. overflow: hidden;
  3164. }
  3165. </style>