@focus-teach/ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/.browserslistrc +2 -0
  2. package/.history/package_20230625121458.json +45 -0
  3. package/.history/package_20230626100440.json +45 -0
  4. package/.history/package_20230626100445.json +45 -0
  5. package/.history/package_20230626100447.json +45 -0
  6. package/.history/package_20230626100636.json +45 -0
  7. package/.history/package_20230626100801.json +45 -0
  8. package/.history/package_20230626100803.json +45 -0
  9. package/.history/package_20230626100838.json +45 -0
  10. package/.history/package_20230626103314.json +45 -0
  11. package/.history/package_20230626103317.json +45 -0
  12. package/.history/packages/assets/css/reset-element_20230605134721.scss +167 -0
  13. package/.history/packages/assets/css/reset-element_20230614205652.scss +173 -0
  14. package/.history/packages/assets/css/reset-element_20230614205654.scss +173 -0
  15. package/.history/packages/assets/css/reset-element_20230614211242.scss +169 -0
  16. package/.history/packages/assets/css/reset-element_20230614211245.scss +167 -0
  17. package/.history/packages/exam-detail/src/index_20230607220441.vue +548 -0
  18. package/.history/packages/exam-detail/src/index_20230613115618.vue +548 -0
  19. package/.history/packages/exam-detail/src/index_20230613115623.vue +548 -0
  20. package/.history/packages/exam-detail/src/index_20230613115629.vue +548 -0
  21. package/.history/packages/exam-detail/src/index_20230613115631.vue +548 -0
  22. package/.history/packages/exam-detail/src/index_20230613115640.vue +548 -0
  23. package/.history/packages/exam-detail/src/index_20230613115651.vue +548 -0
  24. package/.history/packages/exam-detail/src/index_20230613115659.vue +548 -0
  25. package/.history/packages/exam-detail/src/index_20230613115750.vue +548 -0
  26. package/.history/packages/exam-detail/src/index_20230613115806.vue +548 -0
  27. package/.history/packages/exam-detail/src/index_20230613115811.vue +548 -0
  28. package/.history/packages/exam-detail/src/index_20230613115815.vue +548 -0
  29. package/.history/packages/exam-detail/src/index_20230613120250.vue +548 -0
  30. package/.history/packages/exam-detail/src/index_20230613120252.vue +548 -0
  31. package/.history/packages/exam-detail/src/index_20230613120257.vue +547 -0
  32. package/.history/packages/exam-detail/src/index_20230613120323.vue +547 -0
  33. package/.history/packages/exam-detail/src/index_20230613120327.vue +547 -0
  34. package/.history/packages/exam-detail/src/index_20230613120328.vue +547 -0
  35. package/.history/packages/exam-detail/src/index_20230613120915.vue +548 -0
  36. package/.history/packages/exam-detail/src/index_20230613120917.vue +548 -0
  37. package/.history/packages/exam-detail/src/index_20230613120922.vue +549 -0
  38. package/.history/packages/exam-detail/src/index_20230613120924.vue +549 -0
  39. package/.history/packages/exam-detail/src/index_20230613120928.vue +550 -0
  40. package/.history/packages/exam-detail/src/index_20230613120930.vue +550 -0
  41. package/.history/packages/exam-detail/src/index_20230613120936.vue +549 -0
  42. package/.history/packages/exam-detail/src/index_20230613120938.vue +550 -0
  43. package/.history/packages/exam-detail/src/index_20230613120942.vue +550 -0
  44. package/.history/packages/exam-detail/src/index_20230613120944.vue +550 -0
  45. package/.history/packages/exam-detail/src/index_20230613121331.vue +549 -0
  46. package/.history/packages/exam-detail/src/index_20230613121333.vue +548 -0
  47. package/.history/packages/exam-detail/src/index_20230613121335.vue +547 -0
  48. package/.history/packages/exam-detail/src/index_20230613121341.vue +547 -0
  49. package/.history/packages/exam-detail/src/index_20230613121344.vue +546 -0
  50. package/.history/packages/exam-detail/src/index_20230613153022.vue +546 -0
  51. package/.history/packages/exam-detail/src/index_20230613153027.vue +546 -0
  52. package/.history/packages/exam-detail/src/index_20230613153620.vue +546 -0
  53. package/.history/packages/exam-detail/src/index_20230613164734.vue +546 -0
  54. package/.history/packages/exam-detail/src/index_20230613164746.vue +546 -0
  55. package/.history/packages/exam-detail/src/index_20230613164756.vue +546 -0
  56. package/.history/packages/exam-drawer/src/index_20230607103301.vue +1470 -0
  57. package/.history/packages/exam-drawer/src/index_20230613090746.vue +1469 -0
  58. package/.history/packages/exam-drawer/src/index_20230613090759.vue +1469 -0
  59. package/.history/packages/exam-drawer/src/index_20230613090802.vue +1469 -0
  60. package/.history/packages/exam-drawer/src/index_20230613090809.vue +1469 -0
  61. package/.history/packages/exam-drawer/src/index_20230613090850.vue +1470 -0
  62. package/.history/packages/exam-drawer/src/index_20230613090919.vue +1487 -0
  63. package/.history/packages/exam-drawer/src/index_20230613090930.vue +1486 -0
  64. package/.history/packages/exam-drawer/src/index_20230613090935.vue +1485 -0
  65. package/.history/packages/exam-drawer/src/index_20230613091124.vue +1488 -0
  66. package/.history/packages/exam-drawer/src/index_20230613091140.vue +1488 -0
  67. package/.history/packages/exam-drawer/src/index_20230613091141.vue +1488 -0
  68. package/.history/packages/exam-drawer/src/index_20230613092108.vue +1489 -0
  69. package/.history/packages/exam-drawer/src/index_20230613092111.vue +1489 -0
  70. package/.history/packages/exam-drawer/src/index_20230613093130.vue +1490 -0
  71. package/.history/packages/exam-drawer/src/index_20230613093135.vue +1489 -0
  72. package/.history/packages/exam-drawer/src/index_20230613093149.vue +1488 -0
  73. package/.history/packages/exam-drawer/src/index_20230613093156.vue +1487 -0
  74. package/.history/packages/exam-drawer/src/index_20230613093159.vue +1486 -0
  75. package/.history/packages/exam-drawer/src/index_20230613093202.vue +1485 -0
  76. package/.history/packages/exam-drawer/src/index_20230613093204.vue +1484 -0
  77. package/.history/packages/exam-drawer/src/index_20230613093207.vue +1483 -0
  78. package/.history/packages/exam-drawer/src/index_20230613093209.vue +1482 -0
  79. package/.history/packages/exam-drawer/src/index_20230613093212.vue +1483 -0
  80. package/.history/packages/exam-drawer/src/index_20230613093217.vue +1483 -0
  81. package/.history/packages/exam-drawer/src/index_20230613093228.vue +1483 -0
  82. package/.history/packages/exam-drawer/src/index_20230613093229.vue +1483 -0
  83. package/.history/packages/exam-drawer/src/index_20230613093843.vue +1482 -0
  84. package/.history/packages/exam-drawer/src/index_20230613093847.vue +1481 -0
  85. package/.history/packages/exam-drawer/src/index_20230613093851.vue +1480 -0
  86. package/.history/packages/exam-drawer/src/index_20230613115708.vue +1480 -0
  87. package/.history/packages/exam-drawer/src/index_20230613115823.vue +1480 -0
  88. package/.history/packages/exam-drawer/src/index_20230613115825.vue +1480 -0
  89. package/.history/packages/exam-drawer/src/index_20230613115827.vue +1480 -0
  90. package/.history/packages/exam-drawer/src/index_20230613120908.vue +1481 -0
  91. package/.history/packages/exam-drawer/src/index_20230613120910.vue +1481 -0
  92. package/.history/packages/exam-drawer/src/index_20230613121320.vue +1480 -0
  93. package/.history/packages/exam-drawer/src/index_20230613121326.vue +1480 -0
  94. package/.history/packages/exam-drawer/src/index_20230613144244.vue +1479 -0
  95. package/.history/packages/exam-drawer/src/index_20230613144246.vue +1478 -0
  96. package/.history/packages/exam-drawer/src/index_20230613144248.vue +1477 -0
  97. package/.history/packages/exam-drawer/src/index_20230613144251.vue +1476 -0
  98. package/.history/packages/exam-drawer/src/index_20230613152608.vue +1476 -0
  99. package/.history/packages/header/src/index_20230605134719.vue +59 -0
  100. package/.history/packages/header/src/index_20230613115723.vue +59 -0
  101. package/.history/packages/header/src/index_20230613115727.vue +59 -0
  102. package/.history/packages/header/src/index_20230613115733.vue +59 -0
  103. package/.history/packages/header/src/index_20230613115736.vue +59 -0
  104. package/.history/packages/header/src/index_20230613120901.vue +60 -0
  105. package/.history/packages/header/src/index_20230613120903.vue +60 -0
  106. package/.history/packages/header/src/index_20230613121316.vue +59 -0
  107. package/.history/packages/question-drawer/src/index_20230607160653.vue +1735 -0
  108. package/.history/packages/question-drawer/src/index_20230607160720.scss +265 -0
  109. package/.history/packages/question-drawer/src/index_20230613090910.vue +1735 -0
  110. package/.history/packages/question-drawer/src/index_20230613090928.vue +1734 -0
  111. package/.history/packages/question-drawer/src/index_20230613090937.vue +1733 -0
  112. package/.history/packages/question-drawer/src/index_20230613115842.vue +1733 -0
  113. package/.history/packages/question-drawer/src/index_20230613115844.vue +1733 -0
  114. package/.history/packages/question-drawer/src/index_20230613115848.vue +1733 -0
  115. package/.history/packages/question-drawer/src/index_20230613115902.vue +1733 -0
  116. package/.history/packages/question-drawer/src/index_20230613115911.vue +1733 -0
  117. package/.history/packages/question-drawer/src/index_20230613115914.vue +1733 -0
  118. package/.history/packages/question-drawer/src/index_20230613115922.vue +1733 -0
  119. package/.history/packages/question-drawer/src/index_20230613120356.vue +1733 -0
  120. package/.history/packages/question-drawer/src/index_20230613120359.vue +1732 -0
  121. package/.history/packages/question-drawer/src/index_20230613120710.vue +1731 -0
  122. package/.history/packages/question-drawer/src/index_20230613120839.vue +1732 -0
  123. package/.history/packages/question-drawer/src/index_20230613120841.vue +1732 -0
  124. package/.history/packages/question-drawer/src/index_20230613120844.vue +1733 -0
  125. package/.history/packages/question-drawer/src/index_20230613120846.vue +1733 -0
  126. package/.history/packages/question-drawer/src/index_20230613120850.vue +1734 -0
  127. package/.history/packages/question-drawer/src/index_20230613120852.vue +1734 -0
  128. package/.history/packages/question-drawer/src/index_20230613120856.vue +1735 -0
  129. package/.history/packages/question-drawer/src/index_20230613120858.vue +1735 -0
  130. package/.history/packages/question-drawer/src/index_20230613121150.vue +1735 -0
  131. package/.history/packages/question-drawer/src/index_20230613121238.vue +1734 -0
  132. package/.history/packages/question-drawer/src/index_20230613121252.vue +1734 -0
  133. package/.history/packages/question-drawer/src/index_20230613121256.vue +1734 -0
  134. package/.history/packages/question-drawer/src/index_20230613121258.vue +1733 -0
  135. package/.history/packages/question-drawer/src/index_20230613121303.vue +1733 -0
  136. package/.history/packages/question-drawer/src/index_20230613121307.vue +1733 -0
  137. package/.history/packages/question-drawer/src/index_20230613121310.vue +1732 -0
  138. package/.history/packages/question-drawer/src/index_20230613121313.vue +1731 -0
  139. package/.history/packages/question-drawer/src/index_20230613121549.vue +1731 -0
  140. package/.history/packages/question-drawer/src/index_20230613121623.vue +1731 -0
  141. package/.history/packages/question-drawer/src/index_20230613151515.vue +1730 -0
  142. package/.history/packages/question-drawer/src/index_20230613151517.vue +1729 -0
  143. package/.history/packages/question-drawer/src/index_20230613151612.vue +1729 -0
  144. package/.history/packages/question-drawer/src/index_20230613151618.vue +1729 -0
  145. package/.history/packages/question-drawer/src/index_20230613151928.vue +1729 -0
  146. package/.history/packages/question-drawer/src/index_20230613151929.vue +1729 -0
  147. package/.history/packages/question-drawer/src/index_20230613152233.vue +1728 -0
  148. package/.history/packages/question-drawer/src/index_20230613152235.vue +1727 -0
  149. package/.history/packages/question-drawer/src/index_20230613152237.vue +1726 -0
  150. package/.history/packages/question-drawer/src/index_20230613152239.vue +1726 -0
  151. package/.history/packages/question-drawer/src/index_20230613152243.vue +1725 -0
  152. package/.history/packages/question-drawer/src/index_20230613152245.vue +1724 -0
  153. package/.history/packages/question-drawer/src/index_20230613152247.vue +1723 -0
  154. package/.history/packages/question-drawer/src/index_20230613152248.vue +1723 -0
  155. package/.history/packages/question-drawer/src/index_20230613152543.vue +1723 -0
  156. package/.history/packages/question-drawer/src/index_20230613152613.vue +1723 -0
  157. package/.history/packages/question-drawer/src/index_20230614203619.vue +1725 -0
  158. package/.history/packages/question-drawer/src/index_20230614203633.vue +1729 -0
  159. package/.history/packages/question-drawer/src/index_20230614203637.vue +1729 -0
  160. package/.history/packages/question-drawer/src/index_20230614203912.vue +1729 -0
  161. package/.history/packages/question-drawer/src/index_20230614211516.scss +270 -0
  162. package/.history/packages/question-drawer/src/index_20230614212057.scss +265 -0
  163. package/.history/packages/question-drawer/src/index_20230614212140.scss +270 -0
  164. package/.history/packages/question-drawer/src/index_20230614212146.scss +270 -0
  165. package/.history/packages/question-drawer/src/index_20230614212158.scss +270 -0
  166. package/.history/packages/question-drawer/src/index_20230614212613.scss +270 -0
  167. package/.history/packages/question-drawer/src/index_20230614212615.scss +270 -0
  168. package/.history/packages/question-drawer/src/index_20230614212841.scss +270 -0
  169. package/.history/packages/question-drawer/src/index_20230614212939.scss +270 -0
  170. package/.history/packages/question-drawer/src/index_20230614213141.scss +270 -0
  171. package/.history/packages/question-drawer/src/index_20230614213255.scss +270 -0
  172. package/.history/packages/question-drawer/src/index_20230614213349.scss +265 -0
  173. package/.history/packages/question-drawer/src/index_20230614213350.scss +265 -0
  174. package/.history/packages/question-drawer/src/index_20230614213400.scss +265 -0
  175. package/.history/packages/question-drawer/src/index_20230614213401.scss +270 -0
  176. package/.history/packages/question-drawer/src/index_20230614213431.scss +265 -0
  177. package/.history/packages/question-drawer/src/index_20230615100944.vue +1730 -0
  178. package/.history/packages/question-drawer/src/index_20230615100946.vue +1730 -0
  179. package/.history/packages/question-drawer/src/index_20230615100952.vue +1730 -0
  180. package/.history/packages/question-drawer/src/index_20230615100957.vue +1730 -0
  181. package/.history/packages/question-drawer/src/index_20230615104839.vue +1730 -0
  182. package/.history/packages/tabs/src/index_20230607165331.scss +60 -0
  183. package/.history/packages/tabs/src/index_20230614211226.scss +60 -0
  184. package/.history/packages/tabs/src/index_20230614211227.scss +61 -0
  185. package/.history/packages/tabs/src/index_20230614211253.scss +65 -0
  186. package/.history/packages/tabs/src/index_20230614211332.scss +60 -0
  187. package/.history/packages/wrong-detail/src/index_20230607221202.vue +570 -0
  188. package/.history/packages/wrong-detail/src/index_20230613120416.vue +570 -0
  189. package/.history/packages/wrong-detail/src/index_20230613120418.vue +569 -0
  190. package/.history/packages/wrong-detail/src/index_20230613120738.vue +568 -0
  191. package/.history/packages/wrong-detail/src/index_20230613120800.vue +568 -0
  192. package/.history/packages/wrong-detail/src/index_20230613120803.vue +568 -0
  193. package/.history/packages/wrong-detail/src/index_20230613120825.vue +568 -0
  194. package/.history/packages/wrong-detail/src/index_20230613120834.vue +569 -0
  195. package/.history/packages/wrong-detail/src/index_20230613121246.vue +568 -0
  196. package/.history/packages/wrong-detail/src/index_20230613155421.vue +574 -0
  197. package/.history/packages/wrong-detail/src/index_20230613155423.vue +574 -0
  198. package/.history/packages/wrong-detail/src/index_20230613155426.vue +574 -0
  199. package/.history/packages/wrong-drawer/src/index_20230607213124.vue +450 -0
  200. package/.history/packages/wrong-drawer/src/index_20230613104307.vue +450 -0
  201. package/.history/packages/wrong-drawer/src/index_20230613104315.vue +451 -0
  202. package/.history/packages/wrong-drawer/src/index_20230613104317.vue +451 -0
  203. package/.history/packages/wrong-drawer/src/index_20230613104334.vue +451 -0
  204. package/.history/packages/wrong-drawer/src/index_20230613104403.vue +450 -0
  205. package/.history/packages/wrong-drawer/src/index_20230613104405.vue +449 -0
  206. package/.history/packages/wrong-drawer/src/index_20230613104621.vue +458 -0
  207. package/.history/packages/wrong-drawer/src/index_20230613104626.vue +459 -0
  208. package/.history/packages/wrong-drawer/src/index_20230613104629.vue +457 -0
  209. package/.history/packages/wrong-drawer/src/index_20230613104630.vue +457 -0
  210. package/.history/packages/wrong-drawer/src/index_20230613104747.vue +464 -0
  211. package/.history/packages/wrong-drawer/src/index_20230613104749.vue +464 -0
  212. package/.history/packages/wrong-drawer/src/index_20230613104753.vue +464 -0
  213. package/.history/packages/wrong-drawer/src/index_20230613111237.vue +464 -0
  214. package/.history/packages/wrong-drawer/src/index_20230613111314.vue +464 -0
  215. package/.history/packages/wrong-drawer/src/index_20230613114319.vue +464 -0
  216. package/.history/packages/wrong-drawer/src/index_20230613114322.vue +464 -0
  217. package/.history/packages/wrong-drawer/src/index_20230613114901.vue +463 -0
  218. package/.history/packages/wrong-drawer/src/index_20230613114903.vue +462 -0
  219. package/.history/packages/wrong-drawer/src/index_20230613114904.vue +462 -0
  220. package/.history/packages/wrong-drawer/src/index_20230613114909.vue +462 -0
  221. package/.history/packages/wrong-drawer/src/index_20230613114936.vue +463 -0
  222. package/.history/packages/wrong-drawer/src/index_20230613114940.vue +463 -0
  223. package/.history/packages/wrong-drawer/src/index_20230613114942.vue +463 -0
  224. package/.history/packages/wrong-drawer/src/index_20230613115348.vue +487 -0
  225. package/.history/packages/wrong-drawer/src/index_20230613115352.vue +487 -0
  226. package/.history/packages/wrong-drawer/src/index_20230613115356.vue +487 -0
  227. package/.history/packages/wrong-drawer/src/index_20230613115408.vue +500 -0
  228. package/.history/packages/wrong-drawer/src/index_20230613115411.vue +500 -0
  229. package/.history/packages/wrong-drawer/src/index_20230613115414.vue +500 -0
  230. package/.history/packages/wrong-drawer/src/index_20230613144213.vue +499 -0
  231. package/.history/packages/wrong-drawer/src/index_20230613144215.vue +498 -0
  232. package/.history/packages/wrong-drawer/src/index_20230613144218.vue +497 -0
  233. package/.history/packages/wrong-drawer/src/index_20230613144223.vue +497 -0
  234. package/.history/packages/wrong-drawer/src/index_20230613144225.vue +497 -0
  235. package/.history/packages/wrong-drawer/src/index_20230613144229.vue +498 -0
  236. package/.history/packages/wrong-drawer/src/index_20230613144232.vue +498 -0
  237. package/.history/packages/wrong-drawer/src/index_20230613144316.vue +500 -0
  238. package/.history/packages/wrong-drawer/src/index_20230613144345.vue +500 -0
  239. package/.history/packages/wrong-drawer/src/index_20230613144346.vue +500 -0
  240. package/.history/packages/wrong-drawer/src/index_20230613145546.vue +498 -0
  241. package/.history/packages/wrong-drawer/src/index_20230613145548.vue +501 -0
  242. package/.history/packages/wrong-drawer/src/index_20230613145550.vue +500 -0
  243. package/.history/packages/wrong-drawer/src/index_20230613145602.vue +500 -0
  244. package/.history/packages/wrong-drawer/src/index_20230613145611.vue +500 -0
  245. package/.history/packages/wrong-drawer/src/index_20230613145625.vue +500 -0
  246. package/.history/packages/wrong-drawer/src/index_20230613145634.vue +500 -0
  247. package/.history/packages/wrong-drawer/src/index_20230613150805.vue +500 -0
  248. package/.history/packages/wrong-drawer/src/index_20230613150806.vue +501 -0
  249. package/.history/packages/wrong-drawer/src/index_20230613150809.vue +501 -0
  250. package/.history/packages/wrong-drawer/src/index_20230613150810.vue +501 -0
  251. package/README.md +14 -0
  252. package/api/index.js +388 -0
  253. package/dist/@focus-teach/ui.common.js +93058 -0
  254. package/dist/@focus-teach/ui.css +1 -0
  255. package/dist/@focus-teach/ui.umd.js +93068 -0
  256. package/dist/@focus-teach/ui.umd.min.js +25 -0
  257. package/dist/demo.html +10 -0
  258. package/dist/fonts/icomoon.356dc15f.woff +0 -0
  259. package/dist/fonts/icomoon.71d64f31.woff +0 -0
  260. package/dist/fonts/icomoon.7c9a60d9.eot +0 -0
  261. package/dist/fonts/icomoon.ba18ad87.eot +0 -0
  262. package/dist/fonts/icomoon.de76432e.ttf +0 -0
  263. package/dist/fonts/icomoon.ec37e716.ttf +0 -0
  264. package/dist/img/cloud_txt_24.87b9d2ae.svg +1 -0
  265. package/dist/img/icomoon.428f3063.svg +346 -0
  266. package/dist/img/icomoon.532b3795.svg +345 -0
  267. package/dist/img/icon_question.e931b16c.svg +14 -0
  268. package/mixins/emitter.js +33 -0
  269. package/package.json +45 -0
  270. package/postcss.config.js +19 -0
  271. package/style/icon/Read Me.txt +7 -0
  272. package/style/icon/demo-files/demo.css +152 -0
  273. package/style/icon/demo-files/demo.js +30 -0
  274. package/style/icon/demo.html +4042 -0
  275. package/style/icon/fonts/icomoon.eot +0 -0
  276. package/style/icon/fonts/icomoon.svg +346 -0
  277. package/style/icon/fonts/icomoon.ttf +0 -0
  278. package/style/icon/fonts/icomoon.woff +0 -0
  279. package/style/icon/selection.json +1 -0
  280. package/style/icon/style.css +1191 -0
  281. package/tests/unit/example.spec.js +13 -0
  282. package/utils/Constants.js +59 -0
  283. package/utils/assist.js +100 -0
  284. package/utils/changNumber.js +26 -0
  285. package/utils/common.js +109 -0
  286. package/utils/random_str.js +9 -0
@@ -0,0 +1,1723 @@
1
+ <!--右侧题目题库抽屉-->
2
+ <template>
3
+ <div class="question-drawer">
4
+ <ft-drawer>
5
+ <ft-tabs
6
+ :options="
7
+ examPointEnableFlag == 1 && examPointList && examPointList.length > 0
8
+ ? tabListWithPoint
9
+ : tabList
10
+ "
11
+ :activeName="activeTab"
12
+ @click="tabClick"
13
+ ></ft-tabs>
14
+ <div class="cascader course" v-show="activeTab == 'course'">
15
+ <ft-cascader
16
+ :options="materialsGradesList"
17
+ :value.sync="currentMaterials"
18
+ @change="changeMaterials"
19
+ ></ft-cascader>
20
+ <ft-cascader
21
+ :options="courseCascaderList"
22
+ :value.sync="currentCourse"
23
+ :props="{
24
+ value: 'courseId',
25
+ label: 'courseName',
26
+ children: 'courses',
27
+ checkStrictly: true,
28
+ }"
29
+ ref="course"
30
+ selfRef="courseCascader"
31
+ @change="changeCourse"
32
+ ></ft-cascader>
33
+ </div>
34
+ <div class="cascader knowledge" v-show="activeTab == 'knowledge'">
35
+ <el-popover
36
+ ref="knowledgePopover"
37
+ style="padding: 0; margin-top: 40px"
38
+ placement="bottom-start"
39
+ width="492"
40
+ trigger="click"
41
+ v-model="knowledgeVisible"
42
+ popper-class="knowledge-popover"
43
+ >
44
+ <div class="knowledge-popover">
45
+ <el-input
46
+ v-model="filterText"
47
+ placeholder="搜索知识点"
48
+ clearable
49
+ size="small"
50
+ style="width: calc(100% - 20px); margin: 5px 10px"
51
+ ></el-input>
52
+ <div class="catalog-tool">
53
+ <el-switch
54
+ class="self-switch"
55
+ v-model="switchValue"
56
+ active-color="#E2E2E2"
57
+ inactive-color="#E2E2E2"
58
+ :active-text="i18n.duoXuan"
59
+ :inactive-text="i18n.danXuan"
60
+ >
61
+ </el-switch>
62
+ <div class="tool-btn-tab" v-show="switchValue">
63
+ <div
64
+ :class="[
65
+ 'knowledge-btn',
66
+ knowledgeType == 0
67
+ ? 'knowledge-btn-select'
68
+ : 'knowledge-btn-normal',
69
+ ]"
70
+ @click="choiseKnowledgeType(0)"
71
+ >
72
+ {{ i18n.zhiShiDianJiaoJi }}
73
+ </div>
74
+ <div
75
+ :class="[
76
+ 'knowledge-btn',
77
+ knowledgeType == 1
78
+ ? 'knowledge-btn-select'
79
+ : 'knowledge-btn-normal',
80
+ ]"
81
+ @click="choiseKnowledgeType(1)"
82
+ >
83
+ {{ i18n.zhiShiDianBingJi }}
84
+ </div>
85
+ </div>
86
+ </div>
87
+ <el-tree
88
+ class="self-tree"
89
+ :data="klList"
90
+ :show-checkbox="switchValue"
91
+ :props="{
92
+ label: 'klname',
93
+ children: 'knowledgeDtoList',
94
+ }"
95
+ :empty-text="i18n.zanWuShuJu"
96
+ node-key="klId"
97
+ ref="secondTree"
98
+ highlight-current
99
+ :filter-node-method="knowledgeFilterNode"
100
+ @node-click="clickKnowledgeNode"
101
+ @check="checkKnowledgeNode"
102
+ >
103
+ <span class="span-ellipsis" slot-scope="{ node }">
104
+ <span :title="node.label">{{ decode(node.label) }}</span>
105
+ </span>
106
+ </el-tree>
107
+ <div class="tool-btn" v-show="switchValue">
108
+ <div class="btn-title">
109
+ {{ i18n.yiXuanZeZhiShiDian
110
+ }}<span class="btn-count">{{ klArr.length }}</span>
111
+ </div>
112
+ <div
113
+ :class="[
114
+ 'btn',
115
+ klArr.length > 0 && klArr.length <= 100
116
+ ? 'btn-sure'
117
+ : 'btn-disable',
118
+ ]"
119
+ @click="toQueryWithKnowledges"
120
+ >
121
+ {{ i18n.queDing }}
122
+ </div>
123
+ <div
124
+ :class="['btn', klArr.length > 0 ? 'btn-clear' : 'btn-disable']"
125
+ @click="clearKnowledges"
126
+ >
127
+ {{ i18n.qingKong }}
128
+ </div>
129
+ </div>
130
+ <toast
131
+ style="
132
+ position: fixed;
133
+ top: 300px;
134
+ right: 120px;
135
+ width: 278px;
136
+ z-index: 10000;
137
+ "
138
+ :toastOptions="toastOptions"
139
+ ></toast>
140
+ </div>
141
+ </el-popover>
142
+ <div class="knowledge-back">
143
+ <div v-popover:knowledgePopover class="knowledge-back-pop">
144
+ <el-tooltip
145
+ :class="
146
+ knowledgeName.length > 0 ? 'item' : 'knowledge-title-item'
147
+ "
148
+ style="margin-top: 0"
149
+ effect="dark"
150
+ :disabled="isShowTooltip"
151
+ :content="allKnowledgeName"
152
+ placement="bottom"
153
+ >
154
+ <input
155
+ :class="[
156
+ 'knowledge-input',
157
+ knowledgeVisible
158
+ ? 'knowledge-input-show'
159
+ : 'knowledge-input-normal',
160
+ knowledgeName.length > 0 ? 'knowledge-input-value' : '',
161
+ ]"
162
+ type="button"
163
+ :value="
164
+ knowledgeName.length > 0
165
+ ? knowledgeName
166
+ : knowledgePlaceholder
167
+ "
168
+ />
169
+ </el-tooltip>
170
+ <i
171
+ :class="
172
+ knowledgeVisible ? 'icon-drop-up-btn' : 'icon-drop-down-btn'
173
+ "
174
+ ></i>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ <div class="cascader point" v-show="activeTab == 'point'">
179
+ <ft-cascader
180
+ :options="pointData"
181
+ :value.sync="currentPointId"
182
+ @change="handlePointChange"
183
+ :props="{
184
+ value: 'pointId',
185
+ label: 'pointName',
186
+ children: 'subExamPointDto',
187
+ checkStrictly: true,
188
+ }"
189
+ >
190
+ </ft-cascader>
191
+ </div>
192
+ <div class="screen">
193
+ <ft-radio
194
+ v-show="itemBankTypeList.length"
195
+ :label="i18n.laiYuan"
196
+ :options="itemBankTypeList"
197
+ :defaultValue="indexParam.itemBankType"
198
+ :props="{
199
+ label: 'itemBankTypeName',
200
+ id: 'itemBankType',
201
+ }"
202
+ @radio-click="sourceClick"
203
+ ></ft-radio>
204
+ <ft-radio
205
+ v-show="topicList.length && defaultCategoryType != 4"
206
+ :label="i18n.zhuanTi"
207
+ :options="topicList"
208
+ :defaultValue="indexParam.topicId ? indexParam.topicId : 'all'"
209
+ :props="{
210
+ label: 'topicName',
211
+ id: 'topicId',
212
+ }"
213
+ @radio-click="topicClick"
214
+ ></ft-radio>
215
+ <ft-radio
216
+ v-show="itemCategoryList.length"
217
+ :label="i18n.tiXing"
218
+ :options="itemCategoryList"
219
+ :defaultValue="
220
+ indexParam.itemCategoryId ? indexParam.itemCategoryId : 'all'
221
+ "
222
+ :props="{
223
+ label: 'itemCategoryName',
224
+ id: 'itemCategoryId',
225
+ }"
226
+ @radio-click="categoryClick"
227
+ ></ft-radio>
228
+ <ft-radio
229
+ v-show="difficultyList.length"
230
+ :label="i18n.nanDu"
231
+ :options="difficultyList"
232
+ :defaultValue="
233
+ indexParam.difficultyId ? indexParam.difficultyId : 'all'
234
+ "
235
+ :props="{
236
+ label: 'difficultyName',
237
+ id: 'difficultyId',
238
+ }"
239
+ @radio-click="difficultyClick"
240
+ ></ft-radio>
241
+ <ft-radio
242
+ v-show="basicSkillsList.length"
243
+ :label="i18n.jiNeng"
244
+ :options="basicSkillsList"
245
+ :defaultValue="
246
+ indexParam.basicSkillsId ? indexParam.basicSkillsId : 'all'
247
+ "
248
+ :props="{
249
+ label: 'basicName',
250
+ id: 'basicSkillsId',
251
+ }"
252
+ @radio-click="basicSkillClick"
253
+ ></ft-radio>
254
+ <ft-radio
255
+ v-if="coreLiteracyFlag && coreLiteracyList.length"
256
+ label="素养"
257
+ :options="coreLiteracyList"
258
+ :defaultValue="indexParam.literacyId ? indexParam.literacyId : 'all'"
259
+ :props="{
260
+ label: 'literacyName',
261
+ id: 'literacyId',
262
+ }"
263
+ @radio-click="coreLiteracyClick"
264
+ :isHtml="true"
265
+ :collapse="true"
266
+ ></ft-radio>
267
+ <ft-radio
268
+ v-show="yearList.length && defaultCategoryType != 4"
269
+ :label="i18n.nianFen"
270
+ :options="yearList"
271
+ :defaultValue="indexParam.year ? indexParam.year : 'all'"
272
+ @radio-click="yearClick"
273
+ ></ft-radio>
274
+ <!-- <ft-radio
275
+ v-show="coreLiteracyList.length"
276
+ label="核心素养"
277
+ :options="coreLiteracyList"
278
+ :defaultValue="indexParam.year ? indexParam.year : 'all'"
279
+ @radio-click="yearClick"
280
+ ></ft-radio> -->
281
+ </div>
282
+ <div
283
+ class="question"
284
+ id="tk-detail-drawer-slot-id"
285
+ v-infinite-scroll="changeCurrentPage"
286
+ :infinite-scroll-disabled="!hasMore"
287
+ infinite-scroll-distance="40"
288
+ >
289
+ <ft-header
290
+ :options="sortList"
291
+ @sort="headerSort"
292
+ default-sort="updateTime"
293
+ v-show="itemInfoList.length"
294
+ >
295
+ {{ i18n.gong }}{{ itemInfoList.length }}{{ i18n.daoTiMu }}
296
+ </ft-header>
297
+ <div id="bankData-drawer-slot-id">
298
+ <ft-question
299
+ v-show=" !loadingBankData && !loadingError && itemInfoList.length > 0 "
300
+ v-for="(item, index) in itemInfoList"
301
+ :key="item.itemInfoId"
302
+ :itemInfo="item"
303
+ :itemIndex="index + 1"
304
+ :examItemList="itemList"
305
+ :variantList="itemList"
306
+ :pointNames="item.pointNames || '--'"
307
+ :klNames="item.klNames || '--'"
308
+ :skill="item.basicSkillNames || '--'"
309
+ :answer="item.answer || '--'"
310
+ :analysis="item.analysis || '--'"
311
+ :itemCategoryName="item.itemCategoryName"
312
+ :topicName="item.topicName"
313
+ :difficultyId="item.difficultyId"
314
+ :difficultyName="item.difficultyName"
315
+ :audioFileId="item.audioFileId"
316
+ :itemFromType="item.itemFromType"
317
+ :content="item.content"
318
+ :updateTime="item.updateTime"
319
+ :referenceCount="item.referenceCount"
320
+ :itemInfoId="item.itemInfoId"
321
+ :provinceId="item.provinceId"
322
+ :provinceName="item.provinceName"
323
+ :areaId="item.areaId"
324
+ :districtId="item.districtId"
325
+ :areaName="item.areaName"
326
+ :districtName="item.districtName"
327
+ :year="item.year"
328
+ :rootItemInfoId="item.rootItemInfoId"
329
+ :itemSourceType="item.itemSourceType"
330
+ @showAnswer="getAnswer"
331
+ @getContent="getContent"
332
+ @choiceOrRemoveQuestion="choiceOrRemoveQuestion"
333
+ @toShowAudio="toShowAudio"
334
+ :fromType="fromType"
335
+ ></ft-question>
336
+ </div>
337
+ <ft-empty v-show="!loadingBankData && !loadingError && itemInfoList.length == 0" :message="i18n.zanWuTiMu">
338
+ <img
339
+ class="empty-img"
340
+ :src="host + '/assets/prepare-course/list/img/empty.fcdd9ba5.png'"
341
+ alt=""
342
+ />
343
+ </ft-empty>
344
+ <ft-error v-show="!loadingBankData && loadingError" @retry="clickRetryBtn" >
345
+ <img
346
+ class="error-img"
347
+ :src="host + '/assets/prepare-course/list/img/error.7e494464.png'"
348
+ alt=""
349
+ />
350
+ </ft-error>
351
+ <div v-show="loadingBankData" class="loading"></div>
352
+ </div>
353
+ <div class="page-contro" v-show="itemInfoList.length > 0">
354
+ {{
355
+ drawerPageError
356
+ ? this.i18n.jiaZaiShiBai
357
+ : loading
358
+ ? this.i18n.jiaZaiZhong
359
+ : hasMore
360
+ ? ""
361
+ : this.i18n.jiaZaiWanBi
362
+ }}
363
+ </div>
364
+ </ft-drawer>
365
+ </div>
366
+ </template>
367
+
368
+ <script>
369
+ import {
370
+ Tabs,
371
+ TabPane,
372
+ Cascader,
373
+ Popover,
374
+ Tooltip,
375
+ Loading,
376
+ Tree,
377
+ Input,
378
+ } from "element-ui";
379
+ import FtTabs from "../../tabs/index";
380
+ import FtCascader from "../../cascader/index";
381
+ import FtQuestion from "../../question/index";
382
+ import FtHeader from "../../header/index";
383
+ import FtRadio from "../../radio/index";
384
+ import FtDrawer from "../../drawer/index";
385
+ import FtEmpty from "../../empty/index";
386
+ import FtError from "../../error/index";
387
+ import {
388
+ getBankIndex,
389
+ getBankData,
390
+ getMaterialsGrades,
391
+ getKnowledge,
392
+ getEditorCourse,
393
+ getTopic,
394
+ getKldftNecessary,
395
+ getQuestion,
396
+ getAnswer,
397
+ } from "../../../api/index";
398
+ import { decodeEntities } from "../../../utils/common";
399
+ import Toast from "./Toast";
400
+ import infiniteScroll from "vue-infinite-scroll";
401
+ export default {
402
+ name: "FtQuestionDrawer",
403
+ // import引入的组件需要注入到对象中才能使用
404
+ components: {
405
+ Toast,
406
+ [Tabs.name]: Tabs,
407
+ [TabPane.name]: TabPane,
408
+ [Cascader.name]: Cascader,
409
+ [Popover.name]: Popover,
410
+ [Tooltip.name]: Tooltip,
411
+ [Tree.name]: Tree,
412
+ [Input.name]: Input,
413
+ FtTabs,
414
+ FtCascader,
415
+ FtQuestion,
416
+ FtHeader,
417
+ FtRadio,
418
+ FtDrawer,
419
+ FtError,
420
+ FtEmpty,
421
+ },
422
+ directives: { infiniteScroll },
423
+ props: {
424
+ itemList: {
425
+ type: Array,
426
+ default: () => [],
427
+ },
428
+ leftInfo: {
429
+ type: Object,
430
+ default: () => {
431
+ return {
432
+ eduLevelId: "",
433
+ subjectId: "",
434
+ courseSrc: "",
435
+ courseId: "",
436
+ };
437
+ },
438
+ },
439
+ fromType: {
440
+ type: String,
441
+ default: "",
442
+ },
443
+ klidsList: {
444
+ type: String,
445
+ default: "",
446
+ },
447
+ i18n: {
448
+ type: Object,
449
+ },
450
+ },
451
+ data() {
452
+ return {
453
+ host: window.location.origin,
454
+ currentPointId: [],
455
+ pointData: [],
456
+ filterText: "",
457
+ activeTab: "course",
458
+ tabList: [
459
+ {
460
+ id: "course",
461
+ label: this.i18n.anTongBuKeCheng,
462
+ },
463
+ {
464
+ id: "knowledge",
465
+ label: this.i18n.anZhiShiDian,
466
+ },
467
+ ],
468
+ tabListWithPoint: [
469
+ {
470
+ id: "course",
471
+ label: this.i18n.anTongBuKeCheng,
472
+ },
473
+ {
474
+ id: "knowledge",
475
+ label: this.i18n.anZhiShiDian,
476
+ },
477
+ {
478
+ id: "point",
479
+ label: this.i18n.anKaoDian,
480
+ },
481
+ ],
482
+ examPointEnableFlag: 0,
483
+ examPointList: [],
484
+ materialsGradesList: [],
485
+ currentMaterials: [],
486
+ courseCascaderList: [],
487
+ currentCourse: [],
488
+ loadingError: false,
489
+ indexParam: {
490
+ itemBackQueryType: 2, //1 按课程 2 按知识点 3 按考点
491
+ page: 1, //页码
492
+ studySectionId: "", //学段id
493
+ subjectId: "", //科目id
494
+ klIds: "", //知识点id集合,多个id以逗号分隔
495
+ klUnionFlag: 1, //知识点交并集标识,0交集,1并集,默认1
496
+ courseId: "", //课程id
497
+ examPointId: "", //考点id
498
+ year: "", //年份
499
+ topicId: "", //专题id
500
+ itemBasicSkillId: "", //基础技能id
501
+ itemCategoryId: "", //题目类型idrtList
502
+ itemDifficultyId: "", //难度id
503
+ order: 0, //排序,0:更新时间倒序,1:更新时间正序
504
+ },
505
+ //首次请求
506
+ isLoading: true,
507
+ defaultCategoryType: 0,
508
+ //题目总数
509
+ totalRecord: 0,
510
+ isFirstIndex: true, //首次加载该题库
511
+ firstRequestCourse: true, //是否首次加载课程
512
+ itemBankTypeList: [],
513
+ topicList: [],
514
+ itemCategoryList: [],
515
+ difficultyList: [],
516
+ basicSkillsList: [],
517
+ coreLiteracyFlag: false,//是否展示核心素养
518
+ coreLiteracyList: [],//核心素养
519
+ years: [],
520
+ itemInfoList: [],
521
+ sortList: [
522
+ {
523
+ label: "使用次数",
524
+ key: "count",
525
+ },
526
+ {
527
+ label: "更新时间",
528
+ key: "updateTime",
529
+ },
530
+ ],
531
+ currentCourseId: "",
532
+ allDifficultyList: [],
533
+ undefinedDifficultyInfo: {
534
+ difficultyCoefficient: "0.0",
535
+ difficultyId: "JPO-tJbAJqc",
536
+ difficultyName: "未定义",
537
+ },
538
+ drawerPageError: false,
539
+ loading: false,
540
+ hasMore: true,
541
+ //是否正在加载题目数据
542
+ loadingBankData: true,
543
+ //加载题目数据是否失败
544
+ loadingError: false,
545
+ currentKlIds: "",
546
+ knowledgeType: 1, //知识点交集:0 || 知识点并集:1
547
+ knowledgeVisible: false,
548
+ currentPointId: [], //考点-当前选择的考点id
549
+ knowledgeName: "", //知识点内容
550
+ isShowTooltip: true,
551
+ allKnowledgeName: "", //没被截取的知识点内容
552
+ switchValue: true, //单选:false || 多选:true
553
+ klList: [],
554
+ klArr: [], //知识点多选时,选择的知识点集合
555
+ knowledgePlaceholder: "",
556
+ inputTempStr: "", //临时存取输入框内容
557
+ toastOptions: { show: false, value: "最多支持100个知识点的查询~" }, //toast的参数
558
+ localKlIds: "",
559
+ firstEnter: true,
560
+ yearList: [],
561
+ };
562
+ },
563
+ //监控data中的数据变化
564
+ watch: {
565
+ "$store.state.resourceInfo": function (n, o) {
566
+ if (this.isFirstIndex) {
567
+ console.log("组件库监听到$store变化", n);
568
+ this.isFirstIndex = false;
569
+ this.requestIndexData();
570
+ if (!n.action) this.currentCourse = n.courseId || (n.list && n.list.courseId);
571
+ }
572
+ },
573
+ materialsGradesList(newValue, oldValue) {
574
+ let firstV = "";
575
+ let secondV = "";
576
+ let thirdV = "";
577
+ newValue.forEach((element) => {
578
+ if (element.value == this.currentCourseValue[0]) {
579
+ firstV = element.value;
580
+ element.children.forEach((item) => {
581
+ if (item.value == this.currentCourseValue[1]) {
582
+ secondV = item.value;
583
+ item.children.forEach((option) => {
584
+ if (option.value == this.currentCourseValue[2]) {
585
+ thirdV = option.value;
586
+ }
587
+ });
588
+ }
589
+ });
590
+ }
591
+ });
592
+ this.currentMaterials = [firstV, secondV, thirdV];
593
+ },
594
+ courseCascaderList(newValue, oldValue) {
595
+ this.courseCascaderList = newValue;
596
+ if (
597
+ this.firstRequestCourse &&
598
+ this.courseCascaderList &&
599
+ this.courseCascaderList.length > 0
600
+ ) {
601
+ this.firstRequestCourse = false;
602
+ setTimeout(() => {
603
+ let checkedCourseArr = [];
604
+ let checkedNodes =
605
+ this.$refs.course.$refs.courseCascader.getCheckedNodes(false);
606
+ if (checkedNodes && checkedNodes.length > 0) {
607
+ let currentNode = checkedNodes[0];
608
+ this.getCurrentCheckedCourse(checkedCourseArr, currentNode);
609
+ this.currentCourse = checkedCourseArr;
610
+ }
611
+ }, 200);
612
+ }
613
+ },
614
+ localKlIds: {
615
+ handler() {
616
+ this.currentKlIds = this.localKlIds;
617
+ this.initTreeValue();
618
+ console.log("watch", this.currentKlIds);
619
+ },
620
+ immediate: true,
621
+ },
622
+ filterText(val) {
623
+ if (this.knowledgeVisible) {
624
+ this.$refs.secondTree.filter(val);
625
+ }
626
+ },
627
+ knowledgeVisible(newVal) {
628
+ if (!newVal) {
629
+ this.filterText = "";
630
+ let length = this.$refs.secondTree.$children.length;
631
+ for (let i = 0; i < length; i++) {
632
+ this.$refs.secondTree.$children[i].node.parent.childNodes[
633
+ i
634
+ ].expanded = false;
635
+ }
636
+ }
637
+ },
638
+ examPointList(newValue, oldValue) {
639
+ this.pointData = newValue;
640
+ if (
641
+ this.pointData &&
642
+ this.pointData.length > 0 &&
643
+ (!this.currentPointId || this.currentPointId.length == 0)
644
+ ) {
645
+ this.currentPointId = [this.pointData[0].pointId];
646
+ }
647
+ },
648
+ klidsList(newValue, oldValue) {
649
+ if (!this.firstEnter) {
650
+ this.localKlIds = newValue;
651
+ }
652
+ this.firstEnter = false;
653
+ this.requestBankData();
654
+ },
655
+ years(newValue, oldValue) {
656
+ if (newValue && newValue.length) {
657
+ this.yearList = []
658
+ if(newValue.length > 6){
659
+ let temp = newValue.slice(0,6)
660
+ this.yearList = [...this.yearList, ...temp,{id: 'earlier', label: '更早'}]
661
+ }else {
662
+ newValue.forEach((element) => {
663
+ this.yearList.push(element);
664
+ });
665
+ }
666
+ } else {
667
+ this.yearList = [];
668
+ }
669
+ },
670
+ },
671
+ methods: {
672
+ changeCurrentPage() {
673
+ console.log(this.indexParam);
674
+ if (this.itemInfoList.length >= this.totalRecord) {
675
+ this.hasMore = false;
676
+ return;
677
+ }
678
+ this.indexParam.page = this.currPage + 1;
679
+ this.requestPageBank(this.indexParam);
680
+ },
681
+ handlePointChange(value) {
682
+ var pointId = value[value.length - 1];
683
+ let dic = { examPointId: pointId };
684
+ this.$emit("changeIndexParam", "changePointId", JSON.stringify(dic));
685
+ },
686
+ setListener() {
687
+ let _this = this;
688
+ //改变indexParam参数,重新请求index接口
689
+ this.$off("changeIndexParam"); //避免重复响应同一事件
690
+ this.$on("changeIndexParam", function (action, msg) {
691
+ if (action == "retryRequest") {
692
+ //加载失败后的重新请求 || 删除题目后刷新题目数据
693
+ _this.requestBankData();
694
+ return;
695
+ }
696
+ let dic = JSON.parse(msg);
697
+ for (let key in dic) {
698
+ let value = dic[key];
699
+ _this.indexParam[key] = value;
700
+ }
701
+ if (action == "changeSource") {
702
+ _this.defaultCategoryType = dic["itemBankType"];
703
+ if (_this.defaultCategoryType == 4) {
704
+ _this.indexParam.topicId = "";
705
+ _this.indexParam.year = "";
706
+ let dic = { selectedTopicId: "", currentYear: "" };
707
+
708
+ this.$emit(
709
+ "toChangeSelectedTopicId",
710
+ "toChangeSelectedTopicId",
711
+ JSON.stringify(dic)
712
+ );
713
+ this.$emit(
714
+ "toChangeCurrentYear",
715
+ "toChangeCurrentYear",
716
+ JSON.stringify(dic)
717
+ );
718
+
719
+ this.$emit(
720
+ "eventbus-emit",
721
+ "toChangeSelectedTopicId",
722
+ "toChangeSelectedTopicId",
723
+ JSON.stringify(dic)
724
+ );
725
+ this.$emit(
726
+ "eventbus-emit",
727
+ "toChangeCurrentYear",
728
+ "toChangeCurrentYear",
729
+ JSON.stringify(dic)
730
+ );
731
+ _this.allDifficultyList = JSON.parse(
732
+ JSON.stringify(_this.difficultyList)
733
+ );
734
+ _this.allDifficultyList.push(_this.undefinedDifficultyInfo);
735
+ } else {
736
+ _this.allDifficultyList = JSON.parse(
737
+ JSON.stringify(_this.difficultyList)
738
+ );
739
+ if (_this.indexParam.itemDifficultyId == "JPO-tJbAJqc") {
740
+ _this.indexParam.itemDifficultyId = "";
741
+ let diffDic = { itemDifficultyId: "" };
742
+ this.$emit(
743
+ "toChangeSelectedDifficultyId",
744
+ "toChangeSelectedDifficultyId",
745
+ JSON.stringify(diffDic)
746
+ );
747
+ this.$emit(
748
+ "eventbus-emit",
749
+ "toChangeSelectedDifficultyId",
750
+ "toChangeSelectedDifficultyId",
751
+ JSON.stringify(diffDic)
752
+ );
753
+ }
754
+ //请求专题
755
+ _this.requestTopicData();
756
+ }
757
+ }
758
+ //
759
+ if (action == "changeOrder") {
760
+ delete _this.indexParam.orderQuote;
761
+ }
762
+ if (action == "changeOrderQuote") {
763
+ delete _this.indexParam.order;
764
+ }
765
+ //请求题目数据
766
+ _this.requestBankData();
767
+ });
768
+ //编辑单题成功,若当前来源是我的题库,则刷新题目列表数据
769
+ this.$on("editItemSuccess", async (newItemObj) => {
770
+ if (_this.indexParam.itemBankType == 4) {
771
+ _this.requestBankData();
772
+ }
773
+ });
774
+ },
775
+ tabClick(value) {
776
+ console.log(value);
777
+ this.activeTab = value;
778
+ let _this = this;
779
+ let dic = {};
780
+ switch (this.activeTab) {
781
+ case "course":
782
+ _this.knowledgeVisible = false;
783
+ dic = {
784
+ itemBackQueryType: 1,
785
+ courseId: _this.currentCourseId,
786
+ klIds: "",
787
+ klUnionFlag: 1,
788
+ examPointId: "",
789
+ };
790
+ break;
791
+ case "knowledge":
792
+ dic = {
793
+ itemBackQueryType: 2,
794
+ courseId: _this.currentCourseId,
795
+ klIds: _this.currentKlIds,
796
+ klUnionFlag: _this.knowledgeType,
797
+ examPointId: "",
798
+ };
799
+ break;
800
+ case "point":
801
+ _this.knowledgeVisible = false;
802
+ dic = {
803
+ itemBackQueryType: 3,
804
+ courseId: "",
805
+ klIds: "",
806
+ klUnionFlag: 1,
807
+ examPointId:
808
+ _this.currentPointId.length > 0
809
+ ? _this.currentPointId[_this.currentPointId.length - 1]
810
+ : "",
811
+ };
812
+ break;
813
+ }
814
+ this.$emit("changeIndexParam", "changeTab", JSON.stringify(dic));
815
+ },
816
+ //初始化tree默认值
817
+ initTreeValue() {
818
+ console.log("initTree");
819
+ // debugger
820
+ if (this.switchValue) {
821
+ //多选
822
+ if (this.currentKlIds.length == 0) {
823
+ return;
824
+ }
825
+ this.klArr = this.currentKlIds.split(",");
826
+ this.$nextTick(() => {
827
+ this.$refs.secondTree.setCheckedKeys(this.klArr);
828
+ this.klArr = this.$refs.secondTree.getCheckedKeys(true);
829
+ var nodesArr = this.$refs.secondTree.getCheckedNodes();
830
+ let tempStr = "";
831
+ if (nodesArr.length == 0) {
832
+ tempStr = "";
833
+ } else if (nodesArr.length > 1) {
834
+ nodesArr.forEach((element) => {
835
+ if (!element.hasChild) {
836
+ tempStr += element.klname + ",";
837
+ }
838
+ });
839
+ } else {
840
+ tempStr = nodesArr[0].klname;
841
+ }
842
+ this.inputTempStr = tempStr;
843
+ this.clickKnowledgeItem(true, tempStr);
844
+ });
845
+ } else {
846
+ this.$nextTick(() => {
847
+ this.$refs.secondTree.setCurrentKey(this.currentKlIds);
848
+ var nodeData = this.$refs.secondTree.getCurrentNode();
849
+ if (nodeData) {
850
+ this.clickKnowledgeItem(true, nodeData.klname);
851
+ }
852
+ });
853
+ }
854
+ },
855
+ //树状结构过滤器
856
+ knowledgeFilterNode(value, data, node) {
857
+ // 如果什么都没填就直接返回
858
+ console.log("进行了过滤");
859
+ if (!value) return true;
860
+ // 如果传入的value和data中的label相同说明是匹配到了
861
+ if (data.klname.indexOf(value) !== -1) {
862
+ return true;
863
+ }
864
+ // 否则要去判断它是不是选中节点的子节点
865
+ return this.checkBelongToChooseNode(value, data, node);
866
+ },
867
+ // 判断传入的节点是不是选中节点的子节点
868
+ checkBelongToChooseNode(value, data, node) {
869
+ const level = node.level;
870
+ // 如果传入的节点本身就是一级节点就不用校验了
871
+ if (level === 1) {
872
+ return false;
873
+ }
874
+ // 先取当前节点的父节点
875
+ var parentData = node.parent;
876
+ // 遍历当前节点的父节点
877
+ var index = 0;
878
+ while (index < level - 1) {
879
+ // 如果匹配到直接返回
880
+ if (parentData.data.klname.indexOf(value) !== -1) {
881
+ return true;
882
+ }
883
+ // 否则的话再往上一层做匹配
884
+ parentData = parentData.parent;
885
+ index++;
886
+ }
887
+ // 没匹配到返回false
888
+ return false;
889
+ },
890
+ choiseKnowledgeType(value) {
891
+ this.knowledgeType = value;
892
+ },
893
+ clickKnowledgeNode(object) {
894
+ if (!this.switchValue) {
895
+ this.currentKlIds = object.klId;
896
+ let dic = { klIds: object.klId, klUnionFlag: 1 };
897
+ this.clickKnowledgeItem(true, object.klname);
898
+ this.$emit("changeIndexParam", "changeKnowledge", JSON.stringify(dic));
899
+ let tempDic = {
900
+ klIds: object.klId,
901
+ switch: this.switchValue,
902
+ knowledgeType: 1,
903
+ };
904
+ this.$emit("changeKLIds", "changeKLIds", JSON.stringify(tempDic));
905
+ }
906
+ },
907
+ checkKnowledgeNode(object, compo) {
908
+ this.klArr = this.$refs.secondTree.getCheckedKeys(true);
909
+ let tempStr = "";
910
+ if (compo.checkedNodes.length == 0) {
911
+ tempStr = "";
912
+ } else if (compo.checkedNodes.length > 1) {
913
+ compo.checkedNodes.forEach((element) => {
914
+ if (!element.hasChild) {
915
+ tempStr += element.klname + ",";
916
+ }
917
+ });
918
+ } else {
919
+ tempStr = compo.checkedNodes[0].klname;
920
+ }
921
+ this.inputTempStr = tempStr;
922
+ this.clickKnowledgeItem(false, tempStr);
923
+ if (this.klArr.length > 100) {
924
+ this.toastOptions.show = true;
925
+ setTimeout(() => {
926
+ this.toastOptions.show = false;
927
+ }, 2000);
928
+ }
929
+ },
930
+ clearKnowledges() {
931
+ let _this = this;
932
+ _this.currentKlIds = "";
933
+ if (_this.klArr.length == 0) {
934
+ return;
935
+ }
936
+ _this.klArr = [];
937
+ _this.inputTempStr = "";
938
+ _this.clickKnowledgeItem(false, _this.inputTempStr);
939
+ this.$nextTick(() => {
940
+ _this.$refs.secondTree.setCheckedKeys([]);
941
+ _this.klArr = [];
942
+ let dic = {
943
+ klIds: "",
944
+ klUnionFlag: _this.knowledgeType,
945
+ };
946
+ this.$emit("changeIndexParam", "changeKnowledge", JSON.stringify(dic));
947
+ let tempDic = {
948
+ klIds: "",
949
+ switch: _this.switchValue,
950
+ knowledgeType: _this.knowledgeType,
951
+ };
952
+ this.$emit("changeKLIds", "changeKLIds", JSON.stringify(tempDic));
953
+ });
954
+ },
955
+ toQueryWithKnowledges() {
956
+ let _this = this;
957
+ if (_this.klArr.length == 0 || _this.klArr.length > 100) {
958
+ return;
959
+ }
960
+ _this.clickKnowledgeItem(true, _this.inputTempStr);
961
+ _this.currentKlIds = _this.klArr.join();
962
+ let dic = { klIds: _this.currentKlIds, klUnionFlag: _this.knowledgeType };
963
+ this.$emit("changeIndexParam", "changeKnowledge", JSON.stringify(dic));
964
+ let tempDic = {
965
+ klIds: _this.currentKlIds,
966
+ switch: _this.switchValue,
967
+ knowledgeType: _this.knowledgeType,
968
+ };
969
+ this.$emit("changeKLIds", "changeKLIds", JSON.stringify(tempDic));
970
+ },
971
+ clickKnowledgeItem(isDisplay, name) {
972
+ console.log("clickKnowledgeItem", name);
973
+ name = this.decode(name);
974
+ this.knowledgeVisible = !isDisplay;
975
+ this.allKnowledgeName = name;
976
+ this.isShowTooltip = true;
977
+ if (name.length > 30) {
978
+ this.isShowTooltip = false;
979
+ name = name.slice(0, 30) + "...";
980
+ }
981
+ this.knowledgeName = name;
982
+ },
983
+ decode(str) {
984
+ return decodeEntities(str);
985
+ },
986
+ getAnswer(itemInfo) {
987
+ let currentItem = this.itemInfoList.find(
988
+ (item) => item.itemInfoId == itemInfo.itemInfoId
989
+ );
990
+ getAnswer(
991
+ {
992
+ itemId: itemInfo.itemInfoId,
993
+ itemBankType: this.indexParam.itemBankType,
994
+ itemSourceType: itemInfo.itemSourceType,
995
+ rootSourceId: itemInfo.rootItemInfoId,
996
+ },
997
+ (res) => {
998
+ // this.$set(currentItem, "answerDic", res.value);
999
+ // getQuestion({ itemId: res.value.itemAnalysis }, (result) => {
1000
+ // if (!result) {
1001
+ // return;
1002
+ // }
1003
+ // currentItem.answerDic = {
1004
+ // ...currentItem.answerDic,
1005
+ // analysis: result.data,
1006
+ // };
1007
+ // this.$set(currentItem, "answerDic", currentItem.answerDic);
1008
+ // });
1009
+ if (!res) {
1010
+ return;
1011
+ }
1012
+ if (typeof res === "string") res = JSON.parse(res);
1013
+ if (res.code == 0) {
1014
+ //取出答案与解析
1015
+ // _this.answerDic = res.value;
1016
+ this.$set(currentItem, "pointNames", res.value.pointNames);
1017
+ this.$set(currentItem, "klNames", res.value.klNames);
1018
+ this.$set(currentItem, "answer", res.value.correctAnswer);
1019
+ this.$set(
1020
+ currentItem,
1021
+ "basicSkillNames",
1022
+ res.value.basicSkillNames
1023
+ );
1024
+ if (
1025
+ (res.value.itemType == 3 || res.value.itemType == 6) &&
1026
+ res.value.correctAnswer &&
1027
+ res.value.correctAnswer.length > 0
1028
+ ) {
1029
+ getQuestion({ itemId: res.value.correctAnswer }, (res) => {
1030
+ if (!res) {
1031
+ return;
1032
+ }
1033
+ if (typeof res === "string") res = JSON.parse(res);
1034
+ //取出题目数据
1035
+ this.$set(currentItem, "answer", res.data);
1036
+ });
1037
+ } else if (res.value.itemType == 7) {
1038
+ //组合单选题
1039
+ var answerArr = res.value.correctAnswer.split(",");
1040
+ var fiveArr = [],tempStr = ""; //将组合单选题答案五五放到一个数组展示
1041
+ answerArr && answerArr.length && answerArr.map(function (item, idx) {
1042
+ if (idx % 5 !== 0 || idx == 0) {
1043
+ tempStr += item;
1044
+ } else {
1045
+ fiveArr.push(tempStr);
1046
+ tempStr = item;
1047
+ }
1048
+ if (idx == answerArr.length - 1) {
1049
+ fiveArr.push(tempStr);
1050
+ }
1051
+ });
1052
+ this.$set(currentItem, "answer", fiveArr.join(";"));
1053
+ } else {
1054
+ this.$set(currentItem, "answer", res.value.correctAnswer);
1055
+ }
1056
+ if (res.value.itemAnalysis && res.value.itemAnalysis.length > 0) {
1057
+ getQuestion({ itemId: res.value.itemAnalysis }, (res) => {
1058
+ if (!res) {
1059
+ return;
1060
+ }
1061
+ //取出题目数据
1062
+ this.$set(currentItem, "analysis", res.data);
1063
+ });
1064
+ }
1065
+ }
1066
+ }
1067
+ );
1068
+ },
1069
+ getContent(itemInfo) {
1070
+ let currentItem = this.itemInfoList.find(
1071
+ (item) => item.itemInfoId == itemInfo.itemInfoId
1072
+ );
1073
+ getQuestion({ itemId: itemInfo.itemFileId }, (res) => {
1074
+ this.$set(currentItem, "content", res.data);
1075
+ });
1076
+ },
1077
+ choiceOrRemoveQuestion(itemInfo, isAdd) {
1078
+ this.$emit(
1079
+ "choiceOrRemoveQuestion",
1080
+ itemInfo,
1081
+ isAdd,
1082
+ this.defaultCategoryType
1083
+ );
1084
+ },
1085
+ headerSort(item) {
1086
+ console.log(item);
1087
+ if (item.key == "updateTime") {
1088
+ let dic = { order: item.sortOrder ? 1 : 0 };
1089
+ this.$emit("changeIndexParam", "changeOrder", JSON.stringify(dic));
1090
+ } else {
1091
+ let dic = { orderQuote: item.sortOrder ? 1 : 0 };
1092
+ this.$emit("changeIndexParam", "changeOrderQuote", JSON.stringify(dic));
1093
+ }
1094
+ },
1095
+ toShowAudio(itemInfo, itemIndex) {
1096
+ let dic = {
1097
+ questionIndex: itemIndex,
1098
+ fileId: itemInfo.audioFileId,
1099
+ };
1100
+ this.$emit("toShowAudio", "toShowAudio", JSON.stringify(dic));
1101
+ },
1102
+ // 来源点击
1103
+ sourceClick(itemBankType) {
1104
+ if (itemBankType == 5) {
1105
+ this.$emit("goQptk");
1106
+ return;
1107
+ }
1108
+ // this.currentSourceType = itemBankType;
1109
+ let dic = { itemBankType: itemBankType };
1110
+ // this.$emit('eventbus-emit', "changeIndexParam", "changeSource", JSON.stringify(dic))
1111
+ this.$emit(
1112
+ "eventbus-emit",
1113
+ "changeSource",
1114
+ "changeSource",
1115
+ JSON.stringify(dic)
1116
+ );
1117
+ this.$emit("changeIndexParam", "changeSource", JSON.stringify(dic));
1118
+ // this.$emit("changeSource", "changeSource", JSON.stringify(dic));
1119
+ },
1120
+ // 专题点击
1121
+ topicClick(topicId) {
1122
+ if (topicId == "all") {
1123
+ topicId = "";
1124
+ }
1125
+ this.selectedTopicId = topicId;
1126
+ let dic = { topicId: topicId };
1127
+ this.$emit("changeIndexParam", "changeTopic", JSON.stringify(dic));
1128
+ },
1129
+ // 题型点击
1130
+ categoryClick(itemCategoryId) {
1131
+ if (itemCategoryId == "all") {
1132
+ itemCategoryId = "";
1133
+ }
1134
+ this.selectedCategoryId = itemCategoryId;
1135
+ let dic = { itemCategoryId: itemCategoryId };
1136
+ this.$emit("changeIndexParam", "changeCategory", JSON.stringify(dic));
1137
+ },
1138
+ // 难度点击
1139
+ difficultyClick(difficultyId) {
1140
+ if (difficultyId == "all") {
1141
+ difficultyId = "";
1142
+ }
1143
+ this.selectedDifficultId = difficultyId;
1144
+ let dic = { itemDifficultyId: difficultyId };
1145
+ this.$emit("changeIndexParam", "changeDifficulty", JSON.stringify(dic));
1146
+ },
1147
+ // 年份
1148
+ yearClick(year) {
1149
+ if (year == "all") {
1150
+ year = "";
1151
+ }
1152
+ this.currentYear = year;
1153
+ let isEarly = year == "earlier" ? true : false;
1154
+ let _lastYear = this.yearList.slice(-2,-1)[0].id
1155
+ let lastYear = typeof _lastYear == 'number' ? _lastYear : 0;
1156
+ let dic = { year: isEarly ? lastYear - 1 : year, isEarlier:isEarly ? -1 : 1 };
1157
+ this.$emit("changeIndexParam", "selectYear", JSON.stringify(dic));
1158
+ },
1159
+ // 技能
1160
+ basicSkillClick(basicSkillsId) {
1161
+ if (basicSkillsId == "all") {
1162
+ basicSkillsId = "";
1163
+ }
1164
+ this.selectedSkillId = basicSkillsId;
1165
+ let dic = { itemBasicSkillId: basicSkillsId };
1166
+ this.$emit("changeIndexParam", "changeSkill", JSON.stringify(dic));
1167
+ },
1168
+ // 核心素养
1169
+ coreLiteracyClick(literacyId) {
1170
+ if (literacyId == "all") {
1171
+ literacyId = "";
1172
+ }
1173
+ let dic = { literacyId: literacyId };
1174
+ this.$emit("changeIndexParam", "changeLiteracy", JSON.stringify(dic));
1175
+ },
1176
+ changeMaterials(value) {
1177
+ console.log(value);
1178
+ this.currentCourse = []; //重置
1179
+ this.requestCourseListData(
1180
+ this.indexParam.subjectId,
1181
+ value[0],
1182
+ value[1],
1183
+ value[2]
1184
+ );
1185
+ },
1186
+ //递归获取当前选择的课程
1187
+ getCurrentCheckedCourse(arr, node) {
1188
+ if (node && node.value) {
1189
+ arr.unshift(node.value);
1190
+ if (node.parent) {
1191
+ this.getCurrentCheckedCourse(arr, node.parent);
1192
+ }
1193
+ }
1194
+ },
1195
+ changeCourse(value) {
1196
+ this.currentCourseId = value[value.length - 1];
1197
+ let dic = { courseId: this.currentCourseId };
1198
+ this.$emit("changeIndexParam", "changeCourseId", JSON.stringify(dic));
1199
+ },
1200
+ /*
1201
+ **请求题库首页数据
1202
+ * 只在首次进入该页面时请求
1203
+ */
1204
+ requestIndexData() {
1205
+ this.loadingError = false;
1206
+ this.goRequestIndexData();
1207
+ },
1208
+ // 首次进入该页面时请求获取用户信息
1209
+ goRequestIndexData() {
1210
+ let _this = this;
1211
+ console.log("getBank", this);
1212
+ var prepareInfo = this.leftInfo;
1213
+ console.log(prepareInfo, "prepareInfo1");
1214
+ if (prepareInfo && prepareInfo.eduLevelId) {
1215
+ var eduLevelId = prepareInfo.eduLevelId;
1216
+ var subjectId = prepareInfo.subjectId;
1217
+ var courseSrc = prepareInfo.courseSrc;
1218
+ var courseId = prepareInfo.courseId;
1219
+ _this.indexParam["courseSrc"] = courseSrc;
1220
+ _this.indexParam["studySectionId"] = eduLevelId;
1221
+ _this.indexParam["subjectId"] = subjectId;
1222
+ _this.indexParam["courseId"] = courseId;
1223
+ _this.currentCourseId = courseId;
1224
+ var teachMaterialId = prepareInfo.teachMaterialId;
1225
+ var gradeId = prepareInfo.gradeId;
1226
+
1227
+ let dom = document.getElementById("tk-detail-drawer-slot-id");
1228
+ let loadingInstance = Loading.service({
1229
+ target: dom,
1230
+ text: this.i18n.jiaZaiZhong,
1231
+ });
1232
+ console.log(prepareInfo, "prepareInfo");
1233
+ getBankIndex(
1234
+ {
1235
+ eduLevelId: eduLevelId,
1236
+ subjectId: subjectId,
1237
+ gradeId: gradeId,
1238
+ teachMaterialId: teachMaterialId,
1239
+ courseId: courseId,
1240
+ courseSrc: courseSrc,
1241
+ },
1242
+ (res) => {
1243
+ this.$nextTick(() => {
1244
+ // 以服务的方式调用的 Loading 需要异步关闭
1245
+ loadingInstance.close();
1246
+ });
1247
+ _this.isLoading = false;
1248
+ if (typeof res === "string") res = JSON.parse(res);
1249
+ if (res && res.code == 0) {
1250
+ console.log("getBank", res);
1251
+ //处理indexParam
1252
+ _this.indexParam.studySectionId = eduLevelId;
1253
+ _this.indexParam.subjectId = subjectId;
1254
+ _this.indexParam.itemBankType =
1255
+ res.value.itemBankQueryDto.itemBankType;
1256
+ _this.requestBankData();
1257
+ _this.totalRecord = res.value.totalRecord;
1258
+ // _this.pageInfo = {
1259
+ // currPage: res.value.currPage,
1260
+ // totalPage: res.value.totalPage,
1261
+ // perPage: res.value.perPage,
1262
+ // };
1263
+ //取出默认的题库类型
1264
+ _this.defaultCategoryType = res.value.itemBankQueryDto.itemBankType;
1265
+
1266
+ // _this.defaultSubjectList = res.value.defaultSubjectList;
1267
+ //请求教材版本
1268
+ _this.requestMaterialsGradesData(
1269
+ eduLevelId,
1270
+ subjectId,
1271
+ teachMaterialId,
1272
+ gradeId
1273
+ );
1274
+ //难度知识点是否必填
1275
+ _this.requestDifficultyAndKnowledgeSettingInfo(
1276
+ eduLevelId,
1277
+ subjectId
1278
+ );
1279
+ //请求专题数据
1280
+ _this.requestTopicData();
1281
+
1282
+ //判断是否展示“考点”tab
1283
+ _this.examPointEnableFlag = res.value.examPointEnableFlag;
1284
+ //取学年数组
1285
+ _this.years = res.value && res.value.yearList && res.value.yearList.length && res.value.yearList.map((item) => {
1286
+ return {
1287
+ id: item,
1288
+ label: item,
1289
+ };
1290
+ });
1291
+ if (_this.years.length) {
1292
+ _this.years.unshift({
1293
+ id: "all",
1294
+ label: _this.i18n.quanBu,
1295
+ });
1296
+ }
1297
+ //取来源数据
1298
+ _this.itemBankTypeList = res.value.itemBankTypeList;
1299
+ _this.itemBankTypeList.unshift({
1300
+ itemBankType: 5,
1301
+ itemBankTypeName: "精品题库",
1302
+ });
1303
+ //取技能数据
1304
+ _this.basicSkillsList = res.value.basicSkillsList;
1305
+ if (_this.basicSkillsList.length) {
1306
+ _this.basicSkillsList.unshift({
1307
+ basicSkillsId: "all",
1308
+ basicName: this.i18n.quanBu,
1309
+ });
1310
+ }
1311
+ //取核心素养数据
1312
+ _this.coreLiteracyFlag = res.value.coreLiteracyFlag;
1313
+ _this.coreLiteracyList = res.value && res.value.coreLiteracyList && res.value.coreLiteracyList.length && res.value.coreLiteracyList.map(item=>{
1314
+ return {
1315
+ literacyId: item.literacyId,
1316
+ literacyName: item.literacyName
1317
+ }
1318
+ }) || [];
1319
+ if (_this.coreLiteracyList && _this.coreLiteracyList.length) {
1320
+ _this.coreLiteracyList.unshift({
1321
+ literacyId: "all",
1322
+ literacyName: this.i18n.quanBu,
1323
+ });
1324
+ }
1325
+ console.log('_this.coreLiteracyList',_this.coreLiteracyList)
1326
+ //取题型数据
1327
+ _this.itemCategoryList = res.value.itemCategoryList;
1328
+ if (_this.itemCategoryList.length) {
1329
+ _this.itemCategoryList.unshift({
1330
+ itemCategoryId: "all",
1331
+ itemCategoryName: this.i18n.quanBu,
1332
+ itemType: -1,
1333
+ });
1334
+ }
1335
+
1336
+ //取难度数据
1337
+ _this.difficultyList = JSON.parse(
1338
+ JSON.stringify(res.value.cfgDifficultyList)
1339
+ );
1340
+ if (_this.difficultyList.length) {
1341
+ _this.difficultyList.unshift({
1342
+ difficultyId: "all",
1343
+ difficultyName: this.i18n.quanBu,
1344
+ });
1345
+ }
1346
+
1347
+ if (_this.indexParam.itemBankType == 4) {
1348
+ _this.allDifficultyList = JSON.parse(
1349
+ JSON.stringify(res.value.cfgDifficultyList)
1350
+ );
1351
+ _this.allDifficultyList.push(_this.undefinedDifficultyInfo);
1352
+ } else {
1353
+ _this.allDifficultyList = JSON.parse(
1354
+ JSON.stringify(res.value.cfgDifficultyList)
1355
+ );
1356
+ }
1357
+ //知识点
1358
+ _this.klList = res.value.knowledgeList;
1359
+ //考点
1360
+ _this.examPointList = res.value.examPointList;
1361
+ //获取该课程下关联的知识点
1362
+ //变式题默认当前原题的知识点
1363
+ if (_this.fromType == "variant") {
1364
+ if (_this.klidsList == "") {
1365
+ if (
1366
+ res.value &&
1367
+ res.value.klIds &&
1368
+ res.value.klIds.length > 0
1369
+ ) {
1370
+ _this.localKlIds = res.value.klIds;
1371
+ _this.$store.commit(
1372
+ "saveCurrentKnowledgeIds",
1373
+ res.value.klIds
1374
+ );
1375
+ } else if (_this.klList.length > 0) {
1376
+ _this.localKlIds = _this.getFirstKnowledgeId(_this.klList);
1377
+ }
1378
+ } else {
1379
+ _this.localKlIds = _this.klidsList;
1380
+ }
1381
+ } else {
1382
+ if (
1383
+ res.value &&
1384
+ res.value.klIds &&
1385
+ res.value.klIds.length > 0
1386
+ ) {
1387
+ _this.localKlIds = res.value.klIds;
1388
+ _this.$store.commit(
1389
+ "saveCurrentKnowledgeIds",
1390
+ res.value.klIds
1391
+ );
1392
+ } else if (_this.klList.length > 0) {
1393
+ _this.localKlIds = _this.getFirstKnowledgeId(_this.klList);
1394
+ }
1395
+ }
1396
+ //提供数据给Vuex
1397
+ _this.$store.commit("changeValue", {
1398
+ type: "itemCategory",
1399
+ val: _this.itemCategoryList || [],
1400
+ });
1401
+ _this.$store.commit("changeValue", {
1402
+ type: "difficults",
1403
+ val: _this.difficultyList || [],
1404
+ });
1405
+ _this.$store.commit("changeValue", {
1406
+ type: "basicSkillIdList",
1407
+ val: _this.basicSkillsList || [],
1408
+ });
1409
+ _this.$store.commit("changeValue", {
1410
+ type: "klIdList",
1411
+ val: _this.klList || [],
1412
+ });
1413
+ _this.$store.commit("changeValue", {
1414
+ type: "pointIdList",
1415
+ val: _this.examPointList || [],
1416
+ });
1417
+ _this.$store.commit("changeValue", {
1418
+ type: "enableShowPoint",
1419
+ val: _this.examPointEnableFlag || false,
1420
+ });
1421
+ } else {
1422
+ _this.loadingError = true;
1423
+ }
1424
+ }
1425
+ );
1426
+ }
1427
+ },
1428
+ /*
1429
+ **请求题库数据
1430
+ * 筛选条件时请求
1431
+ */
1432
+ requestBankData() {
1433
+ let _this = this;
1434
+ _this.loadingError = false;
1435
+ _this.loadingBankData = true;
1436
+ _this.goRequestBankData();
1437
+ },
1438
+ //筛选条件时请求获取用户信息
1439
+ goRequestBankData() {
1440
+ let dom = document.getElementById("bankData-drawer-slot-id");
1441
+ let loadingInstance = Loading.service({
1442
+ target: dom,
1443
+ text: this.i18n.jiaZaiZhong,
1444
+ });
1445
+ let _this = this;
1446
+ var prepareInfo = this.leftInfo;
1447
+ if (prepareInfo && prepareInfo.eduLevelId) {
1448
+ var eduLevelId = prepareInfo.eduLevelId;
1449
+ var subjectId = prepareInfo.subjectId;
1450
+ var courseSrc = prepareInfo.courseSrc;
1451
+ _this.indexParam["courseSrc"] = courseSrc;
1452
+ _this.indexParam["studySectionId"] = eduLevelId;
1453
+ _this.indexParam["subjectId"] = subjectId;
1454
+ _this.indexParam["klIds"] = this.localKlIds;
1455
+ getBankData(_this.indexParam, (res) => {
1456
+ _this.loadingBankData = false;
1457
+ if (typeof res === "string") res = JSON.parse(res);
1458
+ if (res && res.code == 0) {
1459
+ //判断是否展示“考点”tab
1460
+ // _this.examPointEnableFlag = res.value.examPointEnableFlag;
1461
+ //取出题目数据
1462
+ _this.loadingError = false;
1463
+ _this.itemInfoList = res.value && res.value.itemInfoList && res.value.itemInfoList.length && res.value.itemInfoList.map((item) => {
1464
+ return { ...item, answerDic: {} };
1465
+ });
1466
+
1467
+ _this.totalRecord = res.value.totalRecord;
1468
+ _this.currPage = res.value.currPage;
1469
+ if (_this.itemInfoList.length >= _this.totalRecord) {
1470
+ _this.hasMore = false;
1471
+ } else {
1472
+ _this.hasMore = true;
1473
+ }
1474
+ _this.pageInfo = {
1475
+ currPage: res.value.currPage,
1476
+ totalPage: res.value.totalPage,
1477
+ perPage: res.value.perPage,
1478
+ };
1479
+ loadingInstance.close();
1480
+ } else {
1481
+ //请求题目数据报错
1482
+ _this.loadingError = true;
1483
+ _this.itemInfoList = [];
1484
+ _this.pageInfo = {};
1485
+ }
1486
+ });
1487
+ }
1488
+ },
1489
+ /*
1490
+ **获取教材版本数据
1491
+ */
1492
+ requestMaterialsGradesData(
1493
+ eduLevelId,
1494
+ subjectId,
1495
+ teachMaterialId,
1496
+ gradeId
1497
+ ) {
1498
+ console.log("请求教材");
1499
+ let _this = this;
1500
+ _this.courseCascaderList = [];
1501
+ getMaterialsGrades(
1502
+ {
1503
+ eduLevelId: eduLevelId,
1504
+ subjectId: subjectId,
1505
+ teachMaterialId: teachMaterialId,
1506
+ gradeId: gradeId,
1507
+ },
1508
+ (res) => {
1509
+ if (!res) {
1510
+ return;
1511
+ }
1512
+ if (typeof res === "string") res = JSON.parse(res);
1513
+ if (res.code == 0) {
1514
+ _this.currentCourseValue = [
1515
+ res.value.checkTeachMaterialId,
1516
+ res.value.checkClassificationId,
1517
+ res.value.checkTermIndex,
1518
+ ];
1519
+ _this.currentMaterials = [];
1520
+ _this.materialsGradesList = res.value.list;
1521
+
1522
+ _this.requestCourseListData(
1523
+ subjectId,
1524
+ res.value.checkTeachMaterialId,
1525
+ res.value.checkClassificationId,
1526
+ res.value.checkTermIndex
1527
+ );
1528
+ }
1529
+ }
1530
+ );
1531
+ },
1532
+ /*
1533
+ **获取知识点、难度配置,是否必填
1534
+ */
1535
+ requestDifficultyAndKnowledgeSettingInfo(eduLevelId, subjectId) {
1536
+ let _this = this;
1537
+ getKldftNecessary(
1538
+ {
1539
+ eduLevelId: eduLevelId,
1540
+ subjectId: subjectId,
1541
+ },
1542
+ (res) => {
1543
+ if (!res) {
1544
+ return;
1545
+ }
1546
+ if (typeof res === "string") res = JSON.parse(res);
1547
+ if (res.code == 0) {
1548
+ if (res.value && res.value == 2) {
1549
+ _this.$store.commit("changeValue", {
1550
+ type: "knowledgeIsRequired",
1551
+ val: false,
1552
+ });
1553
+ }
1554
+ }
1555
+ }
1556
+ );
1557
+ },
1558
+ /*
1559
+ ** 获取知识点数据
1560
+ */
1561
+ requestKnowledgeData() {
1562
+ let _this = this;
1563
+ getKnowledge(
1564
+ {
1565
+ eduLevelId: _this.indexParam.studySectionId,
1566
+ subjectId: _this.indexParam.subjectId,
1567
+ },
1568
+ (res) => {
1569
+ if (!res) {
1570
+ return;
1571
+ }
1572
+ if (typeof res === "string") res = JSON.parse(res);
1573
+ if (res.code == 0) {
1574
+ _this.klList = res.value;
1575
+ }
1576
+ }
1577
+ );
1578
+ },
1579
+ /*
1580
+ ** 获取专题数据
1581
+ */
1582
+ requestTopicData() {
1583
+ let _this = this;
1584
+ getTopic(
1585
+ {
1586
+ eduLevelId: _this.indexParam.studySectionId,
1587
+ topicSource: _this.indexParam.itemBankType == 2 ? 1 : "",
1588
+ },
1589
+ (res) => {
1590
+ if (!res) {
1591
+ return;
1592
+ }
1593
+ if (typeof res === "string") res = JSON.parse(res);
1594
+ if (res.code == 0) {
1595
+ _this.topicList = res.value;
1596
+ if (_this.topicList.length) {
1597
+ _this.topicList.unshift({
1598
+ topicId: "all",
1599
+ topicName: this.i18n.quanBu,
1600
+ });
1601
+ }
1602
+
1603
+ var hasTopic = false;
1604
+ for (var i = 0; i < _this.topicList.length; i++) {
1605
+ var topicItem = _this.topicList[i];
1606
+ if (topicItem.topicId == _this.indexParam.topicId) {
1607
+ hasTopic = true;
1608
+ break;
1609
+ }
1610
+ }
1611
+ if (!hasTopic) {
1612
+ _this.indexParam.topicId = "";
1613
+ let dic = { selectedTopicId: "" };
1614
+ this.$emit(
1615
+ "toChangeSelectedTopicId",
1616
+ "toChangeSelectedTopicId",
1617
+ JSON.stringify(dic)
1618
+ );
1619
+ }
1620
+ }
1621
+ }
1622
+ );
1623
+ },
1624
+ /*
1625
+ **获取默认的第一个子知识点
1626
+ */
1627
+ getFirstKnowledgeId(knowledgeList) {
1628
+ var tempKL = knowledgeList[0];
1629
+ if (
1630
+ tempKL.hasChild &&
1631
+ tempKL.knowledgeDtoList &&
1632
+ tempKL.knowledgeDtoList.length > 0
1633
+ ) {
1634
+ return this.getFirstKnowledgeId(tempKL.knowledgeDtoList);
1635
+ } else {
1636
+ return tempKL.klId;
1637
+ }
1638
+ },
1639
+ /*
1640
+ ** 获取课程数据
1641
+ * teachMaterialId:教材版本id
1642
+ * classificationId:册别id
1643
+ * termIndex:学期号
1644
+ */
1645
+ requestCourseListData(
1646
+ subjectId,
1647
+ teachMaterialId,
1648
+ classificationId,
1649
+ termIndex
1650
+ ) {
1651
+ let _this = this;
1652
+ getEditorCourse(
1653
+ {
1654
+ subjectId: subjectId,
1655
+ teachMaterialId: teachMaterialId,
1656
+ termIndex: termIndex,
1657
+ classificationId: classificationId,
1658
+ },
1659
+ (res) => {
1660
+ if (!res) {
1661
+ return;
1662
+ }
1663
+ if (typeof res === "string") res = JSON.parse(res);
1664
+ if (res.code == 0) {
1665
+ _this.courseCascaderList = res.value.list;
1666
+ }
1667
+ }
1668
+ );
1669
+ },
1670
+ /*
1671
+ **请求题库数据
1672
+ * 筛选条件时请求
1673
+ */
1674
+ requestPageBank(param) {
1675
+ let _this = this;
1676
+ if (!param["itemBankType"]) {
1677
+ return;
1678
+ }
1679
+ _this.pageError = false;
1680
+ _this.drawerPageError = false;
1681
+ _this.loading = true;
1682
+ getBankData(param, (res) => {
1683
+ _this.loading = false;
1684
+ if (typeof res === "string") res = JSON.parse(res);
1685
+ if (res && res.code == 0) {
1686
+ //取出题目数据
1687
+ _this.drawerPageError = false;
1688
+ _this.currPage = res.value.currPage;
1689
+ _this.itemInfoList = _this.itemInfoList.concat(
1690
+ res.value.itemInfoList
1691
+ );
1692
+ if (_this.itemInfoList.length >= res.value.totalRecord) {
1693
+ _this.hasMore = false;
1694
+ } else {
1695
+ _this.hasMore = true;
1696
+ }
1697
+ } else {
1698
+ //请求题目数据报错
1699
+ _this.drawerPageError = true;
1700
+ }
1701
+ });
1702
+ },
1703
+ clickRetryBtn() {
1704
+ this.$emit("changeIndexParam", "retryRequest", "retryRequest");
1705
+ },
1706
+ },
1707
+ computed: {},
1708
+ created() {},
1709
+ mounted() {
1710
+ this.setListener();
1711
+ this.requestIndexData();
1712
+ if (!this.host.includes("teach.focusteach.com")) {
1713
+ this.host = "http://teach.focusteach.com:8085";
1714
+ }
1715
+ },
1716
+ };
1717
+ </script>
1718
+
1719
+ <style lang="scss" scoped>
1720
+ @import "../../../style/icon/style.css";
1721
+ @import "./index.scss";
1722
+ </style>
1723
+