index.vue 111 KB

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