page.js 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340
  1. import React from 'react';
  2. import './index.less';
  3. import LineChart from '@src/components/LineChart';
  4. import BarChart from '@src/components/BarChart';
  5. import PieChart from '@src/components/PieChart';
  6. import Assets from '@src/components/Assets';
  7. import Page from '@src/containers/Page';
  8. import { formatDate, formatPercent, formatSeconds, formatMinute, formatSecond, getMap } from '@src/services/Tools';
  9. import { Icon, Tooltip } from 'antd';
  10. import { Question } from '../../../stores/question';
  11. import { Button } from '../../../components/Button';
  12. import Tabs from '../../../components/Tabs';
  13. import { Icon as GIcon } from '../../../components/Icon';
  14. import {
  15. QuestionDifficult,
  16. ExaminationQuestionType,
  17. ExaminationSubject,
  18. } from '../../../../Constant';
  19. const QuestionDifficultMap = getMap(QuestionDifficult, 'value', 'label');
  20. function BarOption3(titles, source, data1, data2, color1, color2) {
  21. return {
  22. title: [
  23. {
  24. text: titles[0],
  25. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  26. left: 100,
  27. top: 15,
  28. },
  29. {
  30. text: titles[1],
  31. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  32. left: 195,
  33. top: 15,
  34. },
  35. {
  36. text: titles[2],
  37. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  38. left: 695,
  39. top: 15,
  40. },
  41. ],
  42. grid: [{ width: 250, x: 200, bottom: 30 }, { width: 250, x: 700, bottom: 30 }],
  43. xAxis: [
  44. {
  45. gridIndex: 0,
  46. show: false,
  47. axisTick: { show: false },
  48. axisLine: { show: false },
  49. splitLine: { show: false },
  50. },
  51. {
  52. gridIndex: 1,
  53. show: false,
  54. axisTick: { show: false },
  55. axisLine: { show: false },
  56. splitLine: { show: false },
  57. },
  58. ],
  59. yAxis: [
  60. {
  61. gridIndex: 0,
  62. type: 'category',
  63. axisTick: { show: false },
  64. axisLine: { show: false },
  65. splitLine: { show: false },
  66. offset: 15,
  67. data: source,
  68. axisLabel: { color: '#686872', fontSize: 16 },
  69. },
  70. {
  71. gridIndex: 1,
  72. type: 'category',
  73. axisTick: { show: false },
  74. axisLine: { show: false },
  75. splitLine: { show: false },
  76. axisLabel: { show: false },
  77. },
  78. ],
  79. series: [
  80. {
  81. type: 'bar',
  82. xAxisIndex: 0,
  83. yAxisIndex: 0,
  84. barWidth: 30,
  85. data: data1.map((item, index) => ({
  86. value: item,
  87. itemStyle: { color: index % 2 ? color1[0] : color1[1] },
  88. label: {
  89. show: true,
  90. color: '#303036',
  91. align: 'right',
  92. position: [360, 5],
  93. fontSize: 16,
  94. formatter: item,
  95. },
  96. })),
  97. },
  98. {
  99. type: 'bar',
  100. xAxisIndex: 1,
  101. yAxisIndex: 1,
  102. barWidth: 30,
  103. data: data2.map((item, index) => ({
  104. value: item,
  105. itemStyle: { color: index % 2 ? color2[0] : color2[1] },
  106. label: {
  107. show: true,
  108. color: '#303036',
  109. align: 'right',
  110. fontSize: 16,
  111. position: [360, 5],
  112. formatter: item,
  113. },
  114. })),
  115. },
  116. ],
  117. };
  118. }
  119. function BarOption2(title, data, legend, color) {
  120. return {
  121. title: {
  122. text: title,
  123. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  124. },
  125. tooltip: {
  126. trigger: 'axis',
  127. },
  128. legend: {
  129. show: legend.length > 1,
  130. data: legend,
  131. right: 20,
  132. },
  133. color,
  134. dataset: {
  135. source: [['type', ...legend], ...data],
  136. },
  137. grid: { left: 30, right: 30, height: 300 },
  138. xAxis: {
  139. type: 'category',
  140. axisLabel: { color: '#686872' },
  141. axisLine: { lineStyle: { color: '#D1D6DF' } },
  142. },
  143. yAxis: {
  144. type: 'value',
  145. min: 0,
  146. max: 100,
  147. axisLabel: { color: '#686872' },
  148. axisLine: { lineStyle: { color: '#D1D6DF' } },
  149. },
  150. series: legend.map(() => ({
  151. type: 'bar',
  152. barWidth: 40,
  153. })),
  154. };
  155. }
  156. function lineOption1(title, data, legend, color) {
  157. return {
  158. title: {
  159. text: title,
  160. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  161. left: '0',
  162. },
  163. tooltip: {
  164. trigger: 'axis',
  165. },
  166. legend: {
  167. show: legend.length > 1,
  168. data: legend,
  169. right: 20,
  170. },
  171. color,
  172. grid: { left: 30, right: 30, height: 300 },
  173. xAxis: {
  174. type: 'category',
  175. axisLabel: { color: '#686872' },
  176. axisLine: { lineStyle: { color: '#D1D6DF' } },
  177. },
  178. yAxis: {
  179. type: 'value',
  180. min: 0,
  181. max: 100,
  182. axisLabel: { color: '#686872' },
  183. axisLine: { lineStyle: { color: '#D1D6DF' } },
  184. },
  185. dataset: {
  186. source: [['type', ...legend], ...data],
  187. },
  188. series: legend.map(() => ({
  189. type: 'line',
  190. smooth: true,
  191. symbol: 'circle',
  192. })),
  193. };
  194. }
  195. function barOption1(title, value, allValue, avgCorrect, avgIncorrent) {
  196. const xAxis1 = [
  197. {
  198. gridIndex: 0,
  199. type: 'category',
  200. axisTick: { show: false },
  201. axisLine: { lineStyle: { color: '#D1D6DF' } },
  202. splitLine: { show: false },
  203. },
  204. {
  205. gridIndex: 1,
  206. type: 'category',
  207. axisTick: { show: false },
  208. axisLine: { lineStyle: { color: '#D1D6DF' } },
  209. splitLine: { show: false },
  210. data: [
  211. {
  212. value: 'Avg Time\nCorrect',
  213. textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
  214. },
  215. {
  216. value: 'Avg Time\nIncorrect',
  217. textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
  218. },
  219. ],
  220. },
  221. ];
  222. const xAxis2 = {
  223. type: 'category',
  224. axisTick: { show: false },
  225. axisLine: { lineStyle: { color: '#D1D6DF' } },
  226. splitLine: { show: false },
  227. };
  228. const yAxis1 = [
  229. {
  230. gridIndex: 0,
  231. show: false,
  232. min: 0,
  233. max: 100,
  234. axisTick: { show: false },
  235. axisLine: { show: false },
  236. splitLine: { show: false },
  237. },
  238. {
  239. gridIndex: 1,
  240. show: false,
  241. min: 0,
  242. max: 100,
  243. axisTick: { show: false },
  244. axisLine: { show: false },
  245. splitLine: { show: false },
  246. },
  247. ];
  248. const yAxis2 = {
  249. show: false,
  250. min: 0,
  251. max: 100,
  252. axisTick: { show: false },
  253. axisLine: { show: false },
  254. splitLine: { show: false },
  255. };
  256. const data1 = {
  257. type: 'bar',
  258. barWidth: 50,
  259. xAxisIndex: 0,
  260. yAxisIndex: 0,
  261. data: [
  262. {
  263. value,
  264. itemStyle: { color: '#7AA7DC' },
  265. label: {
  266. show: true,
  267. position: 'top',
  268. formatter: `{a|${value}}`,
  269. rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
  270. },
  271. },
  272. {
  273. value: allValue,
  274. itemStyle: { color: '#598FCF' },
  275. label: {
  276. show: true,
  277. position: 'top',
  278. formatter: `{a|${allValue}}`,
  279. rich: { a: { fontSize: 12, color: '#686872' } },
  280. },
  281. },
  282. ],
  283. };
  284. const data2 = {
  285. type: 'bar',
  286. barWidth: 50,
  287. xAxisIndex: 1,
  288. yAxisIndex: 1,
  289. data: [
  290. {
  291. value: avgCorrect,
  292. name: 'Avg Time\nCorrect',
  293. itemStyle: { color: '#7775CA' },
  294. label: {
  295. show: true,
  296. position: 'top',
  297. formatter: `{a|${avgCorrect}}`,
  298. rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
  299. },
  300. },
  301. {
  302. value: avgIncorrent,
  303. name: 'Avg Time\nIncorrect',
  304. itemStyle: { color: '#9396C9' },
  305. label: {
  306. show: true,
  307. position: 'top',
  308. formatter: `{a|${avgIncorrent}}`,
  309. rich: { a: { fontSize: 16, fontWeight: 'bold', color: '#686872' } },
  310. },
  311. },
  312. ],
  313. };
  314. return {
  315. title: [
  316. {
  317. text: title,
  318. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  319. left: '0',
  320. },
  321. {
  322. text: 'Avg Time\nTotal',
  323. textAlign: 'center',
  324. textVerticalAlign: 'middle',
  325. textStyle: { color: '#686872', fontWeight: '500', fontSize: 14, lineHeight: 20 },
  326. bottom: '2%',
  327. left: '26%',
  328. },
  329. ],
  330. xAxis: avgCorrect ? xAxis1 : xAxis2,
  331. yAxis: avgCorrect ? yAxis1 : yAxis2,
  332. grid: avgCorrect ? [{ width: 200, x: 72 }, { width: 350, x: 272 }] : { width: 200, left: '30%' },
  333. series: avgCorrect ? [data1, data2] : [data1],
  334. };
  335. }
  336. function pieOption1(title, userCorrect, userNumber, totalCorrect, totalNumber) {
  337. const value = formatPercent(userCorrect, userNumber);
  338. const allValue = formatPercent(totalCorrect, totalNumber);
  339. return {
  340. title: [
  341. {
  342. text: title,
  343. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  344. left: '0',
  345. },
  346. {
  347. text: `${value}%`,
  348. textAlign: 'center',
  349. textVerticalAlign: 'middle',
  350. textStyle: { color: value < 50 ? '#f19057' : '#7AA7DC', fontSize: 45 },
  351. subtext: `${userCorrect}/${userNumber}`,
  352. subtextStyle: { color: '#686872', fontSize: 16 },
  353. top: '35%',
  354. left: '49%',
  355. },
  356. ],
  357. series: [
  358. {
  359. type: 'pie',
  360. radius: ['64%', '70%'],
  361. label: {
  362. show: false,
  363. },
  364. hoverAnimation: false,
  365. animation: false,
  366. data: [
  367. {
  368. value: allValue,
  369. itemStyle: { color: '#7775CA' },
  370. label: {
  371. show: true,
  372. position: 'outside',
  373. formatter: `{a|全站用户}:{b|${allValue}%}`,
  374. rich: {
  375. a: {
  376. color: '#686872',
  377. fontSize: 16,
  378. },
  379. b: {
  380. color: '#6865FD',
  381. fontSize: 16,
  382. },
  383. },
  384. },
  385. },
  386. {
  387. value: 100 - allValue,
  388. itemStyle: { color: '#e1e1e1' },
  389. emphasis: { itemStyle: { color: '#e1e1e1' } },
  390. },
  391. ],
  392. },
  393. {
  394. type: 'pie',
  395. radius: ['45%', '61%'],
  396. label: {
  397. show: false,
  398. },
  399. hoverAnimation: false,
  400. animation: false,
  401. data: [
  402. { value, itemStyle: { color: value < 50 ? '#f19057' : '#7AA7DC' } },
  403. { value: 100 - value, itemStyle: { color: '#e1e1e1' }, emphasis: { itemStyle: { color: '#e1e1e1' } } },
  404. ],
  405. },
  406. ],
  407. };
  408. }
  409. function pieOption2(title, value1, value2, value3) {
  410. return {
  411. title: [
  412. {
  413. text: title,
  414. textStyle: { fontSize: 24, fontWeight: 'bold', color: '#686872' },
  415. left: '0',
  416. },
  417. {
  418. text: `${value1 + value2 + value3}`,
  419. textAlign: 'center',
  420. textVerticalAlign: 'middle',
  421. textStyle: { color: '#686872', fontSize: 60 },
  422. subtext: '综合实力',
  423. subtextStyle: { color: '#686872', fontSize: 14 },
  424. top: '35%',
  425. left: '49.5%',
  426. },
  427. ],
  428. series: [
  429. {
  430. type: 'pie',
  431. radius: ['50%', '80%'],
  432. startAngle: 30,
  433. hoverAnimation: false,
  434. animation: false,
  435. data: [
  436. {
  437. value: value1,
  438. itemStyle: { color: '#6865FD' },
  439. label: {
  440. position: 'outside',
  441. formatter: `{a|逻辑关系} {b|${value1}}`,
  442. rich: {
  443. a: {
  444. color: '#686872',
  445. fontSize: 18,
  446. },
  447. b: {
  448. color: '#6865FD',
  449. fontSize: 18,
  450. },
  451. },
  452. },
  453. },
  454. {
  455. value: value2,
  456. itemStyle: { color: '#6EC28D' },
  457. label: {
  458. position: 'outside',
  459. formatter: `{a|句子结构} {b|${value2}}`,
  460. rich: {
  461. a: {
  462. color: '#686872',
  463. fontSize: 18,
  464. },
  465. b: {
  466. color: '#6EC28D',
  467. fontSize: 18,
  468. },
  469. },
  470. },
  471. },
  472. {
  473. value: value3,
  474. itemStyle: { color: '#598FCF' },
  475. label: {
  476. position: 'outside',
  477. formatter: `{a|阅读速度} {b|${value3}}`,
  478. rich: {
  479. a: {
  480. color: '#686872',
  481. fontSize: 18,
  482. },
  483. b: {
  484. color: '#598FCF',
  485. fontSize: 18,
  486. },
  487. },
  488. },
  489. },
  490. ],
  491. },
  492. ],
  493. };
  494. }
  495. export default class extends Page {
  496. initState() {
  497. return { tab: 'main', report: { paperModule: 'sentence' } };
  498. }
  499. initData() {
  500. const { id } = this.params;
  501. const { info = '' } = this.state.search;
  502. Question.detailReport(id).then(result => {
  503. switch (result.paperModule) {
  504. case 'sentence':
  505. this.refreshSentence(result);
  506. break;
  507. case 'textbook':
  508. this.refreshTextbook(result);
  509. break;
  510. case 'exercise':
  511. this.refreshExercise(result);
  512. break;
  513. case 'examination':
  514. this.refreshExamination(result);
  515. break;
  516. default:
  517. }
  518. this.setState({ report: result, paper: result.paper });
  519. });
  520. switch (info) {
  521. case 'question':
  522. // 题目回顾列表
  523. Question.questionReport(id).then(result => {
  524. this.setState({ list: result });
  525. });
  526. break;
  527. default:
  528. break;
  529. }
  530. }
  531. refreshSentence() {
  532. const { info = '' } = this.state.search;
  533. switch (info) {
  534. case 'question':
  535. break;
  536. default:
  537. }
  538. }
  539. refreshTextbook() {
  540. this.refreshExercise();
  541. }
  542. refreshExamination() {
  543. const { info = '' } = this.state.search;
  544. switch (info) {
  545. case 'score':
  546. break;
  547. default:
  548. }
  549. }
  550. refreshExercise() {
  551. const { info = '' } = this.state.search;
  552. switch (info) {
  553. case 'question':
  554. break;
  555. default:
  556. }
  557. }
  558. renderView() {
  559. const { report = {} } = this.state;
  560. console.log(report);
  561. switch (report.paperModule) {
  562. case 'sentence':
  563. return this.renderSentence();
  564. case 'textbook':
  565. return this.renderTextbook();
  566. case 'exercise':
  567. return this.renderExercise();
  568. case 'examination':
  569. return this.renderExamination();
  570. default:
  571. return <div />;
  572. }
  573. }
  574. renderSentence() {
  575. const { paper = {}, report = {}, search = {} } = this.state;
  576. const { info } = search;
  577. const { user } = this.props;
  578. return (
  579. <div className="sentence">
  580. <div className="header">
  581. <div className="content">
  582. <div className="title">Report for 「{report.paperModule === 'examination' ? '模考' : '练习'}」{paper.title}</div>
  583. <div className="btns">
  584. <Button size="small" radius onClick={() => {
  585. linkTo('/');
  586. }}>返回首页</Button>
  587. {!info && <Button size="small" radius onClick={() => {
  588. linkTo(`/paper/report/${report.id}?info=question`);
  589. }}>题目回顾</Button>}
  590. {info === 'question' && <Button size="small" radius onClick={() => {
  591. linkTo(`/paper/report/${report.id}`);
  592. }}>详细报告</Button>}
  593. </div>
  594. <div className="right">
  595. <div className="text">{user.info.nickname}</div>
  596. <div className="desc">练习次数{paper.times}</div>
  597. <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  598. </div>
  599. </div>
  600. </div>
  601. {info === 'question' && this.renderSentenceQuestion()}
  602. {!info && this.renderSentenceDetail()}
  603. </div>
  604. );
  605. }
  606. renderTextbook() {
  607. return this.renderExercise();
  608. }
  609. renderExercise() {
  610. const { paper = {}, report = {}, search = {} } = this.state;
  611. const { info } = search;
  612. const { user } = this.props;
  613. return (
  614. <div className="exercise">
  615. <div className="header">
  616. <div className="content">
  617. <div className="title">Report for「练习」{paper.title}</div>
  618. <div className="btns">
  619. <Button size="small" radius onClick={() => {
  620. linkTo('/');
  621. }}>返回首页</Button>
  622. {!info && <Button size="small" radius onClick={() => {
  623. linkTo(`/paper/report/${report.id}?info=question`);
  624. }}>题目回顾</Button>}
  625. {info === 'question' && <Button size="small" radius onClick={() => {
  626. linkTo(`/paper/report/${report.id}`);
  627. }}>详细报告</Button>}
  628. </div>
  629. <div className="right">
  630. <div className="text">{user.info.nickname}</div>
  631. <div className="desc">练习次数{paper.times}</div>
  632. <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  633. </div>
  634. </div>
  635. </div>
  636. {info === 'question' && this.renderExerciseQuestion()}
  637. {!info && this.renderExerciseDetail()}
  638. </div>
  639. );
  640. }
  641. renderExamination() {
  642. const { paper = {}, report = {}, search = {} } = this.state;
  643. const { info } = search;
  644. const { user } = this.props;
  645. return (
  646. <div className="examination">
  647. <div className="header">
  648. <div className="content">
  649. <div className="title">Report for 「{report.paperModule === 'examination' ? '模考' : '练习'}」{paper.title}</div>
  650. <div className="btns">
  651. <Button size="small" radius onClick={() => {
  652. linkTo('/');
  653. }}>返回首页</Button>
  654. {!info && <Button size="small" radius onClick={() => {
  655. linkTo(`/paper/report/${report.id}?info=score`);
  656. }}>成绩单</Button>}
  657. {info === 'score' && <Button size="small" radius onClick={() => {
  658. linkTo(`/paper/report/${report.id}`);
  659. }}>详细报告</Button>}
  660. </div>
  661. <div className="right">
  662. <div className="text">{user.info.nickname}</div>
  663. <div className="desc">练习次数{paper.times}</div>
  664. <div className="desc">{formatDate(report.updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  665. </div>
  666. </div>
  667. </div>
  668. {info === 'score' && this.renderExaminationScore()}
  669. {!info && this.renderExaminationDetail()}
  670. </div>
  671. );
  672. }
  673. renderSentenceQuestion() {
  674. return <div className='sentence question'>
  675. <div className='header'>
  676. <div className='content'>
  677. <div className='title'>题目回顾</div>
  678. <Button className='back' radius>返回长难句报告</Button>
  679. </div>
  680. </div>
  681. <div className='body'>
  682. <div className='content'>
  683. <div className='tip'><Assets name='notice' />点击题目查看详情</div>
  684. <table>
  685. <thead>
  686. <tr>
  687. <th>序号</th>
  688. <th width='360'>题目</th>
  689. <th>句子结构<GIcon name='arrow-up' /></th>
  690. <th>逻辑关系<GIcon name='arrow-down' /></th>
  691. <th>用时<GIcon name='arrow-up' /></th>
  692. <th>收藏<GIcon name='arrow-up' /></th>
  693. <th>笔记<GIcon name='arrow-up' /></th>
  694. </tr>
  695. </thead>
  696. <tbody>
  697. <tr>
  698. <td>1</td>
  699. <td>
  700. <div className='n'> OG18 #678</div>
  701. <div className='desc'>「图形」None of the attempts to specify the causes of crime explains why most of the people exposed to</div>
  702. </td>
  703. <td><GIcon name='error' noHover /></td>
  704. <td><GIcon name='right' noHover /></td>
  705. <td>1.3</td>
  706. <td><GIcon name='star' noHover /></td>
  707. <td><GIcon name='note' noHover /></td>
  708. </tr>
  709. <tr>
  710. <td>1</td>
  711. <td>
  712. <div className='n'> OG18 #678</div>
  713. <div className='desc'>「图形」None of the attempts to specify the causes of crime explains why most of the people exposed to</div>
  714. </td>
  715. <td><GIcon name='error' noHover /></td>
  716. <td><GIcon name='right' noHover /></td>
  717. <td>1.3</td>
  718. <td><GIcon name='star' active /></td>
  719. <td><GIcon name='note' active /></td>
  720. </tr>
  721. <tr>
  722. <td>1</td>
  723. <td>
  724. <div className='n'> OG18 #678</div>
  725. <div className='desc'>「图形」None of the attempts to specify the causes of crime explains why most of the people exposed to</div>
  726. </td>
  727. <td><GIcon name='error' noHover /></td>
  728. <td><GIcon name='right' noHover /></td>
  729. <td>1.3</td>
  730. <td><GIcon name='star' noHover /></td>
  731. <td><GIcon name='note' noHover /></td>
  732. </tr>
  733. <tr>
  734. <td>1</td>
  735. <td>
  736. <div className='n'> OG18 #678</div>
  737. <div className='desc'>「图形」None of the attempts to specify the causes of crime explains why most of the people exposed to</div>
  738. </td>
  739. <td><GIcon name='error' noHover /></td>
  740. <td><GIcon name='right' noHover /></td>
  741. <td>1.3</td>
  742. <td><GIcon name='star' active /></td>
  743. <td><GIcon name='note' active /></td>
  744. </tr>
  745. </tbody>
  746. </table>
  747. </div>
  748. </div>
  749. </div>;
  750. }
  751. renderSentenceDetail() {
  752. const { report = {} } = this.state;
  753. const { detail = {} } = report;
  754. return <div>
  755. <div className="body">
  756. <div className="content">
  757. <div className="title">完成情况</div>
  758. <div className="detail">
  759. <div className="block">
  760. <div className="t1">总耗时</div>
  761. <div className="t2">{formatMinute(detail.info.userTime, true)}</div>
  762. <div className="t3">min</div>
  763. </div>
  764. {detail.info.userTime > detail.info.time && <div className="block">
  765. <div className="t1">超出建议用时</div>
  766. <div className="t2">{formatMinute(detail.info.userTime - detail.info.time, true)}</div>
  767. <div className="t3">min</div>
  768. </div>}
  769. <div className="line" />
  770. <div className="block">
  771. <div className="t1">完成题目</div>
  772. <div className="t2">{detail.info.userNumber}</div>
  773. <div className="t3">题</div>
  774. </div>
  775. {detail.info.userNumber !== detail.info.questionNumber && <div className="block">
  776. <div className="t1">剩余未做</div>
  777. <div className="t2">{detail.info.questionNumber || 0 - detail.info.userNumber}</div>
  778. <div className="t3">题</div>
  779. </div>}
  780. </div>
  781. </div>
  782. </div>
  783. <div className="body gray">
  784. <div className="content">
  785. <div className="title">基本情况</div>
  786. <div className="block-wrapper">
  787. <div className="block">
  788. <PieChart option={pieOption1('正确率', detail.info.userCorrect, detail.info.userNumber, detail.info.totalCorrect, detail.info.totalNumber)} />
  789. </div>
  790. <div className="block">
  791. <BarChart option={barOption1('用时', detail.info.userTime / detail.info.userNumber, detail.info.totalTime / detail.info.totalNumber, detail.info.correctTime, detail.info.incorrectTime)} />
  792. </div>
  793. </div>
  794. </div>
  795. </div>
  796. <div className="body">
  797. <div className="content">
  798. <div className="title">能力评估</div>
  799. <PieChart option={pieOption2('综合得分', detail.ability.logic, detail.ability.struct, detail.ability.speed)} />
  800. </div>
  801. </div>
  802. <div className="body gray">
  803. <div className="content t-c">
  804. <Button size="lager" width={200} radius>
  805. 继续做题
  806. </Button>
  807. </div>
  808. </div>
  809. </div>;
  810. }
  811. renderExerciseQuestion() {
  812. return <div />;
  813. }
  814. renderExerciseDetail() {
  815. const { report = {} } = this.state;
  816. const { detail = {} } = report;
  817. return <div>
  818. <div className="body">
  819. <div className="content">
  820. <div className="title">完成情况</div>
  821. <div className="detail">
  822. <div className="block">
  823. <div className="t1">总耗时</div>
  824. <div className="t2">{formatMinute(detail.info.userTime, true)}</div>
  825. <div className="t3">min</div>
  826. </div>
  827. {detail.info.userTime > detail.info.time && <div className="block">
  828. <div className="t1">超出建议用时</div>
  829. <div className="t2">{formatMinute(detail.info.userTime - detail.info.time, true)}</div>
  830. <div className="t3">min</div>
  831. </div>}
  832. <div className="line" />
  833. <div className="block">
  834. <div className="t1">完成题目</div>
  835. <div className="t2">{detail.info.userNumber}</div>
  836. <div className="t3">题</div>
  837. </div>
  838. {detail.info.userNumber !== detail.info.questionNumber && <div className="block">
  839. <div className="t1">剩余未做</div>
  840. <div className="t2">{detail.info.questionNumber - detail.info.userNumber}</div>
  841. <div className="t3">题</div>
  842. </div>}
  843. </div>
  844. </div>
  845. </div>
  846. <div className="body gray">
  847. <div className="content">
  848. <div className="title">基本情况</div>
  849. <div className="block-wrapper">
  850. <div className="block">
  851. <PieChart option={pieOption1('正确率', detail.info.userCorrect, detail.info.userNumber, detail.info.totalCorrect, detail.info.totalNumber)} />
  852. </div>
  853. <div className="block">
  854. <BarChart option={barOption1('用时', detail.info.userTime / detail.info.userNumber, detail.info.totalTime / detail.info.totalNumber, detail.info.correctTime, detail.info.incorrectTime)} />
  855. </div>
  856. </div>
  857. </div>
  858. </div>
  859. <div className="body">
  860. <div className="content">
  861. <div className="title">PACE</div>
  862. <div className="detail-1">
  863. <div className="block">
  864. <div className="t1">平均用时</div>
  865. <div dangerouslySetInnerHTML={{ __html: formatSeconds(detail.info.userTime / detail.info.userNumber).replace(/([0-9]+)(m|min|h|hour|s)/g, '<div class="s">$1</div><div class="t3">$2</div>') }} />
  866. </div>
  867. <div className="block all">
  868. <div className="t1">全站用户</div>
  869. <div dangerouslySetInnerHTML={{ __html: formatSeconds(detail.info.totalTime / detail.info.totalNumber).replace(/([0-9]+)(m|min|h|hour|s)/g, '<div class="s">$1</div><div class="t3">$2</div>') }} />
  870. </div>
  871. </div>
  872. <LineChart
  873. height={400}
  874. option={lineOption1(
  875. '每题用时情况',
  876. detail.pace.map(row => {
  877. return [`${row.no}`, row.userTime, row.time];
  878. }),
  879. ['我的', '全站'],
  880. ['#7AA7DC', '#8684df'],
  881. )}
  882. />
  883. </div>
  884. </div>
  885. <div className="body gray">
  886. <div className="content">
  887. <div className="title">难度分析</div>
  888. <div className="detail-1">
  889. <div className="block">
  890. <div className="t1">正确率</div>
  891. <div className="t2">{formatPercent(detail.info.userCorrect, detail.info.userNumber, false)}</div>
  892. </div>
  893. <div className="block all">
  894. <div className="t1">全站用户</div>
  895. <div className="t2">90</div>
  896. <div className="t3">{formatPercent(detail.info.totalCorrect, detail.info.totalNumber, false)}</div>
  897. </div>
  898. </div>
  899. <BarChart
  900. height={400}
  901. option={BarOption2(
  902. '正确率',
  903. detail.difficult.map(row => {
  904. return [QuestionDifficultMap[row.key], formatPercent(row.userCorrect, row.userNumber), formatPercent(row.totalCorrect, row.totalNumber)];
  905. }),
  906. ['我的', '全站'],
  907. ['#8684df', '#5195e5'],
  908. )}
  909. />
  910. </div>
  911. </div>
  912. <div className="body">
  913. <div className="content">
  914. <div className="title">知识体系分析</div>
  915. <div className="detail-1">
  916. <div className="block">
  917. <div className="t1">平均用时</div>
  918. <div dangerouslySetInnerHTML={{ __html: formatSeconds(detail.info.userTime / detail.info.userNumber).replace(/([0-9]+)(m|min|h|hour|s)/g, '<div class="s">$1</div><div class="t3">$2</div>') }} />
  919. </div>
  920. <div className="block all">
  921. <div className="t1">正确率</div>
  922. <div className="t2">{formatPercent(detail.info.userCorrect, detail.info.userNumber, false)}</div>
  923. </div>
  924. </div>
  925. <BarChart
  926. height={400}
  927. option={BarOption3(
  928. ['知识点', '正确率分析', '用时分析'],
  929. detail.place.map(row => {
  930. return row.key;
  931. }),
  932. detail.place.map(row => {
  933. return formatPercent(row.userCorrect, row.userNumber);
  934. }),
  935. detail.place.map(row => {
  936. return row.userTime / row.userNumber;
  937. }),
  938. ['#7AA7DC', '#BFD4EE'],
  939. ['#8684df', '#C3C3E5'],
  940. )}
  941. />
  942. </div>
  943. </div>
  944. <div className="body gray">
  945. <div className="content">
  946. <div className="title">实战提醒</div>
  947. {detail.info.userTime > detail.info.time && <div className="tip">
  948. <div className="t1">在实战限时情况下,本套题正确率为 </div>
  949. <div className="t2">{formatPercent(detail.limit.userCorrect, detail.limit.userNumber)}</div>
  950. <Tooltip message="仅统计在建议时间内完成题目正确率情况,更接近实战表现"><Icon type="question-circle" theme="filled" /></Tooltip>
  951. </div>}
  952. {detail.info.userTime <= detail.info.time && <div className="tip">
  953. <div className="t1">目前的做题速度已达到实战标准!很棒!请继续保持!</div>
  954. </div>}
  955. </div>
  956. </div>
  957. <div className="body">
  958. <div className="content t-c">
  959. <Button size="lager" width={200} radius>
  960. 继续做题
  961. </Button>
  962. </div>
  963. </div>
  964. </div>;
  965. }
  966. renderTextbookQuestion() {
  967. return this.renderExerciseQuestion();
  968. }
  969. renderExaminationDetail() {
  970. const { report = {}, tab } = this.state;
  971. const { detail = {} } = report;
  972. const subjectDetail = tab === 'main' ? null : (detail.subject || {})[tab] || { info: {}, defficlt: [], place: [], pace: [] };
  973. return <div>
  974. <div className="body">
  975. <div className="content">
  976. <Tabs
  977. type="division"
  978. theme="gray"
  979. active={tab}
  980. space={7}
  981. tabs={[
  982. { key: 'main', name: '总览 Overview' },
  983. { key: 'verbal', name: '语文 Verbal' },
  984. { key: 'quant', name: '数学 Quant' },
  985. { key: 'ir', name: '综合推理 IR' },
  986. ]}
  987. onChange={(value) => {
  988. this.setState({ tab: value });
  989. }}
  990. />
  991. {!subjectDetail && <div className="list">
  992. <div className="title">完成情况</div>
  993. <div className="detail">
  994. <div className="block">
  995. <div className="t1" />
  996. <div className="t4">Verbal</div>
  997. <div className="t4">Quant</div>
  998. <div className="t4">IR</div>
  999. </div>
  1000. <div className="block">
  1001. <div className="t1">总耗时</div>
  1002. <div className="t1">
  1003. <div className="t2">{formatMinute((detail.subject.verbal || {}).userTime, true)}</div>
  1004. <div className="t3">min</div>
  1005. </div>
  1006. <div className="t1">
  1007. <div className="t2">{formatMinute((detail.subject.quant || {}).userTime, true)}</div>
  1008. <div className="t3">min</div>
  1009. </div>
  1010. <div className="t1">
  1011. <div className="t2">{formatMinute((detail.subject.ir || {}).userTime, true)}</div>
  1012. <div className="t3">min</div>
  1013. </div>
  1014. </div>
  1015. <div className="block">
  1016. <div className="t1">超出建议用时</div>
  1017. <div className="t1">
  1018. <div className="t2">{formatMinute((detail.subject.verbal || {}).userTime - (detail.subject.verbal || {}).time, true)}</div>
  1019. <div className="t3">min</div>
  1020. </div>
  1021. <div className="t1">
  1022. <div className="t2">{formatMinute((detail.subject.quant || {}).userTime - (detail.subject.quant || {}).time, true)}</div>
  1023. <div className="t3">min</div>
  1024. </div>
  1025. <div className="t1">
  1026. <div className="t2">{formatMinute((detail.subject.ir || {}).userTime - (detail.subject.ir || {}).time, true)}</div>
  1027. <div className="t3">min</div>
  1028. </div>
  1029. </div>
  1030. <div className="block">
  1031. <div className="t1" />
  1032. <div className="t1">
  1033. <div className="line" />
  1034. </div>
  1035. <div className="t1">
  1036. <div className="line" />
  1037. </div>
  1038. <div className="t1">
  1039. <div className="line" />
  1040. </div>
  1041. </div>
  1042. <div className="block">
  1043. <div className="t1">完成题目</div>
  1044. <div className="t1">
  1045. <div className="t2">{(detail.subject.verbal || {}).userNumber}</div>
  1046. <div className="t3">题</div>
  1047. </div>
  1048. <div className="t1">
  1049. <div className="t2">{(detail.subject.quant || {}).userNumber}</div>
  1050. <div className="t3">题</div>
  1051. </div>
  1052. <div className="t1">
  1053. <div className="t2">{(detail.subject.ir || {}).userNumber}</div>
  1054. <div className="t3">题</div>
  1055. </div>
  1056. </div>
  1057. <div className="block">
  1058. <div className="t1">剩余未做</div>
  1059. <div className="t1">
  1060. <div className="t2">{(detail.subject.verbal || {}).questionNumber - (detail.subject.verbal || {}).userNumber}</div>
  1061. <div className="t3">题</div>
  1062. </div>
  1063. <div className="t1">
  1064. <div className="t2">{(detail.subject.quant || {}).questionNumber - (detail.subject.quant || {}).userNumber}</div>
  1065. <div className="t3">题</div>
  1066. </div>
  1067. <div className="t1">
  1068. <div className="t2">{(detail.subject.ir || {}).questionNumber - (detail.subject.ir || {}).userNumber}</div>
  1069. <div className="t3">题</div>
  1070. </div>
  1071. </div>
  1072. </div></div>}
  1073. {subjectDetail && <div>
  1074. <div className="title">PACE</div>
  1075. <div className="detail-1">
  1076. <div className="block">
  1077. <div className="t1">平均用时</div>
  1078. <div dangerouslySetInnerHTML={{ __html: formatSeconds(subjectDetail.info.userTime / subjectDetail.info.userNumber).replace(/([0-9]+)(m|min|h|hour|s)/g, '<div class="s">$1</div><div class="t3">$2</div>') }} />
  1079. </div>
  1080. </div>
  1081. <LineChart
  1082. height={400}
  1083. option={lineOption1(
  1084. '每题用时情况',
  1085. subjectDetail.pace.map(row => {
  1086. return [`${row.no}`, row.userTime];
  1087. }),
  1088. ['我的'],
  1089. ['#A3A8BF'],
  1090. )}
  1091. />
  1092. <div className="m-b-4" />
  1093. <LineChart
  1094. height={400}
  1095. option={lineOption1(
  1096. '累计用时情况',
  1097. (function (sd) {
  1098. let userTime = 0;
  1099. let time = 0;
  1100. sd.pace.map(row => {
  1101. userTime += row.userTime;
  1102. time += row.time;
  1103. return [`${row.no}`, userTime, time];
  1104. });
  1105. }(subjectDetail)),
  1106. ['我的', '建议'],
  1107. ['#A3A8BF', '#7AA7DC'],
  1108. )}
  1109. />
  1110. </div>}
  1111. </div>
  1112. </div>
  1113. {!subjectDetail && <div className="body gray">
  1114. <div className="content">
  1115. <div className="title">成绩单</div>
  1116. <table>
  1117. <thead>
  1118. <tr>
  1119. <th>Question format</th>
  1120. <th>Total</th>
  1121. <th>Correct</th>
  1122. <th>%Correct</th>
  1123. <th>
  1124. Avg Time
  1125. </th>
  1126. <th>
  1127. Avg Time
  1128. <br />
  1129. Correct
  1130. </th>
  1131. <th>
  1132. Avg Time
  1133. <br />
  1134. Incorrect
  1135. </th>
  1136. <th>
  1137. Avg Diff
  1138. <br />
  1139. Correct
  1140. </th>
  1141. <th>
  1142. Avg Diff
  1143. <br />
  1144. Incorrect
  1145. </th>
  1146. </tr>
  1147. </thead>
  1148. <tbody>
  1149. {ExaminationQuestionType.map(row => {
  1150. const typeDetail = detail.type[row.value];
  1151. return <tr>
  1152. <td>{row.long}</td>
  1153. <td>{typeDetail.info.questionNumber}</td>
  1154. <td>{typeDetail.info.userCorrect}</td>
  1155. <td>
  1156. {formatPercent(typeDetail.info.userCorrect, typeDetail.info.userNumber)}
  1157. </td>
  1158. <td>
  1159. {formatSecond(typeDetail.info.userTime / typeDetail.info.userNumber)}
  1160. </td>
  1161. <td>
  1162. {formatSecond(typeDetail.info.correctTime / typeDetail.info.userCorrect)}
  1163. </td>
  1164. <td>
  1165. {formatSecond(typeDetail.info.incorrectTime / typeDetail.info.userNumber - typeDetail.info.userCorrect)}
  1166. </td>
  1167. <td>{typeDetail.info.avgDiffCorrect}</td>
  1168. <td>{typeDetail.info.avgDiffIncorrect}</td>
  1169. </tr>;
  1170. })}
  1171. </tbody>
  1172. </table>
  1173. </div>
  1174. </div>}
  1175. {subjectDetail && <div className="body gray">
  1176. <div className="content">
  1177. <div className="title">基本情况</div>
  1178. <table>
  1179. <thead>
  1180. <tr>
  1181. <th>%Correct</th>
  1182. <th>Avg Time</th>
  1183. <th>
  1184. Avg Time
  1185. <br />
  1186. Correct
  1187. </th>
  1188. <th>
  1189. Avg Time
  1190. <br />
  1191. Incorrect
  1192. </th>
  1193. <th>
  1194. Avg Diff
  1195. <br />
  1196. Correct
  1197. </th>
  1198. <th>
  1199. Avg Diff
  1200. <br />
  1201. Incorrect
  1202. </th>
  1203. </tr>
  1204. </thead>
  1205. <tbody>
  1206. <tr>
  1207. <td>
  1208. {formatPercent(subjectDetail.info.userCorrect, subjectDetail.info.userNumber)}
  1209. <br />
  1210. <span>{subjectDetail.info.userCorrect}题/{subjectDetail.info.userNumber}题</span>
  1211. </td>
  1212. <td>
  1213. {formatSecond(subjectDetail.info.userTime / subjectDetail.info.userNumber)}
  1214. <br />
  1215. <span>{formatMinute(subjectDetail.info.userTime)}min/{subjectDetail.info.userNumber}题</span>
  1216. </td>
  1217. <td>
  1218. {formatSecond(subjectDetail.info.correctTime / subjectDetail.info.userCorrect)}
  1219. <br />
  1220. <span>{formatMinute(subjectDetail.info.correctTime)}min/{subjectDetail.info.userCorrect}题</span>
  1221. </td>
  1222. <td>
  1223. {formatSecond(subjectDetail.info.incorrectTime / subjectDetail.info.userNumber - subjectDetail.info.userCorrect)}
  1224. <br />
  1225. <span>{formatMinute(subjectDetail.info.incorrectTime)}min/{subjectDetail.info.userNumber}题</span>
  1226. </td>
  1227. <td>{subjectDetail.info.avgDiffCorrect}</td>
  1228. <td>{subjectDetail.info.avgDiffIncorrect}</td>
  1229. </tr>
  1230. </tbody>
  1231. </table>
  1232. </div>
  1233. </div>}
  1234. {subjectDetail && <div className="body">
  1235. <div className="content">
  1236. <div className="title">难度分析</div>
  1237. <BarChart
  1238. height={400}
  1239. option={BarOption2(
  1240. '正确率',
  1241. subjectDetail.difficult.map(row => {
  1242. return [QuestionDifficultMap[row.key], formatPercent(row.userCorrect, row.userNumber)];
  1243. }),
  1244. ['我的'],
  1245. ['#989FC1'],
  1246. )}
  1247. />
  1248. </div>
  1249. </div>}
  1250. {subjectDetail && <div className="body gray">
  1251. <div className="content">
  1252. <div className="title">知识体系分析</div>
  1253. <BarChart
  1254. height={400}
  1255. option={BarOption3(
  1256. ['知识点', '正确率分析', '用时分析'],
  1257. subjectDetail.place.map(row => {
  1258. return row.key;
  1259. }),
  1260. subjectDetail.place.map(row => {
  1261. return formatPercent(row.userCorrect, row.userNumber);
  1262. }),
  1263. subjectDetail.place.map(row => {
  1264. return row.userTime / row.userNumber;
  1265. }),
  1266. ['#92AFD2', '#BFD4EE'],
  1267. ['#989FC1', '#CCCCDC'],
  1268. )}
  1269. />
  1270. </div>
  1271. </div>}
  1272. </div >;
  1273. }
  1274. renderExaminationScore() {
  1275. const { report = {} } = this.state;
  1276. const { score } = report;
  1277. return <div className="body">
  1278. <div className="content">
  1279. <div className="title">成绩单</div>
  1280. <table>
  1281. <thead>
  1282. <tr>
  1283. <th>学科</th>
  1284. <th>分数</th>
  1285. <th>排名</th>
  1286. <th>题目</th>
  1287. </tr>
  1288. </thead>
  1289. <tbody>
  1290. {ExaminationSubject.map(row => {
  1291. return <tr>
  1292. <td>{row.long}</td>
  1293. <td>{row.ignore ? '--' : score[`${row.value}Score`]}</td>
  1294. <td>{row.ignore ? '--' : score[`${row.value}Rank`]}</td>
  1295. <td><Button size="small" radius onClick={() => {
  1296. Question.getDetailByNo(report.id, 1, row.value).then((r) => {
  1297. linkTo(`/paper/question/${r.id}`);
  1298. });
  1299. }}>回顾</Button></td></tr>;
  1300. })}
  1301. <tr>
  1302. <td>Total</td>
  1303. <td>{score.totalScore}</td>
  1304. <td>{score.totalRank}</td>
  1305. <td><Button size="small" radius onClick={() => {
  1306. Question.getDetailByNo(report.id, 1).then((r) => {
  1307. linkTo(`/paper/question/${r.id}`);
  1308. });
  1309. }}>回顾</Button></td></tr>;
  1310. </tbody>
  1311. </table>
  1312. </div>
  1313. </div>;
  1314. }
  1315. }