index.vue 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542
  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">
  19. <div class="left-box">
  20. <Header-tab-box
  21. :num="questionOverNum(true)"
  22. @prevQuestion="prevQuestion"
  23. @nextQuestion="nextQuestion"
  24. ></Header-tab-box>
  25. <div class="left-box__body">
  26. <template v-for="(question, questionIndex) in questionList">
  27. <div
  28. class="question"
  29. v-if="question.type == 1 && current == questionIndex"
  30. :key="questionIndex"
  31. >
  32. <div class="question__title">
  33. {{ questionIndex + 1 }}、单选题
  34. </div>
  35. <div
  36. class="question__desc"
  37. v-html="question.content"
  38. ></div>
  39. <div class="question__content">
  40. <div class="question-list" v-if="!question.ques">
  41. <div
  42. class="radio"
  43. v-for="(item, index) in question.jsonStr"
  44. :key="index"
  45. @click="
  46. radioSelect(
  47. question,
  48. questionIndex,
  49. item.optionsId
  50. )
  51. "
  52. >
  53. <div>
  54. {{ ast[index] }}. {{ item.content }}
  55. <div v-if="item.imgUrl">
  56. <img
  57. style="max-width: 100%"
  58. :src="$tools.splitImgHost(item.imgUrl)"
  59. alt=""
  60. />
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="question-list" v-if="question.ques">
  66. <div
  67. class="radio"
  68. :class="{
  69. right:
  70. item.optionsId == question.ques ||
  71. item.optionsId == question.ans,
  72. wrong:
  73. item.optionsId == question.ques &&
  74. question.ques != question.ans,
  75. }"
  76. v-for="(item, index) in question.jsonStr"
  77. :key="index"
  78. >
  79. <div>
  80. {{ ast[index] }}. {{ item.content }}
  81. <div v-if="item.imgUrl">
  82. <img
  83. style="max-width: 100%"
  84. :src="$tools.splitImgHost(item.imgUrl)"
  85. alt=""
  86. />
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="answer-list" v-if="question.ques">
  92. <div class="answer-list__left">
  93. 正确答案:{{ ast[question.ans - 1] }}
  94. </div>
  95. <div class="answer-list__left">
  96. 我的答案:{{ ast[question.ques - 1] }}
  97. </div>
  98. </div>
  99. <div class="explain-list" v-if="question.ques">
  100. <div class="explain-list__header">答案解析:</div>
  101. <div
  102. class="explain-list__body"
  103. v-html="question.analysisContent"
  104. ></div>
  105. </div>
  106. </div>
  107. </div>
  108. <div
  109. class="question"
  110. v-if="question.type == 2 && current == questionIndex"
  111. :key="questionIndex"
  112. >
  113. <div class="question__title">
  114. {{ questionIndex + 1 }}、多选题
  115. </div>
  116. <div
  117. class="question__desc"
  118. v-html="question.content"
  119. ></div>
  120. <div class="question__content">
  121. <div class="question-list" v-if="!question.ques">
  122. <el-checkbox
  123. class="checkbox"
  124. v-for="(item, index) in question.jsonStr"
  125. :key="index"
  126. :label="item.optionsId"
  127. v-model="item.checked"
  128. >
  129. <div>
  130. {{ ast[index] }}. {{ item.content }}
  131. <div v-if="item.imgUrl">
  132. <img
  133. style="max-width: 100%"
  134. :src="$tools.splitImgHost(item.imgUrl)"
  135. alt=""
  136. />
  137. </div>
  138. </div>
  139. </el-checkbox>
  140. </div>
  141. <div class="question-list" v-if="question.ques">
  142. <el-checkbox
  143. disabled
  144. class="checkbox"
  145. :class="{
  146. right:
  147. question.ques.indexOf(item.optionsId) != -1 ||
  148. question.ans.indexOf(item.optionsId) != -1,
  149. wrong:
  150. question.ques.indexOf(item.optionsId) != -1 &&
  151. question.ans.indexOf(item.optionsId) == -1,
  152. }"
  153. v-for="(item, index) in question.jsonStr"
  154. :key="index"
  155. :label="item.optionsId"
  156. v-model="item.checked"
  157. >
  158. <div>
  159. {{ ast[index] }}. {{ item.content }}
  160. <div v-if="item.imgUrl">
  161. <img
  162. style="max-width: 100%"
  163. :src="$tools.splitImgHost(item.imgUrl)"
  164. alt=""
  165. />
  166. </div>
  167. </div>
  168. </el-checkbox>
  169. </div>
  170. <div class="answer-list" v-if="question.ques">
  171. <div class="answer-list__left">
  172. 正确答案:
  173. <template v-for="ansItem in question.ans">{{
  174. ast[ansItem - 1]
  175. }}</template>
  176. </div>
  177. <div class="answer-list__left">
  178. 我的答案:
  179. <template v-for="quesItem in question.ques">{{
  180. ast[quesItem - 1]
  181. }}</template>
  182. </div>
  183. </div>
  184. <div class="explain-list" v-if="question.ques">
  185. <div class="explain-list__header">答案解析:</div>
  186. <div
  187. class="explain-list__body"
  188. v-html="question.analysisContent"
  189. ></div>
  190. </div>
  191. </div>
  192. <div class="question__btns">
  193. <div
  194. v-if="!question.ques"
  195. class="submit"
  196. @click="checkboxSubmit(question, questionIndex)"
  197. >
  198. 确认答案
  199. </div>
  200. </div>
  201. </div>
  202. <div
  203. class="question"
  204. v-if="question.type == 3 && current == questionIndex"
  205. :key="questionIndex"
  206. >
  207. <div class="question__title">
  208. {{ questionIndex + 1 }}、判断题
  209. </div>
  210. <div
  211. class="question__desc"
  212. v-html="question.content"
  213. ></div>
  214. <div class="question__content">
  215. <div class="question-list" v-if="!question.ques">
  216. <div
  217. class="radio"
  218. v-for="(item, index) in judge"
  219. :key="index"
  220. @click="judgeSelect(question, questionIndex, index)"
  221. >
  222. <div>
  223. {{ ast[index] }}. {{ item }}
  224. <div v-if="item.imgUrl">
  225. <img
  226. style="max-width: 100%"
  227. :src="$tools.splitImgHost(item.imgUrl)"
  228. alt=""
  229. />
  230. </div>
  231. </div>
  232. </div>
  233. </div>
  234. <div class="question-list" v-if="question.ques">
  235. <!-- right:
  236. index == question.ques || index == question.ans,
  237. wrong:
  238. index == question.ques &&
  239. question.ques != question.ans, -->
  240. <div
  241. class="radio"
  242. :class="{
  243. right:
  244. index == (question.ques == 1 ? 0 : 1) ||
  245. index != question.ans,
  246. wrong:
  247. index == (question.ques == 1 ? 0 : 1) &&
  248. question.ques != question.ans,
  249. }"
  250. v-for="(item, index) in judge"
  251. :key="index"
  252. >
  253. <div>
  254. {{ ast[index] }}. {{ item }}
  255. <div v-if="item.imgUrl">
  256. <img
  257. style="max-width: 100%"
  258. :src="$tools.splitImgHost(item.imgUrl)"
  259. alt=""
  260. />
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. <div class="answer-list" v-if="question.ques">
  266. <div class="answer-list__left">
  267. 正确答案:{{ ast[question.ans == 1 ? 0 : 1] }}
  268. </div>
  269. <div class="answer-list__left">
  270. 我的答案:{{ ast[question.ques == 1 ? 0 : 1] }}
  271. </div>
  272. </div>
  273. <div class="explain-list" v-if="question.ques">
  274. <div class="explain-list__header">答案解析:</div>
  275. <div
  276. class="explain-list__body"
  277. v-html="question.analysisContent"
  278. ></div>
  279. </div>
  280. </div>
  281. </div>
  282. <div
  283. class="question"
  284. v-if="question.type == 4 && current == questionIndex"
  285. :key="questionIndex"
  286. >
  287. <div class="question__title">
  288. {{ questionIndex + 1 }}、案例题
  289. </div>
  290. <div
  291. class="question__desc"
  292. v-html="question.content"
  293. ></div>
  294. <div class="question__content">
  295. <el-tabs v-model="question.tabIndex">
  296. <el-tab-pane
  297. v-for="(json, jsonIndex) in question.jsonStr"
  298. :label="'问题' + (jsonIndex + 1)"
  299. :name="jsonIndex + ''"
  300. :key="jsonIndex"
  301. >
  302. <div
  303. class="question"
  304. v-if="json.type == 1"
  305. :key="questionIndex"
  306. >
  307. <div class="question__title">
  308. {{ jsonIndex + 1 }}、单选题
  309. </div>
  310. <div
  311. class="question__desc"
  312. v-html="json.content"
  313. ></div>
  314. <div class="question__content">
  315. <div
  316. class="question-list"
  317. v-if="!question.ques[jsonIndex]"
  318. >
  319. <div
  320. class="radio"
  321. v-for="(item, index) in json.optionsList"
  322. :key="index"
  323. @click="
  324. radioSelectChild(
  325. questionIndex,
  326. jsonIndex,
  327. item.optionsId
  328. )
  329. "
  330. >
  331. <div>
  332. {{ ast[index] }}. {{ item.content }}
  333. <div v-if="item.imgUrl">
  334. <img
  335. style="max-width: 100%"
  336. :src="
  337. $tools.splitImgHost(item.imgUrl)
  338. "
  339. alt=""
  340. />
  341. </div>
  342. </div>
  343. </div>
  344. </div>
  345. <div
  346. class="question-list"
  347. v-if="question.ques[jsonIndex]"
  348. >
  349. <div
  350. class="radio"
  351. :class="{
  352. right:
  353. item.optionsId ==
  354. question.ques[jsonIndex] ||
  355. item.optionsId ==
  356. question.ans[jsonIndex],
  357. wrong:
  358. item.optionsId ==
  359. question.ques[jsonIndex] &&
  360. question.ques[jsonIndex] !=
  361. question.ans[jsonIndex],
  362. }"
  363. v-for="(item, index) in json.optionsList"
  364. :key="index"
  365. >
  366. <div>
  367. {{ ast[index] }}. {{ item.content }}
  368. <div v-if="item.imgUrl">
  369. <img
  370. style="max-width: 100%"
  371. :src="
  372. $tools.splitImgHost(item.imgUrl)
  373. "
  374. alt=""
  375. />
  376. </div>
  377. </div>
  378. </div>
  379. </div>
  380. <div
  381. class="answer-list"
  382. v-if="question.ques[jsonIndex]"
  383. >
  384. <div class="answer-list__left">
  385. 正确答案:{{
  386. ast[question.ans[jsonIndex] - 1]
  387. }}
  388. </div>
  389. <div class="answer-list__left">
  390. 我的答案:{{
  391. ast[question.ques[jsonIndex] - 1]
  392. }}
  393. </div>
  394. </div>
  395. <div
  396. class="explain-list"
  397. v-if="question.ques[jsonIndex]"
  398. >
  399. <div class="explain-list__header">
  400. 答案解析:
  401. </div>
  402. <div
  403. class="explain-list__body"
  404. v-html="json.analysisContent"
  405. ></div>
  406. </div>
  407. </div>
  408. <div class="question__btns"></div>
  409. </div>
  410. <div
  411. class="question"
  412. v-if="json.type == 2"
  413. :key="jsonIndex"
  414. >
  415. <div class="question__title">
  416. {{ jsonIndex + 1 }}、多选题
  417. </div>
  418. <div
  419. class="question__desc"
  420. v-html="json.content"
  421. ></div>
  422. <div class="question__content">
  423. <div
  424. class="question-list"
  425. v-if="!question.ques[jsonIndex]"
  426. >
  427. <el-checkbox
  428. class="checkbox"
  429. v-for="(item, index) in json.optionsList"
  430. :key="index"
  431. :label="item.optionsId"
  432. v-model="item.checked"
  433. >
  434. <div>
  435. {{ ast[index] }}. {{ item.content }}
  436. <div v-if="item.imgUrl">
  437. <img
  438. style="max-width: 100%"
  439. :src="
  440. $tools.splitImgHost(item.imgUrl)
  441. "
  442. alt=""
  443. />
  444. </div>
  445. </div>
  446. </el-checkbox>
  447. </div>
  448. <div
  449. class="question-list"
  450. v-if="question.ques[jsonIndex]"
  451. >
  452. <el-checkbox
  453. disabled
  454. class="checkbox"
  455. :class="{
  456. right:
  457. question.ques[jsonIndex].indexOf(
  458. item.optionsId
  459. ) != -1 ||
  460. question.ans[jsonIndex].indexOf(
  461. item.optionsId
  462. ) != -1,
  463. wrong:
  464. question.ques[jsonIndex].indexOf(
  465. item.optionsId
  466. ) != -1 &&
  467. question.ans[jsonIndex].indexOf(
  468. item.optionsId
  469. ) == -1,
  470. }"
  471. v-for="(item, index) in json.optionsList"
  472. :key="index"
  473. :label="item.optionsId"
  474. v-model="item.checked"
  475. >
  476. <div>
  477. {{ ast[index] }}. {{ item.content }}
  478. <div v-if="item.imgUrl">
  479. <img
  480. style="max-width: 100%"
  481. :src="
  482. $tools.splitImgHost(item.imgUrl)
  483. "
  484. alt=""
  485. />
  486. </div>
  487. </div>
  488. </el-checkbox>
  489. </div>
  490. <div
  491. class="answer-list"
  492. v-if="question.ques[jsonIndex]"
  493. >
  494. <div class="answer-list__left">
  495. 正确答案:
  496. <template
  497. v-for="ansItem in question.ans[jsonIndex]"
  498. >{{ ast[ansItem - 1] }}</template
  499. >
  500. </div>
  501. <div class="answer-list__left">
  502. 我的答案:
  503. <template
  504. v-for="quesItem in question.ques[
  505. jsonIndex
  506. ]"
  507. >{{ ast[quesItem - 1] }}</template
  508. >
  509. </div>
  510. </div>
  511. <div
  512. class="explain-list"
  513. v-if="question.ques[jsonIndex]"
  514. >
  515. <div class="explain-list__header">
  516. 答案解析:
  517. </div>
  518. <div
  519. class="explain-list__body"
  520. v-html="json.analysisContent"
  521. ></div>
  522. </div>
  523. </div>
  524. <div class="question__btns">
  525. <div
  526. v-if="!question.ques[jsonIndex]"
  527. class="submit"
  528. @click="
  529. checkboxSubmitChild(
  530. questionIndex,
  531. jsonIndex
  532. )
  533. "
  534. >
  535. 确认答案
  536. </div>
  537. </div>
  538. </div>
  539. <div
  540. class="question"
  541. v-if="json.type == 3"
  542. :key="jsonIndex"
  543. >
  544. <div class="question__title">
  545. {{ jsonIndex + 1 }}、判断题
  546. </div>
  547. <div
  548. class="question__desc"
  549. v-html="json.content"
  550. ></div>
  551. <div class="question__content">
  552. <div
  553. class="question-list"
  554. v-if="!question.ques[jsonIndex]"
  555. >
  556. <div
  557. class="radio"
  558. v-for="(item, index) in judge"
  559. :key="index"
  560. @click="
  561. judgeSelectChild(
  562. questionIndex,
  563. jsonIndex,
  564. index
  565. )
  566. "
  567. >
  568. <div>
  569. {{ ast[index] }}. {{ item }}
  570. <div v-if="item.imgUrl">
  571. <img
  572. style="max-width: 100%"
  573. :src="
  574. $tools.splitImgHost(item.imgUrl)
  575. "
  576. alt=""
  577. />
  578. </div>
  579. </div>
  580. </div>
  581. </div>
  582. <div
  583. class="question-list"
  584. v-if="question.ques[jsonIndex]"
  585. >
  586. <div
  587. class="radio"
  588. :class="{
  589. right:
  590. index ==
  591. (question.ques[jsonIndex] == 1
  592. ? 0
  593. : 1) ||
  594. index != question.ans[jsonIndex],
  595. wrong:
  596. index ==
  597. (question.ques[jsonIndex] == 1
  598. ? 0
  599. : 1) &&
  600. question.ques[jsonIndex] !=
  601. question.ans[jsonIndex],
  602. }"
  603. v-for="(item, index) in judge"
  604. :key="index"
  605. >
  606. <div>
  607. {{ ast[index] }}. {{ item }}
  608. <div v-if="item.imgUrl">
  609. <img
  610. style="max-width: 100%"
  611. :src="
  612. $tools.splitImgHost(item.imgUrl)
  613. "
  614. alt=""
  615. />
  616. </div>
  617. </div>
  618. </div>
  619. </div>
  620. <div
  621. class="answer-list"
  622. v-if="question.ques[jsonIndex]"
  623. >
  624. <div class="answer-list__left">
  625. 正确答案:{{
  626. ast[question.ans[jsonIndex] == 1 ? 0 : 1]
  627. }}
  628. </div>
  629. <div class="answer-list__left">
  630. 我的答案:{{
  631. ast[question.ques[jsonIndex] == 1 ? 0 : 1]
  632. }}
  633. </div>
  634. </div>
  635. <div
  636. class="explain-list"
  637. v-if="question.ques[jsonIndex]"
  638. >
  639. <div class="explain-list__header">
  640. 答案解析:
  641. </div>
  642. <div
  643. class="explain-list__body"
  644. v-html="json.analysisContent"
  645. ></div>
  646. </div>
  647. </div>
  648. <div class="question__btns"></div>
  649. </div>
  650. <div
  651. class="question"
  652. v-if="json.type == 5"
  653. :key="jsonIndex"
  654. >
  655. <div class="question__title">
  656. {{ jsonIndex + 1 }}、简答题
  657. </div>
  658. <div
  659. class="question__desc"
  660. v-html="json.content"
  661. ></div>
  662. <div class="question__content">
  663. <div
  664. class="question-list textarea"
  665. v-if="
  666. !(
  667. question.ques[jsonIndex] &&
  668. (question.ques[jsonIndex].imageList
  669. .length ||
  670. question.ques[jsonIndex].text)
  671. )
  672. "
  673. >
  674. <el-input
  675. type="textarea"
  676. rows="5"
  677. v-model="json.ansText.text"
  678. resize="none"
  679. ></el-input>
  680. <div class="upload clearfix">
  681. <div
  682. class="upload__imgs"
  683. v-for="(img, imgIndex) in json.ansText
  684. .imageList"
  685. :key="imgIndex"
  686. >
  687. <img
  688. :src="$tools.splitImgHost(img, true)"
  689. alt=""
  690. />
  691. </div>
  692. <div class="upload__btn">
  693. <i class="el-icon-plus icon"></i>
  694. <p>上传图片</p>
  695. <input
  696. @change="
  697. uploadImgChild(
  698. $event,
  699. questionIndex,
  700. jsonIndex
  701. )
  702. "
  703. type="file"
  704. />
  705. </div>
  706. </div>
  707. </div>
  708. <div
  709. class="explain-list"
  710. v-if="
  711. question.ques[jsonIndex] &&
  712. (question.ques[jsonIndex].imageList
  713. .length ||
  714. question.ques[jsonIndex].text)
  715. "
  716. >
  717. <div class="explain-list__header">
  718. 我的答案:
  719. </div>
  720. <div class="explain-list__body">
  721. <div>
  722. {{ question.ques[jsonIndex].text }}
  723. </div>
  724. <div class="upload clearfix">
  725. <div
  726. class="upload__imgs"
  727. v-for="(img, imgIndex) in question.ques[
  728. jsonIndex
  729. ].imageList"
  730. :key="imgIndex"
  731. >
  732. <img
  733. :src="$tools.splitImgHost(img, true)"
  734. alt=""
  735. />
  736. </div>
  737. </div>
  738. </div>
  739. <div class="explain-list__header">
  740. 答案解析:
  741. </div>
  742. <div
  743. class="explain-list__body"
  744. v-html="question.analysisContent"
  745. ></div>
  746. </div>
  747. </div>
  748. <div class="question__btns">
  749. <div
  750. v-if="
  751. !(
  752. question.ques[jsonIndex] &&
  753. (question.ques[jsonIndex].imageList
  754. .length ||
  755. question.ques[jsonIndex].text)
  756. )
  757. "
  758. class="submit"
  759. @click="
  760. ansSubmitChild(
  761. question,
  762. questionIndex,
  763. jsonIndex
  764. )
  765. "
  766. >
  767. 确认答案
  768. </div>
  769. </div>
  770. </div>
  771. </el-tab-pane>
  772. </el-tabs>
  773. </div>
  774. </div>
  775. <div
  776. class="question"
  777. v-if="question.type == 5 && current == questionIndex"
  778. :key="questionIndex"
  779. >
  780. <div class="question__title">
  781. {{ questionIndex + 1 }}、简答题
  782. </div>
  783. <div
  784. class="question__desc"
  785. v-html="question.content"
  786. ></div>
  787. <div class="question__content">
  788. <div
  789. class="question-list textarea"
  790. v-if="
  791. !question.ques.imageList.length &&
  792. !question.ques.text
  793. "
  794. >
  795. <el-input
  796. type="textarea"
  797. rows="5"
  798. v-model="question.ansText.text"
  799. resize="none"
  800. ></el-input>
  801. <div class="upload clearfix">
  802. <div
  803. class="upload__imgs"
  804. v-for="(img, imgIndex) in question.ansText
  805. .imageList"
  806. :key="imgIndex"
  807. >
  808. <img
  809. :src="$tools.splitImgHost(img, true)"
  810. alt=""
  811. />
  812. </div>
  813. <div class="upload__btn">
  814. <i class="el-icon-plus icon"></i>
  815. <p>上传图片</p>
  816. <input
  817. @change="
  818. uploadImg($event, question, questionIndex)
  819. "
  820. type="file"
  821. />
  822. </div>
  823. </div>
  824. </div>
  825. <div
  826. class="explain-list"
  827. v-if="
  828. question.ques.imageList.length || question.ques.text
  829. "
  830. >
  831. <div class="explain-list__header">我的答案:</div>
  832. <div class="explain-list__body">
  833. <div>{{ question.ques.text }}</div>
  834. <div class="upload clearfix">
  835. <div
  836. class="upload__imgs"
  837. v-for="(img, imgIndex) in question.ques
  838. .imageList"
  839. :key="imgIndex"
  840. >
  841. <img
  842. :src="$tools.splitImgHost(img, true)"
  843. alt=""
  844. />
  845. </div>
  846. </div>
  847. </div>
  848. <div class="explain-list__header">答案解析:</div>
  849. <div
  850. class="explain-list__body"
  851. v-html="question.analysisContent"
  852. ></div>
  853. </div>
  854. </div>
  855. <div class="question__btns">
  856. <div
  857. v-if="
  858. !question.ques.imageList.length &&
  859. !question.ques.text
  860. "
  861. class="submit"
  862. @click="ansSubmit(question, questionIndex)"
  863. >
  864. 确认答案
  865. </div>
  866. </div>
  867. </div>
  868. </template>
  869. </div>
  870. <Collection-box
  871. :param="param"
  872. @sumit="getCollectInfo(current)"
  873. :showT="!collectList[current]"
  874. ></Collection-box>
  875. </div>
  876. <div class="right-box">
  877. <div class="right-box__header">
  878. <el-button
  879. type="primary"
  880. round
  881. plain
  882. size="small"
  883. class="back-btn"
  884. @click="$router.back(-1)"
  885. >返回</el-button
  886. >
  887. </div>
  888. <div class="right-box__footer">
  889. <el-button
  890. type="primary"
  891. :loading="loading"
  892. class="submit"
  893. @click="submit"
  894. >交卷</el-button
  895. >
  896. </div>
  897. <div class="right-box__header">答题卡</div>
  898. <div class="right-box__body">
  899. <div class="card">
  900. <div class="card__note">
  901. <div class="item">
  902. <div class="box green"></div>
  903. 正确
  904. </div>
  905. <div class="item">
  906. <div class="box red"></div>
  907. 错误
  908. </div>
  909. <div class="item">
  910. <div class="box blue"></div>
  911. 已做未评改
  912. </div>
  913. <div class="item">
  914. <div class="box yellow"></div>
  915. 少选
  916. </div>
  917. <div class="item">
  918. <div class="box white"></div>
  919. 未做
  920. </div>
  921. </div>
  922. <div class="card__content">
  923. <ul class="list">
  924. <li
  925. class="item white"
  926. v-for="(item, index) in questionList"
  927. :key="index"
  928. :class="{
  929. green: isRight(item, index),
  930. red: isWrong(item, index),
  931. yellow: isPart(item, index),
  932. blue: isOver(item, index),
  933. }"
  934. @click="changeIndex(index)"
  935. >
  936. {{ index + 1 }}
  937. </li>
  938. </ul>
  939. </div>
  940. </div>
  941. </div>
  942. </div>
  943. </div>
  944. </div>
  945. </div>
  946. </div>
  947. </section>
  948. <ToolBar></ToolBar>
  949. <Footer></Footer>
  950. </div>
  951. </template>
  952. <script>
  953. import Footer from "@/components/footer/index";
  954. import Header from "@/components/header/index";
  955. import ToolBar from "@/components/toolbar/index";
  956. import CollectionBox from "@/components/common/CollectionBox.vue";
  957. import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
  958. import { mapMutations } from "vuex";
  959. export default {
  960. name: "BankExplain",
  961. components: {
  962. Footer,
  963. Header,
  964. ToolBar,
  965. CollectionBox,
  966. HeaderTabBox
  967. },
  968. data() {
  969. return {
  970. recordId: 0,
  971. questionIndex: 0,
  972. checked: false,
  973. activeName: "1",
  974. questionList: [],
  975. bankList: [],
  976. judge: ["正确", "错误"],
  977. ast: [
  978. "A",
  979. "B",
  980. "C",
  981. "D",
  982. "E",
  983. "F",
  984. "G",
  985. "H",
  986. "I",
  987. "J",
  988. "K",
  989. "L",
  990. "M",
  991. "N",
  992. "O",
  993. "P",
  994. "Q",
  995. "R",
  996. "S",
  997. "T",
  998. "U",
  999. "V",
  1000. "W",
  1001. "X",
  1002. "Y",
  1003. "Z",
  1004. ],
  1005. lastTime: 0, //剩余考试时长
  1006. allTimes: 0, //总考试时长
  1007. lastCount: 0,
  1008. examId: 0,
  1009. goodsId: 0,
  1010. moduleId: 0,
  1011. chapterId: 0,
  1012. loading: false,
  1013. current: 0,
  1014. examData: {},
  1015. orderGoodsId: "",
  1016. collectList: [],
  1017. isSubmit: false,
  1018. postTimer: null,
  1019. };
  1020. },
  1021. beforeDestroy() {
  1022. clearInterval(this.postTimer);
  1023. },
  1024. beforeRouteLeave(to, from, next) {
  1025. if (this.isSubmit) {
  1026. //交卷
  1027. next();
  1028. return;
  1029. }
  1030. let ansCount = this.questionOverNum(true); //已答题数
  1031. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1032. //所有题目答完
  1033. if (this.lastCount == 0) {
  1034. // this.testOver = true;
  1035. this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
  1036. confirmButtonText: "结束做题",
  1037. cancelButtonText: "下次继续",
  1038. type: "warning",
  1039. })
  1040. .then(() => {
  1041. this.examSubmit();
  1042. })
  1043. .catch(() => {
  1044. this.examRecordEdit();
  1045. next();
  1046. });
  1047. //未答完
  1048. } else {
  1049. this.$confirm(
  1050. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1051. "温馨提示",
  1052. {
  1053. confirmButtonText: "继续作答",
  1054. cancelButtonText: "下次继续",
  1055. type: "warning",
  1056. }
  1057. )
  1058. .then(() => {
  1059. // confirmButton回调
  1060. })
  1061. .catch(() => {
  1062. this.examRecordEdit();
  1063. next();
  1064. });
  1065. // this.isLastCount = true;
  1066. }
  1067. },
  1068. async mounted() {
  1069. this.goodsId = this.$route.params.goodsId;
  1070. this.examId = this.$route.query.examId;
  1071. this.moduleId = this.$route.query.moduleId;
  1072. this.chapterId = this.$route.query.chapterId;
  1073. this.recordId = this.$route.query.recordId;
  1074. this.orderGoodsId = this.$route.query.orderGoodsId || "";
  1075. this.goodsQuestionList();
  1076. },
  1077. methods: {
  1078. ...mapMutations(["setExamResult"]),
  1079. toFixed(num) {
  1080. if (num) {
  1081. let str = String(num).indexOf(".");
  1082. if (str != -1) {
  1083. return +num.toFixed(2);
  1084. } else {
  1085. return num;
  1086. }
  1087. } else {
  1088. return 0;
  1089. }
  1090. },
  1091. /**
  1092. * 是否做完所有题目
  1093. */
  1094. isDoOver() {
  1095. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1096. if (this.questionList.length == questionOverNum) {
  1097. //全部做完弹窗
  1098. this.$nextTick(() => {
  1099. this.$confirm("您已完成所有题目,快去交卷吧!", "提示", {
  1100. confirmButtonText: "立即交卷",
  1101. cancelButtonText: "暂不交卷",
  1102. type: "warning",
  1103. })
  1104. .then(() => {
  1105. this.examSubmit();
  1106. })
  1107. .catch(() => {});
  1108. });
  1109. }
  1110. },
  1111. /**
  1112. * 请求题目列表
  1113. */
  1114. goodsQuestionList() {
  1115. console.log("继续做题");
  1116. this.$request.examReport(this.recordId).then((res) => {
  1117. let json = JSON.parse(res.data.historyExamJson);
  1118. this.examData = res.data;
  1119. this.questionList = json;
  1120. this.getCollectInfo(this.current);
  1121. //5秒保存一下做题记录
  1122. clearInterval(this.postTimer);
  1123. this.postTimer = setInterval(() => {
  1124. this.examRecordEdit();
  1125. }, 5000);
  1126. });
  1127. },
  1128. /**
  1129. * @param {Object}
  1130. * 单选点击确认
  1131. */
  1132. radioSelect(question, questionIndex, optionsId) {
  1133. if (this.questionList[questionIndex].ques) return;
  1134. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1135. this.isDoOver();
  1136. },
  1137. /**
  1138. * @param {Object}
  1139. * 案例单选点击
  1140. */
  1141. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1142. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1143. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1144. this.isDoOver();
  1145. },
  1146. /**
  1147. * 多选点击确认
  1148. */
  1149. checkboxSubmit(question, questionIndex) {
  1150. if (this.questionList[questionIndex].ques) return;
  1151. let arr = [];
  1152. this.questionList[questionIndex].jsonStr.forEach((item) => {
  1153. if (item.checked) {
  1154. arr.push(item.optionsId);
  1155. }
  1156. });
  1157. if (!arr.length) {
  1158. this.$message({
  1159. type: "warning",
  1160. message: "请选择答案",
  1161. });
  1162. return;
  1163. }
  1164. this.$set(this.questionList[questionIndex], "ques", arr);
  1165. this.isDoOver();
  1166. },
  1167. /**
  1168. * @param {Object}
  1169. * 案例多选确认
  1170. */
  1171. checkboxSubmitChild(questionIndex, ansIndex) {
  1172. if (this.questionList[questionIndex].ques[ansIndex]) return;
  1173. let arr = [];
  1174. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1175. (item) => {
  1176. if (item.checked) {
  1177. arr.push(item.optionsId);
  1178. }
  1179. }
  1180. );
  1181. if (!arr.length) {
  1182. this.$message({
  1183. type: "warning",
  1184. message: "请选择答案",
  1185. });
  1186. return;
  1187. }
  1188. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1189. this.isDoOver();
  1190. },
  1191. /**
  1192. * 判断点击确认
  1193. */
  1194. judgeSelect(question, questionIndex, index) {
  1195. if (question.ques) return;
  1196. this.$set(
  1197. this.questionList[questionIndex],
  1198. "ques",
  1199. index == 0 ? "1" : "0"
  1200. );
  1201. this.isDoOver();
  1202. },
  1203. judgeSelectChild(questionIndex, jsonIndex, index) {
  1204. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  1205. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1206. this.$set(
  1207. this.questionList[questionIndex].ques,
  1208. jsonIndex,
  1209. index == 0 ? "1" : "0"
  1210. );
  1211. this.isDoOver();
  1212. },
  1213. /**
  1214. * 上传图片
  1215. */
  1216. uploadImg(e, question, questionIndex) {
  1217. var file = e.target.files[0];
  1218. if (file.size > 2 * 1024 * 1024) {
  1219. this.$message.warn("图片不得大于2000kb");
  1220. return;
  1221. }
  1222. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1223. if (
  1224. type[0] != "jpg" &&
  1225. type[0] != "png" &&
  1226. type[0] != "jpeg" &&
  1227. type[0] != "gif"
  1228. ) {
  1229. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1230. e.target.value = "";
  1231. return;
  1232. }
  1233. this.$upload.upload(file, 0).then((res) => {
  1234. question.ansText.imageList.push(res);
  1235. });
  1236. },
  1237. /**
  1238. * 案例上传图片
  1239. */
  1240. uploadImgChild(e, questionIndex, jsonIndex) {
  1241. var file = e.target.files[0];
  1242. if (file.size > 2 * 1024 * 1024) {
  1243. this.$message.warn("图片不得大于2000kb");
  1244. return;
  1245. }
  1246. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1247. if (
  1248. type[0] != "jpg" &&
  1249. type[0] != "png" &&
  1250. type[0] != "jpeg" &&
  1251. type[0] != "gif"
  1252. ) {
  1253. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1254. e.target.value = "";
  1255. return;
  1256. }
  1257. this.$upload.upload(file, 0).then((res) => {
  1258. this.questionList[questionIndex].jsonStr[
  1259. jsonIndex
  1260. ].ansText.imageList.push(res);
  1261. });
  1262. },
  1263. /**
  1264. * @param {Object} current
  1265. * 获取收藏信息
  1266. */
  1267. getCollectInfo(current) {
  1268. this.$request
  1269. .getCollectInfo({
  1270. examId: this.examId,
  1271. questionId: this.questionList[current].questionId,
  1272. goodsId: this.goodsId,
  1273. orderGoodsId: this.orderGoodsId,
  1274. doMode: 1
  1275. })
  1276. .then((res) => {
  1277. this.$set(this.collectList, current, res.data);
  1278. })
  1279. .catch((err) => {
  1280. this.$set(this.collectList, current, false);
  1281. });
  1282. },
  1283. isOver(item, index) {
  1284. if (this.questionList[index].ques) {
  1285. if (item.type == 4) {
  1286. //案例题
  1287. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1288. if (
  1289. jsonItem.type == 1 ||
  1290. jsonItem.type == 2 ||
  1291. jsonItem.type == 3
  1292. ) {
  1293. if (item.ques[indexs]) {
  1294. return true;
  1295. } else {
  1296. return false;
  1297. }
  1298. } else if (jsonItem.type == 5) {
  1299. if (
  1300. item.ques[indexs] &&
  1301. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1302. ) {
  1303. console.log("chil");
  1304. return true;
  1305. } else {
  1306. return false;
  1307. }
  1308. }
  1309. });
  1310. if (isOver) {
  1311. return true;
  1312. } else {
  1313. return false;
  1314. }
  1315. } else if (item.type == 5) {
  1316. //简答题
  1317. //每一项都相等
  1318. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1319. return true;
  1320. }
  1321. //判断
  1322. } else {
  1323. return false;
  1324. }
  1325. } else {
  1326. return false;
  1327. }
  1328. },
  1329. ansSubmit(question, questionIndex) {
  1330. if (!question.ansText.text && !question.ansText.imageList.length) {
  1331. this.$message({
  1332. type: "warning",
  1333. message: "请输入内容或上传图片",
  1334. });
  1335. return;
  1336. }
  1337. question.ques.imageList = question.ansText.imageList;
  1338. question.ques.text = question.ansText.text;
  1339. this.isDoOver();
  1340. console.log(question.ques);
  1341. },
  1342. ansSubmitChild(question, questionIndex, jsonIndex) {
  1343. if (
  1344. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1345. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1346. .length
  1347. ) {
  1348. this.$message({
  1349. type: "warning",
  1350. message: "请输入内容或上传图片",
  1351. });
  1352. return;
  1353. }
  1354. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1355. imageList:
  1356. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1357. .imageList || [],
  1358. text:
  1359. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  1360. "",
  1361. });
  1362. this.isDoOver();
  1363. },
  1364. changeIndex(index) {
  1365. this.current = index;
  1366. this.getCollectInfo(this.current);
  1367. },
  1368. nextQuestion() {
  1369. if (this.current >= this.questionList.length - 1) {
  1370. this.$message({
  1371. type: "warning",
  1372. message: "已经是最后一题了!",
  1373. });
  1374. return;
  1375. }
  1376. this.current++;
  1377. this.getCollectInfo(this.current);
  1378. },
  1379. prevQuestion() {
  1380. if (this.current == 0) {
  1381. this.$message({
  1382. type: "warning",
  1383. message: "已经是第一题了!",
  1384. });
  1385. return;
  1386. } else {
  1387. this.current--;
  1388. this.getCollectInfo(this.current);
  1389. }
  1390. },
  1391. isRight(item, index) {
  1392. //单选
  1393. if (this.questionList[index].ques) {
  1394. if (item.type == 1) {
  1395. console.log(
  1396. this.questionList[index].ques == this.questionList[index].ans
  1397. );
  1398. return this.questionList[index].ques == this.questionList[index].ans;
  1399. //多选
  1400. } else if (item.type == 2) {
  1401. //每一项都相等
  1402. return this.questionList[index].ans.every((item, i) => {
  1403. return item == this.questionList[index].ques[i];
  1404. });
  1405. //判断
  1406. } else if (item.type == 3) {
  1407. return this.questionList[index].ques == this.questionList[index].ans;
  1408. } else {
  1409. return false;
  1410. }
  1411. } else {
  1412. return false;
  1413. }
  1414. },
  1415. isWrong(item, index) {
  1416. if (this.questionList[index].ques) {
  1417. //单选
  1418. if (item.type == 1) {
  1419. return this.questionList[index].ques != this.questionList[index].ans;
  1420. //多选
  1421. } else if (item.type == 2) {
  1422. //每一项都相等
  1423. return this.questionList[index].ques.some((item, i) => {
  1424. return this.questionList[index].ans.indexOf(item) == -1;
  1425. });
  1426. //判断
  1427. } else if (item.type == 3) {
  1428. return this.questionList[index].ques != this.questionList[index].ans;
  1429. } else {
  1430. return false;
  1431. }
  1432. } else {
  1433. return false;
  1434. }
  1435. },
  1436. isPart(item, index) {
  1437. if (this.questionList[index].ques) {
  1438. if (item.type == 2) {
  1439. let isWrong = this.questionList[index].ques.some((item, i) => {
  1440. return this.questionList[index].ans.indexOf(item) == -1;
  1441. });
  1442. let isRight = this.questionList[index].ans.every((item, i) => {
  1443. return item == this.questionList[index].ques[i];
  1444. });
  1445. if (!isRight && !isWrong) {
  1446. return true;
  1447. }
  1448. }
  1449. } else {
  1450. return false;
  1451. }
  1452. },
  1453. right(bankIndex, ansIndex, option) {
  1454. if (
  1455. this.questionList[bankIndex].ques[ansIndex] &&
  1456. this.questionList[bankIndex].ans[ansIndex]
  1457. ) {
  1458. if (
  1459. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1460. option.optionsId
  1461. ) != -1 ||
  1462. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1463. option.optionsId
  1464. ) != -1
  1465. ) {
  1466. return true;
  1467. } else {
  1468. return false;
  1469. }
  1470. } else {
  1471. return false;
  1472. }
  1473. },
  1474. wrong(bankIndex, ansIndex, option) {
  1475. if (
  1476. this.questionList[bankIndex].ques[ansIndex] &&
  1477. this.questionList[bankIndex].ans[ansIndex]
  1478. ) {
  1479. if (
  1480. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1481. option.optionsId
  1482. ) != -1 &&
  1483. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1484. option.optionsId
  1485. ) == -1
  1486. ) {
  1487. return true;
  1488. } else {
  1489. return false;
  1490. }
  1491. } else {
  1492. return false;
  1493. }
  1494. },
  1495. /**
  1496. * 获取已经回答的题目数
  1497. * hasSpecail (是否包含简答和案例)
  1498. */
  1499. questionOverNum(hasSpecail) {
  1500. let count = 0;
  1501. this.questionList.forEach((item) => {
  1502. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1503. if (item.ques) {
  1504. count++;
  1505. }
  1506. } else if (item.type == 4) {
  1507. //案例题
  1508. if (hasSpecail) {
  1509. let isOver = item.jsonStr.every((jsonItem, index) => {
  1510. if (
  1511. jsonItem.type == 1 ||
  1512. jsonItem.type == 2 ||
  1513. jsonItem.type == 3
  1514. ) {
  1515. if (item.ques[index]) {
  1516. return true;
  1517. } else {
  1518. return false;
  1519. }
  1520. } else if (jsonItem.type == 5) {
  1521. if (
  1522. item.ques[index] &&
  1523. (item.ques[index].text || item.ques[index].imageList.length)
  1524. ) {
  1525. return true;
  1526. } else {
  1527. return false;
  1528. }
  1529. }
  1530. });
  1531. if (isOver) {
  1532. count++;
  1533. console.log(item, 444);
  1534. }
  1535. }
  1536. } else if (item.type == 5) {
  1537. //简答题
  1538. if (hasSpecail) {
  1539. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1540. console.log(5, item);
  1541. count++;
  1542. }
  1543. }
  1544. }
  1545. });
  1546. return count;
  1547. },
  1548. collect(state, index) {
  1549. if (!state) {
  1550. this.$request
  1551. .collectQuestion({
  1552. examId: this.examId,
  1553. questionId: this.questionList[index].questionId,
  1554. goodsId: this.goodsId || "",
  1555. orderGoodsId: this.orderGoodsId,
  1556. doMode:1
  1557. })
  1558. .then((res) => {
  1559. this.$set(this.collectList, index, true);
  1560. this.$message.success("收藏成功");
  1561. this.getCollectInfo(index);
  1562. });
  1563. } else {
  1564. this.$request
  1565. .deleteCollectQuestion(this.collectList[index].collectQuestionId)
  1566. .then((res) => {
  1567. this.$set(this.collectList, index, false);
  1568. this.$message.success("取消收藏成功");
  1569. });
  1570. }
  1571. return;
  1572. },
  1573. submit() {
  1574. let ansCount = this.questionOverNum(true); //已答题数
  1575. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1576. //没有答完
  1577. if (this.lastCount !== 0) {
  1578. this.$confirm(
  1579. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1580. "提示",
  1581. {
  1582. confirmButtonText: "立即交卷",
  1583. cancelButtonText: "继续做题",
  1584. closeOnClickModal: false,
  1585. closeOnPressEscape: false,
  1586. distinguishCancelAndClose: false,
  1587. showClose: false,
  1588. }
  1589. )
  1590. .then((_) => {
  1591. this.examSubmit();
  1592. })
  1593. .catch((_) => {});
  1594. return;
  1595. }
  1596. this.examSubmit();
  1597. },
  1598. examSubmit() {
  1599. clearInterval(this.postTimer);
  1600. this.loading = true;
  1601. let score = 0; //计算总分
  1602. let reportStatus = 0;
  1603. let number = 0; //做对的题目数量
  1604. let doQuestionNum = 0; //做过的题目数量
  1605. let allScore = 0; //总分
  1606. let passScore = 0;
  1607. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1608. let doQuestionIds = []; //做过的题目id
  1609. let rightQuestionIds = []; //做对的题目id
  1610. let lessQuestionNum = 0;
  1611. this.questionList.forEach((item, index) => {
  1612. passScore = item.passScore;
  1613. if (item.type == 1) {
  1614. //正确
  1615. if (item.ques == item.ans) {
  1616. item.scoreResult = item.score;
  1617. score += item.score;
  1618. number++;
  1619. rightQuestionIds.push(item.questionId);
  1620. } else {
  1621. //错误
  1622. item.scoreResult = 0;
  1623. if (item.ques) {
  1624. doWrongQuestionIds.push(item.questionId);
  1625. }
  1626. }
  1627. allScore += item.score;
  1628. if (item.ques) {
  1629. console.log(doQuestionNum, "单选");
  1630. doQuestionNum++;
  1631. doQuestionIds.push(item.questionId);
  1632. }
  1633. } else if (item.type == 2) {
  1634. let isRight =
  1635. item.ans &&
  1636. item.ans.every((quesItem, quesIndex) => {
  1637. if (item.ques) {
  1638. return item.ques[quesIndex] == item.ans[quesIndex];
  1639. } else {
  1640. return false;
  1641. }
  1642. });
  1643. if (isRight) {
  1644. score += item.score;
  1645. number++;
  1646. item.scoreResult = item.score;
  1647. rightQuestionIds.push(item.questionId);
  1648. } else {
  1649. let hasPart = false;
  1650. let checkboxScore = 1; //获取单题总分数
  1651. item.ques &&
  1652. item.ques.forEach((ques, quesIndex) => {
  1653. //选错一个全扣
  1654. if (item.ques) {
  1655. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1656. checkboxScore = 0;
  1657. }
  1658. } else {
  1659. checkboxScore = 0;
  1660. }
  1661. });
  1662. console.log(checkboxScore);
  1663. //没选错
  1664. if (checkboxScore) {
  1665. checkboxScore = 0;
  1666. item.ans.forEach((ans, quesIndex) => {
  1667. //漏选扣一部分,对n题给n X partScore 分
  1668. if (item.ques) {
  1669. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1670. checkboxScore += item.partScore;
  1671. hasPart = true;
  1672. }
  1673. } else {
  1674. checkboxScore = 0;
  1675. }
  1676. });
  1677. }
  1678. if (!hasPart) {
  1679. //0分
  1680. item.scoreResult = 0;
  1681. if (item.ques) {
  1682. doWrongQuestionIds.push(item.questionId);
  1683. }
  1684. } else {
  1685. //部分分
  1686. // number++;
  1687. lessQuestionNum++;
  1688. // doWrongQuestionIds.push(item.questionId);
  1689. item.scoreResult = checkboxScore;
  1690. score += checkboxScore;
  1691. // rightQuestionIds.push(item.questionId)
  1692. }
  1693. }
  1694. allScore += item.score;
  1695. if (item.ques && item.ques.length) {
  1696. console.log(doQuestionNum, "多选");
  1697. doQuestionNum++;
  1698. doQuestionIds.push(item.questionId);
  1699. }
  1700. } else if (item.type == 3) {
  1701. if (item.ques == item.ans) {
  1702. item.scoreResult = item.score;
  1703. score += item.score;
  1704. number++;
  1705. rightQuestionIds.push(item.questionId);
  1706. } else {
  1707. item.scoreResult = 0;
  1708. if (item.ques) {
  1709. doWrongQuestionIds.push(item.questionId);
  1710. }
  1711. }
  1712. allScore += item.score;
  1713. if (item.ques) {
  1714. console.log(doQuestionNum, "判断");
  1715. doQuestionNum++;
  1716. doQuestionIds.push(item.questionId);
  1717. }
  1718. } else if (item.type == 4) {
  1719. allScore += item.score;
  1720. if (item.ques && item.ques.length) {
  1721. console.log(doQuestionNum, "案例");
  1722. doQuestionNum++;
  1723. doQuestionIds.push(item.questionId);
  1724. }
  1725. } else if (item.type == 5) {
  1726. allScore += item.score;
  1727. if (
  1728. item.ques &&
  1729. (item.ques.imageList.length || item.ques.text.length)
  1730. ) {
  1731. console.log(doQuestionNum, "简答");
  1732. doQuestionNum++;
  1733. doQuestionIds.push(item.questionId);
  1734. }
  1735. }
  1736. });
  1737. //大于分及格
  1738. if (score >= passScore) {
  1739. reportStatus = 1;
  1740. } else {
  1741. reportStatus = 0;
  1742. }
  1743. //交卷
  1744. this.$request
  1745. .examRecordEdit({
  1746. orderGoodsId: this.orderGoodsId,
  1747. examId: this.examId,
  1748. goodsId: this.goodsId,
  1749. reportStatus: reportStatus,
  1750. totalScore: allScore,
  1751. recordId: this.recordId,
  1752. lessQuestionNum: lessQuestionNum,
  1753. rightQuestionNum: number,
  1754. status: 1,
  1755. moduleExamId: this.moduleId || 0,
  1756. chapterExamId: this.chapterId || 0,
  1757. doQuestionIds: doQuestionIds.join(","),
  1758. rightQuestionIds: rightQuestionIds.join(","),
  1759. doQuestionNum: doQuestionNum,
  1760. performance: score,
  1761. historyExamJson: JSON.stringify(this.questionList),
  1762. })
  1763. .then((res) => {
  1764. this.isSubmit = true;
  1765. this.loading = false;
  1766. this.$message({
  1767. type: "success",
  1768. message: "交卷成功",
  1769. });
  1770. setTimeout(() => {
  1771. let result = {
  1772. orderGoodsId: this.orderGoodsId,
  1773. chapterId: this.chapterId,
  1774. moduleId: this.moduleId,
  1775. examId: this.examId,
  1776. recordId: this.recordId,
  1777. };
  1778. console.log(result);
  1779. this.setExamResult(result);
  1780. this.$router.replace({
  1781. path: "/bank-report/" + this.goodsId,
  1782. query: {
  1783. orderGoodsId: this.orderGoodsId,
  1784. chapterId: this.chapterId,
  1785. moduleId: this.moduleId,
  1786. examId: this.examId,
  1787. recordId: this.recordId,
  1788. },
  1789. });
  1790. }, 1000);
  1791. })
  1792. .catch((err) => {
  1793. this.loading = false;
  1794. console.log(err, "err");
  1795. });
  1796. //错题集id提交(客观题)
  1797. this.$request
  1798. .examWrongRecord({
  1799. orderGoodsId: this.orderGoodsId,
  1800. examId: this.examId,
  1801. goodsId: this.goodsId,
  1802. questionIds: doWrongQuestionIds,
  1803. recordId: this.recordId,
  1804. type: 1,
  1805. doMode: this.doMode
  1806. })
  1807. .then((res) => {})
  1808. .catch((err) => {});
  1809. },
  1810. /**
  1811. * 离开页面统计回答正确题数
  1812. */
  1813. examRecordEdit() {
  1814. let number = 0;
  1815. let score = 0;
  1816. let doQuestionNum = 0;
  1817. let doQuestionIds = []; //做过的题目id
  1818. let lessQuestionNum = 0;
  1819. this.questionList.forEach((item, index) => {
  1820. if (item.type == 1) {
  1821. if (item.ques == item.ans) {
  1822. score += item.score;
  1823. number++;
  1824. }
  1825. if (item.ques) {
  1826. doQuestionNum++;
  1827. doQuestionIds.push(item.questionId);
  1828. }
  1829. } else if (item.type == 2) {
  1830. let isRight =
  1831. item.ans &&
  1832. item.ans.every((quesItem, quesIndex) => {
  1833. if (item.ques) {
  1834. return item.ques[quesIndex] == item.ans[quesIndex];
  1835. } else {
  1836. return false;
  1837. }
  1838. });
  1839. if (isRight) {
  1840. score += item.score;
  1841. number++;
  1842. } else {
  1843. let hasPart = false;
  1844. let checkboxScore = 1; //获取单题总分数
  1845. item.ques &&
  1846. item.ques.forEach((ques, quesIndex) => {
  1847. //选错一个全扣
  1848. if (item.ques) {
  1849. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1850. checkboxScore = 0;
  1851. }
  1852. } else {
  1853. checkboxScore = 0;
  1854. }
  1855. });
  1856. console.log(checkboxScore);
  1857. //没选错
  1858. if (checkboxScore) {
  1859. checkboxScore = 0;
  1860. item.ans.forEach((ans, quesIndex) => {
  1861. //漏选扣一部分,对n题给n X partScore 分
  1862. if (item.ques) {
  1863. if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
  1864. checkboxScore += item.partScore;
  1865. hasPart = true;
  1866. }
  1867. } else {
  1868. checkboxScore = 0;
  1869. }
  1870. });
  1871. }
  1872. if (!hasPart) {
  1873. //0分
  1874. } else {
  1875. //部分分
  1876. // number++;
  1877. lessQuestionNum++;
  1878. score += checkboxScore;
  1879. }
  1880. }
  1881. if (item.ques && item.ques.length) {
  1882. doQuestionNum++;
  1883. doQuestionIds.push(item.questionId);
  1884. }
  1885. } else if (item.type == 3) {
  1886. if (item.ques == item.ans) {
  1887. score += item.score;
  1888. number++;
  1889. }
  1890. if (item.ques) {
  1891. doQuestionNum++;
  1892. doQuestionIds.push(item.questionId);
  1893. }
  1894. } else if (item == 4) {
  1895. if (item.ques.length) {
  1896. doQuestionNum++;
  1897. doQuestionIds.push(item.questionId);
  1898. }
  1899. } else if (item.type == 5) {
  1900. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1901. doQuestionNum++;
  1902. doQuestionIds.push(item.questionId);
  1903. }
  1904. }
  1905. });
  1906. this.$request
  1907. .examRecordEdit({
  1908. examId: this.examId,
  1909. goodsId: this.goodsId,
  1910. recordId: this.recordId,
  1911. orderGoodsId: this.orderGoodsId,
  1912. doQuestionIds: doQuestionIds.join(","),
  1913. rightQuestionNum: number,
  1914. lessQuestionNum: lessQuestionNum,
  1915. moduleExamId: this.moduleId || 0,
  1916. chapterExamId: this.chapterId || 0,
  1917. status: 0,
  1918. doQuestionNum: doQuestionNum,
  1919. historyExamJson: JSON.stringify(this.questionList),
  1920. })
  1921. .then((res) => {});
  1922. },
  1923. },
  1924. computed: {
  1925. param() {
  1926. return {
  1927. examId: this.examId,
  1928. questionId: this.questionList[this.current]
  1929. ? this.questionList[this.current].questionId
  1930. : undefined,
  1931. goodsId: this.goodsId,
  1932. orderGoodsId: this.orderGoodsId,
  1933. collectQuestionId: this.collectList[this.current]
  1934. ? this.collectList[this.current].collectQuestionId
  1935. : undefined,
  1936. };
  1937. },
  1938. },
  1939. };
  1940. </script>
  1941. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1942. <style scoped lang="scss">
  1943. .course-exam {
  1944. .section {
  1945. overflow: hidden;
  1946. &__header {
  1947. height: 20px;
  1948. margin-top: 20px;
  1949. }
  1950. &__body {
  1951. .explain-record {
  1952. &__header {
  1953. }
  1954. &__body {
  1955. margin-bottom: 20px;
  1956. border: 1px solid #eee;
  1957. .left-box {
  1958. position: relative;
  1959. float: left;
  1960. width: 970px;
  1961. min-height: 630px;
  1962. border: 1px solid #eee;
  1963. &__body {
  1964. .question {
  1965. padding: 12px 0 0 12px;
  1966. display: flex;
  1967. flex-direction: column;
  1968. height: 100%;
  1969. &__title {
  1970. padding-left: 12px;
  1971. font-size: 16px;
  1972. font-family: Microsoft YaHei;
  1973. font-weight: bold;
  1974. color: #333333;
  1975. line-height: 24px;
  1976. }
  1977. &__desc {
  1978. padding-left: 12px;
  1979. margin-top: 20px;
  1980. font-size: 16px;
  1981. font-family: Microsoft YaHei;
  1982. font-weight: 400;
  1983. color: #666666;
  1984. line-height: 24px;
  1985. /deep/ img {
  1986. max-width: 100% !important;
  1987. }
  1988. }
  1989. &__content {
  1990. /deep/ .el-tabs__item {
  1991. height: 40px;
  1992. line-height: 40px;
  1993. }
  1994. .question__content {
  1995. height: auto;
  1996. overflow: auto;
  1997. }
  1998. .question-list {
  1999. padding: 24px 0 24px 24px;
  2000. border-bottom: 1px solid #eee;
  2001. .checkbox,
  2002. .radio {
  2003. cursor: pointer;
  2004. margin-right: 24px;
  2005. padding: 0 24px;
  2006. display: flex;
  2007. align-items: center;
  2008. margin-top: 2px;
  2009. min-height: 40px;
  2010. padding-top: 10px;
  2011. padding-bottom: 10px;
  2012. background: #f5f9ff;
  2013. border-radius: 8px;
  2014. box-sizing: border-box;
  2015. &.right {
  2016. background: #37c65b;
  2017. }
  2018. &.wrong {
  2019. background: #ff3a30;
  2020. }
  2021. }
  2022. &.textarea {
  2023. margin-right: 12px;
  2024. .upload {
  2025. margin-top: 10px;
  2026. &__imgs {
  2027. margin-right: 10px;
  2028. width: 80px;
  2029. height: 80px;
  2030. background: #ffffff;
  2031. border: 1px solid #eeeeee;
  2032. border-radius: 4px;
  2033. position: relative;
  2034. display: flex;
  2035. float: left;
  2036. align-items: center;
  2037. justify-content: center;
  2038. img {
  2039. max-width: 100%;
  2040. max-height: 100%;
  2041. }
  2042. }
  2043. &__btn {
  2044. margin-right: 10px;
  2045. width: 80px;
  2046. height: 80px;
  2047. background: #ffffff;
  2048. border: 1px solid #eeeeee;
  2049. border-radius: 4px;
  2050. position: relative;
  2051. display: flex;
  2052. float: left;
  2053. align-items: center;
  2054. justify-content: center;
  2055. flex-direction: column;
  2056. .icon {
  2057. font-size: 20px;
  2058. color: #3f8dfd;
  2059. }
  2060. p {
  2061. font-size: 12px;
  2062. font-family: Microsoft YaHei;
  2063. font-weight: 400;
  2064. color: #999999;
  2065. line-height: 24px;
  2066. }
  2067. input {
  2068. position: absolute;
  2069. left: 0;
  2070. top: 0;
  2071. display: block;
  2072. width: 100%;
  2073. height: 100%;
  2074. opacity: 0;
  2075. }
  2076. }
  2077. }
  2078. }
  2079. /deep/
  2080. .el-checkbox__input.is-checked
  2081. + .el-checkbox__label {
  2082. color: #000 !important;
  2083. }
  2084. /deep/
  2085. .el-checkbox__input.is-disabled
  2086. + span.el-checkbox__label {
  2087. color: #000;
  2088. }
  2089. /deep/ .el-checkbox {
  2090. white-space: normal;
  2091. }
  2092. }
  2093. .answer-list {
  2094. height: 40px;
  2095. // border-top: 1px solid #eee;
  2096. border-bottom: 1px solid #eee;
  2097. // margin-top: 24px;
  2098. display: flex;
  2099. align-items: center;
  2100. justify-content: space-between;
  2101. padding: 0 24px;
  2102. &__left {
  2103. font-size: 16px;
  2104. font-family: Microsoft YaHei;
  2105. font-weight: 400;
  2106. color: #333333;
  2107. line-height: 24px;
  2108. }
  2109. &__right {
  2110. font-size: 16px;
  2111. font-family: Microsoft YaHei;
  2112. font-weight: 400;
  2113. color: #333333;
  2114. line-height: 24px;
  2115. }
  2116. }
  2117. .explain-list {
  2118. padding: 12px 24px;
  2119. &__header {
  2120. font-size: 16px;
  2121. font-family: Microsoft YaHei;
  2122. font-weight: bold;
  2123. color: #666666;
  2124. line-height: 24px;
  2125. }
  2126. &__body {
  2127. margin-top: 12px;
  2128. font-size: 16px;
  2129. font-family: Microsoft YaHei;
  2130. font-weight: 400;
  2131. color: #666666;
  2132. line-height: 24px;
  2133. }
  2134. .upload {
  2135. margin-top: 10px;
  2136. &__imgs {
  2137. margin-right: 10px;
  2138. width: 80px;
  2139. height: 80px;
  2140. background: #ffffff;
  2141. border: 1px solid #eeeeee;
  2142. border-radius: 4px;
  2143. position: relative;
  2144. display: flex;
  2145. float: left;
  2146. align-items: center;
  2147. justify-content: center;
  2148. img {
  2149. max-width: 100%;
  2150. max-height: 100%;
  2151. }
  2152. }
  2153. }
  2154. }
  2155. .question {
  2156. padding-bottom: 58px;
  2157. }
  2158. }
  2159. &__btns {
  2160. position: relative;
  2161. height: 32px;
  2162. .submit {
  2163. cursor: pointer;
  2164. margin: 0 auto;
  2165. width: 140px;
  2166. height: 32px;
  2167. color: #fff;
  2168. background: #3f8dfd;
  2169. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2170. border-radius: 16px;
  2171. text-align: center;
  2172. line-height: 32px;
  2173. font-size: 16px;
  2174. }
  2175. .collect {
  2176. width: 100px;
  2177. cursor: pointer;
  2178. position: absolute;
  2179. right: 0;
  2180. top: 5px;
  2181. font-size: 12px;
  2182. font-family: Microsoft YaHei;
  2183. font-weight: 400;
  2184. color: #3f8dfd;
  2185. line-height: 24px;
  2186. i {
  2187. font-size: 20px;
  2188. }
  2189. }
  2190. }
  2191. }
  2192. }
  2193. &__footer {
  2194. height: 40px;
  2195. display: flex;
  2196. justify-content: space-around;
  2197. align-items: center;
  2198. .btn {
  2199. cursor: pointer;
  2200. width: 140px;
  2201. height: 32px;
  2202. background: #ffffff;
  2203. border: 1px solid #3f8dfd;
  2204. border-radius: 16px;
  2205. line-height: 32px;
  2206. text-align: center;
  2207. color: #3f8dfd;
  2208. }
  2209. }
  2210. }
  2211. .right-box {
  2212. float: right;
  2213. width: 299px;
  2214. border-right: 1px solid #eee;
  2215. &__header {
  2216. height: 40px;
  2217. line-height: 40px;
  2218. font-size: 16px;
  2219. font-family: Microsoft YaHei;
  2220. font-weight: bold;
  2221. color: #333333;
  2222. text-align: center;
  2223. border-bottom: 1px solid #eeeeee;
  2224. .back-btn {
  2225. display: block;
  2226. margin: 0 auto;
  2227. width: 160px;
  2228. }
  2229. }
  2230. &__body {
  2231. height: 510px;
  2232. border-bottom: 1px solid #eee;
  2233. .card {
  2234. &__note {
  2235. display: flex;
  2236. height: 64px;
  2237. align-items: center;
  2238. border-bottom: 1px solid #eee;
  2239. flex-wrap: wrap;
  2240. .item {
  2241. display: flex;
  2242. align-items: center;
  2243. margin-left: 10px;
  2244. width: 84px;
  2245. font-size: 12px;
  2246. .box {
  2247. margin-right: 5px;
  2248. width: 16px;
  2249. height: 16px;
  2250. border-radius: 4px;
  2251. &.white {
  2252. background: #ffffff;
  2253. border: 1px solid #eeeeee;
  2254. }
  2255. &.green {
  2256. background: #37c65b;
  2257. }
  2258. &.red {
  2259. background: #ff3a30;
  2260. }
  2261. &.yellow {
  2262. background: #ffc53d;
  2263. }
  2264. &.blue {
  2265. background: #3f8dfd;
  2266. }
  2267. }
  2268. }
  2269. }
  2270. &__content {
  2271. height: 440px;
  2272. overflow-y: scroll;
  2273. &::-webkit-scrollbar {
  2274. width: 6px;
  2275. }
  2276. &::-webkit-scrollbar-track {
  2277. background-color: #fff;
  2278. -webkit-border-radius: 2em;
  2279. -moz-border-radius: 2em;
  2280. border-radius: 2em;
  2281. }
  2282. &::-webkit-scrollbar-thumb {
  2283. background-color: #eeeeee;
  2284. -webkit-border-radius: 2em;
  2285. -moz-border-radius: 2em;
  2286. border-radius: 2em;
  2287. }
  2288. .list {
  2289. display: flex;
  2290. flex-wrap: wrap;
  2291. .item {
  2292. width: 40px;
  2293. height: 40px;
  2294. border-radius: 10px;
  2295. text-align: center;
  2296. line-height: 40px;
  2297. margin-left: 16px;
  2298. margin-top: 16px;
  2299. cursor: pointer;
  2300. &.white {
  2301. line-height: 38px;
  2302. color: #333333;
  2303. background: #ffffff;
  2304. border: 1px solid #eeeeee;
  2305. }
  2306. &.green {
  2307. color: #fff;
  2308. background: #37c65b;
  2309. }
  2310. &.red {
  2311. color: #fff;
  2312. background: #ff3a30;
  2313. }
  2314. &.blue {
  2315. border: 1rpx solid #eeeeee;
  2316. color: #fff;
  2317. background: #3f8dfd;
  2318. }
  2319. &.yellow {
  2320. background: #ffc53d;
  2321. }
  2322. &.disabled {
  2323. cursor: not-allowed;
  2324. line-height: 38px;
  2325. color: #eeeeee;
  2326. background: #ffffff;
  2327. border: 1px solid #eeeeee;
  2328. }
  2329. }
  2330. }
  2331. }
  2332. }
  2333. }
  2334. &__footer {
  2335. border-bottom: 1px solid #eee;
  2336. height: 40px;
  2337. display: flex;
  2338. align-items: center;
  2339. justify-content: center;
  2340. .submit {
  2341. cursor: pointer;
  2342. width: 140px;
  2343. height: 32px;
  2344. padding: 0;
  2345. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2346. border-radius: 16px;
  2347. line-height: 32px;
  2348. text-align: center;
  2349. font-size: 16px;
  2350. }
  2351. }
  2352. }
  2353. }
  2354. }
  2355. }
  2356. }
  2357. .take-photo {
  2358. /deep/ .el-dialog__header {
  2359. display: none;
  2360. }
  2361. /deep/ .el-dialog__body {
  2362. padding: 0;
  2363. overflow: unset;
  2364. }
  2365. &__close {
  2366. cursor: pointer;
  2367. position: absolute;
  2368. right: 0;
  2369. top: -28px;
  2370. width: 24px;
  2371. height: 24px;
  2372. line-height: 24px;
  2373. text-align: center;
  2374. color: #eee;
  2375. border: 1px solid #eee;
  2376. border-radius: 50%;
  2377. }
  2378. &__header {
  2379. height: 40px;
  2380. border-bottom: 1px solid #eee;
  2381. line-height: 40px;
  2382. font-size: 16px;
  2383. font-family: Microsoft YaHei;
  2384. font-weight: bold;
  2385. color: #333333;
  2386. padding-left: 24px;
  2387. }
  2388. &__body {
  2389. height: 400px;
  2390. padding: 40px 24px;
  2391. .left-box {
  2392. width: 336px;
  2393. float: left;
  2394. .title {
  2395. font-size: 16px;
  2396. font-family: Microsoft YaHei;
  2397. font-weight: bold;
  2398. color: #ff3b30;
  2399. line-height: 24px;
  2400. }
  2401. .content {
  2402. font-size: 14px;
  2403. font-family: Microsoft YaHei;
  2404. font-weight: 400;
  2405. color: #333333;
  2406. line-height: 28px;
  2407. margin-top: 32px;
  2408. }
  2409. }
  2410. .right-box {
  2411. float: right;
  2412. width: 400px;
  2413. height: 300px;
  2414. video {
  2415. width: 100%;
  2416. height: 100%;
  2417. }
  2418. }
  2419. }
  2420. &__footer {
  2421. height: 90px;
  2422. border-top: 1px solid #eee;
  2423. text-align: center;
  2424. .take {
  2425. display: inline-block;
  2426. width: 200px;
  2427. height: 40px;
  2428. padding: 0;
  2429. border-radius: 20px;
  2430. text-align: center;
  2431. line-height: 40px;
  2432. margin: 24px auto;
  2433. }
  2434. }
  2435. }
  2436. }
  2437. </style>