index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <template>
  2. <div class="bank-detail">
  3. <section class="section">
  4. <div class="section__body">
  5. <div class="left-box">
  6. <div class="goods-collect">
  7. <div class="goods-collect__header">
  8. <div class="selects">
  9. <div class="selects__item">
  10. <el-row :gutter="20">
  11. <el-col :span="6">
  12. <el-select
  13. placeholder="请选择题库记录"
  14. v-model="goodsSelect"
  15. @change="getWrongData"
  16. clearable
  17. @clear="getWrongData"
  18. >
  19. <el-option
  20. v-for="(item, index) in goodsList"
  21. :key="index"
  22. :label="item.goodsName"
  23. :value="item.goodsId"
  24. ></el-option>
  25. </el-select>
  26. </el-col>
  27. <el-col :span="6">
  28. <el-select
  29. placeholder="请选择试卷类型"
  30. v-model="paperSelect"
  31. @change="getWrongData"
  32. clearable
  33. @clear="getWrongData"
  34. >
  35. <el-option
  36. v-for="(item, index) in paperList"
  37. :key="index"
  38. :label="item.paperName"
  39. :value="item.paperId"
  40. ></el-option>
  41. </el-select>
  42. </el-col>
  43. </el-row>
  44. </div>
  45. </div>
  46. <div class="tabs">
  47. <el-tabs v-model="wrongName" @tab-click="getWrongData">
  48. <el-tab-pane label="试卷归类" name="1"></el-tab-pane>
  49. <el-tab-pane label="题型归类" name="2"></el-tab-pane>
  50. </el-tabs>
  51. </div>
  52. </div>
  53. <div class="goods-collect__body">
  54. <div class="box">
  55. <div class="title">错题统计</div>
  56. <div class="circle">
  57. <el-progress
  58. type="circle"
  59. :width="160"
  60. :stroke-width="12"
  61. color="#F5222D"
  62. :format="() => wrongTotal || '0'"
  63. :percentage="25"
  64. ></el-progress>
  65. </div>
  66. </div>
  67. <div class="list" v-if="wrongName == '1'">
  68. <div
  69. class="list__item"
  70. v-for="(item, index) in wrongExamList"
  71. :key="index"
  72. >
  73. <div class="title">
  74. {{ item.examName }}
  75. </div>
  76. <div class="content clearfix">
  77. <div class="left">
  78. 错题数<span class="red">{{ item.wrongQuestionNum }}</span>
  79. </div>
  80. <div class="right">
  81. <el-button
  82. type="primary"
  83. @click="
  84. go('/subject/wrong-bank/' + item.examId, {
  85. examId:item.examId,
  86. orderGoodsId: orderGoodsId,
  87. })
  88. "
  89. round
  90. plain
  91. class="btn"
  92. >重做</el-button
  93. >
  94. <el-button
  95. type="primary"
  96. @click="
  97. go('/subject/wrong-bank/' + item.examId, {
  98. explain: 1,
  99. examId:item.examId,
  100. orderGoodsId: orderGoodsId,
  101. })
  102. "
  103. round
  104. plain
  105. class="btn"
  106. >解析</el-button
  107. >
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <div class="list" v-if="wrongName == '2'">
  113. <div
  114. class="list__item"
  115. v-for="(item, index) in wrongTypeList"
  116. :key="index"
  117. >
  118. <div class="title">
  119. <template v-if="item.type == 1">单选题</template>
  120. <template v-if="item.type == 2">多选题</template>
  121. <template v-if="item.type == 3">判断题</template>
  122. <template v-if="item.type == 4">案例题</template>
  123. <template v-if="item.type == 5">简答题</template>
  124. </div>
  125. <div class="content clearfix">
  126. <div class="left">
  127. 错题数<span class="red">{{ item.num }}</span>
  128. </div>
  129. <div class="right">
  130. <el-button
  131. type="primary"
  132. @click="
  133. go('/subject/wrong-type-bank/' + item.type, {
  134. orderGoodsId: orderGoodsId,
  135. })
  136. "
  137. round
  138. plain
  139. class="btn"
  140. >重做</el-button
  141. >
  142. <el-button
  143. type="primary"
  144. @click="
  145. go('/subject/wrong-type-bank/' + item.type, {
  146. explain: 1,
  147. orderGoodsId: orderGoodsId,
  148. })
  149. "
  150. round
  151. plain
  152. class="btn"
  153. >解析</el-button
  154. >
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </section>
  164. </div>
  165. </template>
  166. <script>
  167. export default {
  168. name: "BankDetail",
  169. components: {},
  170. data() {
  171. return {
  172. orderGoodsId: "",
  173. activeName: "1",
  174. wrongName: "1",
  175. wrongName: "1",
  176. goodsId: "",
  177. goodsDetail: {},
  178. goodsCount: {},
  179. paperList: [],
  180. paperSelect: "",
  181. goodsList: "",
  182. goodsSelect: "",
  183. wrongTypeList: [],
  184. wrongExamList: [],
  185. wrongTotal: 0,
  186. };
  187. },
  188. mounted() {
  189. this.listGoodsUserQuestion();
  190. this.examaperList();
  191. this.getWrongData();
  192. },
  193. computed: {},
  194. methods: {
  195. go(path, query = {}) {
  196. this.$router.push({
  197. path,
  198. query,
  199. });
  200. },
  201. examaperList() {
  202. this.$request.examaperList().then((res) => {
  203. this.paperList = res.rows;
  204. });
  205. },
  206. listGoodsUserQuestion() {
  207. this.$request.listGoodsUserQuestion().then((res) => {
  208. this.goodsList = res.rows;
  209. });
  210. },
  211. getWrongData() {
  212. if (this.wrongName == "1") {
  213. //试卷归类
  214. this.wrongRecordList();
  215. } else if (this.wrongName == "2") {
  216. //题型归类
  217. this.wrongRecordTypeList();
  218. }
  219. },
  220. /**
  221. * 错题按试卷分类
  222. */
  223. wrongRecordList() {
  224. this.$request
  225. .wrongRecordList({
  226. paperId: this.paperSelect,
  227. goodsId: this.goodsSelect,
  228. })
  229. .then((res) => {
  230. this.wrongExamList = res.rows;
  231. let total = 0;
  232. res.rows.forEach((item) => {
  233. total += item.wrongQuestionNum;
  234. });
  235. this.wrongTotal = total;
  236. });
  237. },
  238. /**
  239. * 错题按题型分类
  240. */
  241. wrongRecordTypeList() {
  242. this.$request
  243. .wrongRecordTypeList({
  244. paperId: this.paperSelect,
  245. goodsId: this.goodsSelect,
  246. })
  247. .then((res) => {
  248. this.wrongTypeList = res.rows;
  249. let total = 0;
  250. res.rows.forEach((item) => {
  251. total += item.num;
  252. });
  253. this.wrongTotal = total;
  254. });
  255. },
  256. },
  257. };
  258. </script>
  259. <!-- Add "scoped" attribute to limit CSS to this component only -->
  260. <style scoped lang="scss">
  261. .bank-detail {
  262. .section {
  263. &__header {
  264. height: 40px;
  265. display: flex;
  266. align-items: center;
  267. padding: 0 20px;
  268. }
  269. &__body {
  270. .left-box {
  271. float: left;
  272. width: 768px;
  273. /deep/.el-tabs__item {
  274. height: 98px;
  275. line-height: 98px;
  276. }
  277. .goods-menu {
  278. padding: 0 16px 16px;
  279. border-radius: 10px;
  280. background: #f5f7fa;
  281. &__header {
  282. display: flex;
  283. padding-right: 8px;
  284. align-items: center;
  285. .title {
  286. padding: 10px 0;
  287. font-size: 16px;
  288. font-family: Microsoft YaHei;
  289. font-weight: bold;
  290. color: #333333;
  291. flex: 1;
  292. }
  293. .question-num {
  294. font-size: 14px;
  295. font-family: Microsoft YaHei;
  296. font-weight: 400;
  297. color: #999999;
  298. text-align: center;
  299. display: inline-block;
  300. width: 80px;
  301. }
  302. .question-do {
  303. width: 88px;
  304. }
  305. }
  306. &__body {
  307. .item {
  308. overflow: hidden;
  309. background: #fff;
  310. padding: 0 10px;
  311. &__title {
  312. padding: 20px 0;
  313. cursor: pointer;
  314. font-size: 16px;
  315. font-family: Microsoft YaHei;
  316. font-weight: bold;
  317. color: #333333;
  318. border-bottom: 1px solid #eeeeee;
  319. .note {
  320. display: inline-block;
  321. margin-left: 20px;
  322. width: 40px;
  323. height: 24px;
  324. border: 1px solid #ff3b30;
  325. border-radius: 8px;
  326. line-height: 22px;
  327. color: #ff3b30;
  328. text-align: center;
  329. }
  330. }
  331. &__content {
  332. margin-top: 12px;
  333. background: #fff;
  334. .bank-chapter {
  335. margin-left: 4px;
  336. &__item {
  337. font-size: 16px;
  338. &__text {
  339. padding-top: 20px;
  340. padding-bottom: 20px;
  341. border-bottom: 1px solid #eeeeee;
  342. cursor: pointer;
  343. flex: 1;
  344. }
  345. }
  346. }
  347. .bank-section {
  348. margin-left: 40px;
  349. &__item {
  350. padding-top: 20px;
  351. padding-bottom: 20px;
  352. border-bottom: 1px solid #eeeeee;
  353. font-size: 16px;
  354. display: flex;
  355. &__text {
  356. flex: 1;
  357. }
  358. .btn {
  359. margin-right: 20px;
  360. width: 88px;
  361. height: 32px;
  362. padding: 0;
  363. border-radius: 16px;
  364. line-height: 32px;
  365. text-align: center;
  366. cursor: pointer;
  367. }
  368. }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. .goods-collect {
  375. &__header {
  376. .selects {
  377. margin: 20px;
  378. }
  379. }
  380. &__body {
  381. .box {
  382. width: 300px;
  383. height: 240px;
  384. background: #ffffff;
  385. border: 1px solid #d9d9d9;
  386. border-radius: 8px;
  387. padding: 16px;
  388. .title {
  389. font-size: 14px;
  390. font-family: Microsoft YaHei;
  391. font-weight: 400;
  392. color: #333333;
  393. }
  394. .circle {
  395. width: 160px;
  396. height: 160px;
  397. margin: 10px auto 0;
  398. }
  399. }
  400. .list {
  401. overflow: hidden;
  402. &__item {
  403. margin-top: 16px;
  404. height: 98px;
  405. background: #f7f9fc;
  406. box-shadow: 0px 3px 6px 0px #e1e6ed;
  407. border-radius: 8px;
  408. .title {
  409. padding: 10px 16px;
  410. font-size: 16px;
  411. font-family: Microsoft YaHei;
  412. font-weight: bold;
  413. color: #333333;
  414. }
  415. .content {
  416. border-top: 1px solid #eee;
  417. .left {
  418. float: left;
  419. margin-left: 16px;
  420. margin-top: 10px;
  421. padding: 4px 12px;
  422. border: 1px solid #666666;
  423. border-radius: 4px;
  424. font-size: 14px;
  425. .red {
  426. margin-left: 12px;
  427. color: #f5222d;
  428. font-size: 14px;
  429. }
  430. }
  431. .right {
  432. float: right;
  433. margin-right: 16px;
  434. margin-top: 10px;
  435. .btn {
  436. width: 88px;
  437. height: 32px;
  438. border-radius: 16px;
  439. text-align: center;
  440. padding: 0;
  441. line-height: 32px;
  442. }
  443. }
  444. }
  445. }
  446. }
  447. }
  448. }
  449. }
  450. .right-box {
  451. width: 300px;
  452. float: right;
  453. &__header {
  454. height: 98px;
  455. border-bottom: 2px solid #e4e7ed;
  456. .title {
  457. cursor: pointer;
  458. height: 32px;
  459. font-size: 14px;
  460. font-family: Microsoft YaHei;
  461. font-weight: 400;
  462. color: #333333;
  463. line-height: 32px;
  464. }
  465. .content {
  466. height: 64px;
  467. font-size: 0;
  468. .left {
  469. width: 50%;
  470. display: inline-block;
  471. border-right: 1px solid #e4e7ed;
  472. .title {
  473. font-size: 14px;
  474. font-family: Microsoft YaHei;
  475. font-weight: 400;
  476. color: #999999;
  477. }
  478. .note {
  479. font-size: 24px;
  480. font-family: Microsoft YaHei;
  481. font-weight: bold;
  482. color: #3f8dfd;
  483. }
  484. }
  485. .right {
  486. text-align: center;
  487. display: inline-block;
  488. width: 50%;
  489. .title {
  490. font-size: 14px;
  491. font-family: Microsoft YaHei;
  492. font-weight: 400;
  493. color: #999999;
  494. .blue {
  495. color: #3f8dfd;
  496. }
  497. }
  498. .note {
  499. font-size: 24px;
  500. font-family: Microsoft YaHei;
  501. color: #999999;
  502. .blue {
  503. font-size: 24px;
  504. color: #3f8dfd;
  505. }
  506. }
  507. }
  508. }
  509. }
  510. &__body {
  511. .title {
  512. margin-top: 15px;
  513. font-size: 16px;
  514. font-family: Microsoft YaHei;
  515. font-weight: 400;
  516. color: #333333;
  517. text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
  518. position: relative;
  519. .more {
  520. cursor: pointer;
  521. font-size: 16px;
  522. font-family: Microsoft YaHei;
  523. font-weight: 400;
  524. color: #999999;
  525. position: absolute;
  526. right: 0;
  527. }
  528. }
  529. .list {
  530. .course-item {
  531. margin: 110px 0 0;
  532. width: 300px;
  533. height: 178px;
  534. background: #ffffff;
  535. box-shadow: 0px 10px 13px 3px rgba(63, 141, 253, 0.1);
  536. border-radius: 10px;
  537. position: relative;
  538. background: #fff;
  539. padding-top: 100px;
  540. &__img {
  541. width: 280px;
  542. height: 178px;
  543. background: #ffffff;
  544. box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  545. border-radius: 10px;
  546. position: absolute;
  547. left: 10px;
  548. top: -78px;
  549. background: rgba(122, 136, 246, 1);
  550. overflow: hidden;
  551. background: no-repeat center center;
  552. background-size: 280px 178px;
  553. .note {
  554. width: 80px;
  555. height: 24px;
  556. background: #d94404;
  557. box-shadow: 0px 1px 1px 0px rgba(248, 78, 5, 0.4);
  558. border-radius: 10px 0px 20px 0px;
  559. text-align: center;
  560. line-height: 24px;
  561. color: #fff;
  562. }
  563. }
  564. &__title {
  565. margin: 0 8px;
  566. font-size: 14px;
  567. font-family: Microsoft YaHei;
  568. font-weight: 400;
  569. color: #333333;
  570. line-height: 24px;
  571. }
  572. &__desc {
  573. height: 32px;
  574. position: absolute;
  575. left: 0;
  576. right: 0;
  577. bottom: 0;
  578. margin-left: 8px;
  579. display: flex;
  580. justify-content: space-between;
  581. .price {
  582. font-size: 18px;
  583. font-family: Microsoft YaHei;
  584. font-weight: bold;
  585. color: #ff2d55;
  586. line-height: 32px;
  587. }
  588. .add {
  589. display: block;
  590. width: 118px;
  591. height: 32px;
  592. line-height: 30px;
  593. background: #f2f4f7;
  594. border-radius: 10px 0px 10px 0px;
  595. font-size: 16px;
  596. color: #3f8dfd;
  597. text-align: center;
  598. &:hover {
  599. background: #3f8dfd;
  600. color: #f2f4f7;
  601. }
  602. }
  603. }
  604. }
  605. }
  606. }
  607. }
  608. }
  609. }
  610. }
  611. </style>