index.vue 18 KB

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