index.vue 102 KB

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