@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,1730 @@
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
+ "
301
+ v-for="(item, index) in itemInfoList"
302
+ :key="item.itemInfoId"
303
+ :itemInfo="item"
304
+ :itemIndex="index + 1"
305
+ :examItemList="itemList"
306
+ :variantList="itemList"
307
+ :pointNames="item.pointNames || '--'"
308
+ :klNames="item.klNames || '--'"
309
+ :skill="item.basicSkillNames || '--'"
310
+ :answer="item.answer || '--'"
311
+ :analysis="item.analysis || '--'"
312
+ :itemCategoryName="item.itemCategoryName"
313
+ :topicName="item.topicName"
314
+ :difficultyId="item.difficultyId"
315
+ :difficultyName="item.difficultyName"
316
+ :audioFileId="item.audioFileId"
317
+ :itemFromType="item.itemFromType"
318
+ :content="item.content"
319
+ :updateTime="item.updateTime"
320
+ :referenceCount="item.referenceCount"
321
+ :itemInfoId="item.itemInfoId"
322
+ :provinceId="item.provinceId"
323
+ :provinceName="item.provinceName"
324
+ :areaId="item.areaId"
325
+ :districtId="item.districtId"
326
+ :areaName="item.areaName"
327
+ :districtName="item.districtName"
328
+ :year="item.year"
329
+ :rootItemInfoId="item.rootItemInfoId"
330
+ :itemSourceType="item.itemSourceType"
331
+ @showAnswer="getAnswer"
332
+ @getContent="getContent"
333
+ @choiceOrRemoveQuestion="choiceOrRemoveQuestion"
334
+ @toShowAudio="toShowAudio"
335
+ :fromType="fromType"
336
+ ></ft-question>
337
+ </div>
338
+ <ft-empty
339
+ v-show="!loadingBankData && !loadingError && itemInfoList.length == 0"
340
+ :message="i18n.zanWuTiMu"
341
+ >
342
+ <img
343
+ class="empty-img"
344
+ :src="host + '/assets/prepare-course/list/img/empty.fcdd9ba5.png'"
345
+ alt=""
346
+ />
347
+ </ft-empty>
348
+ <ft-error
349
+ v-show="!loadingBankData && loadingError"
350
+ @retry="clickRetryBtn"
351
+ >
352
+ <img
353
+ class="error-img"
354
+ :src="host + '/assets/prepare-course/list/img/error.7e494464.png'"
355
+ alt=""
356
+ />
357
+ </ft-error>
358
+ <div v-show="loadingBankData" class="loading"></div>
359
+ </div>
360
+ <div class="page-contro" v-show="itemInfoList.length > 0">
361
+ {{
362
+ drawerPageError
363
+ ? this.i18n.jiaZaiShiBai
364
+ : loading
365
+ ? this.i18n.jiaZaiZhong
366
+ : hasMore
367
+ ? ""
368
+ : this.i18n.jiaZaiWanBi
369
+ }}
370
+ </div>
371
+ </ft-drawer>
372
+ </div>
373
+ </template>
374
+
375
+ <script>
376
+ import {
377
+ Tabs,
378
+ TabPane,
379
+ Cascader,
380
+ Popover,
381
+ Tooltip,
382
+ Loading,
383
+ Tree,
384
+ Input,
385
+ } from "element-ui";
386
+ import FtTabs from "../../tabs/index";
387
+ import FtCascader from "../../cascader/index";
388
+ import FtQuestion from "../../question/index";
389
+ import FtHeader from "../../header/index";
390
+ import FtRadio from "../../radio/index";
391
+ import FtDrawer from "../../drawer/index";
392
+ import FtEmpty from "../../empty/index";
393
+ import FtError from "../../error/index";
394
+ import {
395
+ getBankIndex,
396
+ getBankData,
397
+ getMaterialsGrades,
398
+ getKnowledge,
399
+ getEditorCourse,
400
+ getTopic,
401
+ getKldftNecessary,
402
+ getQuestion,
403
+ getAnswer,
404
+ } from "../../../api/index";
405
+ import { decodeEntities } from "../../../utils/common";
406
+ import Toast from "./Toast";
407
+ import infiniteScroll from "vue-infinite-scroll";
408
+ export default {
409
+ name: "FtQuestionDrawer",
410
+ // import引入的组件需要注入到对象中才能使用
411
+ components: {
412
+ Toast,
413
+ [Tabs.name]: Tabs,
414
+ [TabPane.name]: TabPane,
415
+ [Cascader.name]: Cascader,
416
+ [Popover.name]: Popover,
417
+ [Tooltip.name]: Tooltip,
418
+ [Tree.name]: Tree,
419
+ [Input.name]: Input,
420
+ FtTabs,
421
+ FtCascader,
422
+ FtQuestion,
423
+ FtHeader,
424
+ FtRadio,
425
+ FtDrawer,
426
+ FtError,
427
+ FtEmpty,
428
+ },
429
+ directives: { infiniteScroll },
430
+ props: {
431
+ itemList: {
432
+ type: Array,
433
+ default: () => [],
434
+ },
435
+ leftInfo: {
436
+ type: Object,
437
+ default: () => {
438
+ return {
439
+ eduLevelId: "",
440
+ subjectId: "",
441
+ courseSrc: "",
442
+ courseId: "",
443
+ };
444
+ },
445
+ },
446
+ fromType: {
447
+ type: String,
448
+ default: "",
449
+ },
450
+ klidsList: {
451
+ type: String,
452
+ default: "",
453
+ },
454
+ i18n: {
455
+ type: Object,
456
+ },
457
+ },
458
+ data() {
459
+ return {
460
+ host: window.location.origin,
461
+ currentPointId: [],
462
+ pointData: [],
463
+ filterText: "",
464
+ activeTab: "course",
465
+ tabList: [
466
+ {
467
+ id: "course",
468
+ label: this.i18n.anTongBuKeCheng,
469
+ },
470
+ {
471
+ id: "knowledge",
472
+ label: this.i18n.anZhiShiDian,
473
+ },
474
+ ],
475
+ tabListWithPoint: [
476
+ {
477
+ id: "course",
478
+ label: this.i18n.anTongBuKeCheng,
479
+ },
480
+ {
481
+ id: "knowledge",
482
+ label: this.i18n.anZhiShiDian,
483
+ },
484
+ {
485
+ id: "point",
486
+ label: this.i18n.anKaoDian,
487
+ },
488
+ ],
489
+ examPointEnableFlag: 0,
490
+ examPointList: [],
491
+ materialsGradesList: [],
492
+ currentMaterials: [],
493
+ courseCascaderList: [],
494
+ currentCourse: [],
495
+ loadingError: false,
496
+ indexParam: {
497
+ itemBackQueryType: 2, //1 按课程 2 按知识点 3 按考点
498
+ page: 1, //页码
499
+ studySectionId: "", //学段id
500
+ subjectId: "", //科目id
501
+ klIds: "", //知识点id集合,多个id以逗号分隔
502
+ klUnionFlag: 1, //知识点交并集标识,0交集,1并集,默认1
503
+ courseId: "", //课程id
504
+ examPointId: "", //考点id
505
+ year: "", //年份
506
+ topicId: "", //专题id
507
+ itemBasicSkillId: "", //基础技能id
508
+ itemCategoryId: "", //题目类型idrtList
509
+ itemDifficultyId: "", //难度id
510
+ order: 0, //排序,0:更新时间倒序,1:更新时间正序
511
+ },
512
+ //首次请求
513
+ isLoading: true,
514
+ defaultCategoryType: 0,
515
+ //题目总数
516
+ totalRecord: 0,
517
+ isFirstIndex: true, //首次加载该题库
518
+ firstRequestCourse: true, //是否首次加载课程
519
+ itemBankTypeList: [],
520
+ topicList: [],
521
+ itemCategoryList: [],
522
+ difficultyList: [],
523
+ basicSkillsList: [],
524
+ coreLiteracyFlag: false,//是否展示核心素养
525
+ coreLiteracyList: [],//核心素养
526
+ years: [],
527
+ itemInfoList: [],
528
+ sortList: [
529
+ {
530
+ label: "使用次数",
531
+ key: "count",
532
+ },
533
+ {
534
+ label: "更新时间",
535
+ key: "updateTime",
536
+ },
537
+ ],
538
+ currentCourseId: "",
539
+ allDifficultyList: [],
540
+ undefinedDifficultyInfo: {
541
+ difficultyCoefficient: "0.0",
542
+ difficultyId: "JPO-tJbAJqc",
543
+ difficultyName: "未定义",
544
+ },
545
+ drawerPageError: false,
546
+ loading: false,
547
+ hasMore: true,
548
+ //是否正在加载题目数据
549
+ loadingBankData: true,
550
+ //加载题目数据是否失败
551
+ loadingError: false,
552
+ currentKlIds: "",
553
+ knowledgeType: 1, //知识点交集:0 || 知识点并集:1
554
+ knowledgeVisible: false,
555
+ currentPointId: [], //考点-当前选择的考点id
556
+ knowledgeName: "", //知识点内容
557
+ isShowTooltip: true,
558
+ allKnowledgeName: "", //没被截取的知识点内容
559
+ switchValue: true, //单选:false || 多选:true
560
+ klList: [],
561
+ klArr: [], //知识点多选时,选择的知识点集合
562
+ knowledgePlaceholder: "",
563
+ inputTempStr: "", //临时存取输入框内容
564
+ toastOptions: { show: false, value: "最多支持100个知识点的查询~" }, //toast的参数
565
+ localKlIds: "",
566
+ firstEnter: true,
567
+ yearList: [],
568
+ };
569
+ },
570
+ //监控data中的数据变化
571
+ watch: {
572
+ "$store.state.resourceInfo": function (n, o) {
573
+ if (this.isFirstIndex) {
574
+ console.log("组件库监听到$store变化", n);
575
+ this.isFirstIndex = false;
576
+ this.requestIndexData();
577
+ if (!n.action) this.currentCourse = n.courseId || (n.list && n.list.courseId);
578
+ }
579
+ },
580
+ materialsGradesList(newValue, oldValue) {
581
+ let firstV = "";
582
+ let secondV = "";
583
+ let thirdV = "";
584
+ newValue.forEach((element) => {
585
+ if (element.value == this.currentCourseValue[0]) {
586
+ firstV = element.value;
587
+ element.children.forEach((item) => {
588
+ if (item.value == this.currentCourseValue[1]) {
589
+ secondV = item.value;
590
+ item.children.forEach((option) => {
591
+ if (option.value == this.currentCourseValue[2]) {
592
+ thirdV = option.value;
593
+ }
594
+ });
595
+ }
596
+ });
597
+ }
598
+ });
599
+ this.currentMaterials = [firstV, secondV, thirdV];
600
+ },
601
+ courseCascaderList(newValue, oldValue) {
602
+ this.courseCascaderList = newValue;
603
+ if (
604
+ this.firstRequestCourse &&
605
+ this.courseCascaderList &&
606
+ this.courseCascaderList.length > 0
607
+ ) {
608
+ this.firstRequestCourse = false;
609
+ setTimeout(() => {
610
+ let checkedCourseArr = [];
611
+ let checkedNodes =
612
+ this.$refs.course.$refs.courseCascader.getCheckedNodes(false);
613
+ if (checkedNodes && checkedNodes.length > 0) {
614
+ let currentNode = checkedNodes[0];
615
+ this.getCurrentCheckedCourse(checkedCourseArr, currentNode);
616
+ this.currentCourse = checkedCourseArr;
617
+ }
618
+ }, 200);
619
+ }
620
+ },
621
+ localKlIds: {
622
+ handler() {
623
+ this.currentKlIds = this.localKlIds;
624
+ this.initTreeValue();
625
+ console.log("watch", this.currentKlIds);
626
+ },
627
+ immediate: true,
628
+ },
629
+ filterText(val) {
630
+ if (this.knowledgeVisible) {
631
+ this.$refs.secondTree.filter(val);
632
+ }
633
+ },
634
+ knowledgeVisible(newVal) {
635
+ if (!newVal) {
636
+ this.filterText = "";
637
+ let length = this.$refs.secondTree.$children.length;
638
+ for (let i = 0; i < length; i++) {
639
+ this.$refs.secondTree.$children[i].node.parent.childNodes[
640
+ i
641
+ ].expanded = false;
642
+ }
643
+ }
644
+ },
645
+ examPointList(newValue, oldValue) {
646
+ this.pointData = newValue;
647
+ if (
648
+ this.pointData &&
649
+ this.pointData.length > 0 &&
650
+ (!this.currentPointId || this.currentPointId.length == 0)
651
+ ) {
652
+ this.currentPointId = [this.pointData[0].pointId];
653
+ }
654
+ },
655
+ klidsList(newValue, oldValue) {
656
+ if (!this.firstEnter) {
657
+ this.localKlIds = newValue;
658
+ }
659
+ this.firstEnter = false;
660
+ this.requestBankData();
661
+ },
662
+ years(newValue, oldValue) {
663
+ if (newValue && newValue.length) {
664
+ this.yearList = []
665
+ if(newValue.length > 6){
666
+ let temp = newValue.slice(0,6)
667
+ this.yearList = [...this.yearList, ...temp,{id: 'earlier', label: '更早'}]
668
+ }else {
669
+ newValue.forEach((element) => {
670
+ this.yearList.push(element);
671
+ });
672
+ }
673
+ } else {
674
+ this.yearList = [];
675
+ }
676
+ },
677
+ },
678
+ methods: {
679
+ changeCurrentPage() {
680
+ console.log(this.indexParam);
681
+ if (this.itemInfoList.length >= this.totalRecord) {
682
+ this.hasMore = false;
683
+ return;
684
+ }
685
+ this.indexParam.page = this.currPage + 1;
686
+ this.requestPageBank(this.indexParam);
687
+ },
688
+ handlePointChange(value) {
689
+ var pointId = value[value.length - 1];
690
+ let dic = { examPointId: pointId };
691
+ this.$emit("changeIndexParam", "changePointId", JSON.stringify(dic));
692
+ },
693
+ setListener() {
694
+ let _this = this;
695
+ //改变indexParam参数,重新请求index接口
696
+ this.$off("changeIndexParam"); //避免重复响应同一事件
697
+ this.$on("changeIndexParam", function (action, msg) {
698
+ if (action == "retryRequest") {
699
+ //加载失败后的重新请求 || 删除题目后刷新题目数据
700
+ _this.requestBankData();
701
+ return;
702
+ }
703
+ let dic = JSON.parse(msg);
704
+ for (let key in dic) {
705
+ let value = dic[key];
706
+ _this.indexParam[key] = value;
707
+ }
708
+ if (action == "changeSource") {
709
+ _this.defaultCategoryType = dic["itemBankType"];
710
+ if (_this.defaultCategoryType == 4) {
711
+ _this.indexParam.topicId = "";
712
+ _this.indexParam.year = "";
713
+ let dic = { selectedTopicId: "", currentYear: "" };
714
+
715
+ this.$emit(
716
+ "toChangeSelectedTopicId",
717
+ "toChangeSelectedTopicId",
718
+ JSON.stringify(dic)
719
+ );
720
+ this.$emit(
721
+ "toChangeCurrentYear",
722
+ "toChangeCurrentYear",
723
+ JSON.stringify(dic)
724
+ );
725
+
726
+ this.$emit(
727
+ "eventbus-emit",
728
+ "toChangeSelectedTopicId",
729
+ "toChangeSelectedTopicId",
730
+ JSON.stringify(dic)
731
+ );
732
+ this.$emit(
733
+ "eventbus-emit",
734
+ "toChangeCurrentYear",
735
+ "toChangeCurrentYear",
736
+ JSON.stringify(dic)
737
+ );
738
+ _this.allDifficultyList = JSON.parse(
739
+ JSON.stringify(_this.difficultyList)
740
+ );
741
+ _this.allDifficultyList.push(_this.undefinedDifficultyInfo);
742
+ } else {
743
+ _this.allDifficultyList = JSON.parse(
744
+ JSON.stringify(_this.difficultyList)
745
+ );
746
+ if (_this.indexParam.itemDifficultyId == "JPO-tJbAJqc") {
747
+ _this.indexParam.itemDifficultyId = "";
748
+ let diffDic = { itemDifficultyId: "" };
749
+ this.$emit(
750
+ "toChangeSelectedDifficultyId",
751
+ "toChangeSelectedDifficultyId",
752
+ JSON.stringify(diffDic)
753
+ );
754
+ this.$emit(
755
+ "eventbus-emit",
756
+ "toChangeSelectedDifficultyId",
757
+ "toChangeSelectedDifficultyId",
758
+ JSON.stringify(diffDic)
759
+ );
760
+ }
761
+ //请求专题
762
+ _this.requestTopicData();
763
+ }
764
+ }
765
+ //
766
+ if (action == "changeOrder") {
767
+ delete _this.indexParam.orderQuote;
768
+ }
769
+ if (action == "changeOrderQuote") {
770
+ delete _this.indexParam.order;
771
+ }
772
+ //请求题目数据
773
+ _this.requestBankData();
774
+ });
775
+ //编辑单题成功,若当前来源是我的题库,则刷新题目列表数据
776
+ this.$on("editItemSuccess", async (newItemObj) => {
777
+ if (_this.indexParam.itemBankType == 4) {
778
+ _this.requestBankData();
779
+ }
780
+ });
781
+ },
782
+ tabClick(value) {
783
+ console.log(value);
784
+ this.activeTab = value;
785
+ let _this = this;
786
+ let dic = {};
787
+ switch (this.activeTab) {
788
+ case "course":
789
+ _this.knowledgeVisible = false;
790
+ dic = {
791
+ itemBackQueryType: 1,
792
+ courseId: _this.currentCourseId,
793
+ klIds: "",
794
+ klUnionFlag: 1,
795
+ examPointId: "",
796
+ };
797
+ break;
798
+ case "knowledge":
799
+ dic = {
800
+ itemBackQueryType: 2,
801
+ courseId: _this.currentCourseId,
802
+ klIds: _this.currentKlIds,
803
+ klUnionFlag: _this.knowledgeType,
804
+ examPointId: "",
805
+ };
806
+ break;
807
+ case "point":
808
+ _this.knowledgeVisible = false;
809
+ dic = {
810
+ itemBackQueryType: 3,
811
+ courseId: "",
812
+ klIds: "",
813
+ klUnionFlag: 1,
814
+ examPointId:
815
+ _this.currentPointId.length > 0
816
+ ? _this.currentPointId[_this.currentPointId.length - 1]
817
+ : "",
818
+ };
819
+ break;
820
+ }
821
+ this.$emit("changeIndexParam", "changeTab", JSON.stringify(dic));
822
+ },
823
+ //初始化tree默认值
824
+ initTreeValue() {
825
+ console.log("initTree");
826
+ // debugger
827
+ if (this.switchValue) {
828
+ //多选
829
+ if (this.currentKlIds.length == 0) {
830
+ return;
831
+ }
832
+ this.klArr = this.currentKlIds.split(",");
833
+ this.$nextTick(() => {
834
+ this.$refs.secondTree.setCheckedKeys(this.klArr);
835
+ this.klArr = this.$refs.secondTree.getCheckedKeys(true);
836
+ var nodesArr = this.$refs.secondTree.getCheckedNodes();
837
+ let tempStr = "";
838
+ if (nodesArr.length == 0) {
839
+ tempStr = "";
840
+ } else if (nodesArr.length > 1) {
841
+ nodesArr.forEach((element) => {
842
+ if (!element.hasChild) {
843
+ tempStr += element.klname + ",";
844
+ }
845
+ });
846
+ } else {
847
+ tempStr = nodesArr[0].klname;
848
+ }
849
+ this.inputTempStr = tempStr;
850
+ this.clickKnowledgeItem(true, tempStr);
851
+ });
852
+ } else {
853
+ this.$nextTick(() => {
854
+ this.$refs.secondTree.setCurrentKey(this.currentKlIds);
855
+ var nodeData = this.$refs.secondTree.getCurrentNode();
856
+ if (nodeData) {
857
+ this.clickKnowledgeItem(true, nodeData.klname);
858
+ }
859
+ });
860
+ }
861
+ },
862
+ //树状结构过滤器
863
+ knowledgeFilterNode(value, data, node) {
864
+ // 如果什么都没填就直接返回
865
+ console.log("进行了过滤");
866
+ if (!value) return true;
867
+ // 如果传入的value和data中的label相同说明是匹配到了
868
+ if (data.klname.indexOf(value) !== -1) {
869
+ return true;
870
+ }
871
+ // 否则要去判断它是不是选中节点的子节点
872
+ return this.checkBelongToChooseNode(value, data, node);
873
+ },
874
+ // 判断传入的节点是不是选中节点的子节点
875
+ checkBelongToChooseNode(value, data, node) {
876
+ const level = node.level;
877
+ // 如果传入的节点本身就是一级节点就不用校验了
878
+ if (level === 1) {
879
+ return false;
880
+ }
881
+ // 先取当前节点的父节点
882
+ var parentData = node.parent;
883
+ // 遍历当前节点的父节点
884
+ var index = 0;
885
+ while (index < level - 1) {
886
+ // 如果匹配到直接返回
887
+ if (parentData.data.klname.indexOf(value) !== -1) {
888
+ return true;
889
+ }
890
+ // 否则的话再往上一层做匹配
891
+ parentData = parentData.parent;
892
+ index++;
893
+ }
894
+ // 没匹配到返回false
895
+ return false;
896
+ },
897
+ choiseKnowledgeType(value) {
898
+ this.knowledgeType = value;
899
+ },
900
+ clickKnowledgeNode(object) {
901
+ if (!this.switchValue) {
902
+ this.currentKlIds = object.klId;
903
+ let dic = { klIds: object.klId, klUnionFlag: 1 };
904
+ this.clickKnowledgeItem(true, object.klname);
905
+ this.$emit("changeIndexParam", "changeKnowledge", JSON.stringify(dic));
906
+ let tempDic = {
907
+ klIds: object.klId,
908
+ switch: this.switchValue,
909
+ knowledgeType: 1,
910
+ };
911
+ this.$emit("changeKLIds", "changeKLIds", JSON.stringify(tempDic));
912
+ }
913
+ },
914
+ checkKnowledgeNode(object, compo) {
915
+ this.klArr = this.$refs.secondTree.getCheckedKeys(true);
916
+ let tempStr = "";
917
+ if (compo.checkedNodes.length == 0) {
918
+ tempStr = "";
919
+ } else if (compo.checkedNodes.length > 1) {
920
+ compo.checkedNodes.forEach((element) => {
921
+ if (!element.hasChild) {
922
+ tempStr += element.klname + ",";
923
+ }
924
+ });
925
+ } else {
926
+ tempStr = compo.checkedNodes[0].klname;
927
+ }
928
+ this.inputTempStr = tempStr;
929
+ this.clickKnowledgeItem(false, tempStr);
930
+ if (this.klArr.length > 100) {
931
+ this.toastOptions.show = true;
932
+ setTimeout(() => {
933
+ this.toastOptions.show = false;
934
+ }, 2000);
935
+ }
936
+ },
937
+ clearKnowledges() {
938
+ let _this = this;
939
+ _this.currentKlIds = "";
940
+ if (_this.klArr.length == 0) {
941
+ return;
942
+ }
943
+ _this.klArr = [];
944
+ _this.inputTempStr = "";
945
+ _this.clickKnowledgeItem(false, _this.inputTempStr);
946
+ this.$nextTick(() => {
947
+ _this.$refs.secondTree.setCheckedKeys([]);
948
+ _this.klArr = [];
949
+ let dic = {
950
+ klIds: "",
951
+ klUnionFlag: _this.knowledgeType,
952
+ };
953
+ this.$emit("changeIndexParam", "changeKnowledge", JSON.stringify(dic));
954
+ let tempDic = {
955
+ klIds: "",
956
+ switch: _this.switchValue,
957
+ knowledgeType: _this.knowledgeType,
958
+ };
959
+ this.$emit("changeKLIds", "changeKLIds", JSON.stringify(tempDic));
960
+ });
961
+ },
962
+ toQueryWithKnowledges() {
963
+ let _this = this;
964
+ if (_this.klArr.length == 0 || _this.klArr.length > 100) {
965
+ return;
966
+ }
967
+ _this.clickKnowledgeItem(true, _this.inputTempStr);
968
+ _this.currentKlIds = _this.klArr.join();
969
+ let dic = { klIds: _this.currentKlIds, klUnionFlag: _this.knowledgeType };
970
+ this.$emit("changeIndexParam", "changeKnowledge", JSON.stringify(dic));
971
+ let tempDic = {
972
+ klIds: _this.currentKlIds,
973
+ switch: _this.switchValue,
974
+ knowledgeType: _this.knowledgeType,
975
+ };
976
+ this.$emit("changeKLIds", "changeKLIds", JSON.stringify(tempDic));
977
+ },
978
+ clickKnowledgeItem(isDisplay, name) {
979
+ console.log("clickKnowledgeItem", name);
980
+ name = this.decode(name);
981
+ this.knowledgeVisible = !isDisplay;
982
+ this.allKnowledgeName = name;
983
+ this.isShowTooltip = true;
984
+ if (name.length > 30) {
985
+ this.isShowTooltip = false;
986
+ name = name.slice(0, 30) + "...";
987
+ }
988
+ this.knowledgeName = name;
989
+ },
990
+ decode(str) {
991
+ return decodeEntities(str);
992
+ },
993
+ getAnswer(itemInfo) {
994
+ let currentItem = this.itemInfoList.find(
995
+ (item) => item.itemInfoId == itemInfo.itemInfoId
996
+ );
997
+ getAnswer(
998
+ {
999
+ itemId: itemInfo.itemInfoId,
1000
+ itemBankType: this.indexParam.itemBankType,
1001
+ itemSourceType: itemInfo.itemSourceType,
1002
+ rootSourceId: itemInfo.rootItemInfoId,
1003
+ },
1004
+ (res) => {
1005
+ // this.$set(currentItem, "answerDic", res.value);
1006
+ // getQuestion({ itemId: res.value.itemAnalysis }, (result) => {
1007
+ // if (!result) {
1008
+ // return;
1009
+ // }
1010
+ // currentItem.answerDic = {
1011
+ // ...currentItem.answerDic,
1012
+ // analysis: result.data,
1013
+ // };
1014
+ // this.$set(currentItem, "answerDic", currentItem.answerDic);
1015
+ // });
1016
+ if (!res) {
1017
+ return;
1018
+ }
1019
+ if (typeof res === "string") res = JSON.parse(res);
1020
+ if (res.code == 0) {
1021
+ //取出答案与解析
1022
+ // _this.answerDic = res.value;
1023
+ this.$set(currentItem, "pointNames", res.value.pointNames);
1024
+ this.$set(currentItem, "klNames", res.value.klNames);
1025
+ this.$set(currentItem, "answer", res.value.correctAnswer);
1026
+ this.$set(
1027
+ currentItem,
1028
+ "basicSkillNames",
1029
+ res.value.basicSkillNames
1030
+ );
1031
+ if (
1032
+ (res.value.itemType == 3 || res.value.itemType == 6) &&
1033
+ res.value.correctAnswer &&
1034
+ res.value.correctAnswer.length > 0
1035
+ ) {
1036
+ getQuestion({ itemId: res.value.correctAnswer }, (res) => {
1037
+ if (!res) {
1038
+ return;
1039
+ }
1040
+ if (typeof res === "string") res = JSON.parse(res);
1041
+ //取出题目数据
1042
+ this.$set(currentItem, "answer", res.data);
1043
+ });
1044
+ } else if (res.value.itemType == 7) {
1045
+ //组合单选题
1046
+ var answerArr = res.value.correctAnswer.split(",");
1047
+ var fiveArr = [],tempStr = ""; //将组合单选题答案五五放到一个数组展示
1048
+ answerArr && answerArr.length && answerArr.map(function (item, idx) {
1049
+ if (idx % 5 !== 0 || idx == 0) {
1050
+ tempStr += item;
1051
+ } else {
1052
+ fiveArr.push(tempStr);
1053
+ tempStr = item;
1054
+ }
1055
+ if (idx == answerArr.length - 1) {
1056
+ fiveArr.push(tempStr);
1057
+ }
1058
+ });
1059
+ this.$set(currentItem, "answer", fiveArr.join(";"));
1060
+ } else {
1061
+ this.$set(currentItem, "answer", res.value.correctAnswer);
1062
+ }
1063
+ if (res.value.itemAnalysis && res.value.itemAnalysis.length > 0) {
1064
+ getQuestion({ itemId: res.value.itemAnalysis }, (res) => {
1065
+ if (!res) {
1066
+ return;
1067
+ }
1068
+ //取出题目数据
1069
+ this.$set(currentItem, "analysis", res.data);
1070
+ });
1071
+ }
1072
+ }
1073
+ }
1074
+ );
1075
+ },
1076
+ getContent(itemInfo) {
1077
+ let currentItem = this.itemInfoList.find(
1078
+ (item) => item.itemInfoId == itemInfo.itemInfoId
1079
+ );
1080
+ getQuestion({ itemId: itemInfo.itemFileId }, (res) => {
1081
+ this.$set(currentItem, "content", res.data);
1082
+ });
1083
+ },
1084
+ choiceOrRemoveQuestion(itemInfo, isAdd) {
1085
+ this.$emit(
1086
+ "choiceOrRemoveQuestion",
1087
+ itemInfo,
1088
+ isAdd,
1089
+ this.defaultCategoryType
1090
+ );
1091
+ },
1092
+ headerSort(item) {
1093
+ console.log(item);
1094
+ if (item.key == "updateTime") {
1095
+ let dic = { order: item.sortOrder ? 1 : 0 };
1096
+ this.$emit("changeIndexParam", "changeOrder", JSON.stringify(dic));
1097
+ } else {
1098
+ let dic = { orderQuote: item.sortOrder ? 1 : 0 };
1099
+ this.$emit("changeIndexParam", "changeOrderQuote", JSON.stringify(dic));
1100
+ }
1101
+ },
1102
+ toShowAudio(itemInfo, itemIndex) {
1103
+ let dic = {
1104
+ questionIndex: itemIndex,
1105
+ fileId: itemInfo.audioFileId,
1106
+ };
1107
+ this.$emit("toShowAudio", "toShowAudio", JSON.stringify(dic));
1108
+ },
1109
+ // 来源点击
1110
+ sourceClick(itemBankType) {
1111
+ if (itemBankType == 5) {
1112
+ this.$emit("goQptk");
1113
+ return;
1114
+ }
1115
+ // this.currentSourceType = itemBankType;
1116
+ let dic = { itemBankType: itemBankType };
1117
+ // this.$emit('eventbus-emit', "changeIndexParam", "changeSource", JSON.stringify(dic))
1118
+ this.$emit(
1119
+ "eventbus-emit",
1120
+ "changeSource",
1121
+ "changeSource",
1122
+ JSON.stringify(dic)
1123
+ );
1124
+ this.$emit("changeIndexParam", "changeSource", JSON.stringify(dic));
1125
+ // this.$emit("changeSource", "changeSource", JSON.stringify(dic));
1126
+ },
1127
+ // 专题点击
1128
+ topicClick(topicId) {
1129
+ if (topicId == "all") {
1130
+ topicId = "";
1131
+ }
1132
+ this.selectedTopicId = topicId;
1133
+ let dic = { topicId: topicId };
1134
+ this.$emit("changeIndexParam", "changeTopic", JSON.stringify(dic));
1135
+ },
1136
+ // 题型点击
1137
+ categoryClick(itemCategoryId) {
1138
+ if (itemCategoryId == "all") {
1139
+ itemCategoryId = "";
1140
+ }
1141
+ this.selectedCategoryId = itemCategoryId;
1142
+ let dic = { itemCategoryId: itemCategoryId };
1143
+ this.$emit("changeIndexParam", "changeCategory", JSON.stringify(dic));
1144
+ },
1145
+ // 难度点击
1146
+ difficultyClick(difficultyId) {
1147
+ if (difficultyId == "all") {
1148
+ difficultyId = "";
1149
+ }
1150
+ this.selectedDifficultId = difficultyId;
1151
+ let dic = { itemDifficultyId: difficultyId };
1152
+ this.$emit("changeIndexParam", "changeDifficulty", JSON.stringify(dic));
1153
+ },
1154
+ // 年份
1155
+ yearClick(year) {
1156
+ if (year == "all") {
1157
+ year = "";
1158
+ }
1159
+ this.currentYear = year;
1160
+ let isEarly = year == "earlier" ? true : false;
1161
+ let _lastYear = this.yearList.slice(-2,-1)[0].id
1162
+ let lastYear = typeof _lastYear == 'number' ? _lastYear : 0;
1163
+ let dic = { year: isEarly ? lastYear - 1 : year, isEarlier:isEarly ? -1 : 1 };
1164
+ this.$emit("changeIndexParam", "selectYear", JSON.stringify(dic));
1165
+ },
1166
+ // 技能
1167
+ basicSkillClick(basicSkillsId) {
1168
+ if (basicSkillsId == "all") {
1169
+ basicSkillsId = "";
1170
+ }
1171
+ this.selectedSkillId = basicSkillsId;
1172
+ let dic = { itemBasicSkillId: basicSkillsId };
1173
+ this.$emit("changeIndexParam", "changeSkill", JSON.stringify(dic));
1174
+ },
1175
+ // 核心素养
1176
+ coreLiteracyClick(literacyId) {
1177
+ if (literacyId == "all") {
1178
+ literacyId = "";
1179
+ }
1180
+ let dic = { literacyId: literacyId };
1181
+ this.$emit("changeIndexParam", "changeLiteracy", JSON.stringify(dic));
1182
+ },
1183
+ changeMaterials(value) {
1184
+ console.log(value);
1185
+ this.currentCourse = []; //重置
1186
+ this.requestCourseListData(
1187
+ this.indexParam.subjectId,
1188
+ value[0],
1189
+ value[1],
1190
+ value[2]
1191
+ );
1192
+ },
1193
+ //递归获取当前选择的课程
1194
+ getCurrentCheckedCourse(arr, node) {
1195
+ if (node && node.value) {
1196
+ arr.unshift(node.value);
1197
+ if (node.parent) {
1198
+ this.getCurrentCheckedCourse(arr, node.parent);
1199
+ }
1200
+ }
1201
+ },
1202
+ changeCourse(value) {
1203
+ this.currentCourseId = value[value.length - 1];
1204
+ let dic = { courseId: this.currentCourseId };
1205
+ this.$emit("changeIndexParam", "changeCourseId", JSON.stringify(dic));
1206
+ },
1207
+ /*
1208
+ **请求题库首页数据
1209
+ * 只在首次进入该页面时请求
1210
+ */
1211
+ requestIndexData() {
1212
+ this.loadingError = false;
1213
+ this.goRequestIndexData();
1214
+ },
1215
+ // 首次进入该页面时请求获取用户信息
1216
+ goRequestIndexData() {
1217
+ let _this = this;
1218
+ console.log("getBank", this);
1219
+ var prepareInfo = this.leftInfo;
1220
+ console.log(prepareInfo, "prepareInfo1");
1221
+ if (prepareInfo && prepareInfo.eduLevelId) {
1222
+ var eduLevelId = prepareInfo.eduLevelId;
1223
+ var subjectId = prepareInfo.subjectId;
1224
+ var courseSrc = prepareInfo.courseSrc;
1225
+ var courseId = prepareInfo.courseId;
1226
+ _this.indexParam["courseSrc"] = courseSrc;
1227
+ _this.indexParam["studySectionId"] = eduLevelId;
1228
+ _this.indexParam["subjectId"] = subjectId;
1229
+ _this.indexParam["courseId"] = courseId;
1230
+ _this.currentCourseId = courseId;
1231
+ var teachMaterialId = prepareInfo.teachMaterialId;
1232
+ var gradeId = prepareInfo.gradeId;
1233
+
1234
+ let dom = document.getElementById("tk-detail-drawer-slot-id");
1235
+ let loadingInstance = Loading.service({
1236
+ target: dom,
1237
+ text: this.i18n.jiaZaiZhong,
1238
+ });
1239
+ console.log(prepareInfo, "prepareInfo");
1240
+ getBankIndex(
1241
+ {
1242
+ eduLevelId: eduLevelId,
1243
+ subjectId: subjectId,
1244
+ gradeId: gradeId,
1245
+ teachMaterialId: teachMaterialId,
1246
+ courseId: courseId,
1247
+ courseSrc: courseSrc,
1248
+ },
1249
+ (res) => {
1250
+ this.$nextTick(() => {
1251
+ // 以服务的方式调用的 Loading 需要异步关闭
1252
+ loadingInstance.close();
1253
+ });
1254
+ _this.isLoading = false;
1255
+ if (typeof res === "string") res = JSON.parse(res);
1256
+ if (res && res.code == 0) {
1257
+ console.log("getBank", res);
1258
+ //处理indexParam
1259
+ _this.indexParam.studySectionId = eduLevelId;
1260
+ _this.indexParam.subjectId = subjectId;
1261
+ _this.indexParam.itemBankType =
1262
+ res.value.itemBankQueryDto.itemBankType;
1263
+ _this.requestBankData();
1264
+ _this.totalRecord = res.value.totalRecord;
1265
+ // _this.pageInfo = {
1266
+ // currPage: res.value.currPage,
1267
+ // totalPage: res.value.totalPage,
1268
+ // perPage: res.value.perPage,
1269
+ // };
1270
+ //取出默认的题库类型
1271
+ _this.defaultCategoryType = res.value.itemBankQueryDto.itemBankType;
1272
+
1273
+ // _this.defaultSubjectList = res.value.defaultSubjectList;
1274
+ //请求教材版本
1275
+ _this.requestMaterialsGradesData(
1276
+ eduLevelId,
1277
+ subjectId,
1278
+ teachMaterialId,
1279
+ gradeId
1280
+ );
1281
+ //难度知识点是否必填
1282
+ _this.requestDifficultyAndKnowledgeSettingInfo(
1283
+ eduLevelId,
1284
+ subjectId
1285
+ );
1286
+ //请求专题数据
1287
+ _this.requestTopicData();
1288
+
1289
+ //判断是否展示“考点”tab
1290
+ _this.examPointEnableFlag = res.value.examPointEnableFlag;
1291
+ //取学年数组
1292
+ _this.years = res.value && res.value.yearList && res.value.yearList.length && res.value.yearList.map((item) => {
1293
+ return {
1294
+ id: item,
1295
+ label: item,
1296
+ };
1297
+ });
1298
+ if (_this.years.length) {
1299
+ _this.years.unshift({
1300
+ id: "all",
1301
+ label: _this.i18n.quanBu,
1302
+ });
1303
+ }
1304
+ //取来源数据
1305
+ _this.itemBankTypeList = res.value.itemBankTypeList;
1306
+ _this.itemBankTypeList.unshift({
1307
+ itemBankType: 5,
1308
+ itemBankTypeName: "精品题库",
1309
+ });
1310
+ //取技能数据
1311
+ _this.basicSkillsList = res.value.basicSkillsList;
1312
+ if (_this.basicSkillsList.length) {
1313
+ _this.basicSkillsList.unshift({
1314
+ basicSkillsId: "all",
1315
+ basicName: this.i18n.quanBu,
1316
+ });
1317
+ }
1318
+ //取核心素养数据
1319
+ _this.coreLiteracyFlag = res.value.coreLiteracyFlag;
1320
+ _this.coreLiteracyList = res.value && res.value.coreLiteracyList && res.value.coreLiteracyList.length && res.value.coreLiteracyList.map(item=>{
1321
+ return {
1322
+ literacyId: item.literacyId,
1323
+ literacyName: item.literacyName
1324
+ }
1325
+ }) || [];
1326
+ if (_this.coreLiteracyList && _this.coreLiteracyList.length) {
1327
+ _this.coreLiteracyList.unshift({
1328
+ literacyId: "all",
1329
+ literacyName: this.i18n.quanBu,
1330
+ });
1331
+ }
1332
+ console.log('_this.coreLiteracyList',_this.coreLiteracyList)
1333
+ //取题型数据
1334
+ _this.itemCategoryList = res.value.itemCategoryList;
1335
+ if (_this.itemCategoryList.length) {
1336
+ _this.itemCategoryList.unshift({
1337
+ itemCategoryId: "all",
1338
+ itemCategoryName: this.i18n.quanBu,
1339
+ itemType: -1,
1340
+ });
1341
+ }
1342
+
1343
+ //取难度数据
1344
+ _this.difficultyList = JSON.parse(
1345
+ JSON.stringify(res.value.cfgDifficultyList)
1346
+ );
1347
+ if (_this.difficultyList.length) {
1348
+ _this.difficultyList.unshift({
1349
+ difficultyId: "all",
1350
+ difficultyName: this.i18n.quanBu,
1351
+ });
1352
+ }
1353
+
1354
+ if (_this.indexParam.itemBankType == 4) {
1355
+ _this.allDifficultyList = JSON.parse(
1356
+ JSON.stringify(res.value.cfgDifficultyList)
1357
+ );
1358
+ _this.allDifficultyList.push(_this.undefinedDifficultyInfo);
1359
+ } else {
1360
+ _this.allDifficultyList = JSON.parse(
1361
+ JSON.stringify(res.value.cfgDifficultyList)
1362
+ );
1363
+ }
1364
+ //知识点
1365
+ _this.klList = res.value.knowledgeList;
1366
+ //考点
1367
+ _this.examPointList = res.value.examPointList;
1368
+ //获取该课程下关联的知识点
1369
+ //变式题默认当前原题的知识点
1370
+ if (_this.fromType == "variant") {
1371
+ if (_this.klidsList == "") {
1372
+ if (
1373
+ res.value &&
1374
+ res.value.klIds &&
1375
+ res.value.klIds.length > 0
1376
+ ) {
1377
+ _this.localKlIds = res.value.klIds;
1378
+ _this.$store.commit(
1379
+ "saveCurrentKnowledgeIds",
1380
+ res.value.klIds
1381
+ );
1382
+ } else if (_this.klList.length > 0) {
1383
+ _this.localKlIds = _this.getFirstKnowledgeId(_this.klList);
1384
+ }
1385
+ } else {
1386
+ _this.localKlIds = _this.klidsList;
1387
+ }
1388
+ } else {
1389
+ if (
1390
+ res.value &&
1391
+ res.value.klIds &&
1392
+ res.value.klIds.length > 0
1393
+ ) {
1394
+ _this.localKlIds = res.value.klIds;
1395
+ _this.$store.commit(
1396
+ "saveCurrentKnowledgeIds",
1397
+ res.value.klIds
1398
+ );
1399
+ } else if (_this.klList.length > 0) {
1400
+ _this.localKlIds = _this.getFirstKnowledgeId(_this.klList);
1401
+ }
1402
+ }
1403
+ //提供数据给Vuex
1404
+ _this.$store.commit("changeValue", {
1405
+ type: "itemCategory",
1406
+ val: _this.itemCategoryList || [],
1407
+ });
1408
+ _this.$store.commit("changeValue", {
1409
+ type: "difficults",
1410
+ val: _this.difficultyList || [],
1411
+ });
1412
+ _this.$store.commit("changeValue", {
1413
+ type: "basicSkillIdList",
1414
+ val: _this.basicSkillsList || [],
1415
+ });
1416
+ _this.$store.commit("changeValue", {
1417
+ type: "klIdList",
1418
+ val: _this.klList || [],
1419
+ });
1420
+ _this.$store.commit("changeValue", {
1421
+ type: "pointIdList",
1422
+ val: _this.examPointList || [],
1423
+ });
1424
+ _this.$store.commit("changeValue", {
1425
+ type: "enableShowPoint",
1426
+ val: _this.examPointEnableFlag || false,
1427
+ });
1428
+ } else {
1429
+ _this.loadingError = true;
1430
+ }
1431
+ }
1432
+ );
1433
+ }
1434
+ },
1435
+ /*
1436
+ **请求题库数据
1437
+ * 筛选条件时请求
1438
+ */
1439
+ requestBankData() {
1440
+ let _this = this;
1441
+ _this.loadingError = false;
1442
+ _this.loadingBankData = true;
1443
+ _this.goRequestBankData();
1444
+ },
1445
+ //筛选条件时请求获取用户信息
1446
+ goRequestBankData() {
1447
+ let dom = document.getElementById("bankData-drawer-slot-id");
1448
+ let loadingInstance = Loading.service({
1449
+ target: dom,
1450
+ text: this.i18n.jiaZaiZhong,
1451
+ });
1452
+ let _this = this;
1453
+ var prepareInfo = this.leftInfo;
1454
+ if (prepareInfo && prepareInfo.eduLevelId) {
1455
+ var eduLevelId = prepareInfo.eduLevelId;
1456
+ var subjectId = prepareInfo.subjectId;
1457
+ var courseSrc = prepareInfo.courseSrc;
1458
+ _this.indexParam["courseSrc"] = courseSrc;
1459
+ _this.indexParam["studySectionId"] = eduLevelId;
1460
+ _this.indexParam["subjectId"] = subjectId;
1461
+ _this.indexParam["klIds"] = this.localKlIds;
1462
+ getBankData(_this.indexParam, (res) => {
1463
+ _this.loadingBankData = false;
1464
+ if (typeof res === "string") res = JSON.parse(res);
1465
+ if (res && res.code == 0) {
1466
+ //判断是否展示“考点”tab
1467
+ // _this.examPointEnableFlag = res.value.examPointEnableFlag;
1468
+ //取出题目数据
1469
+ _this.loadingError = false;
1470
+ _this.itemInfoList = res.value && res.value.itemInfoList && res.value.itemInfoList.length && res.value.itemInfoList.map((item) => {
1471
+ return { ...item, answerDic: {} };
1472
+ });
1473
+
1474
+ _this.totalRecord = res.value.totalRecord;
1475
+ _this.currPage = res.value.currPage;
1476
+ if (_this.itemInfoList.length >= _this.totalRecord) {
1477
+ _this.hasMore = false;
1478
+ } else {
1479
+ _this.hasMore = true;
1480
+ }
1481
+ _this.pageInfo = {
1482
+ currPage: res.value.currPage,
1483
+ totalPage: res.value.totalPage,
1484
+ perPage: res.value.perPage,
1485
+ };
1486
+ loadingInstance.close();
1487
+ } else {
1488
+ //请求题目数据报错
1489
+ _this.loadingError = true;
1490
+ _this.itemInfoList = [];
1491
+ _this.pageInfo = {};
1492
+ }
1493
+ });
1494
+ }
1495
+ },
1496
+ /*
1497
+ **获取教材版本数据
1498
+ */
1499
+ requestMaterialsGradesData(
1500
+ eduLevelId,
1501
+ subjectId,
1502
+ teachMaterialId,
1503
+ gradeId
1504
+ ) {
1505
+ console.log("请求教材");
1506
+ let _this = this;
1507
+ _this.courseCascaderList = [];
1508
+ getMaterialsGrades(
1509
+ {
1510
+ eduLevelId: eduLevelId,
1511
+ subjectId: subjectId,
1512
+ teachMaterialId: teachMaterialId,
1513
+ gradeId: gradeId,
1514
+ },
1515
+ (res) => {
1516
+ if (!res) {
1517
+ return;
1518
+ }
1519
+ if (typeof res === "string") res = JSON.parse(res);
1520
+ if (res.code == 0) {
1521
+ _this.currentCourseValue = [
1522
+ res.value.checkTeachMaterialId,
1523
+ res.value.checkClassificationId,
1524
+ res.value.checkTermIndex,
1525
+ ];
1526
+ _this.currentMaterials = [];
1527
+ _this.materialsGradesList = res.value.list;
1528
+
1529
+ _this.requestCourseListData(
1530
+ subjectId,
1531
+ res.value.checkTeachMaterialId,
1532
+ res.value.checkClassificationId,
1533
+ res.value.checkTermIndex
1534
+ );
1535
+ }
1536
+ }
1537
+ );
1538
+ },
1539
+ /*
1540
+ **获取知识点、难度配置,是否必填
1541
+ */
1542
+ requestDifficultyAndKnowledgeSettingInfo(eduLevelId, subjectId) {
1543
+ let _this = this;
1544
+ getKldftNecessary(
1545
+ {
1546
+ eduLevelId: eduLevelId,
1547
+ subjectId: subjectId,
1548
+ },
1549
+ (res) => {
1550
+ if (!res) {
1551
+ return;
1552
+ }
1553
+ if (typeof res === "string") res = JSON.parse(res);
1554
+ if (res.code == 0) {
1555
+ if (res.value && res.value == 2) {
1556
+ _this.$store.commit("changeValue", {
1557
+ type: "knowledgeIsRequired",
1558
+ val: false,
1559
+ });
1560
+ }
1561
+ }
1562
+ }
1563
+ );
1564
+ },
1565
+ /*
1566
+ ** 获取知识点数据
1567
+ */
1568
+ requestKnowledgeData() {
1569
+ let _this = this;
1570
+ getKnowledge(
1571
+ {
1572
+ eduLevelId: _this.indexParam.studySectionId,
1573
+ subjectId: _this.indexParam.subjectId,
1574
+ },
1575
+ (res) => {
1576
+ if (!res) {
1577
+ return;
1578
+ }
1579
+ if (typeof res === "string") res = JSON.parse(res);
1580
+ if (res.code == 0) {
1581
+ _this.klList = res.value;
1582
+ }
1583
+ }
1584
+ );
1585
+ },
1586
+ /*
1587
+ ** 获取专题数据
1588
+ */
1589
+ requestTopicData() {
1590
+ let _this = this;
1591
+ getTopic(
1592
+ {
1593
+ eduLevelId: _this.indexParam.studySectionId,
1594
+ topicSource: _this.indexParam.itemBankType == 2 ? 1 : "",
1595
+ },
1596
+ (res) => {
1597
+ if (!res) {
1598
+ return;
1599
+ }
1600
+ if (typeof res === "string") res = JSON.parse(res);
1601
+ if (res.code == 0) {
1602
+ _this.topicList = res.value;
1603
+ if (_this.topicList.length) {
1604
+ _this.topicList.unshift({
1605
+ topicId: "all",
1606
+ topicName: this.i18n.quanBu,
1607
+ });
1608
+ }
1609
+
1610
+ var hasTopic = false;
1611
+ for (var i = 0; i < _this.topicList.length; i++) {
1612
+ var topicItem = _this.topicList[i];
1613
+ if (topicItem.topicId == _this.indexParam.topicId) {
1614
+ hasTopic = true;
1615
+ break;
1616
+ }
1617
+ }
1618
+ if (!hasTopic) {
1619
+ _this.indexParam.topicId = "";
1620
+ let dic = { selectedTopicId: "" };
1621
+ this.$emit(
1622
+ "toChangeSelectedTopicId",
1623
+ "toChangeSelectedTopicId",
1624
+ JSON.stringify(dic)
1625
+ );
1626
+ }
1627
+ }
1628
+ }
1629
+ );
1630
+ },
1631
+ /*
1632
+ **获取默认的第一个子知识点
1633
+ */
1634
+ getFirstKnowledgeId(knowledgeList) {
1635
+ var tempKL = knowledgeList[0];
1636
+ if (
1637
+ tempKL.hasChild &&
1638
+ tempKL.knowledgeDtoList &&
1639
+ tempKL.knowledgeDtoList.length > 0
1640
+ ) {
1641
+ return this.getFirstKnowledgeId(tempKL.knowledgeDtoList);
1642
+ } else {
1643
+ return tempKL.klId;
1644
+ }
1645
+ },
1646
+ /*
1647
+ ** 获取课程数据
1648
+ * teachMaterialId:教材版本id
1649
+ * classificationId:册别id
1650
+ * termIndex:学期号
1651
+ */
1652
+ requestCourseListData(
1653
+ subjectId,
1654
+ teachMaterialId,
1655
+ classificationId,
1656
+ termIndex
1657
+ ) {
1658
+ let _this = this;
1659
+ getEditorCourse(
1660
+ {
1661
+ subjectId: subjectId,
1662
+ teachMaterialId: teachMaterialId,
1663
+ termIndex: termIndex,
1664
+ classificationId: classificationId,
1665
+ },
1666
+ (res) => {
1667
+ if (!res) {
1668
+ return;
1669
+ }
1670
+ if (typeof res === "string") res = JSON.parse(res);
1671
+ if (res.code == 0) {
1672
+ _this.courseCascaderList = res.value.list;
1673
+ }
1674
+ }
1675
+ );
1676
+ },
1677
+ /*
1678
+ **请求题库数据
1679
+ * 筛选条件时请求
1680
+ */
1681
+ requestPageBank(param) {
1682
+ let _this = this;
1683
+ if (!param["itemBankType"]) {
1684
+ return;
1685
+ }
1686
+ _this.pageError = false;
1687
+ _this.drawerPageError = false;
1688
+ _this.loading = true;
1689
+ getBankData(param, (res) => {
1690
+ _this.loading = false;
1691
+ if (typeof res === "string") res = JSON.parse(res);
1692
+ if (res && res.code == 0) {
1693
+ //取出题目数据
1694
+ _this.drawerPageError = false;
1695
+ _this.currPage = res.value.currPage;
1696
+ _this.itemInfoList = _this.itemInfoList.concat(
1697
+ res.value.itemInfoList
1698
+ );
1699
+ if (_this.itemInfoList.length >= res.value.totalRecord) {
1700
+ _this.hasMore = false;
1701
+ } else {
1702
+ _this.hasMore = true;
1703
+ }
1704
+ } else {
1705
+ //请求题目数据报错
1706
+ _this.drawerPageError = true;
1707
+ }
1708
+ });
1709
+ },
1710
+ clickRetryBtn() {
1711
+ this.$emit("changeIndexParam", "retryRequest", "retryRequest");
1712
+ },
1713
+ },
1714
+ computed: {},
1715
+ created() {},
1716
+ mounted() {
1717
+ this.setListener();
1718
+ this.requestIndexData();
1719
+ if (!this.host.includes("teach.focusteach.com")) {
1720
+ this.host = "http://teach.focusteach.com:8085";
1721
+ }
1722
+ },
1723
+ };
1724
+ </script>
1725
+
1726
+ <style lang="scss" scoped>
1727
+ @import "../../../style/icon/style.css";
1728
+ @import "./index.scss";
1729
+ </style>
1730
+