index.vue 110 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227
  1. <template>
  2. <div class="course-exam">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="section__header">
  7. <!-- <el-breadcrumb separator="/">
  8. <el-breadcrumb-item
  9. v-for="(item, index) in $route.matched"
  10. :key="index"
  11. :to="{ path: item.path }"
  12. >{{ item.name }}</el-breadcrumb-item
  13. >
  14. </el-breadcrumb> -->
  15. </div>
  16. <div class="section__body">
  17. <div class="explain-record">
  18. <div class="explain-record__body clearfix">
  19. <div class="left-box">
  20. <div class="left-box__header">
  21. <el-progress
  22. class="progress"
  23. :text-inside="true"
  24. :stroke-width="26"
  25. :percentage="
  26. toFixed(
  27. (questionOverNum(true) / questionList.length) * 100
  28. ) || 0
  29. "
  30. ></el-progress>
  31. <div class="text">
  32. 已完成<span>{{ questionOverNum(true) }}</span
  33. >/{{ questionList.length }}道题
  34. </div>
  35. </div>
  36. <div class="left-box__footer">
  37. <div class="btn" @click="prevQuestion">上一题</div>
  38. <div class="btn" @click="nextQuestion">下一题</div>
  39. </div>
  40. <div class="left-box__body">
  41. <template v-for="(question, questionIndex) in questionList">
  42. <div
  43. class="question"
  44. v-if="question.type == 1 && current == questionIndex"
  45. :key="questionIndex"
  46. >
  47. <div class="question__title">
  48. {{ questionIndex + 1 }}、单选题
  49. </div>
  50. <div
  51. class="question__desc"
  52. v-html="question.content"
  53. ></div>
  54. <div class="question__content">
  55. <div class="question-list" v-if="!question.ques">
  56. <div
  57. class="radio"
  58. v-for="(item, index) in question.jsonStr"
  59. :key="index"
  60. @click="
  61. radioSelect(
  62. question,
  63. questionIndex,
  64. item.optionsId
  65. )
  66. "
  67. >
  68. <div>
  69. {{ ast[index] }}. {{ item.content }}
  70. <div v-if="item.imgUrl">
  71. <img
  72. style="max-width: 100%"
  73. :src="$tools.splitImgHost(item.imgUrl)"
  74. alt=""
  75. />
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="question-list" v-if="question.ques">
  81. <div
  82. class="radio"
  83. :class="{
  84. right:
  85. bankType == 1 &&
  86. (item.optionsId == question.ques ||
  87. item.optionsId == question.ans),
  88. wrong:
  89. bankType == 1 &&
  90. item.optionsId == question.ques &&
  91. question.ques != question.ans,
  92. user_choose:
  93. bankType == 2 &&
  94. item.optionsId == question.ques,
  95. }"
  96. v-for="(item, index) in question.jsonStr"
  97. :key="index"
  98. @click="
  99. radioSelect(
  100. question,
  101. questionIndex,
  102. item.optionsId
  103. )
  104. "
  105. >
  106. <div>
  107. {{ ast[index] }}. {{ item.content }}
  108. <div v-if="item.imgUrl">
  109. <img
  110. :src="$tools.splitImgHost(item.imgUrl)"
  111. alt=""
  112. />
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div
  118. class="answer-list"
  119. v-if="bankType == 1 && question.ques"
  120. >
  121. <div class="answer-list__left">
  122. 正确答案:{{ ast[question.ans - 1] }}
  123. </div>
  124. <div class="answer-list__left">
  125. 我的答案:{{ ast[question.ques - 1] }}
  126. </div>
  127. </div>
  128. <div
  129. class="explain-list"
  130. v-if="bankType == 1 && question.ques"
  131. >
  132. <div class="explain-list__header">答案解析:</div>
  133. <div
  134. class="explain-list__body"
  135. v-html="question.analysisContent"
  136. ></div>
  137. </div>
  138. </div>
  139. <div class="question__btns"></div>
  140. </div>
  141. <div
  142. class="question"
  143. v-if="question.type == 2 && current == questionIndex"
  144. :key="questionIndex"
  145. >
  146. <div class="question__title">
  147. {{ questionIndex + 1 }}、多选题
  148. </div>
  149. <div
  150. class="question__desc"
  151. v-html="question.content"
  152. ></div>
  153. <div class="question__content">
  154. <div class="question-list" v-if="!question.ques">
  155. <el-checkbox
  156. class="checkbox"
  157. v-for="(item, index) in question.jsonStr"
  158. :key="index"
  159. :label="item.optionsId"
  160. v-model="item.checked"
  161. >
  162. <div>
  163. {{ ast[index] }}. {{ item.content }}
  164. <div v-if="item.imgUrl">
  165. <img
  166. :src="$tools.splitImgHost(item.imgUrl)"
  167. alt=""
  168. />
  169. </div>
  170. </div>
  171. </el-checkbox>
  172. </div>
  173. <div class="question-list" v-if="question.ques">
  174. <el-checkbox
  175. :disabled="bankType == 2 ? false : true"
  176. class="checkbox"
  177. :class="{
  178. right:
  179. bankType == 1 &&
  180. (question.ques.indexOf(item.optionsId) != -1 ||
  181. question.ans.indexOf(item.optionsId) != -1),
  182. wrong:
  183. bankType == 1 &&
  184. question.ques.indexOf(item.optionsId) != -1 &&
  185. question.ans.indexOf(item.optionsId) == -1,
  186. user_choose:
  187. bankType == 2 &&
  188. question.ques.indexOf(item.optionsId) != -1,
  189. }"
  190. v-for="(item, index) in question.jsonStr"
  191. :key="index"
  192. :label="item.optionsId"
  193. v-model="item.checked"
  194. >
  195. <div>
  196. {{ ast[index] }}. {{ item.content }}
  197. <div v-if="item.imgUrl">
  198. <img
  199. :src="$tools.splitImgHost(item.imgUrl)"
  200. alt=""
  201. />
  202. </div>
  203. </div>
  204. </el-checkbox>
  205. </div>
  206. <div
  207. class="answer-list"
  208. v-if="bankType == 1 && question.ques"
  209. >
  210. <div class="answer-list__left">
  211. 正确答案:
  212. <template v-for="ansItem in question.ans">{{
  213. ast[ansItem - 1]
  214. }}</template>
  215. </div>
  216. <div class="answer-list__left">
  217. 我的答案:
  218. <template v-for="quesItem in question.ques">{{
  219. ast[quesItem - 1]
  220. }}</template>
  221. </div>
  222. </div>
  223. <div
  224. class="explain-list"
  225. v-if="bankType == 1 && question.ques"
  226. >
  227. <div class="explain-list__header">答案解析:</div>
  228. <div
  229. class="explain-list__body"
  230. v-html="question.analysisContent"
  231. ></div>
  232. </div>
  233. </div>
  234. <div class="question__btns">
  235. <div
  236. v-if="
  237. bankType == 2 || (bankType == 1 && !question.ques)
  238. "
  239. class="submit"
  240. @click="checkboxSubmit(question, questionIndex)"
  241. >
  242. 确认答案
  243. </div>
  244. </div>
  245. </div>
  246. <div
  247. class="question"
  248. v-if="question.type == 3 && current == questionIndex"
  249. :key="questionIndex"
  250. >
  251. <div class="question__title">
  252. {{ questionIndex + 1 }}、判断题
  253. </div>
  254. <div
  255. class="question__desc"
  256. v-html="question.content"
  257. ></div>
  258. <div class="question__content">
  259. <div class="question-list" v-if="!question.ques">
  260. <div
  261. class="radio"
  262. v-for="(item, index) in judge"
  263. :key="index"
  264. @click="judgeSelect(question, questionIndex, index)"
  265. >
  266. <div>
  267. {{ ast[index] }}. {{ item }}
  268. <div v-if="item.imgUrl">
  269. <img
  270. style="max-width: 100%"
  271. :src="$tools.splitImgHost(item.imgUrl)"
  272. alt=""
  273. />
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. <div class="question-list" v-if="question.ques">
  279. <div
  280. class="radio"
  281. :class="{
  282. right:
  283. bankType == 1 &&
  284. (index == (question.ques == 1 ? 0 : 1) ||
  285. index != question.ans),
  286. wrong:
  287. bankType == 1 &&
  288. index == (question.ques == 1 ? 0 : 1) &&
  289. question.ques != question.ans,
  290. user_choose:
  291. bankType == 2 &&
  292. index == (question.ques == 1 ? 0 : 1),
  293. }"
  294. v-for="(item, index) in judge"
  295. :key="index"
  296. @click="judgeSelect(question, questionIndex, index)"
  297. >
  298. <div>
  299. {{ ast[index] }}. {{ item }}
  300. <div v-if="item.imgUrl">
  301. <img
  302. style="max-width: 100%"
  303. :src="$tools.splitImgHost(item.imgUrl)"
  304. alt=""
  305. />
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <div
  311. class="answer-list"
  312. v-if="bankType == 1 && question.ques"
  313. >
  314. <div class="answer-list__left">
  315. 正确答案:{{ ast[question.ans == 1 ? 0 : 1] }}
  316. </div>
  317. <div class="answer-list__left">
  318. 我的答案:{{ ast[question.ques == 1 ? 0 : 1] }}
  319. </div>
  320. </div>
  321. <div
  322. class="explain-list"
  323. v-if="bankType == 1 && question.ques"
  324. >
  325. <div class="explain-list__header">答案解析:</div>
  326. <div
  327. class="explain-list__body"
  328. v-html="question.analysisContent"
  329. ></div>
  330. </div>
  331. </div>
  332. <div class="question__btns"></div>
  333. </div>
  334. <div
  335. class="question"
  336. v-if="question.type == 4 && current == questionIndex"
  337. :key="questionIndex"
  338. >
  339. <div class="question__title">
  340. {{ questionIndex + 1 }}、案例题
  341. </div>
  342. <div
  343. class="question__desc"
  344. v-html="question.content"
  345. ></div>
  346. <div class="question__content">
  347. <el-tabs v-model="question.tabIndex">
  348. <el-tab-pane
  349. v-for="(json, jsonIndex) in question.jsonStr"
  350. :label="'问题' + (jsonIndex + 1)"
  351. :name="jsonIndex + ''"
  352. :key="jsonIndex"
  353. >
  354. <div
  355. class="question"
  356. v-if="json.type == 1"
  357. :key="questionIndex"
  358. >
  359. <div class="question__title">
  360. {{ jsonIndex + 1 }}、单选题
  361. </div>
  362. <div
  363. class="question__desc"
  364. v-html="json.content"
  365. ></div>
  366. <div class="question__content">
  367. <div
  368. class="question-list"
  369. v-if="!question.ques[jsonIndex]"
  370. >
  371. <div
  372. class="radio"
  373. v-for="(item, index) in json.optionsList"
  374. :key="index"
  375. @click="
  376. radioSelectChild(
  377. questionIndex,
  378. jsonIndex,
  379. item.optionsId
  380. )
  381. "
  382. >
  383. <div>
  384. {{ ast[index] }}. {{ item.content }}
  385. <div v-if="item.imgUrl">
  386. <img
  387. style="max-width: 100%"
  388. :src="
  389. $tools.splitImgHost(item.imgUrl)
  390. "
  391. alt=""
  392. />
  393. </div>
  394. </div>
  395. </div>
  396. </div>
  397. <div
  398. class="question-list"
  399. v-if="question.ques[jsonIndex]"
  400. >
  401. <div
  402. class="radio"
  403. :class="{
  404. right:
  405. bankType == 1 &&
  406. (item.optionsId ==
  407. question.ques[jsonIndex] ||
  408. item.optionsId ==
  409. question.ans[jsonIndex]),
  410. wrong:
  411. bankType == 1 &&
  412. item.optionsId ==
  413. question.ques[jsonIndex] &&
  414. question.ques[jsonIndex] !=
  415. question.ans[jsonIndex],
  416. user_choose:
  417. bankType == 2 &&
  418. item.optionsId ==
  419. question.ques[jsonIndex],
  420. }"
  421. v-for="(item, index) in json.optionsList"
  422. :key="index"
  423. @click="
  424. radioSelectChild(
  425. questionIndex,
  426. jsonIndex,
  427. item.optionsId
  428. )
  429. "
  430. >
  431. <div>
  432. {{ ast[index] }}. {{ item.content }}
  433. <div v-if="item.imgUrl">
  434. <img
  435. style="max-width: 100%"
  436. :src="
  437. $tools.splitImgHost(item.imgUrl)
  438. "
  439. alt=""
  440. />
  441. </div>
  442. </div>
  443. </div>
  444. </div>
  445. <div
  446. class="answer-list"
  447. v-if="
  448. bankType == 1 && question.ques[jsonIndex]
  449. "
  450. >
  451. <div class="answer-list__left">
  452. 正确答案:{{
  453. ast[question.ans[jsonIndex] - 1]
  454. }}
  455. </div>
  456. <div class="answer-list__left">
  457. 我的答案:{{
  458. ast[question.ques[jsonIndex] - 1]
  459. }}
  460. </div>
  461. </div>
  462. <div
  463. class="explain-list"
  464. v-if="
  465. bankType == 1 && question.ques[jsonIndex]
  466. "
  467. >
  468. <div class="explain-list__header">
  469. 答案解析:
  470. </div>
  471. <div
  472. class="explain-list__body"
  473. v-html="json.analysisContent"
  474. ></div>
  475. </div>
  476. </div>
  477. <div class="question__btns"></div>
  478. </div>
  479. <div
  480. class="question"
  481. v-if="json.type == 2"
  482. :key="jsonIndex"
  483. >
  484. <div class="question__title">
  485. {{ jsonIndex + 1 }}、多选题
  486. </div>
  487. <div
  488. class="question__desc"
  489. v-html="json.content"
  490. ></div>
  491. <div class="question__content">
  492. <div
  493. class="question-list"
  494. v-if="!question.ques[jsonIndex]"
  495. >
  496. <el-checkbox
  497. class="checkbox"
  498. v-for="(item, index) in json.optionsList"
  499. :key="index"
  500. :label="item.optionsId"
  501. v-model="item.checked"
  502. >
  503. <div>
  504. {{ ast[index] }}. {{ item.content }}
  505. <div v-if="item.imgUrl">
  506. <img
  507. style="max-width: 100%"
  508. :src="
  509. $tools.splitImgHost(item.imgUrl)
  510. "
  511. alt=""
  512. />
  513. </div>
  514. </div>
  515. </el-checkbox>
  516. </div>
  517. <div
  518. class="question-list"
  519. v-if="question.ques[jsonIndex]"
  520. >
  521. <el-checkbox
  522. :disabled="bankType == 2 ? false : true"
  523. class="checkbox"
  524. :class="{
  525. right:
  526. bankType == 1 &&
  527. (question.ques[jsonIndex].indexOf(
  528. item.optionsId
  529. ) != -1 ||
  530. question.ans[jsonIndex].indexOf(
  531. item.optionsId
  532. ) != -1),
  533. wrong:
  534. bankType == 1 &&
  535. question.ques[jsonIndex].indexOf(
  536. item.optionsId
  537. ) != -1 &&
  538. question.ans[jsonIndex].indexOf(
  539. item.optionsId
  540. ) == -1,
  541. user_choose:
  542. bankType == 2 &&
  543. question.ques[jsonIndex].indexOf(
  544. item.optionsId
  545. ) != -1,
  546. }"
  547. v-for="(item, index) in json.optionsList"
  548. :key="index"
  549. :label="item.optionsId"
  550. v-model="item.checked"
  551. >
  552. <div>
  553. {{ ast[index] }}. {{ item.content }}
  554. <div v-if="item.imgUrl">
  555. <img
  556. style="max-width: 100%"
  557. :src="
  558. $tools.splitImgHost(item.imgUrl)
  559. "
  560. alt=""
  561. />
  562. </div>
  563. </div>
  564. </el-checkbox>
  565. </div>
  566. <div
  567. class="answer-list"
  568. v-if="
  569. bankType == 1 && question.ques[jsonIndex]
  570. "
  571. >
  572. <div class="answer-list__left">
  573. 正确答案:
  574. <template
  575. v-for="ansItem in question.ans[jsonIndex]"
  576. >{{ ast[ansItem - 1] }}</template
  577. >
  578. </div>
  579. <div class="answer-list__left">
  580. 我的答案:
  581. <template
  582. v-for="quesItem in question.ques[
  583. jsonIndex
  584. ]"
  585. >{{ ast[quesItem - 1] }}</template
  586. >
  587. </div>
  588. </div>
  589. <div
  590. class="explain-list"
  591. v-if="
  592. bankType == 1 && question.ques[jsonIndex]
  593. "
  594. >
  595. <div class="explain-list__header">
  596. 答案解析:
  597. </div>
  598. <div
  599. class="explain-list__body"
  600. v-html="json.analysisContent"
  601. ></div>
  602. </div>
  603. </div>
  604. <div class="question__btns">
  605. <div
  606. v-if="
  607. bankType == 2 ||
  608. (bankType == 1 && !question.ques[jsonIndex])
  609. "
  610. class="submit"
  611. @click="
  612. checkboxSubmitChild(
  613. questionIndex,
  614. jsonIndex
  615. )
  616. "
  617. >
  618. 确认答案
  619. </div>
  620. </div>
  621. </div>
  622. <div
  623. class="question"
  624. v-if="json.type == 3"
  625. :key="jsonIndex"
  626. >
  627. <div class="question__title">
  628. {{ jsonIndex + 1 }}、判断题
  629. </div>
  630. <div
  631. class="question__desc"
  632. v-html="json.content"
  633. ></div>
  634. <div class="question__content">
  635. <div
  636. class="question-list"
  637. v-if="!question.ques[jsonIndex]"
  638. >
  639. <div
  640. class="radio"
  641. v-for="(item, index) in judge"
  642. :key="index"
  643. @click="
  644. judgeSelectChild(
  645. questionIndex,
  646. jsonIndex,
  647. index
  648. )
  649. "
  650. >
  651. <div>
  652. {{ ast[index] }}. {{ item }}
  653. <div v-if="item.imgUrl">
  654. <img
  655. style="max-width: 100%"
  656. :src="
  657. $tools.splitImgHost(item.imgUrl)
  658. "
  659. alt=""
  660. />
  661. </div>
  662. </div>
  663. </div>
  664. </div>
  665. <div
  666. class="question-list"
  667. v-if="question.ques[jsonIndex]"
  668. >
  669. <div
  670. class="radio"
  671. :class="{
  672. right:
  673. bankType == 1 &&
  674. (index ==
  675. (question.ques[jsonIndex] == 1
  676. ? 0
  677. : 1) ||
  678. index != question.ans[jsonIndex]),
  679. wrong:
  680. bankType == 1 &&
  681. index ==
  682. (question.ques[jsonIndex] == 1
  683. ? 0
  684. : 1) &&
  685. question.ques[jsonIndex] !=
  686. question.ans[jsonIndex],
  687. user_choose:
  688. bankType == 2 &&
  689. index ==
  690. (question.ques[jsonIndex] == 1
  691. ? 0
  692. : 1),
  693. }"
  694. v-for="(item, index) in judge"
  695. :key="index"
  696. @click="
  697. judgeSelectChild(
  698. questionIndex,
  699. jsonIndex,
  700. index
  701. )
  702. "
  703. >
  704. <div>
  705. {{ ast[index] }}. {{ item }}
  706. <div v-if="item.imgUrl">
  707. <img
  708. style="max-width: 100%"
  709. :src="
  710. $tools.splitImgHost(item.imgUrl)
  711. "
  712. alt=""
  713. />
  714. </div>
  715. </div>
  716. </div>
  717. </div>
  718. <div
  719. class="answer-list"
  720. v-if="
  721. bankType == 1 && question.ques[jsonIndex]
  722. "
  723. >
  724. <div class="answer-list__left">
  725. 正确答案:{{
  726. ast[question.ans[jsonIndex] == 1 ? 0 : 1]
  727. }}
  728. </div>
  729. <div class="answer-list__left">
  730. 我的答案:{{
  731. ast[question.ques[jsonIndex] == 1 ? 0 : 1]
  732. }}
  733. </div>
  734. </div>
  735. <div
  736. class="explain-list"
  737. v-if="
  738. bankType == 1 && question.ques[jsonIndex]
  739. "
  740. >
  741. <div class="explain-list__header">
  742. 答案解析:
  743. </div>
  744. <div
  745. class="explain-list__body"
  746. v-html="json.analysisContent"
  747. ></div>
  748. </div>
  749. </div>
  750. <div class="question__btns"></div>
  751. </div>
  752. <div
  753. class="question"
  754. v-if="json.type == 5"
  755. :key="jsonIndex"
  756. >
  757. <div class="question__title">
  758. {{ jsonIndex + 1 }}、简答题
  759. </div>
  760. <div
  761. class="question__desc"
  762. v-html="json.content"
  763. ></div>
  764. <div class="question__content">
  765. <div
  766. class="question-list textarea"
  767. v-if="
  768. bankType == 2 ||
  769. (bankType == 1 &&
  770. !(
  771. question.ques[jsonIndex] &&
  772. (question.ques[jsonIndex].imageList
  773. .length ||
  774. question.ques[jsonIndex].text)
  775. ))
  776. "
  777. >
  778. <el-input
  779. type="textarea"
  780. rows="5"
  781. v-model="json.ansText.text"
  782. resize="none"
  783. ></el-input>
  784. <div class="upload clearfix">
  785. <div
  786. class="upload__imgs"
  787. v-for="(img, imgIndex) in json.ansText
  788. .imageList"
  789. :key="imgIndex"
  790. >
  791. <img
  792. :src="$tools.splitImgHost(img, true)"
  793. alt=""
  794. />
  795. </div>
  796. <div class="upload__btn">
  797. <i class="el-icon-plus icon"></i>
  798. <p>上传图片</p>
  799. <input
  800. @change="
  801. uploadImgChild(
  802. $event,
  803. questionIndex,
  804. jsonIndex
  805. )
  806. "
  807. type="file"
  808. />
  809. </div>
  810. </div>
  811. </div>
  812. <div
  813. class="explain-list"
  814. v-if="
  815. bankType == 1 &&
  816. question.ques[jsonIndex] &&
  817. (question.ques[jsonIndex].imageList
  818. .length ||
  819. question.ques[jsonIndex].text)
  820. "
  821. >
  822. <div class="explain-list__header">
  823. 我的答案:
  824. </div>
  825. <div class="explain-list__body">
  826. <div>
  827. {{ question.ques[jsonIndex].text }}
  828. </div>
  829. <div class="upload clearfix">
  830. <div
  831. class="upload__imgs"
  832. v-for="(img, imgIndex) in question.ques[
  833. jsonIndex
  834. ].imageList"
  835. :key="imgIndex"
  836. >
  837. <img
  838. :src="$tools.splitImgHost(img, true)"
  839. alt=""
  840. />
  841. </div>
  842. </div>
  843. </div>
  844. <div class="explain-list__header">
  845. 答案解析:
  846. </div>
  847. <div
  848. class="explain-list__body"
  849. v-html="question.analysisContent"
  850. ></div>
  851. </div>
  852. </div>
  853. <div class="question__btns">
  854. <div
  855. v-if="
  856. bankType == 2 ||
  857. (bankType == 1 &&
  858. !(
  859. question.ques[jsonIndex] &&
  860. (question.ques[jsonIndex].imageList
  861. .length ||
  862. question.ques[jsonIndex].text)
  863. ))
  864. "
  865. class="submit"
  866. @click="
  867. ansSubmitChild(
  868. question,
  869. questionIndex,
  870. jsonIndex
  871. )
  872. "
  873. >
  874. 确认答案
  875. </div>
  876. </div>
  877. </div>
  878. </el-tab-pane>
  879. </el-tabs>
  880. </div>
  881. <div class="question__btns"></div>
  882. </div>
  883. <div
  884. class="question"
  885. v-if="question.type == 5 && current == questionIndex"
  886. :key="questionIndex"
  887. >
  888. <div class="question__title">
  889. {{ questionIndex + 1 }}、简答题
  890. </div>
  891. <div
  892. class="question__desc"
  893. v-html="question.content"
  894. ></div>
  895. <div class="question__content">
  896. <div
  897. class="question-list textarea"
  898. v-if="
  899. bankType == 2 ||
  900. (bankType == 1 &&
  901. !question.ques.imageList.length &&
  902. !question.ques.text)
  903. "
  904. >
  905. <el-input
  906. type="textarea"
  907. rows="5"
  908. v-model="question.ansText.text"
  909. resize="none"
  910. ></el-input>
  911. <div class="upload clearfix">
  912. <div
  913. class="upload__imgs"
  914. v-for="(img, imgIndex) in question.ansText
  915. .imageList"
  916. :key="imgIndex"
  917. >
  918. <img
  919. :src="$tools.splitImgHost(img, true)"
  920. alt=""
  921. />
  922. </div>
  923. <div class="upload__btn">
  924. <i class="el-icon-plus icon"></i>
  925. <p>上传图片</p>
  926. <input
  927. @change="
  928. uploadImg($event, question, questionIndex)
  929. "
  930. type="file"
  931. />
  932. </div>
  933. </div>
  934. </div>
  935. <div
  936. class="explain-list"
  937. v-if="
  938. bankType == 1 &&
  939. (question.ques.imageList.length ||
  940. question.ques.text)
  941. "
  942. >
  943. <div class="explain-list__header">我的答案:</div>
  944. <div class="explain-list__body">
  945. <div>{{ question.ques.text }}</div>
  946. <div class="upload clearfix">
  947. <div
  948. class="upload__imgs"
  949. v-for="(img, imgIndex) in question.ques
  950. .imageList"
  951. :key="imgIndex"
  952. >
  953. <img
  954. :src="$tools.splitImgHost(img, true)"
  955. alt=""
  956. />
  957. </div>
  958. </div>
  959. </div>
  960. <div class="explain-list__header">答案解析:</div>
  961. <div
  962. class="explain-list__body"
  963. v-html="question.analysisContent"
  964. ></div>
  965. </div>
  966. </div>
  967. <div class="question__btns">
  968. <div
  969. v-if="
  970. bankType == 2 ||
  971. (bankType == 1 &&
  972. !question.ques.imageList.length &&
  973. !question.ques.text)
  974. "
  975. class="submit"
  976. @click="ansSubmit(question, questionIndex)"
  977. >
  978. 确认答案
  979. </div>
  980. </div>
  981. </div>
  982. </template>
  983. </div>
  984. </div>
  985. <div class="right-box">
  986. <div class="right-box__header">
  987. <el-button
  988. type="primary"
  989. round
  990. plain
  991. size="small"
  992. class="back-btn"
  993. @click="$router.back(-1)"
  994. >返回</el-button
  995. >
  996. </div>
  997. <div class="right-box__footer">
  998. <el-button
  999. type="primary"
  1000. :loading="loading"
  1001. class="submit"
  1002. @click="submit"
  1003. >交卷</el-button
  1004. >
  1005. </div>
  1006. <div class="right-box__header">
  1007. <div class="title">答题卡</div>
  1008. <div class="time" v-if="allTimes">
  1009. {{ countdown(lastTime) }}
  1010. </div>
  1011. </div>
  1012. <div class="right-box__body">
  1013. <div class="card">
  1014. <div class="card__note">
  1015. <div class="item">
  1016. <div class="box green"></div>
  1017. 正确
  1018. </div>
  1019. <div class="item">
  1020. <div class="box red"></div>
  1021. 错误
  1022. </div>
  1023. <div class="item">
  1024. <div class="box blue"></div>
  1025. 已做未评改
  1026. </div>
  1027. <div class="item">
  1028. <div class="box yellow"></div>
  1029. 少选
  1030. </div>
  1031. <div class="item">
  1032. <div class="box white"></div>
  1033. 未做
  1034. </div>
  1035. </div>
  1036. <div class="card__content">
  1037. <ul class="list">
  1038. <li
  1039. class="item white"
  1040. v-for="(item, index) in questionList"
  1041. :key="index"
  1042. :class="{
  1043. green: bankType == 1 && isRight(item, index),
  1044. red: bankType == 1 && isWrong(item, index),
  1045. yellow: bankType == 1 && isPart(item, index),
  1046. blue: bankType == 1 && isOver(item, index),
  1047. check_ans: bankType == 2 && isCheck(item, index),
  1048. }"
  1049. @click="changeIndex(index)"
  1050. >
  1051. {{ index + 1 }}
  1052. </li>
  1053. </ul>
  1054. </div>
  1055. </div>
  1056. </div>
  1057. </div>
  1058. </div>
  1059. </div>
  1060. </div>
  1061. </div>
  1062. </section>
  1063. <ToolBar></ToolBar>
  1064. <Footer></Footer>
  1065. </div>
  1066. </template>
  1067. <script>
  1068. import Footer from "@/components/footer/index";
  1069. import Header from "@/components/header/index";
  1070. import ToolBar from "@/components/toolbar/index";
  1071. import { mapMutations, mapGetters, mapActions } from "vuex";
  1072. export default {
  1073. name: "BankExplain",
  1074. components: {
  1075. Footer,
  1076. Header,
  1077. ToolBar,
  1078. },
  1079. computed: {
  1080. ...mapGetters(["sysTime"]),
  1081. },
  1082. data() {
  1083. return {
  1084. recordId: 0,
  1085. tabIndex: "1",
  1086. textarea: "",
  1087. questionIndex: 0,
  1088. checked: false,
  1089. activeName: "1",
  1090. questionList: [],
  1091. goodsExamConfig: [],
  1092. goodsDetail: {},
  1093. bankList: [],
  1094. judge: ["正确", "错误"],
  1095. ast: [
  1096. "A",
  1097. "B",
  1098. "C",
  1099. "D",
  1100. "E",
  1101. "F",
  1102. "G",
  1103. "H",
  1104. "I",
  1105. "J",
  1106. "K",
  1107. "L",
  1108. "M",
  1109. "N",
  1110. "O",
  1111. "P",
  1112. "Q",
  1113. "R",
  1114. "S",
  1115. "T",
  1116. "U",
  1117. "V",
  1118. "W",
  1119. "X",
  1120. "Y",
  1121. "Z",
  1122. ],
  1123. loading: false,
  1124. needPhoto: false,
  1125. lastTime: 0, //剩余考试时长
  1126. allTimes: 0, //总考试时长
  1127. lastCount: 0,
  1128. examId: 0,
  1129. current: 0,
  1130. eachExamId: 0,
  1131. bankType: 0,
  1132. timer: null,
  1133. examData: {},
  1134. collectList: [],
  1135. isSubmit: false,
  1136. postTimer: null,
  1137. subscribeId: 0,
  1138. isAutoSubmit: false,
  1139. examEndTime: 0,
  1140. examStartTime: 0,
  1141. };
  1142. },
  1143. async mounted() {
  1144. this.examStartTime = this.$route.query.examStartTime;
  1145. this.examEndTime = this.$route.query.examEndTime;
  1146. this.examId = this.$route.query.examId;
  1147. this.eachExamId = this.$route.query.eachExamId;
  1148. this.subscribeId = this.$route.query.subscribeId || "";
  1149. this.allTimes = this.examEndTime - this.examStartTime || "";
  1150. await this.setSystemTime();
  1151. await this.bankExam();
  1152. this.goodsQuestionList();
  1153. },
  1154. beforeDestroy() {
  1155. clearInterval(this.postTimer);
  1156. clearInterval(this.timer);
  1157. try {
  1158. this.$msgbox.close();
  1159. } catch (err) {}
  1160. },
  1161. beforeRouteLeave(to, from, next) {
  1162. if (this.isSubmit) {
  1163. //交卷
  1164. next();
  1165. } else {
  1166. //离开
  1167. if (this.bankType == 1) {
  1168. console.log(1);
  1169. let ansCount = this.questionOverNum(true); //已答题数
  1170. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1171. //所有题目答完
  1172. if (this.lastCount == 0) {
  1173. // this.testOver = true;
  1174. this.$nextTick(() => {
  1175. this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
  1176. confirmButtonText: "结束做题",
  1177. cancelButtonText: "下次继续",
  1178. type: "warning",
  1179. })
  1180. .then(() => {
  1181. this.examSubmit();
  1182. })
  1183. .catch(() => {
  1184. this.mockRecordEdit();
  1185. next();
  1186. });
  1187. });
  1188. //未答完
  1189. } else {
  1190. this.$nextTick(() => {
  1191. this.$confirm(
  1192. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1193. "温馨提示",
  1194. {
  1195. confirmButtonText: "继续作答",
  1196. cancelButtonText: "下次继续",
  1197. type: "warning",
  1198. }
  1199. )
  1200. .then(() => {
  1201. // confirmButton回调
  1202. })
  1203. .catch(() => {
  1204. this.mockRecordEdit();
  1205. next();
  1206. });
  1207. });
  1208. // this.isLastCount = true;
  1209. }
  1210. } else if (this.bankType == 2) {
  1211. console.log(2);
  1212. let ansCount = this.questionOverNum(true); //已答题数
  1213. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1214. //所有题目答完
  1215. if (this.lastCount == 0) {
  1216. this.$nextTick(() => {
  1217. this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
  1218. confirmButtonText: "立即交卷",
  1219. cancelButtonText: "暂不交卷",
  1220. type: "warning",
  1221. })
  1222. .then(() => {
  1223. // confirmButton回调
  1224. this.examSubmit();
  1225. next();
  1226. })
  1227. .catch(() => {});
  1228. });
  1229. //未答完
  1230. } else {
  1231. this.$nextTick(() => {
  1232. this.$confirm(
  1233. `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
  1234. "温馨提示",
  1235. {
  1236. confirmButtonText: "继续离开",
  1237. cancelButtonText: "暂不离开",
  1238. type: "warning",
  1239. }
  1240. )
  1241. .then(() => {
  1242. // confirmButton回调
  1243. console.log(12);
  1244. this.leaveNow();
  1245. next();
  1246. })
  1247. .catch(() => {});
  1248. });
  1249. }
  1250. }
  1251. }
  1252. },
  1253. methods: {
  1254. ...mapMutations(["setExamResult"]),
  1255. ...mapActions(["setSystemTime"]),
  1256. mockSubscribeEdit() {
  1257. this.$request
  1258. .mockSubscribeEdit({
  1259. subscribeId: this.subscribeId,
  1260. handStatus: this.isAutoSubmit ? 2 : 1,
  1261. })
  1262. .then((res) => {});
  1263. },
  1264. toFixed(num) {
  1265. if (num) {
  1266. let str = String(num).indexOf(".");
  1267. if (str != -1) {
  1268. return +num.toFixed(2);
  1269. } else {
  1270. return num;
  1271. }
  1272. } else {
  1273. return 0;
  1274. }
  1275. },
  1276. /**
  1277. * @param {Object} current
  1278. * 获取收藏信息
  1279. */
  1280. getCollectInfo(current) {
  1281. this.$request
  1282. .getCollectInfo({
  1283. examId: this.examId,
  1284. questionId: this.questionList[current].questionId,
  1285. goodsId: this.goodsId,
  1286. orderGoodsId: this.orderGoodsId,
  1287. })
  1288. .then((res) => {
  1289. this.$set(this.collectList, current, res.data);
  1290. })
  1291. .catch((err) => {
  1292. this.$set(this.collectList, current, false);
  1293. });
  1294. },
  1295. /**
  1296. * 是否做完所有题目
  1297. */
  1298. isDoOver() {
  1299. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1300. if (this.questionList.length == questionOverNum) {
  1301. //全部做完弹窗
  1302. this.$nextTick(() => {
  1303. this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
  1304. confirmButtonText: "立即交卷",
  1305. cancelButtonText: "暂不交卷",
  1306. type: "warning",
  1307. })
  1308. .then(() => {
  1309. // confirmButton回调
  1310. this.examSubmit();
  1311. })
  1312. .catch(() => {});
  1313. });
  1314. }
  1315. },
  1316. /**
  1317. * 请求题目列表
  1318. */
  1319. goodsQuestionList() {
  1320. this.$request
  1321. .goodsQuestionList({
  1322. examId: this.examId,
  1323. })
  1324. .then(async (res) => {
  1325. if (!res.data.length) {
  1326. this.$message({
  1327. type: "warning",
  1328. message: "该试卷暂无题目",
  1329. });
  1330. return;
  1331. }
  1332. if (this.subscribeId) {
  1333. this.lastTime = this.examEndTime - this.sysTime;
  1334. //考试时间到了自动交卷
  1335. if (this.lastTime) {
  1336. this.timer = setInterval(() => {
  1337. if (this.lastTime <= 0) {
  1338. clearInterval(this.timer);
  1339. this.$confirm(`考试时间已到,系统将自动交卷`, "提示", {
  1340. confirmButtonText: "立即交卷",
  1341. closeOnClickModal: false,
  1342. showCancelButton: false,
  1343. closeOnPressEscape: false,
  1344. distinguishCancelAndClose: false,
  1345. showClose: false,
  1346. });
  1347. this.isAutoSubmit = true;
  1348. setTimeout(() => {
  1349. try {
  1350. this.$msgbox.close();
  1351. } catch (err) {}
  1352. this.examSubmit();
  1353. }, 3000);
  1354. return;
  1355. }
  1356. this.lastTime--;
  1357. }, 1000);
  1358. } else {
  1359. }
  1360. }
  1361. res.data.forEach((item, index) => {
  1362. item.jsonStr = JSON.parse(item.jsonStr);
  1363. console.log(item.type, "item");
  1364. if (item.type == 2) {
  1365. //多选
  1366. item.jsonStr.forEach((str) => {
  1367. str.optionsId = "" + str.optionsId;
  1368. });
  1369. let arr = item.answerQuestion.split(",");
  1370. arr.forEach((a, i) => {
  1371. arr[i] = "" + a;
  1372. });
  1373. item.ans = arr;
  1374. item.quesSelect = [];
  1375. item.analysisContent &&
  1376. (item.analysisContent = item.analysisContent.replace(
  1377. /<img/gi,
  1378. '<img style="max-width:100%;"'
  1379. ));
  1380. item.content &&
  1381. (item.content = item.content.replace(
  1382. /<img/gi,
  1383. '<img style="max-width:100%;"'
  1384. ));
  1385. return;
  1386. } else if (item.type == 5) {
  1387. //简答题
  1388. item.ansText = {
  1389. text: "",
  1390. imageList: [],
  1391. };
  1392. item.ques = {
  1393. text: "",
  1394. imageList: [],
  1395. };
  1396. item.analysisContent &&
  1397. (item.analysisContent = item.analysisContent.replace(
  1398. /<img/gi,
  1399. '<img style="max-width:100%;"'
  1400. ));
  1401. item.content &&
  1402. (item.content = item.content.replace(
  1403. /<img/gi,
  1404. '<img style="max-width:100%;"'
  1405. ));
  1406. return;
  1407. } else if (item.type == 4) {
  1408. //案例题
  1409. console.log(item.jsonStr);
  1410. item.ques = [];
  1411. item.tabIndex = "0";
  1412. let ansArr = [];
  1413. item.jsonStr.forEach((json, index) => {
  1414. if (json.type == 1) {
  1415. ansArr[index] = json.answerQuestion;
  1416. json.content &&
  1417. (json.content = json.content.replace(
  1418. /<img/gi,
  1419. '<img style="max-width:100%;"'
  1420. ));
  1421. } else if (json.type == 2) {
  1422. json.optionsList.forEach((str) => {
  1423. str.optionsId = "" + str.optionsId;
  1424. });
  1425. let arr = json.answerQuestion.split(",");
  1426. arr.forEach((a, i) => {
  1427. arr[i] = "" + a;
  1428. });
  1429. ansArr[index] = arr;
  1430. json.content &&
  1431. (json.content = json.content.replace(
  1432. /<img/gi,
  1433. '<img style="max-width:100%;"'
  1434. ));
  1435. } else if (json.type == 3) {
  1436. ansArr[index] = json.answerQuestion;
  1437. json.content &&
  1438. (json.content = json.content.replace(
  1439. /<img/gi,
  1440. '<img style="max-width:100%;"'
  1441. ));
  1442. } else if (json.type == 5) {
  1443. ansArr[index] = {
  1444. text: "",
  1445. imageList: [],
  1446. };
  1447. json.ansText = {
  1448. text: "",
  1449. imageList: [],
  1450. };
  1451. json.ques = {
  1452. text: "",
  1453. imageList: [],
  1454. };
  1455. json.content &&
  1456. (json.content = json.content.replace(
  1457. /<img/gi,
  1458. '<img style="max-width:100%;"'
  1459. ));
  1460. }
  1461. });
  1462. item.ans = ansArr;
  1463. return;
  1464. }
  1465. item.analysisContent &&
  1466. (item.analysisContent = item.analysisContent.replace(
  1467. /<img/gi,
  1468. '<img style="max-width:100%;"'
  1469. ));
  1470. item.content &&
  1471. (item.content = item.content.replace(
  1472. /<img/gi,
  1473. '<img style="max-width:100%;"'
  1474. ));
  1475. item.ques = "";
  1476. item.ans = item.answerQuestion;
  1477. });
  1478. this.questionList = res.data;
  1479. this.lastCount = this.questionList.length;
  1480. this.getCollectInfo(this.current)
  1481. await this.mockRecord();
  1482. });
  1483. },
  1484. /**
  1485. * 记录总题数,获取recordId
  1486. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1487. */
  1488. mockRecord(hasSpecial) {
  1489. return new Promise((resolve) => {
  1490. let self = this;
  1491. let questionList = 0;
  1492. // if(!hasSpecial) {
  1493. this.questionList.forEach((item, index) => {
  1494. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1495. questionList++;
  1496. }
  1497. });
  1498. // } else {
  1499. // questionList = this.questionList.length;
  1500. // }
  1501. this.$request
  1502. .mockRecord({
  1503. eachExamId: this.eachExamId,
  1504. examId: this.examId,
  1505. totalQuestionNum: questionList,
  1506. allQuestionNum: this.questionList.length,
  1507. })
  1508. .then((res) => {
  1509. this.recordId = res.data;
  1510. });
  1511. });
  1512. },
  1513. /**
  1514. * 离开页面统计回答正确题数
  1515. */
  1516. mockRecordEdit() {
  1517. clearInterval(this.postTimer);
  1518. clearInterval(this.timer);
  1519. let number = 0;
  1520. let score = 0;
  1521. let doQuestionNum = 0;
  1522. let doQuestionIds = []; //做过的题目id
  1523. let lessQuestionNum = 0;
  1524. this.questionList.forEach((item, index) => {
  1525. if (item.type == 1) {
  1526. if (item.ques == item.ans) {
  1527. score += item.score;
  1528. number++;
  1529. }
  1530. if (item.ques) {
  1531. doQuestionNum++;
  1532. doQuestionIds.push(item.questionId);
  1533. }
  1534. } else if (item.type == 2) {
  1535. let isRight =
  1536. item.ans &&
  1537. item.ans.every((quesItem, quesIndex) => {
  1538. if (item.ques) {
  1539. return item.ques[quesIndex] == item.ans[quesIndex];
  1540. } else {
  1541. return false;
  1542. }
  1543. });
  1544. if (isRight) {
  1545. score += item.score;
  1546. number++;
  1547. } else {
  1548. let hasPart = false;
  1549. let checkboxScore = 1; //获取单题总分数
  1550. item.ques &&
  1551. item.ques.forEach((ques, quesIndex) => {
  1552. //选错一个全扣
  1553. if (item.ques) {
  1554. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1555. checkboxScore = 0;
  1556. }
  1557. } else {
  1558. checkboxScore = 0;
  1559. }
  1560. });
  1561. console.log(checkboxScore);
  1562. //没选错
  1563. if (checkboxScore) {
  1564. checkboxScore = 0;
  1565. item.ans.forEach((ans, quesIndex) => {
  1566. //漏选扣一部分,对n题给n X partScore 分
  1567. if (item.ques) {
  1568. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1569. checkboxScore += item.partScore;
  1570. hasPart = true;
  1571. }
  1572. } else {
  1573. checkboxScore = 0;
  1574. }
  1575. });
  1576. }
  1577. if (!hasPart) {
  1578. //0分
  1579. } else {
  1580. //部分分
  1581. // number++;
  1582. lessQuestionNum++;
  1583. score += checkboxScore;
  1584. }
  1585. }
  1586. if (item.ques && item.ques.length) {
  1587. doQuestionNum++;
  1588. doQuestionIds.push(item.questionId);
  1589. }
  1590. } else if (item.type == 3) {
  1591. if (item.ques == item.ans) {
  1592. score += item.score;
  1593. number++;
  1594. }
  1595. if (item.ques) {
  1596. doQuestionNum++;
  1597. doQuestionIds.push(item.questionId);
  1598. }
  1599. } else if (item == 4) {
  1600. if (item.ques.length) {
  1601. doQuestionNum++;
  1602. doQuestionIds.push(item.questionId);
  1603. }
  1604. } else if (item.type == 5) {
  1605. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1606. doQuestionNum++;
  1607. doQuestionIds.push(item.questionId);
  1608. }
  1609. }
  1610. });
  1611. if (this.subscribeId) {
  1612. this.mockSubscribeEdit();
  1613. }
  1614. this.$request
  1615. .mockRecordEdit({
  1616. eachExamId: this.eachExamId,
  1617. examId: this.examId,
  1618. recordId: this.recordId,
  1619. doQuestionIds: doQuestionIds.join(","),
  1620. rightQuestionNum: number,
  1621. lessQuestionNum: lessQuestionNum,
  1622. status: 1,
  1623. doQuestionNum: doQuestionNum,
  1624. historyExamJson: JSON.stringify(this.questionList),
  1625. })
  1626. .then((res) => {});
  1627. },
  1628. /**
  1629. * 获取试卷类型2考试,1练习
  1630. */
  1631. bankExam() {
  1632. return new Promise((resolve) => {
  1633. this.$request.bankExam(this.examId).then((res) => {
  1634. this.bankType = res.data.doType;
  1635. this.examData = res.data;
  1636. if (this.bankType == 2) {
  1637. this.needBack = true;
  1638. }
  1639. resolve();
  1640. });
  1641. });
  1642. },
  1643. /**
  1644. * @param {Object}
  1645. * 单选点击确认
  1646. */
  1647. radioSelect(question, questionIndex, optionsId) {
  1648. // if (this.questionList[questionIndex].ques) return;
  1649. if (this.questionList[questionIndex].ques && this.bankType == 1) {
  1650. return;
  1651. }
  1652. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1653. this.isDoOver();
  1654. },
  1655. /**
  1656. * @param {Object}
  1657. * 案例单选点击
  1658. */
  1659. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1660. // if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1661. if (
  1662. this.questionList[questionIndex].ques[jsonIndex] &&
  1663. this.bankType == 1
  1664. ) {
  1665. return;
  1666. }
  1667. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1668. this.isDoOver();
  1669. },
  1670. /**
  1671. * 多选点击确认
  1672. */
  1673. checkboxSubmit(question, questionIndex) {
  1674. // if (this.questionList[questionIndex].ques) return;
  1675. if (this.questionList[questionIndex].ques && this.bankType == 1) {
  1676. return;
  1677. }
  1678. let arr = [];
  1679. this.questionList[questionIndex].jsonStr.forEach((item) => {
  1680. if (item.checked) {
  1681. arr.push(item.optionsId);
  1682. }
  1683. });
  1684. if (!arr.length) {
  1685. delete this.questionList[questionIndex].ques;
  1686. this.$message({
  1687. type: "warning",
  1688. message: "请选择答案",
  1689. });
  1690. return;
  1691. }
  1692. this.$set(this.questionList[questionIndex], "ques", arr);
  1693. this.isDoOver();
  1694. },
  1695. /**
  1696. * @param {Object}
  1697. * 案例多选确认
  1698. */
  1699. checkboxSubmitChild(questionIndex, ansIndex) {
  1700. // if (this.questionList[questionIndex].ques[ansIndex]) return;
  1701. if (
  1702. this.questionList[questionIndex].ques[ansIndex] &&
  1703. this.bankType == 1
  1704. ) {
  1705. return;
  1706. }
  1707. let arr = [];
  1708. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1709. (item) => {
  1710. if (item.checked) {
  1711. arr.push(item.optionsId);
  1712. }
  1713. }
  1714. );
  1715. if (!arr.length) {
  1716. delete this.questionList[questionIndex].ques[ansIndex];
  1717. this.$message({
  1718. type: "warning",
  1719. message: "请选择答案",
  1720. });
  1721. return;
  1722. }
  1723. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1724. this.isDoOver();
  1725. },
  1726. /**
  1727. * 判断点击确认
  1728. */
  1729. judgeSelect(question, questionIndex, index) {
  1730. // if (question.ques) return;
  1731. if (question.ques && this.bankType == 1) {
  1732. return;
  1733. }
  1734. this.$set(
  1735. this.questionList[questionIndex],
  1736. "ques",
  1737. index == 0 ? "1" : "0"
  1738. );
  1739. this.isDoOver();
  1740. },
  1741. judgeSelectChild(questionIndex, jsonIndex, index) {
  1742. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  1743. // if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1744. if (
  1745. this.questionList[questionIndex].ques[jsonIndex] &&
  1746. this.bankType == 1
  1747. ) {
  1748. return;
  1749. }
  1750. this.$set(
  1751. this.questionList[questionIndex].ques,
  1752. jsonIndex,
  1753. index == 0 ? "1" : "0"
  1754. );
  1755. this.isDoOver();
  1756. },
  1757. /**
  1758. * 上传图片
  1759. */
  1760. uploadImg(e, question, questionIndex) {
  1761. var file = e.target.files[0];
  1762. if (file.size > 2 * 1024 * 1024) {
  1763. this.$message.warn("图片不得大于2000kb");
  1764. return;
  1765. }
  1766. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1767. if (
  1768. type[0] != "jpg" &&
  1769. type[0] != "png" &&
  1770. type[0] != "jpeg" &&
  1771. type[0] != "gif"
  1772. ) {
  1773. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1774. e.target.value = "";
  1775. return;
  1776. }
  1777. this.$upload.upload(file, 0).then((res) => {
  1778. question.ansText.imageList.push(res);
  1779. });
  1780. },
  1781. /**
  1782. * 案例上传图片
  1783. */
  1784. uploadImgChild(e, questionIndex, jsonIndex) {
  1785. var file = e.target.files[0];
  1786. if (file.size > 2 * 1024 * 1024) {
  1787. this.$message.warn("图片不得大于2000kb");
  1788. return;
  1789. }
  1790. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1791. if (
  1792. type[0] != "jpg" &&
  1793. type[0] != "png" &&
  1794. type[0] != "jpeg" &&
  1795. type[0] != "gif"
  1796. ) {
  1797. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1798. e.target.value = "";
  1799. return;
  1800. }
  1801. this.$upload.upload(file, 0).then((res) => {
  1802. this.questionList[questionIndex].jsonStr[
  1803. jsonIndex
  1804. ].ansText.imageList.push(res);
  1805. });
  1806. },
  1807. isOver(item, index) {
  1808. if (this.questionList[index].ques) {
  1809. if (item.type == 4) {
  1810. //案例题
  1811. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1812. if (
  1813. jsonItem.type == 1 ||
  1814. jsonItem.type == 2 ||
  1815. jsonItem.type == 3
  1816. ) {
  1817. if (item.ques[indexs]) {
  1818. return true;
  1819. } else {
  1820. return false;
  1821. }
  1822. } else if (jsonItem.type == 5) {
  1823. if (
  1824. item.ques[indexs] &&
  1825. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1826. ) {
  1827. console.log("chil");
  1828. return true;
  1829. } else {
  1830. return false;
  1831. }
  1832. }
  1833. });
  1834. if (isOver) {
  1835. return true;
  1836. } else {
  1837. return false;
  1838. }
  1839. } else if (item.type == 5) {
  1840. //简答题
  1841. //每一项都相等
  1842. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1843. return true;
  1844. }
  1845. //判断
  1846. } else {
  1847. return false;
  1848. }
  1849. } else {
  1850. return false;
  1851. }
  1852. },
  1853. ansSubmit(question, questionIndex) {
  1854. if (!question.ansText.text && !question.ansText.imageList.length) {
  1855. this.$message({
  1856. type: "warning",
  1857. message: "请输入内容或上传图片",
  1858. });
  1859. return;
  1860. }
  1861. question.ques.imageList = question.ansText.imageList;
  1862. question.ques.text = question.ansText.text;
  1863. this.isDoOver();
  1864. console.log(question.ques);
  1865. },
  1866. ansSubmitChild(question, questionIndex, jsonIndex) {
  1867. if (
  1868. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1869. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1870. .length
  1871. ) {
  1872. this.$message({
  1873. type: "warning",
  1874. message: "请输入内容或上传图片",
  1875. });
  1876. return;
  1877. }
  1878. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1879. imageList:
  1880. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1881. .imageList || [],
  1882. text:
  1883. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  1884. "",
  1885. });
  1886. this.isDoOver();
  1887. },
  1888. changeIndex(index) {
  1889. this.current = index;
  1890. this.getCollectInfo(this.current);
  1891. },
  1892. nextQuestion() {
  1893. if (this.current >= this.questionList.length - 1) {
  1894. this.$message({
  1895. type: "warning",
  1896. message: "已经是最后一题了!",
  1897. });
  1898. return;
  1899. }
  1900. this.current++;
  1901. this.getCollectInfo(this.current);
  1902. },
  1903. prevQuestion() {
  1904. if (this.current == 0) {
  1905. this.$message({
  1906. type: "warning",
  1907. message: "已经是第一题了!",
  1908. });
  1909. return;
  1910. } else {
  1911. this.current--;
  1912. this.getCollectInfo(this.current);
  1913. }
  1914. },
  1915. isCheck(item, index) {
  1916. if (this.questionList[index].ques) {
  1917. return true;
  1918. }
  1919. },
  1920. isRight(item, index) {
  1921. //单选
  1922. if (this.questionList[index].ques) {
  1923. if (item.type == 1) {
  1924. console.log(
  1925. this.questionList[index].ques == this.questionList[index].ans
  1926. );
  1927. return this.questionList[index].ques == this.questionList[index].ans;
  1928. //多选
  1929. } else if (item.type == 2) {
  1930. //每一项都相等
  1931. return this.questionList[index].ans.every((item, i) => {
  1932. return item == this.questionList[index].ques[i];
  1933. });
  1934. //判断
  1935. } else if (item.type == 3) {
  1936. return this.questionList[index].ques == this.questionList[index].ans;
  1937. } else {
  1938. return false;
  1939. }
  1940. } else {
  1941. return false;
  1942. }
  1943. },
  1944. isWrong(item, index) {
  1945. if (this.questionList[index].ques) {
  1946. //单选
  1947. if (item.type == 1) {
  1948. return this.questionList[index].ques != this.questionList[index].ans;
  1949. //多选
  1950. } else if (item.type == 2) {
  1951. //每一项都相等
  1952. return this.questionList[index].ques.some((item, i) => {
  1953. return this.questionList[index].ans.indexOf(item) == -1;
  1954. });
  1955. //判断
  1956. } else if (item.type == 3) {
  1957. return this.questionList[index].ques != this.questionList[index].ans;
  1958. } else {
  1959. return false;
  1960. }
  1961. } else {
  1962. return false;
  1963. }
  1964. },
  1965. isPart(item, index) {
  1966. if (this.questionList[index].ques) {
  1967. if (item.type == 2) {
  1968. let isWrong = this.questionList[index].ques.some((item, i) => {
  1969. return this.questionList[index].ans.indexOf(item) == -1;
  1970. });
  1971. let isRight = this.questionList[index].ans.every((item, i) => {
  1972. return item == this.questionList[index].ques[i];
  1973. });
  1974. if (!isRight && !isWrong) {
  1975. return true;
  1976. }
  1977. }
  1978. } else {
  1979. return false;
  1980. }
  1981. },
  1982. right(bankIndex, ansIndex, option) {
  1983. if (
  1984. this.questionList[bankIndex].ques[ansIndex] &&
  1985. this.questionList[bankIndex].ans[ansIndex]
  1986. ) {
  1987. if (
  1988. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1989. option.optionsId
  1990. ) != -1 ||
  1991. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1992. option.optionsId
  1993. ) != -1
  1994. ) {
  1995. return true;
  1996. } else {
  1997. return false;
  1998. }
  1999. } else {
  2000. return false;
  2001. }
  2002. },
  2003. wrong(bankIndex, ansIndex, option) {
  2004. if (
  2005. this.questionList[bankIndex].ques[ansIndex] &&
  2006. this.questionList[bankIndex].ans[ansIndex]
  2007. ) {
  2008. if (
  2009. this.questionList[bankIndex].ques[ansIndex].indexOf(
  2010. option.optionsId
  2011. ) != -1 &&
  2012. this.questionList[bankIndex].ans[ansIndex].indexOf(
  2013. option.optionsId
  2014. ) == -1
  2015. ) {
  2016. return true;
  2017. } else {
  2018. return false;
  2019. }
  2020. } else {
  2021. return false;
  2022. }
  2023. },
  2024. /**
  2025. * 获取已经回答的题目数
  2026. * hasSpecail (是否包含简答和案例)
  2027. */
  2028. questionOverNum(hasSpecail) {
  2029. let count = 0;
  2030. this.questionList.forEach((item) => {
  2031. if (item.type == 1 || item.type == 2 || item.type == 3) {
  2032. if (item.ques) {
  2033. count++;
  2034. }
  2035. } else if (item.type == 4) {
  2036. //案例题
  2037. if (hasSpecail) {
  2038. let isOver = item.jsonStr.every((jsonItem, index) => {
  2039. if (
  2040. jsonItem.type == 1 ||
  2041. jsonItem.type == 2 ||
  2042. jsonItem.type == 3
  2043. ) {
  2044. if (item.ques[index]) {
  2045. return true;
  2046. } else {
  2047. return false;
  2048. }
  2049. } else if (jsonItem.type == 5) {
  2050. if (
  2051. item.ques[index] &&
  2052. (item.ques[index].text || item.ques[index].imageList.length)
  2053. ) {
  2054. return true;
  2055. } else {
  2056. return false;
  2057. }
  2058. }
  2059. });
  2060. if (isOver) {
  2061. count++;
  2062. console.log(item, 444);
  2063. }
  2064. }
  2065. } else if (item.type == 5) {
  2066. //简答题
  2067. if (hasSpecail) {
  2068. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  2069. console.log(5, item);
  2070. count++;
  2071. }
  2072. }
  2073. }
  2074. });
  2075. return count;
  2076. },
  2077. collect(state, index) {
  2078. if (!state) {
  2079. this.$request
  2080. .collectQuestion({
  2081. examId: this.examId,
  2082. questionId: this.questionList[index].questionId,
  2083. goodsId: this.goodsId || "",
  2084. orderGoodsId: this.orderGoodsId,
  2085. })
  2086. .then((res) => {
  2087. this.$set(this.collectList, index, true);
  2088. this.$message.success("收藏成功");
  2089. this.getCollectInfo(index);
  2090. });
  2091. } else {
  2092. this.$request
  2093. .deleteCollectQuestion(this.collectList[index].collectQuestionId)
  2094. .then((res) => {
  2095. this.$set(this.collectList, index, false);
  2096. this.$message.success("取消收藏成功");
  2097. });
  2098. }
  2099. return;
  2100. },
  2101. submit() {
  2102. let ansCount = this.questionOverNum(true); //已答题数
  2103. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  2104. //没有答完
  2105. if (this.lastCount > 0) {
  2106. this.$confirm(
  2107. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  2108. "提示",
  2109. {
  2110. confirmButtonText: "立即交卷",
  2111. cancelButtonText: "继续做题",
  2112. closeOnClickModal: false,
  2113. closeOnPressEscape: false,
  2114. distinguishCancelAndClose: false,
  2115. showClose: false,
  2116. }
  2117. )
  2118. .then((_) => {
  2119. this.examSubmit();
  2120. })
  2121. .catch((_) => {});
  2122. return;
  2123. }
  2124. if (this.bankType == 2) {
  2125. if (this.lastTime > 0) {
  2126. let lastTime = this.countdown(this.lastTime);
  2127. this.$confirm(`时间还剩余${lastTime},确定交卷吗?`, "提示", {
  2128. confirmButtonText: "交卷",
  2129. cancelButtonText: "继续答题",
  2130. closeOnClickModal: false,
  2131. closeOnPressEscape: false,
  2132. distinguishCancelAndClose: false,
  2133. showClose: false,
  2134. })
  2135. .then((_) => {
  2136. this.examSubmit();
  2137. })
  2138. .catch((_) => {});
  2139. return;
  2140. }
  2141. }
  2142. this.examSubmit();
  2143. },
  2144. /**
  2145. * @param {Object} second倒计时过滤器
  2146. */
  2147. countdown(second) {
  2148. if (second) {
  2149. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  2150. let m = parseInt((second / 60) % 60); // 计算分数
  2151. let s = parseInt(second % 60); // 计算当前秒数
  2152. if (h < 10) h = "0" + h;
  2153. if (m < 10) m = "0" + m;
  2154. if (s < 10) s = "0" + s;
  2155. return h + ":" + m + ":" + s;
  2156. } else {
  2157. return "";
  2158. }
  2159. },
  2160. /**
  2161. * 交卷,跳转报告页
  2162. */
  2163. examSubmit() {
  2164. console.log(12313);
  2165. this.loading = true;
  2166. clearInterval(this.timer);
  2167. clearInterval(this.postTimer);
  2168. let score = 0; //计算总分
  2169. let reportStatus = 0;
  2170. let number = 0; //做对的题目数量
  2171. let doQuestionNum = 0; //做过的题目数量
  2172. let allScore = 0; //总分
  2173. let passScore = 0;
  2174. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  2175. let doQuestionIds = []; //做过的题目id
  2176. let rightQuestionIds = []; //做对的题目id
  2177. let lessQuestionNum = 0;
  2178. this.questionList.forEach((item, index) => {
  2179. passScore = item.passScore;
  2180. if (item.type == 1) {
  2181. //正确
  2182. if (item.ques == item.ans) {
  2183. item.scoreResult = item.score;
  2184. score += item.score;
  2185. number++;
  2186. rightQuestionIds.push(item.questionId);
  2187. } else {
  2188. //错误
  2189. item.scoreResult = 0;
  2190. if (item.ques) {
  2191. doWrongQuestionIds.push(item.questionId);
  2192. }
  2193. }
  2194. allScore += item.score;
  2195. if (item.ques) {
  2196. doQuestionNum++;
  2197. doQuestionIds.push(item.questionId);
  2198. }
  2199. } else if (item.type == 2) {
  2200. let isRight =
  2201. item.ans &&
  2202. item.ans.every((quesItem, quesIndex) => {
  2203. if (item.ques) {
  2204. return item.ques[quesIndex] == item.ans[quesIndex];
  2205. } else {
  2206. return false;
  2207. }
  2208. });
  2209. if (isRight) {
  2210. score += item.score;
  2211. number++;
  2212. item.scoreResult = item.score;
  2213. rightQuestionIds.push(item.questionId);
  2214. } else {
  2215. let hasPart = false;
  2216. let checkboxScore = 1; //获取单题总分数
  2217. item.ques &&
  2218. item.ques.forEach((ques, quesIndex) => {
  2219. //选错一个全扣
  2220. if (item.ques) {
  2221. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  2222. checkboxScore = 0;
  2223. }
  2224. } else {
  2225. checkboxScore = 0;
  2226. }
  2227. });
  2228. console.log(checkboxScore, "checkboxScore1");
  2229. //没选错
  2230. if (checkboxScore) {
  2231. checkboxScore = 0;
  2232. item.ans.forEach((ans, quesIndex) => {
  2233. //漏选扣一部分,对n题给n X partScore 分
  2234. if (item.ques) {
  2235. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  2236. checkboxScore += item.partScore;
  2237. hasPart = true;
  2238. }
  2239. } else {
  2240. checkboxScore = 0;
  2241. }
  2242. });
  2243. }
  2244. console.log(checkboxScore, "checkboxScore2");
  2245. if (!hasPart) {
  2246. //0分
  2247. item.scoreResult = 0;
  2248. if (item.ques) {
  2249. doWrongQuestionIds.push(item.questionId);
  2250. }
  2251. } else {
  2252. //部分分
  2253. // number++;
  2254. lessQuestionNum++;
  2255. // doWrongQuestionIds.push(item.questionId);
  2256. item.scoreResult = checkboxScore;
  2257. score += checkboxScore;
  2258. // rightQuestionIds.push(item.questionId)
  2259. }
  2260. }
  2261. allScore += item.score;
  2262. if (item.ques && item.ques.length) {
  2263. doQuestionNum++;
  2264. doQuestionIds.push(item.questionId);
  2265. }
  2266. } else if (item.type == 3) {
  2267. if (item.ques == item.ans) {
  2268. item.scoreResult = item.score;
  2269. score += item.score;
  2270. number++;
  2271. rightQuestionIds.push(item.questionId);
  2272. } else {
  2273. item.scoreResult = 0;
  2274. if (item.ques) {
  2275. doWrongQuestionIds.push(item.questionId);
  2276. }
  2277. }
  2278. allScore += item.score;
  2279. if (item.ques) {
  2280. doQuestionNum++;
  2281. doQuestionIds.push(item.questionId);
  2282. }
  2283. } else if (item.type == 4) {
  2284. allScore += item.score;
  2285. if (item.ques && item.ques.length) {
  2286. doQuestionNum++;
  2287. doQuestionIds.push(item.questionId);
  2288. }
  2289. } else if (item.type == 5) {
  2290. allScore += item.score;
  2291. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  2292. doQuestionNum++;
  2293. doQuestionIds.push(item.questionId);
  2294. }
  2295. }
  2296. });
  2297. //大于及格
  2298. if (score >= passScore) {
  2299. reportStatus = 1;
  2300. } else {
  2301. reportStatus = 0;
  2302. }
  2303. if (this.subscribeId) {
  2304. this.mockSubscribeEdit();
  2305. }
  2306. // setTimeout(() => {
  2307. // let result = {
  2308. // chapterId: this.chapterId,
  2309. // moduleId: this.moduleId,
  2310. // examId: this.examId,
  2311. // recordId: this.recordId,
  2312. // };
  2313. // this.setExamResult(result);
  2314. // this.$router.push({
  2315. // path: "/bank-report/" + this.goodsId,
  2316. // });
  2317. // }, 1000);
  2318. // return;
  2319. //交卷
  2320. this.$request
  2321. .mockRecordEdit({
  2322. eachExamId: this.eachExamId,
  2323. examId: this.examId,
  2324. reportStatus: reportStatus,
  2325. recordId: this.recordId,
  2326. lessQuestionNum: lessQuestionNum,
  2327. rightQuestionNum: number,
  2328. status: 1,
  2329. doQuestionIds: doQuestionIds.join(","),
  2330. rightQuestionIds: rightQuestionIds.join(","),
  2331. doQuestionNum: doQuestionNum,
  2332. performance: score,
  2333. totalScore: allScore,
  2334. examTime: parseInt(this.allTimes),
  2335. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  2336. historyExamJson: JSON.stringify(this.questionList),
  2337. })
  2338. .then((res) => {
  2339. this.isSubmit = true;
  2340. this.loading = false;
  2341. this.$message({
  2342. type: "success",
  2343. message: "交卷成功",
  2344. });
  2345. setTimeout(() => {
  2346. this.$router.replace({
  2347. path: "/mock-report",
  2348. query: {
  2349. subscribeId: this.subscribeId,
  2350. eachExamId: this.eachExamId,
  2351. examId: this.examId,
  2352. recordId: this.recordId,
  2353. },
  2354. });
  2355. }, 1000);
  2356. })
  2357. .catch((err) => {
  2358. this.loading = false;
  2359. });
  2360. //错题集id提交(客观题)
  2361. this.$request
  2362. .mockWrongRecord({
  2363. eachExamId: this.eachExamId,
  2364. examId: this.examId,
  2365. questionIds: doWrongQuestionIds,
  2366. recordId: this.recordId,
  2367. })
  2368. .then((res) => {})
  2369. .catch((err) => {});
  2370. },
  2371. /**
  2372. * 交卷,不用跳转
  2373. */
  2374. leaveNow() {
  2375. clearInterval(this.timer);
  2376. clearInterval(this.postTimer);
  2377. let score = 0; //计算总分
  2378. let reportStatus = 0;
  2379. let number = 0; //做对的题目数量
  2380. let doQuestionNum = 0; //做过的题目数量
  2381. let allScore = 0; //总分
  2382. let passScore = 0;
  2383. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  2384. let doQuestionIds = []; //做过的题目id
  2385. let rightQuestionIds = []; //做对的题目id
  2386. let lessQuestionNum = 0;
  2387. console.log(111);
  2388. this.questionList.forEach((item, index) => {
  2389. passScore = item.passScore;
  2390. if (item.type == 1) {
  2391. //正确
  2392. if (item.ques == item.ans) {
  2393. item.scoreResult = item.score;
  2394. score += item.score;
  2395. number++;
  2396. rightQuestionIds.push(item.questionId);
  2397. } else {
  2398. //错误
  2399. item.scoreResult = 0;
  2400. if (item.ques) {
  2401. doWrongQuestionIds.push(item.questionId);
  2402. }
  2403. }
  2404. allScore += item.score;
  2405. if (item.ques) {
  2406. doQuestionNum++;
  2407. doQuestionIds.push(item.questionId);
  2408. }
  2409. } else if (item.type == 2) {
  2410. let isRight =
  2411. item.ans &&
  2412. item.ans.every((quesItem, quesIndex) => {
  2413. if (item.ques) {
  2414. return item.ques[quesIndex] == item.ans[quesIndex];
  2415. } else {
  2416. return false;
  2417. }
  2418. });
  2419. if (isRight) {
  2420. score += item.score;
  2421. number++;
  2422. item.scoreResult = item.score;
  2423. rightQuestionIds.push(item.questionId);
  2424. } else {
  2425. let hasPart = false;
  2426. let checkboxScore = 1; //获取单题总分数
  2427. item.ques &&
  2428. item.ques.forEach((ques, quesIndex) => {
  2429. //选错一个全扣
  2430. if (item.ques) {
  2431. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  2432. checkboxScore = 0;
  2433. }
  2434. } else {
  2435. checkboxScore = 0;
  2436. }
  2437. });
  2438. console.log(checkboxScore, "checkboxScore1");
  2439. //没选错
  2440. if (checkboxScore) {
  2441. checkboxScore = 0;
  2442. item.ans.forEach((ans, quesIndex) => {
  2443. //漏选扣一部分,对n题给n X partScore 分
  2444. if (item.ques) {
  2445. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  2446. checkboxScore += item.partScore;
  2447. hasPart = true;
  2448. }
  2449. } else {
  2450. checkboxScore = 0;
  2451. }
  2452. });
  2453. }
  2454. console.log(checkboxScore, "checkboxScore2");
  2455. if (!hasPart) {
  2456. //0分
  2457. item.scoreResult = 0;
  2458. if (item.ques) {
  2459. doWrongQuestionIds.push(item.questionId);
  2460. }
  2461. } else {
  2462. //部分分
  2463. // number++;
  2464. lessQuestionNum++;
  2465. // doWrongQuestionIds.push(item.questionId);
  2466. item.scoreResult = checkboxScore;
  2467. score += checkboxScore;
  2468. // rightQuestionIds.push(item.questionId)
  2469. }
  2470. }
  2471. allScore += item.score;
  2472. if (item.ques && item.ques.length) {
  2473. doQuestionNum++;
  2474. doQuestionIds.push(item.questionId);
  2475. }
  2476. } else if (item.type == 3) {
  2477. if (item.ques == item.ans) {
  2478. item.scoreResult = item.score;
  2479. score += item.score;
  2480. number++;
  2481. rightQuestionIds.push(item.questionId);
  2482. } else {
  2483. item.scoreResult = 0;
  2484. if (item.ques) {
  2485. doWrongQuestionIds.push(item.questionId);
  2486. }
  2487. }
  2488. allScore += item.score;
  2489. if (item.ques) {
  2490. doQuestionNum++;
  2491. doQuestionIds.push(item.questionId);
  2492. }
  2493. } else if (item.type == 4) {
  2494. allScore += item.score;
  2495. if (item.ques && item.ques.length) {
  2496. doQuestionNum++;
  2497. doQuestionIds.push(item.questionId);
  2498. }
  2499. } else if (item.type == 5) {
  2500. allScore += item.score;
  2501. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  2502. doQuestionNum++;
  2503. doQuestionIds.push(item.questionId);
  2504. }
  2505. }
  2506. });
  2507. //大于及格
  2508. if (score >= passScore) {
  2509. reportStatus = 1;
  2510. } else {
  2511. reportStatus = 0;
  2512. }
  2513. if (this.subscribeId) {
  2514. this.mockSubscribeEdit();
  2515. }
  2516. console.log(333);
  2517. //交卷
  2518. this.$request
  2519. .mockRecordEdit({
  2520. eachExamId: this.eachExamId,
  2521. examId: this.examId,
  2522. reportStatus: reportStatus,
  2523. recordId: this.recordId,
  2524. rightQuestionNum: number,
  2525. lessQuestionNum: lessQuestionNum,
  2526. status: 1,
  2527. doQuestionIds: doQuestionIds.join(","),
  2528. rightQuestionIds: rightQuestionIds.join(","),
  2529. doQuestionNum: doQuestionNum,
  2530. performance: score,
  2531. totalScore: allScore,
  2532. examTime: parseInt(this.allTimes),
  2533. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  2534. historyExamJson: JSON.stringify(this.questionList),
  2535. })
  2536. .then((res) => {});
  2537. console.log(222);
  2538. //错题集id提交(客观题)
  2539. this.$request
  2540. .examWrongRecord({
  2541. eachExamId: this.eachExamId,
  2542. examId: this.examId,
  2543. questionIds: doWrongQuestionIds,
  2544. recordId: this.recordId,
  2545. })
  2546. .then((res) => {
  2547. this.loading = false;
  2548. })
  2549. .catch((err) => {
  2550. this.loading = false;
  2551. });
  2552. },
  2553. },
  2554. };
  2555. </script>
  2556. <!-- Add "scoped" attribute to limit CSS to this component only -->
  2557. <style scoped lang="scss">
  2558. .course-exam {
  2559. .section {
  2560. overflow: hidden;
  2561. &__header {
  2562. height: 20px;
  2563. margin-top: 20px;
  2564. }
  2565. &__body {
  2566. .explain-record {
  2567. &__header {
  2568. }
  2569. &__body {
  2570. margin-bottom: 20px;
  2571. border: 1px solid #eee;
  2572. .left-box {
  2573. float: left;
  2574. width: 970px;
  2575. min-height: 630px;
  2576. border: 1px solid #eee;
  2577. &__header {
  2578. height: 40px;
  2579. padding-left: 12px;
  2580. border-bottom: 1px solid #eeeeee;
  2581. display: flex;
  2582. align-items: center;
  2583. .progress {
  2584. width: 636px;
  2585. }
  2586. .text {
  2587. margin-left: 15px;
  2588. font-size: 16px;
  2589. span {
  2590. font-family: Microsoft YaHei;
  2591. font-weight: bold;
  2592. color: #3f8dfd;
  2593. line-height: 24px;
  2594. }
  2595. }
  2596. }
  2597. &__body {
  2598. .question {
  2599. padding: 12px 0 0 12px;
  2600. display: flex;
  2601. flex-direction: column;
  2602. height: 100%;
  2603. &__title {
  2604. padding-left: 12px;
  2605. font-size: 16px;
  2606. font-family: Microsoft YaHei;
  2607. font-weight: bold;
  2608. color: #333333;
  2609. line-height: 24px;
  2610. }
  2611. &__desc {
  2612. padding-left: 12px;
  2613. margin-top: 20px;
  2614. font-size: 16px;
  2615. font-family: Microsoft YaHei;
  2616. font-weight: 400;
  2617. color: #666666;
  2618. line-height: 24px;
  2619. /deep/ img {
  2620. max-width: 100% !important;
  2621. }
  2622. }
  2623. &__content {
  2624. /deep/ .el-tabs__item {
  2625. height: 40px;
  2626. line-height: 40px;
  2627. }
  2628. .question__content {
  2629. height: auto;
  2630. overflow: auto;
  2631. }
  2632. .question-list {
  2633. padding: 24px 0 0 24px;
  2634. .checkbox,
  2635. .radio {
  2636. cursor: pointer;
  2637. margin-right: 24px;
  2638. padding: 0 24px;
  2639. display: flex;
  2640. align-items: center;
  2641. margin-top: 2px;
  2642. min-height: 40px;
  2643. padding-top: 10px;
  2644. padding-bottom: 10px;
  2645. background: #f5f9ff;
  2646. border-radius: 8px;
  2647. box-sizing: border-box;
  2648. &.right {
  2649. background: #37c65b;
  2650. }
  2651. &.wrong {
  2652. background: #ff3a30;
  2653. }
  2654. &.user_choose {
  2655. background: #007aff;
  2656. }
  2657. }
  2658. &.textarea {
  2659. margin-right: 12px;
  2660. .upload {
  2661. margin-top: 10px;
  2662. &__imgs {
  2663. margin-right: 10px;
  2664. width: 80px;
  2665. height: 80px;
  2666. background: #ffffff;
  2667. border: 1px solid #eeeeee;
  2668. border-radius: 4px;
  2669. position: relative;
  2670. display: flex;
  2671. float: left;
  2672. align-items: center;
  2673. justify-content: center;
  2674. img {
  2675. max-width: 100%;
  2676. max-height: 100%;
  2677. }
  2678. }
  2679. &__btn {
  2680. margin-right: 10px;
  2681. width: 80px;
  2682. height: 80px;
  2683. background: #ffffff;
  2684. border: 1px solid #eeeeee;
  2685. border-radius: 4px;
  2686. position: relative;
  2687. display: flex;
  2688. float: left;
  2689. align-items: center;
  2690. justify-content: center;
  2691. flex-direction: column;
  2692. .icon {
  2693. font-size: 20px;
  2694. color: #3f8dfd;
  2695. }
  2696. p {
  2697. font-size: 12px;
  2698. font-family: Microsoft YaHei;
  2699. font-weight: 400;
  2700. color: #999999;
  2701. line-height: 24px;
  2702. }
  2703. input {
  2704. position: absolute;
  2705. left: 0;
  2706. top: 0;
  2707. display: block;
  2708. width: 100%;
  2709. height: 100%;
  2710. opacity: 0;
  2711. }
  2712. }
  2713. }
  2714. }
  2715. /deep/
  2716. .el-checkbox__input.is-checked
  2717. + .el-checkbox__label {
  2718. color: #000 !important;
  2719. }
  2720. /deep/
  2721. .el-checkbox__input.is-disabled
  2722. + span.el-checkbox__label {
  2723. color: #000;
  2724. }
  2725. /deep/ .el-checkbox {
  2726. white-space: normal;
  2727. }
  2728. }
  2729. .answer-list {
  2730. height: 40px;
  2731. border-top: 1px solid #eee;
  2732. border-bottom: 1px solid #eee;
  2733. margin-top: 24px;
  2734. display: flex;
  2735. align-items: center;
  2736. justify-content: space-between;
  2737. padding: 0 24px;
  2738. &__left {
  2739. font-size: 16px;
  2740. font-family: Microsoft YaHei;
  2741. font-weight: 400;
  2742. color: #333333;
  2743. line-height: 24px;
  2744. }
  2745. &__right {
  2746. font-size: 16px;
  2747. font-family: Microsoft YaHei;
  2748. font-weight: 400;
  2749. color: #333333;
  2750. line-height: 24px;
  2751. }
  2752. }
  2753. .explain-list {
  2754. padding: 12px 24px;
  2755. &__header {
  2756. font-size: 16px;
  2757. font-family: Microsoft YaHei;
  2758. font-weight: bold;
  2759. color: #666666;
  2760. line-height: 24px;
  2761. }
  2762. &__body {
  2763. margin-top: 12px;
  2764. font-size: 16px;
  2765. font-family: Microsoft YaHei;
  2766. font-weight: 400;
  2767. color: #666666;
  2768. line-height: 24px;
  2769. }
  2770. .upload {
  2771. margin-top: 10px;
  2772. &__imgs {
  2773. margin-right: 10px;
  2774. width: 80px;
  2775. height: 80px;
  2776. background: #ffffff;
  2777. border: 1px solid #eeeeee;
  2778. border-radius: 4px;
  2779. position: relative;
  2780. display: flex;
  2781. float: left;
  2782. align-items: center;
  2783. justify-content: center;
  2784. img {
  2785. max-width: 100%;
  2786. max-height: 100%;
  2787. }
  2788. }
  2789. }
  2790. }
  2791. }
  2792. &__btns {
  2793. position: relative;
  2794. height: 32px;
  2795. .submit {
  2796. cursor: pointer;
  2797. margin: 0 auto;
  2798. width: 140px;
  2799. height: 32px;
  2800. padding: 0;
  2801. color: #fff;
  2802. background: #3f8dfd;
  2803. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2804. border-radius: 16px;
  2805. text-align: center;
  2806. line-height: 32px;
  2807. font-size: 16px;
  2808. }
  2809. .collect {
  2810. width: 100px;
  2811. cursor: pointer;
  2812. position: absolute;
  2813. right: 0;
  2814. top: 5px;
  2815. font-size: 12px;
  2816. font-family: Microsoft YaHei;
  2817. font-weight: 400;
  2818. color: #3f8dfd;
  2819. line-height: 24px;
  2820. i {
  2821. font-size: 20px;
  2822. }
  2823. }
  2824. }
  2825. }
  2826. }
  2827. &__footer {
  2828. height: 40px;
  2829. display: flex;
  2830. justify-content: space-around;
  2831. align-items: center;
  2832. .btn {
  2833. cursor: pointer;
  2834. width: 140px;
  2835. height: 32px;
  2836. background: #ffffff;
  2837. border: 1px solid #3f8dfd;
  2838. border-radius: 16px;
  2839. line-height: 32px;
  2840. text-align: center;
  2841. color: #3f8dfd;
  2842. }
  2843. }
  2844. }
  2845. .right-box {
  2846. float: right;
  2847. width: 299px;
  2848. border-right: 1px solid #eee;
  2849. &__header {
  2850. height: 40px;
  2851. line-height: 40px;
  2852. border-bottom: 1px solid #eeeeee;
  2853. .back-btn {
  2854. display: block;
  2855. margin: 0 auto;
  2856. width: 160px;
  2857. }
  2858. .title {
  2859. float: left;
  2860. font-size: 16px;
  2861. font-family: Microsoft YaHei;
  2862. font-weight: bold;
  2863. color: #333333;
  2864. }
  2865. .time {
  2866. font-size: 16px;
  2867. font-family: Microsoft YaHei;
  2868. font-weight: 400;
  2869. color: #666666;
  2870. float: right;
  2871. }
  2872. }
  2873. &__body {
  2874. height: 510px;
  2875. border-bottom: 1px solid #eee;
  2876. .card {
  2877. &__note {
  2878. display: flex;
  2879. height: 64px;
  2880. align-items: center;
  2881. border-bottom: 1px solid #eee;
  2882. flex-wrap: wrap;
  2883. .item {
  2884. display: flex;
  2885. align-items: center;
  2886. margin-left: 10px;
  2887. width: 84px;
  2888. font-size: 12px;
  2889. .box {
  2890. margin-right: 5px;
  2891. width: 16px;
  2892. height: 16px;
  2893. border-radius: 4px;
  2894. &.white {
  2895. background: #ffffff;
  2896. border: 1px solid #eeeeee;
  2897. }
  2898. &.green {
  2899. background: #37c65b;
  2900. }
  2901. &.red {
  2902. background: #ff3a30;
  2903. }
  2904. &.yellow {
  2905. background: #ffc53d;
  2906. }
  2907. &.blue,
  2908. &.check_ans {
  2909. background: #3f8dfd;
  2910. }
  2911. }
  2912. }
  2913. }
  2914. &__content {
  2915. height: 440px;
  2916. overflow-y: scroll;
  2917. &::-webkit-scrollbar {
  2918. width: 6px;
  2919. }
  2920. &::-webkit-scrollbar-track {
  2921. background-color: #fff;
  2922. -webkit-border-radius: 2em;
  2923. -moz-border-radius: 2em;
  2924. border-radius: 2em;
  2925. }
  2926. &::-webkit-scrollbar-thumb {
  2927. background-color: #eeeeee;
  2928. -webkit-border-radius: 2em;
  2929. -moz-border-radius: 2em;
  2930. border-radius: 2em;
  2931. }
  2932. .list {
  2933. display: flex;
  2934. flex-wrap: wrap;
  2935. .item {
  2936. width: 40px;
  2937. height: 40px;
  2938. border-radius: 10px;
  2939. text-align: center;
  2940. line-height: 40px;
  2941. margin-left: 16px;
  2942. margin-top: 16px;
  2943. cursor: pointer;
  2944. &.white {
  2945. line-height: 38px;
  2946. color: #333333;
  2947. background: #ffffff;
  2948. border: 1px solid #eeeeee;
  2949. }
  2950. &.green {
  2951. color: #fff;
  2952. background: #37c65b;
  2953. }
  2954. &.red {
  2955. color: #fff;
  2956. background: #ff3a30;
  2957. }
  2958. &.blue,
  2959. &.check_ans {
  2960. color: #fff;
  2961. background: #3f8dfd;
  2962. }
  2963. &.yellow {
  2964. background: #ffc53d;
  2965. }
  2966. &.disabled {
  2967. cursor: not-allowed;
  2968. line-height: 38px;
  2969. color: #eeeeee;
  2970. background: #ffffff;
  2971. border: 1px solid #eeeeee;
  2972. }
  2973. }
  2974. }
  2975. }
  2976. }
  2977. }
  2978. &__footer {
  2979. border-bottom: 1px solid #eee;
  2980. height: 40px;
  2981. display: flex;
  2982. align-items: center;
  2983. justify-content: center;
  2984. .submit {
  2985. cursor: pointer;
  2986. width: 140px;
  2987. height: 32px;
  2988. padding: 0;
  2989. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2990. border-radius: 16px;
  2991. line-height: 32px;
  2992. text-align: center;
  2993. font-size: 16px;
  2994. }
  2995. }
  2996. }
  2997. }
  2998. }
  2999. }
  3000. }
  3001. .take-photo {
  3002. /deep/ .el-dialog__header {
  3003. display: none;
  3004. }
  3005. /deep/ .el-dialog__body {
  3006. padding: 0;
  3007. overflow: unset;
  3008. }
  3009. &__close {
  3010. cursor: pointer;
  3011. position: absolute;
  3012. right: 0;
  3013. top: -28px;
  3014. width: 24px;
  3015. height: 24px;
  3016. line-height: 24px;
  3017. text-align: center;
  3018. color: #eee;
  3019. border: 1px solid #eee;
  3020. border-radius: 50%;
  3021. }
  3022. &__header {
  3023. height: 40px;
  3024. border-bottom: 1px solid #eee;
  3025. line-height: 40px;
  3026. font-size: 16px;
  3027. font-family: Microsoft YaHei;
  3028. font-weight: bold;
  3029. color: #333333;
  3030. padding-left: 24px;
  3031. }
  3032. &__body {
  3033. height: 400px;
  3034. padding: 40px 24px;
  3035. .left-box {
  3036. width: 336px;
  3037. float: left;
  3038. .title {
  3039. font-size: 16px;
  3040. font-family: Microsoft YaHei;
  3041. font-weight: bold;
  3042. color: #ff3b30;
  3043. line-height: 24px;
  3044. }
  3045. .content {
  3046. font-size: 14px;
  3047. font-family: Microsoft YaHei;
  3048. font-weight: 400;
  3049. color: #333333;
  3050. line-height: 28px;
  3051. margin-top: 32px;
  3052. }
  3053. }
  3054. .right-box {
  3055. float: right;
  3056. width: 400px;
  3057. height: 300px;
  3058. video {
  3059. width: 100%;
  3060. height: 100%;
  3061. }
  3062. }
  3063. }
  3064. &__footer {
  3065. height: 90px;
  3066. border-top: 1px solid #eee;
  3067. text-align: center;
  3068. .take {
  3069. display: inline-block;
  3070. width: 200px;
  3071. height: 40px;
  3072. padding: 0;
  3073. border-radius: 20px;
  3074. text-align: center;
  3075. line-height: 40px;
  3076. margin: 24px auto;
  3077. }
  3078. }
  3079. }
  3080. }
  3081. </style>