index.vue 86 KB

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