index.vue 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894
  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. peopleId: this.$route.query.peopleId,
  824. screenWidth: window.innerWidth,
  825. isDesktop: false,
  826. title: "",
  827. testType: [],
  828. see: false,
  829. cJson: [],
  830. loading: false,
  831. look: "",
  832. TeachingOptions:[],
  833. TeachingValue :'',
  834. SubmitTimeOptions: [],
  835. SubmitTime: '',
  836. tableHeight: 500,
  837. isLoading: false,
  838. pageSize: 10,
  839. total: 0,
  840. page: 1,
  841. tableData: [],
  842. testJson: {},
  843. works: [],
  844. iscount: 0,
  845. pcount: 0,
  846. stype: 1,
  847. courseName: "",
  848. dialogVisibleShare: false,
  849. worksArray: [],
  850. testArray: [],
  851. options2: {
  852. 1: "选择题",
  853. // 2: "问答题",
  854. 3: "问答题",
  855. 4: "添加文档",
  856. 5: "附件"
  857. },
  858. videoIcon: videoIcon,
  859. wordIcon: wordIcon,
  860. fileIcon: fileIcon,
  861. dialogVisiblePdf: false,
  862. dialogVisibleVideo: false,
  863. dialogVisibleOffice: false,
  864. wurl: "",
  865. chapters: [],
  866. filterPlacement: 'bottom-end',
  867. pdfLoading: false,
  868. btnDisplay: false
  869. };
  870. },
  871. watch: {},
  872. computed: {
  873. TeachNameCpt: function () {
  874. // `this` 指向 vm 实例
  875. return this.TeachingOptions.filter(i => {return i.id == this.TeachingValue})
  876. },
  877. // vcWords() {
  878. // return function (array) {
  879. // let _array = [];
  880. // if (array.length) {
  881. // for (var i = 0; i < array.length; i++) {
  882. // _array.push(
  883. // {
  884. // text: array[i].name,
  885. // weight: array[i].count,
  886. // }
  887. // )
  888. // }
  889. // }
  890. // console.log(_array);
  891. // return array.length ? _array : [];
  892. // };
  893. // },
  894. getScore() {
  895. return function (item) {
  896. let array = []
  897. for (var i = parseInt(item.small); i <= parseInt(item.big); i++) {
  898. array.push(i)
  899. }
  900. return item.answer2 ? array[item.answer2] : ''
  901. };
  902. },
  903. selectType() {
  904. return function (item) {
  905. if (item.type == 1 && item.atype == 2) {
  906. return '多选题'
  907. } else if (item.type == 1 && item.atype == 1) {
  908. return '单选题'
  909. } else if (item.type == 3) {
  910. return '问答题'
  911. } else if (item.type == 5) {
  912. return '附件'
  913. } else if (item.type == 6) {
  914. return '课程'
  915. } else if (item.type == 7) {
  916. return '评分'
  917. } else if (item.type == 8) {
  918. return '日期'
  919. }
  920. };
  921. },
  922. selectType2() {
  923. return function (val1,val2) {
  924. if (val1 == 1 && val2 == 2) {
  925. return '多选题'
  926. } else if (val1 == 1 && val2 == 1) {
  927. return '单选题'
  928. } else if (val1 == 3) {
  929. return '问答题'
  930. } else if (val1 == 5) {
  931. return '附件'
  932. } else if (val1 == 6) {
  933. return '课程'
  934. } else if (val1 == 7) {
  935. return '评分'
  936. } else if (val1 == 8) {
  937. return '日期'
  938. }
  939. };
  940. },
  941. // 获取评分的平均分
  942. getAverageScore(){
  943. return (_index)=>{
  944. let _result = 0;
  945. let _sum = 0;
  946. this.worksArray.forEach(i1=>{
  947. _result+=i1.array[_index].json.answer2
  948. _sum+=1;
  949. })
  950. _result = _sum ? (_result/_sum).toFixed(2) : 0
  951. return _result ? _result : 0;
  952. }
  953. }
  954. },
  955. methods: {
  956. //获取教研室列表
  957. getClass2() {
  958. let params = {
  959. oid: this.oid,
  960. };
  961. this.ajax
  962. .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
  963. .then((res) => {
  964. this.TeachingOptions = res.data[0];
  965. console.log('this.TeachingOptions',this.TeachingOptions);
  966. })
  967. .catch((err) => {
  968. this.isLoading = false;
  969. console.error(err);
  970. });
  971. },
  972. filterName(value, row, index) {
  973. let name = []
  974. for (var i = 0; i < row.array[index].json.answer2.length; i++) {
  975. name.push(row.array[index].json.array[row.array[index].json.answer2[i]].option)
  976. }
  977. console.log(name.indexOf(value) != -1);
  978. return name.indexOf(value) != -1;
  979. },
  980. // 筛选课程
  981. filterCourse(value, row, index) {
  982. return row.array[index].json.answer2 == value;
  983. },
  984. wordClickHandler(name, value) {
  985. // this.$notify({
  986. // title: name,
  987. // message: "数量:"+value
  988. // });
  989. },
  990. retrunCourse() {
  991. this.goTo(
  992. "/test?userid=" +
  993. this.userid +
  994. "&oid=" +
  995. this.oid +
  996. "&org=" +
  997. this.org +
  998. "&role=" +
  999. this.role
  1000. );
  1001. },
  1002. goTo(path) {
  1003. this.$router.push(path);
  1004. },
  1005. tableRowClassName({ row, rowIndex }) {
  1006. if ((rowIndex + 1) % 2 === 0) {
  1007. return "even_row";
  1008. } else {
  1009. return "";
  1010. }
  1011. },
  1012. changeHeight() {
  1013. if (this.stype == 1) {
  1014. return
  1015. }
  1016. this.tableHeight = this.$refs.stepBox.offsetHeight - 120;
  1017. if (this.tableHeight <= 530) {
  1018. this.tableHeight = 530;
  1019. }
  1020. // 监听窗口大小变化
  1021. let self = this;
  1022. window.onresize = function () {
  1023. if (self.stype == 1) {
  1024. return
  1025. }
  1026. self.tableHeight = this.$refs.stepBox.offsetHeight - 120;
  1027. if (self.tableHeight <= 530) {
  1028. self.tableHeight = 530;
  1029. }
  1030. };
  1031. // this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
  1032. },
  1033. handleCurrentChange(val) {
  1034. this.page = val;
  1035. this.getData2();
  1036. },
  1037. getTest(row) {
  1038. this.$router.push(
  1039. "/checkTest2?cid=" +
  1040. row.courseid +
  1041. "&userid=" +
  1042. this.userid +
  1043. "&userid2=" +
  1044. row.userid +
  1045. "&tid=" +
  1046. row.id +
  1047. "&oid=" +
  1048. this.oid +
  1049. "&org=" +
  1050. this.org +
  1051. "&type=2" +
  1052. "&role=" +
  1053. this.role
  1054. );
  1055. },
  1056. checkDataType(type) {
  1057. if (this.stype != type) {
  1058. this.stype = type
  1059. this.courseName = ''
  1060. if (type == 3) {
  1061. this.getData2();
  1062. } else {
  1063. this.getData();
  1064. }
  1065. this.changeHeight();
  1066. }
  1067. },
  1068. searchCourse() {
  1069. if (this.stype == 3) {
  1070. this.getData2()
  1071. } else {
  1072. this.getData()
  1073. }
  1074. },
  1075. getData() {
  1076. this.isLoading = true;
  1077. let params = {
  1078. cid: this.cid,
  1079. cn: this.courseName,
  1080. tim : !this.SubmitTime? '' : this.SubmitTime,
  1081. tea: this.TeachingValue
  1082. };
  1083. this.ajax
  1084. .get(this.$store.state.api + "getTestWorksNoPageCopy", params)
  1085. .then(async (res) => {
  1086. this.testJson = res.data[0][0]
  1087. console.log('this.testJson',JSON.parse(JSON.stringify(this.testJson)));
  1088. if (this.testJson.juriP) {
  1089. let ajuri2 = this.testJson.juri2.split (',');
  1090. let ajurip = this.testJson.juriP.split (',');
  1091. let JData = ajuri2.reverse()
  1092. this.TeachingOptions = JData.map((key, index) => ({
  1093. id : key,
  1094. name: ajurip[index]
  1095. }));
  1096. }else{
  1097. this.getClass2()
  1098. }
  1099. // console.log('dddd',this.TeachingOptions);
  1100. this.works = res.data[1]
  1101. this.iscount = res.data[2][0].count
  1102. this.pcount = res.data[3][0].count
  1103. let chapters = this.setJSON(this.setJson2(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
  1104. this.chapters = this.setFilter(this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
  1105. let testArray = []
  1106. let array = []
  1107. for (let i = 0; i < this.works.length; i++) {
  1108. let cJson = this.setJSON(JSON.parse(JSON.stringify(JSON.parse(this.works[i].courseJson))))
  1109. if (JSON.stringify(cJson) == JSON.stringify(chapters)) {
  1110. let _json = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(this.works[i].courseJson))))
  1111. for (var ja = 0; ja < _json.length; ja++) {
  1112. let _json2 = _json[ja].json
  1113. if (_json[ja].type == 6) {
  1114. let _cjson = await this.getCourse(_json2.answer2)
  1115. _json2.answer2 = _cjson ? _cjson.title : ''
  1116. }
  1117. }
  1118. array.push({
  1119. courseid: this.works[i].courseid,
  1120. id: this.works[i].id,
  1121. userid: this.works[i].userid,
  1122. name: this.works[i].username ? this.works[i].username : '匿名',
  1123. time: this.works[i].time,
  1124. array: _json,
  1125. cut:0,
  1126. courseJson: JSON.parse(this.works[i].courseJson),
  1127. })
  1128. }
  1129. }
  1130. for (var i = 0; i < this.chapters.length; i++) {
  1131. let el = this.chapters[i]
  1132. let topic = {
  1133. type: el.type,
  1134. cut: 0,
  1135. title: el.json ? el.json.title : '',
  1136. detail: el.json ? el.json.detail : '',
  1137. atype: el.json ? el.json.type : '',
  1138. choice: el.json ? el.json.array : '',
  1139. array: [],
  1140. answer: el.json ? el.json.answer : '',
  1141. count: 0,
  1142. courses: el.json ? el.json.courses : [],
  1143. small: el.json ? el.json.small : '',
  1144. big: el.json ? el.json.big : '',
  1145. }
  1146. if (topic.type == 1) {
  1147. for (var t = 0; t < topic.choice.length; t++) {
  1148. topic.array.push({
  1149. name: topic.choice[t].option,
  1150. count: 0
  1151. })
  1152. }
  1153. } else if (topic.type == 3) {
  1154. } else if (topic.type == 5) {
  1155. } else if (topic.type == 6) {
  1156. let _answer = topic.courses
  1157. topic.array = _answer
  1158. topic.courseArray = [];
  1159. let params = {
  1160. cid:topic.array ? topic.array.join(",") : ''
  1161. }
  1162. let data = await this.ajax.get(this.$store.state.api + 'getCourseInfoTestAll',params);
  1163. let result = data.data[0]
  1164. // this.chapters.find(i=>i.type==6).nameFilters = result.map(r=>{return{text:r.title,value:r.courseId}})
  1165. result.forEach(i=>{
  1166. if(this.chapters.find(f=>f.type==6).nameFilters.find(c=>c.value==i.title)==undefined){
  1167. this.chapters.find(i=>i.type==6).nameFilters.push({text:i.title,value:i.title})
  1168. }
  1169. })
  1170. // this.chapters.find(i=>i.type==6).nameFilters = result.map(r=>{return{text:r.title,value:r.title}})
  1171. 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,'-'))
  1172. topic.courseArray = result;
  1173. // topic.array.forEach(async i => {
  1174. // let data = await this.getCourse(i)
  1175. // console.log(data.update_at)
  1176. // 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,'-')
  1177. // topic.courseArray.push(data)
  1178. // })
  1179. } else if (topic.type == 7) {
  1180. for (var t = parseInt(topic.small); t <= parseInt(topic.big); t++) {
  1181. topic.array.push({
  1182. name: t,
  1183. count: 0
  1184. })
  1185. }
  1186. }
  1187. for (var j = 0; j < array.length; j++) {
  1188. let el2 = array[j]
  1189. if (topic.type == 1) {
  1190. let _answer = el2.array[i].json.answer2
  1191. for (var k = 0; k < _answer.length; k++) {
  1192. topic.array[_answer[k]].count++
  1193. topic.count++
  1194. }
  1195. } else if (topic.type == 3 || topic.type == 8) {
  1196. let type3 = 1
  1197. let _answer = el2.array[i].json.answer2
  1198. if (_answer) {
  1199. for (var k = 0; k < topic.array.length; k++) {
  1200. if (topic.array[k].name == _answer) {
  1201. topic.array[k].count++
  1202. type3 = 2
  1203. topic.count++
  1204. break;
  1205. }
  1206. }
  1207. if (type3 == 1) {
  1208. topic.array.push({
  1209. name: _answer,
  1210. count: 1
  1211. })
  1212. }
  1213. }
  1214. } else if (topic.type == 5) {
  1215. let _answer = el2.array[i].json.file ? el2.array[i].json.file : []
  1216. console.log(el2)
  1217. let _user = {userid:el2.userid,username:el2.name}
  1218. for (var k = 0; k < _answer.length; k++) {
  1219. topic.array.push({..._answer[k],..._user})
  1220. }
  1221. } else if (topic.type == 7) {
  1222. if(el2.array[i].json.answer2){
  1223. let _answer = el2.array[i].json.answer2
  1224. topic.array[_answer].count++
  1225. topic.count++
  1226. }
  1227. }
  1228. }
  1229. console.log('topictopictopictopic',topic)
  1230. testArray.push(topic)
  1231. }
  1232. this.testArray = testArray
  1233. this.worksArray = array
  1234. this.isLoading = false;
  1235. })
  1236. .catch((err) => {
  1237. console.error(err);
  1238. });
  1239. },
  1240. getData2() {
  1241. this.isLoading = true;
  1242. let params = {
  1243. cid: this.cid,
  1244. page: this.page,
  1245. pageSize: this.pageSize,
  1246. cn: this.courseName
  1247. };
  1248. this.ajax
  1249. .get(this.$store.state.api + "getTestWorksPage3", params)
  1250. .then((res) => {
  1251. this.isLoading = false;
  1252. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  1253. this.tableData = res.data[0];
  1254. })
  1255. .catch((err) => {
  1256. console.error(err);
  1257. });
  1258. },
  1259. setJSON(json) {
  1260. return json.filter((item) => {
  1261. if (item.array) {
  1262. item.array = item.array.filter((item2) => {
  1263. if (item2.ttype == 1 && item2.json) {
  1264. delete item2.json.answer2
  1265. delete item2.json.score2
  1266. delete item2.json.file
  1267. }
  1268. if (item2.array) {
  1269. item2.array = item2.array.filter((item3) => {
  1270. if (item3.ttype == 1 && item3.json) {
  1271. delete item3.json.answer2
  1272. delete item3.json.score2
  1273. delete item3.json.file
  1274. }
  1275. return item3;
  1276. });
  1277. }
  1278. return item2;
  1279. });
  1280. } else if (item.ttype == 1 && item.json) {
  1281. delete item.json.answer2
  1282. delete item.json.score2
  1283. delete item.json.file
  1284. }
  1285. return item
  1286. console.log(item.array);
  1287. });
  1288. },
  1289. setJson2(json) {
  1290. let _json = json;
  1291. // this.type = _json[0].ttype;
  1292. let checkArray = _json.filter((item) => {
  1293. if (item.array) {
  1294. item.array = item.array.filter((item2) => {
  1295. if (item2.ttype == 1 && item2.json && !item2.json.answer2) {
  1296. item2.json.answer2 = [];
  1297. }
  1298. if (item2.array) {
  1299. item2.array = item2.array.filter((item3) => {
  1300. if (item3.ttype == 1 && item3.json && !item3.json.answer2) {
  1301. item3.json.answer2 = [];
  1302. }
  1303. return item3;
  1304. });
  1305. }
  1306. return (
  1307. (item2.ttype != 1 && item2.array.length > 0) || item2.ttype == 1
  1308. );
  1309. });
  1310. }
  1311. if (item.ttype == 1 && item.json && !item.json.answer2) {
  1312. item.json.answer2 = [];
  1313. }
  1314. console.log(item.array);
  1315. return (item.ttype != 1 && item.array.length > 0) || item.ttype == 1;
  1316. });
  1317. console.log(checkArray);
  1318. return checkArray;
  1319. },
  1320. JSONSetting(json) {
  1321. let _json = json
  1322. let array = []
  1323. _json.filter((item) => {
  1324. if (item.array) {
  1325. item.array = item.array.filter((item2) => {
  1326. if (item2.ttype == 1 && item2.json) {
  1327. array.push(item2)
  1328. }
  1329. if (item2.array) {
  1330. item2.array = item2.array.filter((item3) => {
  1331. if (item3.ttype == 1 && item3.json) {
  1332. array.push(item3)
  1333. }
  1334. return item3;
  1335. });
  1336. }
  1337. return item2;
  1338. });
  1339. }
  1340. if (item.ttype == 1 && item.json) {
  1341. array.push(item)
  1342. }
  1343. console.log(item.array);
  1344. return item;
  1345. });
  1346. console.log(array);
  1347. return array;
  1348. },
  1349. setFilter(json) {
  1350. let _json = json
  1351. let array = []
  1352. _json.filter((item) => {
  1353. item.nameFilters = [],
  1354. item.filterParams = {
  1355. name: [],
  1356. }
  1357. if (item.type == 1) {
  1358. for (var i = 0; i < item.json.array.length; i++) {
  1359. item.nameFilters.push({ text: item.json.array[i].option, value: item.json.array[i].option })
  1360. }
  1361. }
  1362. array.push(item)
  1363. return item;
  1364. });
  1365. return array
  1366. },
  1367. checkFile(item) {
  1368. if (item.type == 3) {
  1369. this.$hevueImgPreview(item.url);
  1370. } else if (item.type == 5) {
  1371. this.downloadFile(item);
  1372. } else if (item.type == 1) {
  1373. this.dialogVisibleOffice = true
  1374. this.wurl = item.url
  1375. } else if (item.type == 2) {
  1376. this.dialogVisibleVideo = true
  1377. this.wurl = item.url
  1378. } else if (item.type == 4) {
  1379. this.dialogVisiblePdf = true
  1380. this.wurl = item.url
  1381. }
  1382. },
  1383. downloadFile(f) {
  1384. var credentials = {
  1385. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  1386. secretAccessKey: "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",
  1387. }; //秘钥形式的登录上传
  1388. window.AWS.config.update(credentials);
  1389. window.AWS.config.region = "cn-northwest-1"; //设置区域
  1390. let url2 = f.url;
  1391. let _url2 = "";
  1392. if (
  1393. url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
  1394. ) {
  1395. _url2 = url2.split(
  1396. "https://view.officeapps.live.com/op/view.aspx?src="
  1397. )[1];
  1398. } else {
  1399. _url2 = url2;
  1400. }
  1401. let _this = this;
  1402. _this.downLoading = _url2
  1403. var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
  1404. let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
  1405. var params = {
  1406. Bucket: "ccrb",
  1407. Key: name
  1408. };
  1409. s3.getObject(params, function (err, data) {
  1410. _this.downLoading = ''
  1411. if (err) console.log(err, err.stack); // an error occurred
  1412. else {
  1413. let url = window.URL.createObjectURL(new Blob([data.Body]));
  1414. let a = document.createElement("a");
  1415. a.name = f.name;
  1416. a.href = url;
  1417. a.download = f.name;
  1418. a.click();
  1419. console.log(data);
  1420. } // sxuccessful response
  1421. });
  1422. },
  1423. deleteTest(tid) {
  1424. let _this = this
  1425. _this
  1426. .$confirm("确定删除此提交的表单么?", "提示", {
  1427. confirmButtonText: "确定",
  1428. cancelButtonText: "取消",
  1429. type: "warning",
  1430. })
  1431. .then(() => {
  1432. let params = [{
  1433. tid: tid,
  1434. }];
  1435. _this.ajax
  1436. .post(_this.$store.state.api + "deleteTestCourseWorks", params)
  1437. .then((res) => {
  1438. _this.$message.success("删除成功");
  1439. if (_this.stype == 3) {
  1440. _this.getData2();
  1441. } else {
  1442. _this.getData();
  1443. }
  1444. })
  1445. .catch((err) => {
  1446. console.error(err);
  1447. });
  1448. })
  1449. .catch(() => {
  1450. return;
  1451. });
  1452. },
  1453. exportPDF() {
  1454. this.pdfLoading = true
  1455. var a = document.getElementsByTagName("img")
  1456. for (var i = 0; i < a.length; i++) { a[i].crossOrigin = "*" }
  1457. downloadPDF(this.$refs.stepBox, this.testJson.title, () => {
  1458. var _a = document.getElementsByTagName("img")
  1459. for (var i = 0; i < _a.length; i++) {
  1460. _a[i].removeAttribute("crossorigin")
  1461. }
  1462. setTimeout(() => {
  1463. this.pdfLoading = false
  1464. }, 2000);
  1465. })
  1466. },
  1467. score(json) {
  1468. let score = 0
  1469. json.forEach(el => {
  1470. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  1471. el.array.forEach(item => {
  1472. if (item.ttype == 2 && item.array.length > 0) {
  1473. item.array.forEach(item2 => {
  1474. if (item2.ttype == 1 && item2.json) {
  1475. score += item2.json.score ? parseFloat(item2.json.score) : 0
  1476. }
  1477. })
  1478. } else if (item.ttype == 1 && item.json) {
  1479. score += item.json.score ? parseFloat(item.json.score) : 0
  1480. }
  1481. })
  1482. } else if (el.ttype == 1 && el.json) {
  1483. score += el.json.score ? parseFloat(el.json.score) : 0
  1484. }
  1485. })
  1486. return score > 0 ? score + '分' : ''
  1487. },
  1488. score2(json) {
  1489. let score = 0
  1490. // let type = 1
  1491. json.forEach(el => {
  1492. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  1493. el.array.forEach(item => {
  1494. if (item.ttype == 2 && item.array.length > 0) {
  1495. item.array.forEach(item2 => {
  1496. if (item2.ttype == 1 && item2.json) {
  1497. score += item2.json.score2 ? parseFloat(item2.json.score2) : 0
  1498. }
  1499. })
  1500. } else if (item.ttype == 1 && item.json) {
  1501. score += item.json.score2 ? parseFloat(item.json.score2) : 0
  1502. }
  1503. })
  1504. } else if (el.ttype == 1 && el.json) {
  1505. score += el.json.score2 ? parseFloat(el.json.score2) : 0
  1506. }
  1507. })
  1508. return score + '分'
  1509. },
  1510. setWordHtml(data) {
  1511. let _data = data
  1512. let _title = `<div style="font-size:30px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
  1513. let score = this.score(data.courseJson)
  1514. let isScore = this.score2(data.courseJson)
  1515. let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
  1516. 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>`
  1517. let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
  1518. let _test = `<div style='margin-top:40px;'>`
  1519. for (let i = 0; i < _data.array.length; i++) {
  1520. let item = _data.array[i]
  1521. let _div = `<div style='margin-top:20px;font-weight:bold;'>${i + 1}、${item.json.title}</div>`
  1522. _test += _div
  1523. if (item.type == 1) {
  1524. for (let j = 0; j < item.json.array.length; j++) {
  1525. let check = item.json.array[j]
  1526. let _option = `<div style='margin:10px 0 0 40px;'>${(item.json.answer2 && item.json.answer2.indexOf(j) !== -1) ? '☑' : '☐'} ${check.option}</div>`
  1527. _test += _option
  1528. }
  1529. } else if (item.type == 3 && item.json.answer2) {
  1530. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1531. _test += _option
  1532. } else if (item.type == 5 && item.json.file) {
  1533. for (let j = 0; j < item.json.file.length; j++) {
  1534. let check = item.json.file[j]
  1535. let _option = `<div style='margin:10px 0 0 40px;'>${check.name} <a href='${check.url}'>${check.url}</a></div>`
  1536. _test += _option
  1537. }
  1538. } else if (item.type == 6 && item.json.answer2) {
  1539. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1540. _test += _option
  1541. } else if (item.type == 7 && item.json.answer2 ) {
  1542. let _score = this.getScore2(item.json)
  1543. let _option = `<div style='margin:10px 0 0 40px;'>打分:${_score}分</div>`
  1544. _test += _option
  1545. } else if (item.type == 8 && item.json.answer2) {
  1546. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1547. _test += _option
  1548. }
  1549. }
  1550. _test += `</div>`
  1551. let _html = _title + _content + _detail + _test;
  1552. this.exportToWord(_data.name + '-' + _data.time, _html);
  1553. },
  1554. setWordHtml2(data) {
  1555. let _data = data
  1556. _data.array = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(data.courseJson))))
  1557. let _title = `<div style="font-size:30px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
  1558. let score = this.score(JSON.parse(data.courseJson))
  1559. let isScore = this.score2(JSON.parse(data.courseJson))
  1560. let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
  1561. 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>`
  1562. let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
  1563. let _test = `<div style='margin-top:40px;'>`
  1564. for (let i = 0; i < _data.array.length; i++) {
  1565. let item = _data.array[i]
  1566. let _div = `<div style='margin-top:20px;font-weight:bold;'>${i + 1}、${item.json.title}</div>`
  1567. _test += _div
  1568. if (item.type == 1) {
  1569. for (let j = 0; j < item.json.array.length; j++) {
  1570. let check = item.json.array[j]
  1571. let _option = `<div style='margin:10px 0 0 40px;'>${(item.json.answer2 && item.json.answer2.indexOf(j) !== -1) ? '☑' : '☐'} ${check.option}</div>`
  1572. _test += _option
  1573. }
  1574. } else if (item.type == 3 && item.json.answer2) {
  1575. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1576. _test += _option
  1577. } else if (item.type == 5 && item.json.file) {
  1578. for (let j = 0; j < item.json.file.length; j++) {
  1579. let check = item.json.file[j]
  1580. let _option = `<div style='margin:10px 0 0 40px;'>${check.name} <a href='${check.url}'>${check.url}</a></div>`
  1581. _test += _option
  1582. }
  1583. } else if (item.type == 6 && item.json.answer2) {
  1584. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1585. _test += _option
  1586. } else if (item.type == 7 && item.json.answer2 ) {
  1587. let _score = this.getScore2(item.json)
  1588. let _option = `<div style='margin:10px 0 0 40px;'>打分:${_score}分</div>`
  1589. _test += _option
  1590. } else if (item.type == 8 && item.json.answer2) {
  1591. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1592. _test += _option
  1593. }
  1594. }
  1595. _test += `</div>`
  1596. let _html = _title + _content + _detail + _test;
  1597. this.exportToWord(_data.username ? _data.username : '匿名' + '-' + _data.time, _html);
  1598. },
  1599. async exportToWord(a, html) {
  1600. // 将html文件中需要用到的数据挂载到store上
  1601. const content = `<!DOCTYPE html>
  1602. <html lang="en">
  1603. <head>
  1604. <meta charset="UTF-8">
  1605. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  1606. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  1607. <title>${a}</title>
  1608. <style>
  1609. </style>
  1610. </head>
  1611. <body>
  1612. ${html}
  1613. </body>
  1614. </html>`;
  1615. // debugger
  1616. // 生成报告
  1617. const link = document.createElement("a");
  1618. let dname = a + ".doc";
  1619. // link.download = "报告.html"; // 文件名
  1620. link.download = dname; // 文件名
  1621. link.style.display = "none";
  1622. // 创建文件流
  1623. // 创建bolb实例时,内容一定要放在[]中
  1624. const blob = new Blob([content], {
  1625. type: "text/plain;charset='utf-8'",
  1626. });
  1627. link.href = window.URL.createObjectURL(blob);
  1628. document.body.appendChild(link);
  1629. link.click();
  1630. document.body.removeChild(link);
  1631. },
  1632. setWordHtmlAll(data) {
  1633. let _data = data
  1634. let _title = `<div style="font-size:30px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
  1635. let score = this.score(data.courseJson)
  1636. let isScore = this.score2(data.courseJson)
  1637. let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
  1638. 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>`
  1639. let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
  1640. let _test = `<div style='margin-top:40px;'>`
  1641. for (let i = 0; i < _data.array.length; i++) {
  1642. let item = _data.array[i]
  1643. let _div = `<div style='margin-top:20px;font-weight:bold;'>${i + 1}、${item.json.title}</div>`
  1644. _test += _div
  1645. if (item.type == 1) {
  1646. for (let j = 0; j < item.json.array.length; j++) {
  1647. let check = item.json.array[j]
  1648. let _option = `<div style='margin:10px 0 0 40px;'>${(item.json.answer2 && item.json.answer2.indexOf(j) !== -1) ? '☑' : '☐'} ${check.option}</div>`
  1649. _test += _option
  1650. }
  1651. } else if (item.type == 3 && item.json.answer2) {
  1652. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1653. _test += _option
  1654. } else if (item.type == 5 && item.json.file) {
  1655. for (let j = 0; j < item.json.file.length; j++) {
  1656. let check = item.json.file[j]
  1657. let _option = `<div style='margin:10px 0 0 40px;'>${check.name} <a href='${check.url}'>${check.url}</a></div>`
  1658. _test += _option
  1659. }
  1660. } else if (item.type == 6 && item.json.answer2) {
  1661. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${item.json.answer2}</div>`
  1662. _test += _option
  1663. } else if (item.type == 7 && item.json.answer2 ) {
  1664. let _score = this.getScore2(item.json)
  1665. let _option = `<div style='margin:10px 0 0 40px;'>打分:${_score}分</div>`
  1666. _test += _option
  1667. } else if (item.type == 8 && item.json.answer2) {
  1668. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1669. _test += _option
  1670. }
  1671. }
  1672. _test += `</div>`
  1673. let _html = _title + _content + _detail + _test;
  1674. return this.exportToWordAll(_data.name + '-' + _data.time, _html);
  1675. },
  1676. async setWordHtmlAll2(data) {
  1677. let _data = data
  1678. _data.array = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(data.courseJson))))
  1679. let _title = `<div style="font-size:30px;font-weight:bold;text-align:center;">${this.testJson.title}</div>`;
  1680. let score = this.score(JSON.parse(data.courseJson))
  1681. let isScore = this.score2(JSON.parse(data.courseJson))
  1682. let scoreContent = score ? `<b>(得分/总分)${isScore}/${score}</b>` : ''
  1683. 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>`
  1684. let _detail = this.testJson.brief ? `<div style="text-align:center;margin-top: 20px;">${this.testJson.brief}</div>` : ''
  1685. let _test = `<div style='margin-top:40px;'>`
  1686. for (let i = 0; i < _data.array.length; i++) {
  1687. let item = _data.array[i]
  1688. let _div = `<div style='margin-top:20px;font-weight:bold;'>${i + 1}、${item.json.title}</div>`
  1689. _test += _div
  1690. if (item.type == 1) {
  1691. for (let j = 0; j < item.json.array.length; j++) {
  1692. let check = item.json.array[j]
  1693. let _option = `<div style='margin:10px 0 0 40px;'>${(item.json.answer2 && item.json.answer2.indexOf(j) !== -1) ? '☑' : '☐'} ${check.option}</div>`
  1694. _test += _option
  1695. }
  1696. } else if (item.type == 3 && item.json.answer2) {
  1697. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1698. _test += _option
  1699. } else if (item.type == 5 && item.json.file) {
  1700. for (let j = 0; j < item.json.file.length; j++) {
  1701. let check = item.json.file[j]
  1702. let _option = `<div style='margin:10px 0 0 40px;'>${check.name} <a href='${check.url}'>${check.url}</a></div>`
  1703. _test += _option
  1704. }
  1705. } else if (item.type == 6 && item.json.answer2) {
  1706. let _cjson = await this.getCourse(item.json.answer2)
  1707. let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${ _cjson ? _cjson.title : ''}</div>`
  1708. _test += _option
  1709. } else if (item.type == 7 && item.json.answer2 ) {
  1710. let _score = this.getScore2(item.json)
  1711. let _option = `<div style='margin:10px 0 0 40px;'>打分:${_score}分</div>`
  1712. _test += _option
  1713. } else if (item.type == 8 && item.json.answer2) {
  1714. let _option = `<div style='margin:10px 0 0 40px;'>${item.json.answer2}</div>`
  1715. _test += _option
  1716. }
  1717. }
  1718. _test += `</div>`
  1719. let _html = _title + _content + _detail + _test;
  1720. return this.exportToWordAll(_data.username ? _data.username : '匿名' + '-' + _data.time, _html);
  1721. },
  1722. async exportToWordAll(a, html) {
  1723. // 将html文件中需要用到的数据挂载到store上
  1724. const content = `<!DOCTYPE html>
  1725. <html lang="en">
  1726. <head>
  1727. <meta charset="UTF-8">
  1728. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  1729. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  1730. <title>${a}</title>
  1731. <style>
  1732. </style>
  1733. </head>
  1734. <body>
  1735. ${html}
  1736. </body>
  1737. </html>`;
  1738. // debugger
  1739. // 生成报告
  1740. const link = document.createElement("a");
  1741. let dname = a + ".doc";
  1742. // link.download = "报告.html"; // 文件名
  1743. link.download = dname; // 文件名
  1744. link.style.display = "none";
  1745. // 创建文件流
  1746. // 创建bolb实例时,内容一定要放在[]中
  1747. const blob = new Blob([content], {
  1748. type: "text/plain;charset='utf-8'",
  1749. });
  1750. return blob;
  1751. },
  1752. exportAllWord() {
  1753. this.pdfLoading = true;
  1754. const _chapInfo = this.worksArray;
  1755. let url = [];
  1756. for (let i = 0; i < _chapInfo.length; i++) {
  1757. url.push({
  1758. name: _chapInfo[i].name + '-' + _chapInfo[i].time,
  1759. blob: this.setWordHtmlAll(_chapInfo[i]),
  1760. });
  1761. }
  1762. console.log(url);
  1763. this.downLoadAll(url);
  1764. },
  1765. exportAllWord2() {
  1766. this.pdfLoading = true;
  1767. let params = {
  1768. cid: this.cid,
  1769. page: 1,
  1770. pageSize: 999,
  1771. cn: this.courseName
  1772. };
  1773. this.ajax
  1774. .get(this.$store.state.api + "getTestWorksPage3", params)
  1775. .then((res) => {
  1776. const _chapInfo = res.data[0];
  1777. let url = [];
  1778. for (let i = 0; i < _chapInfo.length; i++) {
  1779. url.push({
  1780. name: _chapInfo[i].username + '-' + _chapInfo[i].time,
  1781. blob: this.setWordHtmlAll2(_chapInfo[i]),
  1782. });
  1783. }
  1784. console.log(url);
  1785. this.downLoadAll(url);
  1786. })
  1787. .catch((err) => {
  1788. console.error(err);
  1789. });
  1790. },
  1791. downLoadAll(url) {
  1792. const data = url; // 需要下载打包的路径, 可以是本地相对路径, 也可以是跨域的全路径
  1793. const zip = new JSZip();
  1794. const cache = {};
  1795. data.forEach((item) => {
  1796. // 下载文件, 并存成ArrayBuffer对象
  1797. const file_name = item.name; // 获取文件名
  1798. zip.file(file_name + '.doc', item.blob, { binary: true }); // 逐个添加文件
  1799. cache[file_name] = item.blob;
  1800. });
  1801. zip.generateAsync({ type: "blob" }).then((content) => {
  1802. // 生成二进制流
  1803. FileSaver.saveAs(content, this.testJson.title + ".zip"); // 利用file-saver保存文件 自定义文件名
  1804. setTimeout(() => {
  1805. this.pdfLoading = false;
  1806. }, 2000);
  1807. });
  1808. },
  1809. handleFilterChange() {
  1810. console.log(this.$refs.table.store.states.data);
  1811. },
  1812. exportExcel() {
  1813. let res = this.$refs.table.store.states.data
  1814. if (!res.length) {
  1815. this.$message.error('无导出数据')
  1816. return
  1817. }
  1818. this.isLoading = true;
  1819. let chapters = this.chapters
  1820. var array = [];
  1821. for (var i = 0; i < res.length; i++) {
  1822. var _json = {};
  1823. _json["序号"] = i + 1;
  1824. _json["提交人"] = res[i].name ? res[i].name : '匿名';
  1825. _json["提交时间"] = res[i].time;
  1826. for (var j = 0; j < chapters.length; j++) {
  1827. _json[j + 1 + "." + chapters[j].json.title] = '';
  1828. if (res[i].array[j].type == 1 && res[i].array[j].json.answer2) {
  1829. let a = []
  1830. for (var answer2 = 0; answer2 < res[i].array[j].json.answer2.length; answer2++) {
  1831. a.push(res[i].array[j].json.array[res[i].array[j].json.answer2[answer2]].option)
  1832. }
  1833. _json[j + 1 + "." + chapters[j].json.title] = a.join('、')
  1834. } else if (res[i].array[j].type == 3 && res[i].array[j].json.answer2) {
  1835. _json[j + 1 + "." + chapters[j].json.title] = res[i].array[j].json.answer2
  1836. } else if (res[i].array[j].type == 5 && res[i].array[j].json.file) {
  1837. let files = []
  1838. for (let file = 0; file < res[i].array[j].json.file.length; file++) {
  1839. let check = res[i].array[j].json.file[file]
  1840. files.push(file + 1 + '.' + check.name + '----' + check.url)
  1841. }
  1842. _json[j + 1 + "." + chapters[j].json.title] = files.join('\n')
  1843. } else if (res[i].array[j].type == 6 && res[i].array[j].json.answer2) {
  1844. _json[j + 1 + "." + chapters[j].json.title] = res[i].array[j].json.answer2
  1845. } else if (res[i].array[j].type == 7 && res[i].array[j].json.answer2) {
  1846. let _score = this.getScore2(res[i].array[j].json)
  1847. _json[j + 1 + "." + chapters[j].json.title] = _score
  1848. } else if (res[i].array[j].type == 8 && res[i].array[j].json.answer2) {
  1849. _json[j + 1 + "." + chapters[j].json.title] = res[i].array[j].json.answer2
  1850. }
  1851. }
  1852. array.push(_json);
  1853. }
  1854. let widthJson = []
  1855. let widthArray = Object.keys(array[0])
  1856. for (let i = 0; i < widthArray.length; i++) {
  1857. if (i == 0) {
  1858. widthJson.push({ wch: 5 })
  1859. } else {
  1860. widthJson.push({ wch: 30 })
  1861. }
  1862. }
  1863. const workbook = XLSX.utils.book_new(); //创建一个新的工作簿对象
  1864. let ws = XLSX.utils.json_to_sheet(array); //将json对象数组转化成工作表
  1865. ws["!cols"] = widthJson;
  1866. const styleObj = {
  1867. alignment: {
  1868. horizontal: "center",
  1869. vertical: "center" // 设置垂直居中
  1870. }
  1871. }; // 设置居中对齐和加粗样式
  1872. for (let cell in ws) {
  1873. if (!cell[0].startsWith("!")) {
  1874. ws[cell]["s"] = styleObj;
  1875. }
  1876. }
  1877. XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
  1878. XLSX.writeFile(workbook, this.testJson.title + ".xlsx");
  1879. this.isLoading = false;
  1880. this.$message({
  1881. message: "导出成功",
  1882. type: "success"
  1883. });
  1884. },
  1885. async getCourse(id) {
  1886. let params = {
  1887. cid: id,
  1888. };
  1889. let res = await this.ajax.get(this.$store.state.api + "getCourseInfoTest", params)
  1890. return res.data[0][0]
  1891. },
  1892. getScore2(item) {
  1893. let array = []
  1894. for (var i = parseInt(item.small); i <= parseInt(item.big); i++) {
  1895. array.push(i)
  1896. }
  1897. return item.answer2 ? array[item.answer2] : ''
  1898. },
  1899. checkScreenSize() {
  1900. this.screenWidth = window.innerWidth;
  1901. this.isDesktop = this.screenWidth > 750; // 你可以根据需要调整这个阈值
  1902. },
  1903. downloadFileType5(fileData,title="附件"){
  1904. let data = fileData;
  1905. const zip = new JSZip();
  1906. let downFileArray = [];
  1907. let uniqueArr = data.filter((v,i,a)=>a.map(mb=>mb.userid).indexOf(v.userid)==i);
  1908. uniqueArr.forEach(i=>{
  1909. downFileArray.push({userid:i.userid,username:i.username ? i.username : '匿名',urlList:data.filter(d=>d.userid==i.userid).map(m=>m)});
  1910. })
  1911. let promises = [];
  1912. if(downFileArray.length==1){//只有一位老师的情况
  1913. if(downFileArray[0].urlList.length>1){//多个文件的情况
  1914. const folder = zip.folder(`${downFileArray[0].username}`);
  1915. downFileArray[0].urlList.forEach(i=>{
  1916. const promise = getFile(i.url).then((data) => {
  1917. if (data.data != 1) {
  1918. // 下载文件, 并存成ArrayBuffer对象
  1919. const file_name = i.name; // 获取文件名
  1920. folder.file(file_name, data.data, { binary: true }); // 逐个添加文件
  1921. }
  1922. });
  1923. promises.push(promise)
  1924. })
  1925. }else{//只有一个文件的情况
  1926. promises.push(getFile(downFileArray[0].urlList[0].url).then((data) => {
  1927. if (data.data != 1) {
  1928. // 下载文件, 并存成ArrayBuffer对象
  1929. const file_name = `${downFileArray[0].username}-${downFileArray[0].urlList[0].name}`; // 获取文件名
  1930. zip.file(file_name, data.data, { binary: true }); // 逐个添加文件
  1931. }
  1932. }))
  1933. }
  1934. }else if(downFileArray.length>1){//有多位老师的情况
  1935. downFileArray.forEach(i=>{
  1936. if(i.urlList.length==1){//只有一个文件的情况
  1937. promises.push(getFile(i.urlList[0].url).then((data) => {
  1938. if (data.data != 1) {
  1939. // 下载文件, 并存成ArrayBuffer对象
  1940. const file_name = `${i.username ? i.username : '匿名'}-${i.urlList[0].name}`; // 获取文件名
  1941. zip.file(file_name, data.data, { binary: true }); // 逐个添加文件
  1942. }
  1943. }))
  1944. }else if(i.urlList.length>1){//有多个文件的
  1945. const folder = zip.folder(`${i.username ? i.username : '匿名'}`);
  1946. i.urlList.forEach(ui=>{
  1947. const promise = getFile(ui.url).then((data) => {
  1948. if (data.data != 1) {
  1949. // 下载文件, 并存成ArrayBuffer对象
  1950. const file_name = ui.name; // 获取文件名
  1951. folder.file(file_name, data.data, { binary: true }); // 逐个添加文件
  1952. }
  1953. })
  1954. promises.push(promise)
  1955. })
  1956. }
  1957. })
  1958. }
  1959. Promise.all(promises).then(() => {
  1960. zip.generateAsync({ type: "blob" }).then((content) => {
  1961. // 生成二进制流
  1962. FileSaver.saveAs(content, `${this.testJson.title}-${title}.zip`); // 利用file-saver保存文件 自定义文件名
  1963. });
  1964. });
  1965. },
  1966. getUserInfo() {
  1967. let params = {
  1968. uid: this.peopleId,
  1969. };
  1970. this.ajax
  1971. .get(this.$store.state.api + "selectTestUser", params)
  1972. .then((res) => {
  1973. console.log('111111111111111111111',res.data[0][0]);
  1974. // 用于存储归类后的数据的对象
  1975. this.checkDataType(2)
  1976. this.courseName = res.data[0][0].name
  1977. this.searchCourse()
  1978. })
  1979. .catch((err) => {
  1980. console.error(err);
  1981. });
  1982. },
  1983. },
  1984. beforeDestroy() {
  1985. document.getElementsByTagName('html')[0].style.overflow = '';
  1986. window.removeEventListener("resize", this.checkScreenSize);
  1987. },
  1988. mounted() {
  1989. if(this.peopleId){
  1990. this.getUserInfo();
  1991. }
  1992. this.checkScreenSize();
  1993. window.addEventListener("resize", this.checkScreenSize);
  1994. document.getElementsByTagName('html')[0].scrollTop = 0
  1995. document.getElementsByTagName('html')[0].style.overflow = 'hidden'
  1996. this.$nextTick(function () {
  1997. this.getData();
  1998. // this.getClass2()
  1999. this.changeHeight()
  2000. });
  2001. },
  2002. };
  2003. </script>
  2004. <style scoped>
  2005. .pb_content {
  2006. height: 100% !important;
  2007. /* margin: 0 20px 0 20px; */
  2008. }
  2009. .cutBtnBlockCss{
  2010. width: 100%;display: flex;justify-content: end;
  2011. }
  2012. .cutBtnCss{
  2013. width: 68px;
  2014. height: 27px;
  2015. font-size: 14px;
  2016. border-radius: 5px;
  2017. display: flex;
  2018. color: rgba(54, 129, 252, 1);
  2019. justify-content: center;
  2020. align-items: center;
  2021. margin-top: 10px;
  2022. border: 1px rgba(54, 129, 252, 1) solid;
  2023. }
  2024. .isDesktopRight{
  2025. width:100% !important;
  2026. margin:0 !important;
  2027. height: 300px !important;
  2028. border: none !important;
  2029. }
  2030. .isDTitle2JsonTit{
  2031. width: 130px;
  2032. color: rgba(0, 0, 0, 0.9);
  2033. overflow: hidden;
  2034. white-space: nowrap;
  2035. text-overflow: ellipsis;
  2036. }
  2037. .IsDAnswer{
  2038. margin: 20px 0 30px;color: rgba(0, 0, 0, 0.6);
  2039. }
  2040. .CutCss{
  2041. height: 60px;
  2042. line-height: 60px;
  2043. }
  2044. .topicTitCss{
  2045. color: rgba(0, 0, 0, 0.9);
  2046. font-weight: 600;
  2047. margin-right: 5px;
  2048. }
  2049. .IsDFile{
  2050. width: 150px;
  2051. height: 120px;
  2052. border-radius: 10px;
  2053. position: relative;
  2054. display: flex;
  2055. flex-direction: column;
  2056. overflow: hidden;
  2057. margin-bottom: 5px;
  2058. }
  2059. .IsDownload{
  2060. position: absolute;
  2061. width: 30px;
  2062. top: 5px;
  2063. right: 5px;
  2064. }
  2065. .IsDImg{
  2066. width: 100%;
  2067. height: 70px;
  2068. flex: 1;
  2069. }
  2070. .pb_content_body {
  2071. width: 100% !important;
  2072. height: 100%;
  2073. }
  2074. .pb_content_body>.right {
  2075. height: 100%;
  2076. width: 100%;
  2077. display: flex;
  2078. overflow: hidden;
  2079. flex-direction: column;
  2080. }
  2081. .basic_box {
  2082. margin: 0 auto;
  2083. position: relative;
  2084. padding: 0 20px 0 20px;
  2085. }
  2086. .courseTop {
  2087. display: flex;
  2088. flex-direction: row;
  2089. justify-content: space-between;
  2090. align-items: center;
  2091. width: calc(100% - 40px);
  2092. margin: 0 auto;
  2093. padding: 10px 0;
  2094. }
  2095. .stepsNav {
  2096. display: flex;
  2097. flex-direction: row;
  2098. justify-content: flex-start;
  2099. align-items: center;
  2100. }
  2101. .step_box {
  2102. width: calc(100% - 40px);
  2103. margin: 0 auto;
  2104. height: calc(100% - 50px);
  2105. overflow: auto;
  2106. background: #ffff;
  2107. border-radius: 5px;
  2108. }
  2109. .el-table>>>.even_row {
  2110. background-color: #f1f1f1 !important;
  2111. }
  2112. .student_page {
  2113. margin-top: 10px;
  2114. }
  2115. .test_title {
  2116. display: flex;
  2117. padding: 15px 15px;
  2118. width: 100%;
  2119. box-sizing: border-box;
  2120. justify-content: space-between;
  2121. align-items: center;
  2122. flex-wrap: wrap;
  2123. margin-bottom: 10px;
  2124. }
  2125. .test_title .left {
  2126. max-width: 100%;
  2127. margin-top: 10px
  2128. }
  2129. .test_title .left .title {
  2130. width: 100%;
  2131. font-size: 24px;
  2132. font-weight: 700;
  2133. overflow: hidden;
  2134. text-overflow: ellipsis;
  2135. white-space: nowrap;
  2136. }
  2137. .test_title .left .info {
  2138. display: flex;
  2139. margin-top: 15px;
  2140. }
  2141. .test_title .left .info .info_box {
  2142. font-size: 14px;
  2143. }
  2144. .test_title .left .info .info_box+.info_box {
  2145. margin-left: 20px;
  2146. padding-left: 20px;
  2147. border-left: 1px solid #E7E7E7;
  2148. }
  2149. .test_title .left .info .info_box span:nth-child(1) {
  2150. color: #00000099;
  2151. }
  2152. .test_title .left .info .info_box span:nth-child(2) {}
  2153. .test_title .right {
  2154. display: flex;
  2155. align-items: center;
  2156. margin-top: 10px;
  2157. max-width: 100%;
  2158. }
  2159. .test_title .right .data_box {
  2160. margin-right: 15px;
  2161. width: 150px;
  2162. border: 1px solid #e7e7e7;
  2163. border-radius: 5px;
  2164. padding: 0 10px;
  2165. height: 57px;
  2166. font-size: 14px;
  2167. color: #00000099;
  2168. display: flex;
  2169. justify-content: space-between;
  2170. align-items: center;
  2171. }
  2172. .test_title .right .data_box span:nth-child(1) {}
  2173. .test_title .right .data_box span:nth-child(2) {}
  2174. .test_title .right .data_box span:nth-child(2) .big {
  2175. font-size: 22px;
  2176. }
  2177. .test_title .right .btn_box {
  2178. display: flex;
  2179. flex-direction: column;
  2180. width: 57px;
  2181. height: 57px;
  2182. background: #3681fc;
  2183. border-radius: 5px;
  2184. font-size: 14px;
  2185. cursor: pointer;
  2186. align-items: center;
  2187. justify-content: center;
  2188. color: #fff;
  2189. }
  2190. .test_title .right .btn_box span:nth-child(1) {
  2191. display: block;
  2192. width: 12px;
  2193. height: 14px;
  2194. margin-bottom: 5px;
  2195. background-image: url('../../../../assets/icon/test/icon_share.png');
  2196. background-size: 100% 100%;
  2197. }
  2198. .test_title .right .btn_box span:nth-child(2) {}
  2199. .search_nav {
  2200. border-bottom: 1px solid #E7E7E7;
  2201. width: 100%;
  2202. box-sizing: border-box;
  2203. padding: 0 15px 10px;
  2204. display: flex;
  2205. align-items: flex-end;
  2206. height: 50px;
  2207. }
  2208. .search_nav>.right {
  2209. display: flex;
  2210. align-items: center;
  2211. }
  2212. .search_nav>.right>span {
  2213. height: 24px;
  2214. font-size: 14px;
  2215. color: #000;
  2216. cursor: pointer;
  2217. position: relative;
  2218. }
  2219. .search_nav>.isDesktopRightCut{
  2220. display: flex;
  2221. justify-content: space-between;
  2222. width: 60%;
  2223. }
  2224. .search_nav>.right>span+span {
  2225. margin-left: 35px;
  2226. }
  2227. .search_nav>.right>span.active {
  2228. color: #3681FC;
  2229. font-weight: 600;
  2230. }
  2231. .search_nav>.right>span.active::before {
  2232. content: "";
  2233. position: absolute;
  2234. bottom: -10px;
  2235. width: 15px;
  2236. height: 3px;
  2237. background: #3681fc;
  2238. left: 50%;
  2239. transform: translateX(-50%);
  2240. }
  2241. .search_nav>.left {
  2242. display: flex;
  2243. align-items: center;
  2244. margin-left: auto;
  2245. }
  2246. .search_nav>.right>span.active2 {
  2247. color: #3681FC;
  2248. font-weight: 600;
  2249. }
  2250. .search_nav>.right>span.active2::before {
  2251. content: "";
  2252. position: absolute;
  2253. bottom: -10px;
  2254. width: 100%;
  2255. height: 3px;
  2256. background: #3681fc;
  2257. left: 50%;
  2258. transform: translateX(-50%);
  2259. }
  2260. .student_input>>>.el-input__inner {
  2261. height: 40px;
  2262. width: 190px;
  2263. font-size: 13px;
  2264. padding: 0 35px 0 10px;
  2265. }
  2266. .serach_icon {
  2267. position: absolute;
  2268. right: 12px;
  2269. top: 50%;
  2270. transform: translateY(-50%);
  2271. width: 13px;
  2272. height: 13px;
  2273. background: url("../../../../assets/icon/test/test_search.png") no-repeat;
  2274. background-size: 100% 100%;
  2275. cursor: pointer;
  2276. }
  2277. .title_content {
  2278. padding-bottom: 10px;
  2279. }
  2280. .title_content>.title_box {
  2281. width: calc(100% - 48px);
  2282. margin: 20px auto 0;
  2283. }
  2284. .title_content>.title_box>.title {
  2285. font-size: 18px;
  2286. display: flex;
  2287. white-space: pre-line;
  2288. position: relative;
  2289. }
  2290. .title_content>.title_box>.title>.test_icon {
  2291. min-width: 20px;
  2292. height: 20px;
  2293. }
  2294. .title_content>.title_box>.detail {
  2295. font-size: 14px;
  2296. color: #00000099;
  2297. margin-top: 8px;
  2298. white-space: pre-line;
  2299. }
  2300. .title_content>.title_box>.content1 {
  2301. display: flex;
  2302. width: 100%;
  2303. margin-top: 10px;
  2304. }
  2305. .title_content>.title_box>.content1>>>.el-progress__text {
  2306. color: #3681FC;
  2307. min-width: 55px;
  2308. font-size: 16px !important;
  2309. }
  2310. .title_content>.title_box>.content1>.left {
  2311. width: calc(100% - 620px);
  2312. border: 1px solid #e7e7e7;
  2313. }
  2314. .title_content>.title_box>.content1>.left>div+div {
  2315. border-top: 1px solid #e7e7e7;
  2316. }
  2317. .title_content>.title_box>.content1>.left>.title,
  2318. .title_content>.title_box>.content1>.left>.data {
  2319. display: flex;
  2320. height: 40px;
  2321. align-items: center;
  2322. width: 100%;
  2323. padding: 0 15px;
  2324. box-sizing: border-box;
  2325. line-height: 16px;
  2326. }
  2327. .title_content>.title_box>.content1>.left>.title>span,
  2328. .title_content>.title_box>.content1>.left>.data>span {
  2329. overflow: hidden;
  2330. text-overflow: ellipsis;
  2331. white-space: nowrap;
  2332. }
  2333. .title_content>.title_box>.content1>.left>.title>span:nth-child(1),
  2334. .title_content>.title_box>.content1>.left>.data>span:nth-child(1) {
  2335. width: calc(100% - 320px - 110px);
  2336. }
  2337. .title_content>.title_box>.content1>.left>.title>span:nth-child(2),
  2338. .title_content>.title_box>.content1>.left>.data>span:nth-child(2) {
  2339. width: 110px;
  2340. }
  2341. .title_content>.title_box>.content1>.left>.title>span:nth-child(3),
  2342. .title_content>.title_box>.content1>.left>.data>span:nth-child(3) {
  2343. width: 320px;
  2344. }
  2345. .isDesktopTitle{
  2346. display: flex;
  2347. justify-content: space-around;
  2348. }
  2349. .isDesktopTitle >div {
  2350. width: 60px;
  2351. height: 30px;
  2352. line-height: 30px;
  2353. overflow: hidden;
  2354. white-space: nowrap;
  2355. text-overflow: ellipsis;
  2356. }
  2357. /* .isDesktopTitle:nth-child(1){
  2358. width: 60px;
  2359. }
  2360. .isDesktopTitle:nth-child(2){
  2361. width: 60px;
  2362. }
  2363. .isDesktopTitle:nth-child(3){
  2364. flex: 1;
  2365. } */
  2366. .title_content>.title_box>.content1>.left>.title {
  2367. font-weight: 700;
  2368. background: #F9FAFB;
  2369. }
  2370. .title_content>.title_box>.content1>.right {
  2371. width: 600px;
  2372. margin-left: 20px;
  2373. border: 1px solid #e7e7e7;
  2374. min-height: 300px;
  2375. }
  2376. .title_content>.title_box>.content2 {
  2377. display: flex;
  2378. width: 100%;
  2379. margin-top: 10px;
  2380. }
  2381. .title_content>.title_box>.content2>.left {
  2382. width: calc(100% - 620px);
  2383. border: 1px solid #e7e7e7;
  2384. }
  2385. .title_content>.title_box>.content2>.left>div+div {
  2386. border-top: 1px solid #e7e7e7;
  2387. }
  2388. .title_content>.title_box>.content2>.left>.title,
  2389. .title_content>.title_box>.content2>.left>.data {
  2390. display: flex;
  2391. height: 40px;
  2392. align-items: center;
  2393. width: 100%;
  2394. padding: 0 15px;
  2395. box-sizing: border-box;
  2396. line-height: 16px;
  2397. }
  2398. .title_content>.title_box>.content2>.left>.title>span,
  2399. .title_content>.title_box>.content2>.left>.data>span {
  2400. overflow: hidden;
  2401. text-overflow: ellipsis;
  2402. white-space: nowrap;
  2403. }
  2404. .title_content>.title_box>.content2>.left>.title>span:nth-child(1),
  2405. .title_content>.title_box>.content2>.left>.data>span:nth-child(1) {
  2406. width: 55px;
  2407. }
  2408. .title_content>.title_box>.content2>.left>.title>span:nth-child(2),
  2409. .title_content>.title_box>.content2>.left>.data>span:nth-child(2) {
  2410. width: 110px;
  2411. }
  2412. .title_content>.title_box>.content2>.left>.title>span:nth-child(3),
  2413. .title_content>.title_box>.content2>.left>.data>span:nth-child(3) {
  2414. max-width: calc(100% - 110px - 55px);
  2415. }
  2416. .title_content>.title_box>.content2>.left>.title {
  2417. font-weight: 700;
  2418. background: #F9FAFB;
  2419. }
  2420. .title_content>.title_box>.content2>.right {
  2421. width: 600px;
  2422. margin-left: 20px;
  2423. border: 1px solid #e7e7e7;
  2424. }
  2425. .title_content>.title_box>.content2>.right>>>.wordCloud {
  2426. height: auto;
  2427. min-height: 300px;
  2428. }
  2429. .title_content>.title_box>.content3 {
  2430. display: flex;
  2431. width: 100%;
  2432. overflow: auto;
  2433. }
  2434. .title_content>.title_box>.content3>.file {
  2435. min-width: 200px;
  2436. width: 200px;
  2437. height: 140px;
  2438. margin: 10px 10px 10px 0px;
  2439. border-radius: 15px;
  2440. box-shadow: rgb(223, 218, 218) 0px 0px 6px 1px;
  2441. overflow: hidden;
  2442. margin-right: 15px;
  2443. position: relative;
  2444. display: flex;
  2445. flex-direction: column;
  2446. }
  2447. .title_content>.title_box>.content3>.file>.img {
  2448. width: 100%;
  2449. height: calc(100% - 35px);
  2450. object-fit: cover;
  2451. cursor: pointer;
  2452. }
  2453. .title_content>.title_box>.content3>.file>.del {
  2454. position: absolute;
  2455. width: 25px;
  2456. top: 10px;
  2457. right: 10px;
  2458. cursor: pointer;
  2459. }
  2460. .title_content>.title_box>.content3>.file>.download {
  2461. position: absolute;
  2462. width: 25px;
  2463. top: 10px;
  2464. right: 35px;
  2465. cursor: pointer;
  2466. opacity: .8;
  2467. }
  2468. .title_content>.title_box>.content3>.file>.name {
  2469. height: 35px;
  2470. width: 100%;
  2471. background: #f9f9f9;
  2472. display: flex;
  2473. align-items: center;
  2474. padding: 0 10px;
  2475. box-sizing: border-box;
  2476. }
  2477. .title_content>.title_box>.content3>.file>.name>span {
  2478. display: block;
  2479. text-overflow: ellipsis;
  2480. max-width: 100%;
  2481. white-space: nowrap;
  2482. overflow: hidden;
  2483. }
  2484. .table_content {
  2485. /* width: calc(100% - 48px);
  2486. margin: 20px auto 0; */
  2487. padding: 20px 24px;
  2488. width: 100%;
  2489. box-sizing: border-box;
  2490. }
  2491. .table_content>>>.el-table td {
  2492. padding: 5px 0;
  2493. }
  2494. .isDesktopTable_content{
  2495. width: 100%;
  2496. }
  2497. .isDTitle{
  2498. display: flex;
  2499. justify-content: space-between;
  2500. }
  2501. .isDBri{
  2502. display: flex;
  2503. padding: 15px 0;
  2504. font-size: 14px;
  2505. color: rgba(0, 0, 0, 0.4);
  2506. flex-direction: column;
  2507. height: 80px;
  2508. justify-content: space-between;
  2509. }
  2510. .answer_type {
  2511. background: #F0F2F5;
  2512. padding: 5px 10px;
  2513. display: block;
  2514. border-radius: 3px;
  2515. margin: 5px;
  2516. }
  2517. .table_file>.file {
  2518. min-width: 100px;
  2519. width: 100px;
  2520. height: 70px;
  2521. margin: 10px 10px 10px 0px;
  2522. border-radius: 5px;
  2523. box-shadow: rgb(223, 218, 218) 0px 0px 6px 1px;
  2524. overflow: hidden;
  2525. margin-right: 15px;
  2526. position: relative;
  2527. display: flex;
  2528. flex-direction: column;
  2529. }
  2530. .table_file>.file>.img {
  2531. width: 100%;
  2532. height: calc(100% - 20px);
  2533. object-fit: cover;
  2534. cursor: pointer;
  2535. }
  2536. .table_file>.file>.del {
  2537. position: absolute;
  2538. width: 25px;
  2539. top: 10px;
  2540. right: 10px;
  2541. cursor: pointer;
  2542. }
  2543. .table_file>.file>.download {
  2544. position: absolute;
  2545. width: 25px;
  2546. top: 10px;
  2547. right: 35px;
  2548. cursor: pointer;
  2549. opacity: .8;
  2550. }
  2551. .table_file>.file>.name {
  2552. height: 20px;
  2553. width: 100%;
  2554. background: #f9f9f9;
  2555. display: flex;
  2556. align-items: center;
  2557. padding: 0 10px;
  2558. box-sizing: border-box;
  2559. font-size: 12px;
  2560. }
  2561. .table_file>.file>.name>span {
  2562. display: block;
  2563. text-overflow: ellipsis;
  2564. max-width: 100%;
  2565. white-space: nowrap;
  2566. overflow: hidden;
  2567. }
  2568. .btnA {
  2569. color: #fff;
  2570. background-color: #0061FF;
  2571. padding: 0 24px;
  2572. font-size: 14px;
  2573. min-width: 64px;
  2574. font-weight: 500;
  2575. border-radius: 4px;
  2576. box-sizing: border-box;
  2577. border: none;
  2578. cursor: pointer;
  2579. transition: all 0.2s ease-in-out;
  2580. height: 36px;
  2581. display: flex;
  2582. align-items: center;
  2583. justify-content: center;
  2584. line-height: 1;
  2585. margin-right: 10px;
  2586. position: relative;
  2587. }
  2588. .buttonBox {
  2589. position: absolute;
  2590. bottom: -0;
  2591. transform: translateY(100%);
  2592. background: #fff;
  2593. border-radius: 5px;
  2594. box-shadow: 0 0 3px 1px #e3e3e3;
  2595. width: 100%;
  2596. z-index: 999;
  2597. }
  2598. .buttonBox>div {
  2599. height: 40px;
  2600. line-height: 40px;
  2601. width: 100%;
  2602. text-align: center;
  2603. color: #000;
  2604. box-sizing: border-box;
  2605. }
  2606. .buttonBox>div+div {
  2607. border-top: 1px solid #e0e0e0;
  2608. }
  2609. .buttonBox>div:hover {
  2610. background: #f6f8ff;
  2611. }
  2612. .content4 {
  2613. width: 100%;
  2614. height: auto;
  2615. display: flex;
  2616. flex-wrap: nowrap;
  2617. overflow: auto;
  2618. }
  2619. .out_box {
  2620. display: flex;
  2621. flex-direction: column;
  2622. flex-wrap: nowrap;
  2623. /* width: 200px; */
  2624. min-width: 280px;
  2625. width: 280px;
  2626. background: #fff;
  2627. /* background-color: white; */
  2628. margin-right: 15px;
  2629. /* border: 1px solid #ccc; */
  2630. height: fit-content;
  2631. box-sizing: border-box;
  2632. border-radius: 0px 0px 5px 5px;
  2633. /* overflow: hidden; */
  2634. margin-bottom: 15px;
  2635. position: relative;
  2636. border-radius: 8px;
  2637. box-sizing: border-box;
  2638. overflow: hidden;
  2639. border: 1px solid #3682fc00;
  2640. cursor: pointer;
  2641. border: 1px solid #6a9ff5;
  2642. height: auto;
  2643. }
  2644. .out_boxActive {
  2645. box-sizing: border-box;
  2646. border: 3px solid #3681FC !important;
  2647. }
  2648. .out_box:hover {
  2649. border: 1px solid #3681FC;
  2650. }
  2651. .bottom_box {
  2652. width: 100%;
  2653. display: flex;
  2654. padding: 10px;
  2655. flex-direction: column;
  2656. box-sizing: border-box;
  2657. height: 121px;
  2658. flex-wrap: nowrap;
  2659. justify-content: space-evenly;
  2660. }
  2661. .bottom_box>div:nth-child(1) {
  2662. width: 100%;
  2663. /* overflow: hidden;
  2664. text-overflow: ellipsis;
  2665. white-space: nowrap;
  2666. font-weight: bold; */
  2667. display: flex;
  2668. align-items: center;
  2669. justify-content: space-between;
  2670. }
  2671. .bottom_box>div:nth-child(1)>span:nth-child(1) {
  2672. max-width: 100%;
  2673. overflow: hidden;
  2674. text-overflow: ellipsis;
  2675. white-space: nowrap;
  2676. font-weight: bold;
  2677. }
  2678. .bottom_box>div:nth-child(1)>span:nth-child(2) {
  2679. min-width: fit-content;
  2680. font-size: 14px;
  2681. color: #8c8c8c;
  2682. }
  2683. .tup {
  2684. width: 100%;
  2685. height: auto;
  2686. margin: 0 auto;
  2687. overflow: hidden;
  2688. display: flex;
  2689. flex-direction: column;
  2690. align-items: center;
  2691. padding: 10px;
  2692. box-sizing: border-box;
  2693. }
  2694. .tup>img {
  2695. width: 100%;
  2696. height: 100%;
  2697. object-fit: cover;
  2698. }
  2699. .kc_time {
  2700. margin-top: 8px;
  2701. font-size: 14px;
  2702. color: #717C8D;
  2703. }
  2704. .kc_time+.kc_time {
  2705. margin-top: 0;
  2706. }
  2707. .kc_t {
  2708. margin-top: 5px;
  2709. width: 100%;
  2710. white-space: nowrap;
  2711. overflow: hidden;
  2712. text-overflow: ellipsis;
  2713. display: flex;
  2714. align-items: center;
  2715. justify-content: space-between;
  2716. }
  2717. .kc_t>span:nth-child(1) {
  2718. max-width: 100%;
  2719. overflow: hidden;
  2720. text-overflow: ellipsis;
  2721. white-space: nowrap;
  2722. }
  2723. .kc_t>span:nth-child(2) {
  2724. min-width: fit-content;
  2725. font-size: 14px;
  2726. color: #8c8c8c;
  2727. }
  2728. .title_box>.title>.title_downBtn{
  2729. position: absolute;
  2730. right: 10px;
  2731. top: 0;
  2732. }
  2733. </style>