@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,1477 @@
1
+ <!--试卷头部操作栏-->
2
+ <template>
3
+ <div class="exam-drawer">
4
+ <ft-drawer>
5
+ <ft-tabs
6
+ :options="tabList"
7
+ :activeName="activeTab"
8
+ @click="tabClick"
9
+ ></ft-tabs>
10
+ <div class="cascader" v-show="activeTab == 'course'">
11
+ <ft-cascader
12
+ :key="isResouceShow"
13
+ :value.sync="currentMaterials"
14
+ :options="materialsGradesList"
15
+ :disabled="materialsGradesList.length > 0 ? false : true"
16
+ :props="{
17
+ expandTrigger: 'click',
18
+ }"
19
+ :placeholder="
20
+ materialsGradesList.length > 0
21
+ ? i18n.qingXuanZeJiaoCaiBanBen
22
+ : i18n.zanWuJiaoCaiBanBenKeXuan
23
+ "
24
+ @change="materialChange"
25
+ ></ft-cascader>
26
+ <ft-cascader
27
+ ref="course"
28
+ selfRef="courseCascader"
29
+ :value.sync="currentCourse"
30
+ key="right"
31
+ :options="courseList"
32
+ :disabled="courseList.length > 0 ? false : true"
33
+ :props="{
34
+ expandTrigger: 'click',
35
+ value: 'courseId',
36
+ label: 'courseName',
37
+ children: 'courses',
38
+ checkStrictly: true,
39
+ }"
40
+ :placeholder="
41
+ materialsGradesList.length > 0 && courseList.length > 0
42
+ ? i18n.qingXuanZeZhangJie
43
+ : i18n.zanWuZhangJieKeXuan
44
+ "
45
+ @change="courseChange"
46
+ ></ft-cascader>
47
+ </div>
48
+ <div class="screen">
49
+ <ft-radio
50
+ v-show="itemBankTypeList.length"
51
+ :label="i18n.laiYuan"
52
+ :options="itemBankTypeList"
53
+ :defaultValue="indexParam.resourceSourceType"
54
+ :props="{
55
+ label: 'itemBankTypeName',
56
+ id: 'itemBankType',
57
+ }"
58
+ @radio-click="sourceClick"
59
+ ></ft-radio>
60
+ <ft-radio
61
+ v-show="
62
+ examTopicDtos.length > 0 &&
63
+ screenType == 2 &&
64
+ indexParam.resourceSourceType != 4 &&
65
+ indexParam.resourceType == 13
66
+ "
67
+ :label="i18n.zhuanTi"
68
+ :options="examTopicDtos"
69
+ :defaultValue="
70
+ indexParam.examTopicId ? indexParam.examTopicId : 'all'
71
+ "
72
+ :props="{
73
+ label: 'examTopicName',
74
+ id: 'examTopicId',
75
+ }"
76
+ @radio-click="topicClick"
77
+ ></ft-radio>
78
+ <ft-radio
79
+ v-show="
80
+ gradeList.length > 0 &&
81
+ screenType == 2 &&
82
+ indexParam.resourceSourceType != 4 &&
83
+ indexParam.resourceType == 13 &&
84
+ (indexParam.examTopicName == '单元测验' ||
85
+ indexParam.examTopicName == '月考试卷' ||
86
+ indexParam.examTopicName == '期中试卷' ||
87
+ indexParam.examTopicName == '期末试卷' ||
88
+ indexParam.examTopicName == '假期作业')
89
+ "
90
+ :label="i18n.ceBie"
91
+ :options="gradeList"
92
+ :defaultValue="defaultGradeId"
93
+ :props="{
94
+ label: 'gradeName',
95
+ id: 'gradeId',
96
+ }"
97
+ @radio-click="gradeClick"
98
+ ></ft-radio>
99
+ <ft-radio
100
+ v-show="yearList.length && indexParam.resourceSourceType != 4 && indexParam.resourceType == 13 "
101
+ :label="i18n.nianFen"
102
+ :options="yearList"
103
+ :defaultValue="indexParam.year ? indexParam.year : 'all'"
104
+ @radio-click="yearClick"
105
+ ></ft-radio>
106
+ <ft-radio
107
+ :label="i18n.diQu"
108
+ v-show="
109
+ provinceList.length > 0 &&
110
+ indexParam.resourceSourceType != 4 &&
111
+ indexParam.resourceType == 13
112
+ "
113
+ >
114
+ <ft-area
115
+ slot="area"
116
+ :provinceList="provinceList"
117
+ :areaList="areaList"
118
+ :districtList="districtList"
119
+ :indexParam="indexParam"
120
+ :defaultPosition="defaultPosition"
121
+ @change="areaChange"
122
+ @requestAreasData="requestAreasData"
123
+ ></ft-area>
124
+ </ft-radio>
125
+ <ft-radio
126
+ v-show="itemTypeList.length > 0 && indexParam.resourceType == 1"
127
+ label="类型"
128
+ :options="itemTypeList"
129
+ :defaultValue="
130
+ indexParam.resourceShareCategoryType
131
+ ? indexParam.resourceShareCategoryType
132
+ : 'all'
133
+ "
134
+ :props="{
135
+ label: 'value',
136
+ id: 'id',
137
+ }"
138
+ @radio-click="typeClick"
139
+ ></ft-radio>
140
+ <ft-radio
141
+ v-show="
142
+ currentZoneList.length > 0 &&
143
+ screenType == 2 &&
144
+ ((indexParam.resourceSourceType == 4 &&
145
+ indexParam.resourceType == 13) ||
146
+ indexParam.resourceType != 13)
147
+ "
148
+ :label="i18n.zhuanQu"
149
+ :options="currentZoneList"
150
+ :defaultValue="zoneId"
151
+ :props="{
152
+ label: 'zoneName',
153
+ id: 'zoneId',
154
+ }"
155
+ @radio-click="zoneClick"
156
+ ></ft-radio>
157
+ </div>
158
+ <div
159
+ v-infinite-scroll="changeCurrentPage"
160
+ :infinite-scroll-disabled="!hasMore"
161
+ infinite-scroll-distance="40"
162
+ >
163
+ <ft-header
164
+ v-show="itemInfoList.length"
165
+ :options="sortList"
166
+ @sort="headerSort"
167
+ default-sort="updateTime"
168
+ >
169
+ {{ i18n.gong }}{{ totalRecord }}{{ i18n.geZiYuan }}
170
+ </ft-header>
171
+ <ft-exam
172
+ v-for="item in itemInfoList"
173
+ :key="item.resourceId"
174
+ :itemInfo="item"
175
+ :defaultCategoryType="defaultCategoryType"
176
+ :resourceName="item.resourceName"
177
+ :countryShare="item.countryShare"
178
+ :directoryName="item.directoryName"
179
+ :updateTime="item.updateTime"
180
+ :resourceType="item.resourceType"
181
+ :convertStatus="item.convertStatus"
182
+ :itemCount="item.itemCount"
183
+ :userRealName="item.userRealName"
184
+ :domainName="item.domainName"
185
+ :year="item.year"
186
+ :provinceName="item.provinceName"
187
+ :areaName="item.areaName"
188
+ :districtName="item.districtName"
189
+ :referenceCount="item.referenceCount"
190
+ @click="goExamDetail"
191
+ :src="getShowIcon(item)"
192
+ >
193
+ </ft-exam>
194
+ <ft-empty
195
+ v-show="!loadingBankData && !loadingError && itemInfoList.length == 0"
196
+ :message="i18n.zanWuShuJu"
197
+ >
198
+ <img
199
+ class="empty-img"
200
+ :src="host + '/assets/prepare-course/list/img/empty.fcdd9ba5.png'"
201
+ alt=""
202
+ />
203
+ </ft-empty>
204
+ <ft-error
205
+ v-show="!loadingBankData && loadingError"
206
+ @retry="clickRetryBtn"
207
+ >
208
+ <img class="error-img" :src="host + '/assets/prepare-course/list/img/error.7e494464.png'" alt=""
209
+ />
210
+ </ft-error>
211
+ <div v-show="loadingBankData" class="loading"></div>
212
+ </div>
213
+ <div class="page-contro" v-show="itemInfoList.length > 0">
214
+ {{
215
+ pageError
216
+ ? i18n.jiaZaiShiBai
217
+ : loading
218
+ ? i18n.jiaZaiZhong
219
+ : hasMore
220
+ ? ""
221
+ : i18n.jiaZaiWanBi
222
+ }}
223
+ </div>
224
+ </ft-drawer>
225
+ </div>
226
+ </template>
227
+
228
+ <script>
229
+ import FtTabs from "../../tabs/index";
230
+ import FtCascader from "../../cascader/index";
231
+ import FtHeader from "../../header/index";
232
+ import FtRadio from "../../radio/index";
233
+ import FtExam from "../../exam/index";
234
+ import FtDrawer from "../../drawer/index";
235
+ import FtEmpty from "../../empty/index";
236
+ import FtError from "../../error/index";
237
+ import FtArea from "../../area/index";
238
+ // import this from "../../core/event-bus";
239
+ import { Loading } from "element-ui";
240
+ import {
241
+ getResourcePoolIndex,
242
+ getResourcePoolList,
243
+ getMaterialsGrades,
244
+ getEditorCourse,
245
+ getProvince,
246
+ getUserOperate,
247
+ getClassifications,
248
+ getZoneList,
249
+ getAreas,
250
+ setUserOperate,
251
+ getQptkSubjectID,
252
+ } from "../../../api/index";
253
+ import { getIcon, getUrlKey } from "../../../utils/common";
254
+ import * as CONSTANTS from "../../../utils/Constants.js";
255
+ import infiniteScroll from "vue-infinite-scroll";
256
+ //父组件是paperEdit.vue
257
+ export default {
258
+ name: "FtExamDrawer",
259
+ components: {
260
+ [Loading.name]: Loading,
261
+ FtTabs,
262
+ FtCascader,
263
+ FtHeader,
264
+ FtRadio,
265
+ FtExam,
266
+ FtDrawer,
267
+ FtEmpty,
268
+ FtError,
269
+ FtArea,
270
+ },
271
+ directives: { infiniteScroll },
272
+ props: {
273
+ leftInfo: {
274
+ type: Object,
275
+ required: true,
276
+ },
277
+ itemList: {
278
+ type: Array,
279
+ default: () => [],
280
+ required: true,
281
+ },
282
+ i18n: {
283
+ type: Object,
284
+ required: true,
285
+ },
286
+ },
287
+
288
+ data() {
289
+ return {
290
+ host: window.location.origin,
291
+ sortList: [
292
+ {
293
+ label: "引用人数",
294
+ key: "count",
295
+ },
296
+ {
297
+ label: "更新时间",
298
+ key: "updateTime",
299
+ },
300
+ ],
301
+ activeTab: "course",
302
+ tabList: [
303
+ {
304
+ id: "course",
305
+ label: this.i18n.tongBuKeCheng,
306
+ },
307
+ {
308
+ id: "exam",
309
+ label: this.i18n.shiJuanZhuanQu,
310
+ },
311
+ ],
312
+ currentMaterials: "",
313
+ currentCourse: "",
314
+ //首次请求
315
+ isLoading: true,
316
+ //是否正在加载资源数据
317
+ loadingBankData: false,
318
+ //加载资源数据是否失败
319
+ loadingError: false,
320
+ //资源数据集合
321
+ itemInfoList: [],
322
+ //资源总数
323
+ totalRecord: undefined,
324
+ //分页信息
325
+ pageInfo: {},
326
+ //同步课程列表
327
+ courseList: [],
328
+ //教材版本列表
329
+ materialsGradesList: [],
330
+ //index接口请求参数
331
+ indexParam: {
332
+ teachMaterialId: "", //教材版本id
333
+ gradeId: "", //册别id
334
+ subjectId: "",
335
+ eduLevelId: "",
336
+ resourceSourceType: 3, //资源来源
337
+ resourceType: 13,
338
+ year: "",
339
+ provinceId: "",
340
+ areaId: "",
341
+ districtId: "",
342
+ resourceShareCategoryType: "", //资源分享类型
343
+ examTopicId: "",
344
+ examTopicName: "",
345
+ courseId: "", //课程id
346
+ orderType: 2, //排序方式:*默认 0:引用人数倒序、更新时间倒序;*1:引用人数倒序、更新时间正序;*2:引用人数正序,更新时间倒序;*3:引用人数正序、更新时间正序
347
+ page: 1, //页码
348
+ },
349
+ //默认的题库类型
350
+ defaultCategoryType: -1,
351
+ //当前选择的教材版本信息
352
+ currentCourseValue: [],
353
+ //来源列表
354
+ itemBankTypeList: [],
355
+ //年份列表
356
+ years: [],
357
+ //类型列表
358
+ itemTypeList: [],
359
+ //默认的试卷专题
360
+ examTopicDto: {},
361
+ //试卷专题
362
+ examTopicDtos: [],
363
+ //index接口请求参数
364
+ indexParam: {},
365
+ //当前引用的文件夹信息
366
+ currentDirectory: undefined,
367
+ //筛选视图类型
368
+ screenType: 1,
369
+ //专区id
370
+ zoneId: "",
371
+ currPage: 0, //当前页面
372
+ pageError: false,
373
+ loading: false,
374
+ hasMore: true,
375
+ //当前的教材版本等信息集合
376
+ currentParamInfo: {},
377
+ //默认地区(优先展示用户上次选择的地区,没有则展示用户所在地区)
378
+ defaultPosition: {
379
+ countryId: 1,
380
+ provinceId: "", //省
381
+ areaId: "", //市
382
+ districtId: "", //区
383
+ },
384
+ //省份数据
385
+ provinceList: [],
386
+ //默认的册别
387
+ defaultGradeId: "",
388
+ //册别G
389
+ gradeList: [],
390
+ //
391
+ currentZoneList: [],
392
+ isFirstIndex: true, //首次加载该题库
393
+ isResouceShow: 0,
394
+ firstRequestCourse: true, //是否首次加载课程
395
+ districtList: [],
396
+ areaList: [],
397
+ yearList: [],
398
+ };
399
+ },
400
+ watch: {
401
+ "$store.state.resourceInfo": function (n, o) {
402
+ if (this.isFirstIndex) {
403
+ this.isFirstIndex = false;
404
+ this.asyncGetUserOperateDataInfo();
405
+ }
406
+ if (!this.currentCourse || this.currentCourse.length == 0) {
407
+ this.currentCourse = n.courseId || (n.list && n.list.courseId);
408
+ }
409
+ },
410
+ materialsGradesList(newValue, oldValue) {
411
+ this.isResouceShow += 1;
412
+ if (newValue.length > 0) {
413
+ let firstV = "";
414
+ let secondV = "";
415
+ let thirdV = "";
416
+ newValue.forEach((element) => {
417
+ if (element.value == this.currentCourseValue[0]) {
418
+ firstV = element.value;
419
+ element.children.forEach((item) => {
420
+ if (item.value == this.currentCourseValue[1]) {
421
+ secondV = item.value;
422
+ item.children.forEach((option) => {
423
+ if (option.value == this.currentCourseValue[2]) {
424
+ thirdV = option.value;
425
+ }
426
+ });
427
+ }
428
+ });
429
+ }
430
+ });
431
+ this.currentMaterials = [firstV, secondV, thirdV];
432
+ }
433
+ },
434
+ courseList(newValue, oldValue) {
435
+ this.courseList = newValue;
436
+ if (
437
+ this.firstRequestCourse &&
438
+ this.courseList &&
439
+ this.courseList.length > 0
440
+ ) {
441
+ this.firstRequestCourse = false;
442
+ setTimeout(() => {
443
+ let checkedCourseArr = [];
444
+ let checkedNodes =
445
+ // this.$refs.courseCascaderOne.getCheckedNodes(false);
446
+ this.$refs.course.$refs.courseCascader.getCheckedNodes(false);
447
+ if (checkedNodes && checkedNodes.length > 0) {
448
+ let currentNode = checkedNodes[0];
449
+ this.getCurrentCheckedCourse(checkedCourseArr, currentNode);
450
+ this.currentCourse = checkedCourseArr;
451
+ }
452
+ }, 200);
453
+ }
454
+ },
455
+ years(newValue, oldValue) {
456
+ if (newValue && newValue.length) {
457
+ this.yearList = []
458
+ if(newValue.length > 6){
459
+ let temp = newValue.slice(0,6)
460
+ this.yearList = [...this.yearList, ...temp,{id: 'earlier', label: '更早'}]
461
+ }else {
462
+ newValue.forEach((element) => {
463
+ this.yearList.push(element);
464
+ });
465
+ }
466
+ } else {
467
+ this.yearList = [];
468
+ }
469
+ },
470
+ },
471
+ created() {},
472
+ mounted() {
473
+ let _this = this;
474
+ _this.setListener();
475
+ if (!this.host.includes("teach.focusteach.com")) {
476
+ this.host = "http://teach.focusteach.com:8085";
477
+ }
478
+ },
479
+ methods: {
480
+ tabClick(value) {
481
+ this.activeTab = value;
482
+ let dic = {
483
+ screenType: this.activeTab == "course" ? 1 : 2,
484
+ };
485
+ this.$emit("changeResourceParam", "changeTab", JSON.stringify(dic));
486
+ },
487
+ clickRetryBtn() {
488
+ this.$emit("changeIndexParam", "retryRequest", "retryRequest");
489
+ },
490
+ goExamDetail(itemInfo) {
491
+ let dic = {
492
+ activeIndex: 4,
493
+ currentIndexParam: this.indexParam,
494
+ currentPaperItem: itemInfo,
495
+ };
496
+ this.$emit(
497
+ "goExamDetail",
498
+ "changeDrawerType",
499
+ "changeDrawerType",
500
+ JSON.stringify(dic)
501
+ );
502
+ // this.$emit(
503
+ // "changeDrawerType",
504
+ // "changeDrawerType",
505
+ // JSON.stringify(dic)
506
+ // );
507
+ },
508
+ getShowIcon(paperInfo) {
509
+ switch (paperInfo.resourceType + "") {
510
+ case CONSTANTS.NET_RESOURCE:
511
+ return this.host + "/assets/prepare-course/list/img/web.41562e3b.svg";
512
+ case CONSTANTS.PRACTICE:
513
+ return getIcon(paperInfo.resourceFileName, this.host);
514
+ case CONSTANTS.EXAM:
515
+ return (
516
+ this.host +
517
+ "/assets/prepare-course/list/img/cloud_txt_24.87b9d2ae.svg"
518
+ );
519
+ case CONSTANTS.DESIGN:
520
+ return (
521
+ this.host +
522
+ "/assets/prepare-course/list/img/cloud_instructional_design_24.22b6584f.svg"
523
+ );
524
+ default:
525
+ return (
526
+ this.host +
527
+ "/assets/prepare-course/list/img/cloud_unknown_24.31e4ddb3.svg"
528
+ );
529
+ }
530
+ },
531
+ sourceClick(itemBankType) {
532
+ let _this = this;
533
+ if (itemBankType == 5) {
534
+ this.$emit("goQptk");
535
+ return;
536
+ }
537
+ // this.currentSourceType = itemBankType;
538
+ let dic = { resourceSourceType: itemBankType };
539
+ this.$emit("changeResourceParam", "changeSource", JSON.stringify(dic));
540
+ this.$emit(
541
+ "eventbus-emit",
542
+ "changeSource",
543
+ "changeSource",
544
+ JSON.stringify(dic)
545
+ );
546
+ },
547
+ topicClick(id, topicItem) {
548
+ let topicId = "";
549
+ let topicName = "";
550
+ if (topicItem.examTopicId == "all") {
551
+ topicId = "";
552
+ topicName = "";
553
+ } else {
554
+ topicId = topicItem.examTopicId;
555
+ topicName = topicItem.examTopicName;
556
+ }
557
+ let dic = {
558
+ examTopicId: topicId,
559
+ examTopicName: topicName,
560
+ };
561
+ this.$emit(
562
+ "changeResourceParam",
563
+ "changeExamTopicId",
564
+ JSON.stringify(dic)
565
+ );
566
+ },
567
+ gradeClick(gradeId) {
568
+ let dic = { gradeId: gradeId };
569
+ this.$emit("changeResourceParam", "changeGradeId", JSON.stringify(dic));
570
+ },
571
+ yearClick(year) {
572
+ if (year == "all") {
573
+ year = "";
574
+ }
575
+ let isEarly = year == "earlier" ? true : false;
576
+ let _lastYear = this.yearList.slice(-2,-1)[0].id
577
+ let lastYear = typeof _lastYear == 'number' ? _lastYear : 0;
578
+ let dic = { year: isEarly ? lastYear - 1 : year, isEarlier:isEarly ? -1 : 1 };
579
+ console.log('dic is...',dic)
580
+ this.$emit("changeResourceParam", "selectYear", JSON.stringify(dic));
581
+ },
582
+ typeClick(itemTypeId) {
583
+ if (itemTypeId == "all") {
584
+ itemTypeId = "";
585
+ }
586
+ let dic = { resourceShareCategoryType: itemTypeId };
587
+ this.$emit("changeResourceParam", "changeType", JSON.stringify(dic));
588
+ },
589
+ zoneClick(itemZoneId) {
590
+ if (itemZoneId == "all") {
591
+ itemZoneId = "";
592
+ }
593
+ let dic = { courseId: itemZoneId };
594
+ this.$emit("changeResourceParam", "changeType", JSON.stringify(dic));
595
+ },
596
+ areaChange(type, id, provinceId, areaId) {
597
+ switch (type) {
598
+ case "province":
599
+ let dic;
600
+ if (id != -1) {
601
+ this.requestAreasData(id);
602
+ dic = {
603
+ provinceId: id,
604
+ areaId: "",
605
+ districtId: "",
606
+ };
607
+ } else {
608
+ dic = {
609
+ provinceId: "",
610
+ areaId: "",
611
+ districtId: "",
612
+ };
613
+ }
614
+ this.$emit("changeResourceParam", "changeArea", JSON.stringify(dic));
615
+ this.setUserOperateDataInfo(dic);
616
+ break;
617
+ case "area":
618
+ if (id != -1) {
619
+ var tempDic = { id: -1, name: "不限" };
620
+ this.areaList.forEach((element) => {
621
+ if (element.id == id) {
622
+ this.districtList = [];
623
+ this.districtList = this.districtList.concat(
624
+ tempDic,
625
+ element.districtList
626
+ );
627
+ }
628
+ });
629
+ let dic = {
630
+ provinceId: provinceId,
631
+ areaId: id,
632
+ districtId: "",
633
+ };
634
+ this.$emit(
635
+ "changeResourceParam",
636
+ "changeArea",
637
+ JSON.stringify(dic)
638
+ );
639
+ this.setUserOperateDataInfo(dic);
640
+ } else {
641
+ let dic = {
642
+ provinceId: provinceId,
643
+ areaId: "",
644
+ districtId: "",
645
+ };
646
+ this.$emit(
647
+ "changeResourceParam",
648
+ "changeArea",
649
+ JSON.stringify(dic)
650
+ );
651
+ this.setUserOperateDataInfo(dic);
652
+ }
653
+ break;
654
+ case "district":
655
+ let tempDistrictId = "";
656
+ if (id != -1) {
657
+ tempDistrictId = id;
658
+ }
659
+ dic = {
660
+ provinceId: provinceId,
661
+ areaId: areaId,
662
+ districtId: tempDistrictId,
663
+ };
664
+ this.$emit("changeResourceParam", "changeArea", JSON.stringify(dic));
665
+ this.setUserOperateDataInfo(dic);
666
+ break;
667
+ }
668
+ },
669
+ //记录用户选择的地区,存入云端
670
+ setUserOperateDataInfo(obj) {
671
+ obj["countryId"] = 1;
672
+ var content = JSON.stringify(obj);
673
+ var params = {
674
+ operateLog: content,
675
+ operateLogType: 5,
676
+ };
677
+ setUserOperate(
678
+ params,
679
+ function (res) {
680
+ if (res && res.code == 0) {
681
+ }
682
+ },
683
+ function () {}
684
+ );
685
+ },
686
+ requestAreasData(provinceId, areaId) {
687
+ let _this = this;
688
+ getAreas({ provinceId: provinceId }, (res) => {
689
+ if (!res) {
690
+ return;
691
+ }
692
+ if (typeof res === "string") res = JSON.parse(res);
693
+ if (res.code == 0) {
694
+ _this.areaList = [];
695
+ var dic = { id: -1, name: "不限" };
696
+ _this.areaList = _this.areaList.concat(dic, res.value);
697
+ if (areaId && areaId > 0) {
698
+ _this.areaList.forEach((element) => {
699
+ if (element.id == areaId) {
700
+ _this.districtList = [];
701
+ _this.districtList = _this.districtList.concat(
702
+ dic,
703
+ element.districtList
704
+ );
705
+ return;
706
+ }
707
+ });
708
+ }
709
+ }
710
+ });
711
+ },
712
+ materialChange(value) {
713
+ let dic = {
714
+ teachMaterialId: value[0],
715
+ gradeId: value[1],
716
+ termIndex: value[2],
717
+ courseId: "",
718
+ page: 1,
719
+ };
720
+ this.$emit(
721
+ "changeResourceParam",
722
+ "changeMaterialId",
723
+ JSON.stringify(dic)
724
+ );
725
+ this.requestCourseListData(
726
+ this.indexParam["subjectId"],
727
+ value[0],
728
+ value[1],
729
+ value[2]
730
+ );
731
+ },
732
+ courseChange(value) {
733
+ let dic = { courseId: value[value.length - 1] };
734
+ this.$emit("changeResourceParam", "changeCourseId", JSON.stringify(dic));
735
+ },
736
+ headerSort(item) {
737
+ if (item.key == "updateTime") {
738
+ let dic = { orderType: item.sortOrder ? 3 : 2 };
739
+ this.$emit(
740
+ "changeResourceParam",
741
+ "changeOrderType",
742
+ JSON.stringify(dic)
743
+ );
744
+ } else {
745
+ let dic = { orderType: item.sortOrder ? 1 : 0 };
746
+ this.$emit(
747
+ "changeResourceParam",
748
+ "changeOrderType",
749
+ JSON.stringify(dic)
750
+ );
751
+ }
752
+ },
753
+ //递归获取当前选择的课程
754
+ getCurrentCheckedCourse(arr, node) {
755
+ if (node && node.value) {
756
+ arr.unshift(node.value);
757
+ if (node.parent) {
758
+ this.getCurrentCheckedCourse(arr, node.parent);
759
+ }
760
+ }
761
+ },
762
+ setListener() {
763
+ let _this = this;
764
+ //改变indexParam参数,重新请求 list 接口
765
+ this.$off("changeResourceParam"); //避免重复响应同一事件
766
+ this.$on("changeResourceParam", function (action, msg) {
767
+ if (action == "retryRequest") {
768
+ //加载失败后的重新请求 || 删除题目后刷新题目数据
769
+ _this.requestResourceListData();
770
+ return;
771
+ }
772
+ let dic = JSON.parse(msg);
773
+ if (action == "changeTab") {
774
+ _this.screenType = dic.screenType;
775
+ _this.requestResourceIndexWhenChangeTab();
776
+ return;
777
+ }
778
+ for (let key in dic) {
779
+ let value = dic[key];
780
+ // _this.indexParam[key] = value;
781
+ _this.$set(_this.indexParam, key, value);
782
+ }
783
+ if (action == "changeSource") {
784
+ _this.defaultCategoryType = dic["resourceSourceType"];
785
+ }
786
+ if (action == "changeArea") {
787
+ if (_this.indexParam.districtId == 0) {
788
+ _this.indexParam.districtId = "";
789
+ }
790
+ if (_this.indexParam.areaId == 0) {
791
+ _this.indexParam.areaId = "";
792
+ }
793
+ if (_this.indexParam.provinceId == 0) {
794
+ _this.indexParam.provinceId = "";
795
+ }
796
+ }
797
+ console.log("changeResourceParam---indexParam---", _this.indexParam);
798
+ //请求题目数据
799
+ _this.requestResourceListData();
800
+ });
801
+ //加载更多
802
+ this.$off("changeCurrentPageAndLoadMore"); //避免重复响应同一事件
803
+ this.$on("changeCurrentPageAndLoadMore", function (action, msg) {
804
+ if (action == "changeCurrentPageAndLoadMore") {
805
+ _this.changeCurrentPage();
806
+ return;
807
+ }
808
+ });
809
+ },
810
+ /*
811
+ **请求题库首页数据
812
+ * 只在首次进入该页面时请求
813
+ */
814
+ requestIndexData() {
815
+ let _this = this;
816
+ _this.loadingError = false;
817
+ _this.goRequestIndexData();
818
+ },
819
+ //首次进入该页面时请求获取用户信息
820
+ goRequestIndexData() {
821
+ let _this = this;
822
+ var prepareInfo = this.leftInfo;
823
+ if (prepareInfo && prepareInfo.eduLevelId) {
824
+ var eduLevelId = prepareInfo.eduLevelId;
825
+ var subjectId = prepareInfo.subjectId;
826
+ var courseSrc = prepareInfo.courseSrc;
827
+ if (courseSrc == 3) {
828
+ //专区
829
+ _this.screenType = 2;
830
+ } else {
831
+ //同步课程
832
+ _this.screenType = 1;
833
+ }
834
+ var courseId = prepareInfo.courseId;
835
+ _this.indexParam["courseSrc"] = courseSrc;
836
+ _this.indexParam["eduLevelId"] = eduLevelId;
837
+ _this.indexParam["subjectId"] = subjectId;
838
+ _this.indexParam["courseId"] = courseId;
839
+ var teachMaterialId = prepareInfo.teachMaterialId;
840
+ var gradeId = prepareInfo.gradeId;
841
+ _this.indexParam["teachMaterialId"] = teachMaterialId;
842
+ _this.indexParam["gradeId"] = gradeId;
843
+ _this.indexParam["resourceId"] = getUrlKey("resourceId");
844
+ let dom = document.getElementById("drawer-slot-id");
845
+ let loadingInstance = Loading.service({
846
+ target: dom,
847
+ text: _this.i18n.jiaZaiZhong,
848
+ });
849
+ //初始化index请求数据
850
+ _this.indexParam.resourceSourceType = 3;
851
+ _this.indexParam.resourceType = 13;
852
+ _this.indexParam.resourceShareCategoryType = "";
853
+ _this.defaultCategoryType = -1;
854
+ getResourcePoolIndex(_this.indexParam, (res) => {
855
+ this.$nextTick(() => {
856
+ // 以服务的方式调用的 Loading 需要异步关闭
857
+ loadingInstance.close();
858
+ });
859
+ _this.isLoading = false;
860
+ console.log("typeof res ===", typeof res, res);
861
+ if (typeof res === "string") res = JSON.parse(res);
862
+ if (res && res.code == 0) {
863
+ //
864
+ _this.requestClassifications(
865
+ teachMaterialId,
866
+ subjectId,
867
+ eduLevelId
868
+ );
869
+ //
870
+ _this.requestZones();
871
+ //取出默认的题库类型
872
+ _this.defaultCategoryType = res.value.defaultResourceSourceType;
873
+ _this.years = res.value && res.value.years && res.value.years.length && res.value.years.map((item) => {
874
+ return {
875
+ id: item,
876
+ label: item,
877
+ };
878
+ });
879
+ if (_this.years.length) {
880
+ _this.years.unshift({
881
+ id: "all",
882
+ label: _this.i18n.quanBu,
883
+ });
884
+ }
885
+
886
+ _this.itemBankTypeList = res.value.ResourceSourceTypeList;
887
+ _this.itemBankTypeList.unshift({
888
+ itemBankTypeName: "精品资源",
889
+ itemBankType: 5,
890
+ });
891
+ _this.indexParam.resourceSourceType =
892
+ res.value.defaultResourceSourceType;
893
+ _this.itemTypeList = res.value.resourceShareCategoryTypeList;
894
+ if (_this.itemTypeList.length) {
895
+ _this.itemTypeList.unshift({
896
+ id: "all",
897
+ value: "全部",
898
+ itemType: -1,
899
+ });
900
+ }
901
+ if (res.value.examTopicDto) {
902
+ _this.examTopicDto = {
903
+ examTopicId: "",
904
+ examTopicName: _this.i18n.quanBu,
905
+ }; //默认展示全部
906
+ // _this.examTopicDto = res.value.examTopicDto;
907
+ _this.indexParam.examTopicId = _this.examTopicDto.examTopicId;
908
+ _this.indexParam.examTopicName = _this.examTopicDto.examTopicName;
909
+ }
910
+ _this.examTopicDtos = res.value.examTopicDtos;
911
+ if (_this.examTopicDtos.length) {
912
+ _this.examTopicDtos.unshift({
913
+ examTopicId: "all",
914
+ examTopicName: this.i18n.quanBu,
915
+ });
916
+ }
917
+
918
+ _this.totalRecord = res.value.totalRecord;
919
+ _this.pageInfo = {
920
+ currPage: res.value.currPage,
921
+ totalPage: res.value.totalPage,
922
+ perPage: res.value.perPage,
923
+ };
924
+ if (
925
+ (_this.screenType == 2 &&
926
+ (_this.indexParam.examTopicName == _this.i18n.danYuanCeYan ||
927
+ _this.indexParam.examTopicName == _this.i18n.yueKaoShiJuan ||
928
+ _this.indexParam.examTopicName == _this.i18n.qiZhongShiJuan ||
929
+ _this.indexParam.examTopicName == _this.i18n.qiMoShiJuan ||
930
+ _this.indexParam.examTopicName == _this.i18n.jiaQiZuoYe)) ||
931
+ res.value.defaultResourceSourceType == 2
932
+ ) {
933
+ //需要重新请求数据
934
+ _this.requestResourceListData();
935
+ } else {
936
+ //取出资源数据
937
+ _this.itemInfoList = res.value.result;
938
+ }
939
+ _this.requestMaterialsGradesData(
940
+ eduLevelId,
941
+ subjectId,
942
+ teachMaterialId,
943
+ gradeId
944
+ );
945
+ } else {
946
+ _this.loadingError = true;
947
+ }
948
+ });
949
+ }
950
+ },
951
+ /*
952
+ **根据条件的变化请求index
953
+ */
954
+ requestResourceIndexWhenChangeTab() {
955
+ let _this = this;
956
+ _this.loadingError = false;
957
+ _this.loadingBankData = true;
958
+ let tempParams = _this.getCurrentParams();
959
+ getResourcePoolIndex(tempParams, (res) => {
960
+ _this.loadingBankData = false;
961
+ console.log("typeof res ===", typeof res, res);
962
+ if (typeof res === "string") res = JSON.parse(res);
963
+ if (res && res.code == 0) {
964
+ _this.loadingError = false;
965
+ //取出资源数据
966
+ if (res.value.examTopicDto) {
967
+ _this.examTopicDto = {
968
+ examTopicId: "",
969
+ examTopicName: _this.i18n.quanBu,
970
+ }; //默认展示全部
971
+ // _this.examTopicDto = res.value.examTopicDto;
972
+ _this.indexParam.examTopicId = _this.examTopicDto.examTopicId;
973
+ _this.indexParam.examTopicName = _this.examTopicDto.examTopicName;
974
+ }
975
+ _this.examTopicDtos = res.value.examTopicDtos;
976
+ if (_this.examTopicDtos.length) {
977
+ _this.examTopicDtos.unshift({
978
+ examTopicId: "all",
979
+ examTopicName: this.i18n.quanBu,
980
+ });
981
+ }
982
+
983
+ _this.totalRecord = res.value.totalRecord;
984
+ _this.pageInfo = {
985
+ currPage: res.value.currPage,
986
+ totalPage: res.value.totalPage,
987
+ perPage: res.value.perPage,
988
+ };
989
+ if (
990
+ _this.screenType == 2 &&
991
+ (_this.indexParam.examTopicName == _this.i18n.danYuanCeYan ||
992
+ _this.indexParam.examTopicName == _this.i18n.yueKaoShiJuan ||
993
+ _this.indexParam.examTopicName == _this.i18n.qiZhongShiJuan ||
994
+ _this.indexParam.examTopicName == _this.i18n.qiMoShiJuan ||
995
+ _this.indexParam.examTopicName == _this.i18n.jiaQiZuoYe)
996
+ ) {
997
+ //需要重新请求数据
998
+ _this.requestResourceListData();
999
+ } else {
1000
+ //取出资源数据
1001
+ _this.itemInfoList = res.value.result;
1002
+ }
1003
+ } else {
1004
+ _this.loadingError = true;
1005
+ _this.itemInfoList = [];
1006
+ _this.pageInfo = {};
1007
+ }
1008
+ });
1009
+ },
1010
+ /*
1011
+ **请求题库数据
1012
+ * 筛选条件时请求
1013
+ */
1014
+ requestResourceListData() {
1015
+ let _this = this;
1016
+ _this.loadingError = false;
1017
+ _this.loadingBankData = true;
1018
+ let tempParams = _this.getCurrentParams();
1019
+ getResourcePoolList(tempParams, (res) => {
1020
+ _this.loadingBankData = false;
1021
+ if (typeof res === "string") res = JSON.parse(res);
1022
+ if (res && res.code == 0) {
1023
+ _this.loadingError = false;
1024
+ _this.itemInfoList = res.value.result;
1025
+ _this.totalRecord = res.value.totalRecord;
1026
+ _this.currPage = res.value.currPage;
1027
+ if (_this.itemInfoList.length >= _this.totalRecord) {
1028
+ _this.hasMore = false;
1029
+ } else {
1030
+ _this.hasMore = true;
1031
+ }
1032
+ _this.pageInfo = {
1033
+ currPage: res.value.currPage,
1034
+ totalPage: res.value.totalPage,
1035
+ perPage: res.value.perPage,
1036
+ };
1037
+ } else {
1038
+ //请求题目数据报错
1039
+ _this.loadingError = true;
1040
+ _this.itemInfoList = [];
1041
+ _this.pageInfo = {};
1042
+ }
1043
+ });
1044
+ },
1045
+ /*
1046
+ **获取符合当前条件的参数,过滤掉无效的参数,规则如下描述(奇葩的需求,搞个筛选条件弄了这么复杂的逻辑,无语。。。)
1047
+ *
1048
+ * ******************************************** 筛选字段含义如下 ********************************************
1049
+ * 01 teachMaterialId:教材版本
1050
+ * 02 gradeId:册别
1051
+ * 03 subjectId:科目
1052
+ * 04 eduLevelId:学段
1053
+ * 05 resourceSourceType:来源 (区本资源:2,校本资源:3,我的资源:4)
1054
+ * 06 resourceType:分类(试卷:13,教学设计:14,教学课件:1,网络资源:0)
1055
+ * 07 year:年份
1056
+ * 08 provinceId:省
1057
+ * 09 areaId:市
1058
+ * 10 districtId:区
1059
+ * 11 resourceShareCategoryType:类型
1060
+ * 12 examTopicId:试卷专题id
1061
+ * 13 examTopicName:试卷专题name (查询数据用examTopicId,逻辑判断用examTopicName。。。。。。大写的服!!!!!!)
1062
+ * 14 courseId:课程id || 专区id
1063
+ * 15 orderType:排序方式:*默认 0:引用人数倒序、更新时间倒序;*1:引用人数倒序、更新时间正序;*2:引用人数正序,更新时间倒序;*3:引用人数正序、更新时间正序
1064
+ * 16 page:页码
1065
+ * 17 courseSrc: 0是同步课程下的资源库,3是专区下的资源库
1066
+ *
1067
+ * ******************************************** 筛选规则如下 ********************************************
1068
+ * 公共条件:来源和分类
1069
+ * 同步课程 - 区本资源||校本资源 - 试卷 :则展示条件(年份、地区)
1070
+ * 同步课程 - 区本资源||校本资源||我的资源 - 教学课件 :则展示条件(类型)
1071
+ * 同步课程 - 区本资源||校本资源 - 教学设计||网络资源 :则不展示其他条件
1072
+ * 同步课程 - 我的资源 - 试卷||教学设计||网络资源 :则不展示其他条件
1073
+ * 专区 - 区本资源||校本资源 - 试卷 :则展示条件(试卷专题、年份、地区)---> 试卷专题若为单元测验、月考试卷、期中试卷、期末试卷、假期作业,还要显示册别
1074
+ * 专区 - 区本资源||校本资源||我的资源 - 教学课件 :则展示条件(类型、专区)
1075
+ * 专区 - 区本资源||校本资源||我的资源 - 教学设计||网络资源 :则展示条件(专区)
1076
+ * 专区 - 我的资源 - 试卷:则展示条件(专区)
1077
+ *
1078
+ */
1079
+ getCurrentParams() {
1080
+ let _this = this;
1081
+ let currentParams = {
1082
+ teachMaterialId: _this.indexParam.teachMaterialId,
1083
+ subjectId: _this.indexParam.subjectId,
1084
+ eduLevelId: _this.indexParam.eduLevelId,
1085
+ resourceSourceType: _this.indexParam.resourceSourceType,
1086
+ resourceType: _this.indexParam.resourceType,
1087
+ orderType: _this.indexParam.orderType ? _this.indexParam.orderType : 2,
1088
+ page: _this.indexParam.page,
1089
+ };
1090
+ if (_this.indexParam.resourceType == 1) {
1091
+ //只要“分类”选择的是“教学课件”,就一定有“类型”筛选条件
1092
+ currentParams["resourceShareCategoryType"] =
1093
+ _this.indexParam.resourceShareCategoryType;
1094
+ }
1095
+ if (_this.screenType == 1) {
1096
+ //同步课程
1097
+ currentParams["courseId"] = _this.indexParam.courseId;
1098
+ currentParams["courseSrc"] = 0;
1099
+ currentParams["gradeId"] = _this.indexParam.gradeId;
1100
+ if (_this.indexParam.resourceSourceType == 4) {
1101
+ //我的资源
1102
+ currentParams["year"] = "";
1103
+ currentParams["provinceId"] = "";
1104
+ currentParams["areaId"] = "";
1105
+ currentParams["districtId"] = "";
1106
+ } else {
1107
+ //区本资源||校本资源
1108
+ if (_this.indexParam.resourceType == 13) {
1109
+ //“分类”选择的是“试卷”,则有“年份”、“地区”
1110
+ currentParams["year"] = _this.indexParam.year;
1111
+ currentParams["isEarlier"] = _this.indexParam.isEarlier;
1112
+ currentParams["provinceId"] = _this.indexParam.provinceId == 0 ? "" : _this.indexParam.provinceId;
1113
+ currentParams["areaId"] = _this.indexParam.areaId == 0 ? "" : _this.indexParam.areaId;
1114
+ currentParams["districtId"] = _this.indexParam.districtId == 0 ? "" : _this.indexParam.districtId;
1115
+ }
1116
+ }
1117
+ } else {
1118
+ //专区
1119
+ currentParams["courseSrc"] = 3;
1120
+ if (_this.indexParam.resourceSourceType == 4) {
1121
+ //我的资源,则一定有“专区”
1122
+ currentParams["courseId"] = _this.indexParam.courseId;
1123
+ } else {
1124
+ //区本资源||校本资源
1125
+ if (_this.indexParam.resourceType == 13) {
1126
+ //“分类”选择的是“试卷”,则有“试卷专题”、“年份”、“地区”
1127
+ currentParams["examTopicId"] = _this.indexParam.examTopicId;
1128
+ currentParams["year"] = _this.indexParam.year;
1129
+ currentParams["provinceId"] =
1130
+ _this.indexParam.provinceId == 0
1131
+ ? ""
1132
+ : _this.indexParam.provinceId;
1133
+ currentParams["areaId"] =
1134
+ _this.indexParam.areaId == 0 ? "" : _this.indexParam.areaId;
1135
+ currentParams["districtId"] =
1136
+ _this.indexParam.districtId == 0
1137
+ ? ""
1138
+ : _this.indexParam.districtId;
1139
+ if (
1140
+ _this.indexParam.examTopicName == _this.i18n.danYuanCeYan ||
1141
+ _this.indexParam.examTopicName == _this.i18n.yueKaoShiJuan ||
1142
+ _this.indexParam.examTopicName == _this.i18n.qiZhongShiJuan ||
1143
+ _this.indexParam.examTopicName == _this.i18n.qiMoShiJuan ||
1144
+ _this.indexParam.examTopicName == _this.i18n.jiaQiZuoYe
1145
+ ) {
1146
+ //试卷专题若为单元测验、月考试卷、期中试卷、期末试卷、假期作业,还要"册别"
1147
+ currentParams["gradeId"] = _this.indexParam.gradeId;
1148
+ }
1149
+ } else {
1150
+ //其他分类则有“专区”
1151
+ currentParams["courseId"] = _this.indexParam.courseId;
1152
+ }
1153
+ }
1154
+ }
1155
+ return currentParams;
1156
+ },
1157
+ /*
1158
+ **获取教材版本数据
1159
+ */
1160
+ requestMaterialsGradesData(
1161
+ eduLevelId,
1162
+ subjectId,
1163
+ teachMaterialId,
1164
+ gradeId
1165
+ ) {
1166
+ let _this = this;
1167
+ _this.courseList = [];
1168
+ getMaterialsGrades(
1169
+ {
1170
+ eduLevelId: eduLevelId,
1171
+ subjectId: subjectId,
1172
+ teachMaterialId: teachMaterialId,
1173
+ gradeId: gradeId,
1174
+ },
1175
+ (res) => {
1176
+ if (!res) {
1177
+ return;
1178
+ }
1179
+ if (typeof res === "string") res = JSON.parse(res);
1180
+ if (res.code == 0) {
1181
+ _this.currentCourseValue = [
1182
+ res.value.checkTeachMaterialId,
1183
+ res.value.checkClassificationId,
1184
+ res.value.checkTermIndex,
1185
+ ];
1186
+ _this.materialsGradesList = res.value.list;
1187
+ _this.requestCourseListData(
1188
+ subjectId,
1189
+ res.value.checkTeachMaterialId,
1190
+ res.value.checkClassificationId,
1191
+ res.value.checkTermIndex
1192
+ );
1193
+ }
1194
+ }
1195
+ );
1196
+ },
1197
+ /*
1198
+ ** 获取课程数据
1199
+ * teachMaterialId:教材版本id
1200
+ * classificationId:册别id
1201
+ * termIndex:学期号
1202
+ */
1203
+ requestCourseListData(
1204
+ subjectId,
1205
+ teachMaterialId,
1206
+ classificationId,
1207
+ termIndex
1208
+ ) {
1209
+ let _this = this;
1210
+ getEditorCourse(
1211
+ {
1212
+ subjectId: subjectId,
1213
+ teachMaterialId: teachMaterialId,
1214
+ termIndex: termIndex,
1215
+ classificationId: classificationId,
1216
+ },
1217
+ (res) => {
1218
+ if (!res) {
1219
+ return;
1220
+ }
1221
+ if (typeof res === "string") res = JSON.parse(res);
1222
+ if (res.code == 0) {
1223
+ _this.courseList = res.value.list;
1224
+ }
1225
+ }
1226
+ );
1227
+ },
1228
+ /*
1229
+ ** 获取知识点数据
1230
+ */
1231
+ requestKnowledgeData() {
1232
+ let _this = this;
1233
+ getKnowledge(
1234
+ {
1235
+ eduLevelId: _this.indexParam.studySectionId,
1236
+ subjectId: _this.indexParam.subjectId,
1237
+ },
1238
+ (res) => {
1239
+ if (!res) {
1240
+ return;
1241
+ }
1242
+ if (typeof res === "string") res = JSON.parse(res);
1243
+ if (res.code == 0) {
1244
+ _this.klList = res.value;
1245
+ }
1246
+ }
1247
+ );
1248
+ },
1249
+ /*
1250
+ ** 获取考点数据
1251
+ */
1252
+ requestPointData() {
1253
+ let _this = this;
1254
+ getPoint(
1255
+ {
1256
+ eduLevelId: _this.indexParam.studySectionId,
1257
+ subjectId: _this.indexParam.subjectId,
1258
+ },
1259
+ (res) => {
1260
+ if (!res) {
1261
+ return;
1262
+ }
1263
+ if (typeof res === "string") res = JSON.parse(res);
1264
+ if (res.code == 0) {
1265
+ _this.examPointList = res.value;
1266
+ }
1267
+ }
1268
+ );
1269
+ },
1270
+ /*
1271
+ ** 获取册别数据
1272
+ */
1273
+ requestClassifications(teachMaterialId, subjectId, eduLevelId) {
1274
+ let _this = this;
1275
+ getClassifications(
1276
+ {
1277
+ teachMaterialId: teachMaterialId,
1278
+ subjectId: subjectId,
1279
+ eduLevelId: eduLevelId,
1280
+ },
1281
+ (res) => {
1282
+ if (!res) {
1283
+ return;
1284
+ }
1285
+ if (typeof res === "string") res = JSON.parse(res);
1286
+ if (res.code == 0) {
1287
+ _this.gradeList = res.value;
1288
+ if (
1289
+ _this.indexParam.gradeId &&
1290
+ _this.indexParam.gradeId.length > 0
1291
+ ) {
1292
+ _this.defaultGradeId = _this.indexParam.gradeId;
1293
+ } else {
1294
+ if (_this.gradeList && _this.gradeList.length > 0) {
1295
+ _this.defaultGradeId = _this.gradeList[0].gradeId;
1296
+ }
1297
+ }
1298
+ }
1299
+ }
1300
+ );
1301
+ },
1302
+ /*
1303
+ ** 获取专区数据
1304
+ */
1305
+ requestZones() {
1306
+ let _this = this;
1307
+ getZoneList({}, (res) => {
1308
+ if (!res) {
1309
+ return;
1310
+ }
1311
+ if (typeof res === "string") res = JSON.parse(res);
1312
+ if (res.code == 0) {
1313
+ _this.currentZoneList = res.value;
1314
+ _this.currentZoneList.unshift({
1315
+ zoneId: "all",
1316
+ zoneName: "全部",
1317
+ itemType: -1,
1318
+ });
1319
+ if (
1320
+ _this.screenType == 2 &&
1321
+ _this.indexParam.courseId &&
1322
+ _this.indexParam.courseId.length > 0
1323
+ ) {
1324
+ _this.zoneId = _this.indexParam.courseId;
1325
+ } else {
1326
+ if (_this.currentZoneList && _this.currentZoneList.length > 0) {
1327
+ _this.zoneId = _this.currentZoneList[0].zoneId;
1328
+ }
1329
+ }
1330
+ }
1331
+ });
1332
+ },
1333
+ //改变右侧栏宽度
1334
+ changeSize(e) {
1335
+ document.onmousemove = (e) => {
1336
+ e.stopPropagation();
1337
+ document.body.style.cursor = "w-resize";
1338
+ let addWidth = this.$refs.drawer.offsetLeft - e.clientX;
1339
+ let curWidth = this.$refs.drawer.offsetWidth;
1340
+ this.$refs.drawer.style.width = `${curWidth + addWidth}px`;
1341
+ };
1342
+ document.onmouseup = (e) => {
1343
+ e.stopPropagation();
1344
+ document.onmousemove = null;
1345
+ document.onmouseup = null;
1346
+ document.body.style.cursor = "default";
1347
+ };
1348
+ },
1349
+ //改变当前页
1350
+ changeCurrentPage() {
1351
+ let _this = this;
1352
+ console.log(
1353
+ "changeCurrentPage---",
1354
+ _this.itemInfoList.length,
1355
+ _this.totalRecord,
1356
+ _this.provinceList.length
1357
+ );
1358
+ if (
1359
+ _this.itemInfoList.length >= _this.totalRecord ||
1360
+ _this.provinceList.length <= 0
1361
+ ) {
1362
+ _this.hasMore = false;
1363
+ return;
1364
+ }
1365
+ // let dic = _this.indexParam;
1366
+ let dic = _this.getCurrentParams(); //获取当前参数;
1367
+ dic["page"] = _this.currPage + 1;
1368
+ _this.requestPageBank(dic);
1369
+ },
1370
+ /*
1371
+ **请求题库数据
1372
+ * 筛选条件时请求
1373
+ */
1374
+ requestPageBank(param) {
1375
+ let _this = this;
1376
+ _this.pageError = false;
1377
+ _this.loading = true;
1378
+ let query = JSON.parse(JSON.stringify(param));
1379
+ if (query.examTopicId) delete query.examTopicId;
1380
+ if (query.examTopicName) delete query.examTopicName;
1381
+ getResourcePoolList(query, (res) => {
1382
+ _this.loading = false;
1383
+ if (typeof res === "string") res = JSON.parse(res);
1384
+ if (res && res.code == 0) {
1385
+ //取出题目数据
1386
+ _this.pageError = false;
1387
+ _this.currPage = res.value.currPage;
1388
+ _this.itemInfoList = _this.itemInfoList.concat(res.value.result);
1389
+ if (_this.itemInfoList.length >= res.value.totalRecord) {
1390
+ _this.hasMore = false;
1391
+ } else {
1392
+ _this.hasMore = true;
1393
+ }
1394
+ } else {
1395
+ //请求题目数据报错
1396
+ _this.pageError = true;
1397
+ }
1398
+ });
1399
+ },
1400
+ //请求获取用户信息
1401
+ async asyncGetUserOperateDataInfo() {
1402
+ let _this = this;
1403
+ var operateString = undefined;
1404
+ let res = await getUserOperate({ operateLogType: 5 });
1405
+ if (res && res.code == 0) {
1406
+ operateString = res.value;
1407
+ if (operateString != undefined && operateString.length > 0) {
1408
+ var prepareInfo = JSON.parse(operateString);
1409
+ if (prepareInfo && prepareInfo.countryId) {
1410
+ _this.defaultPosition.countryId = prepareInfo.countryId;
1411
+ _this.defaultPosition.provinceId =
1412
+ prepareInfo.provinceId && prepareInfo.provinceId > 0
1413
+ ? prepareInfo.provinceId
1414
+ : 0;
1415
+ _this.defaultPosition.areaId =
1416
+ prepareInfo.areaId && prepareInfo.areaId > 0
1417
+ ? prepareInfo.areaId
1418
+ : 0;
1419
+ _this.defaultPosition.districtId =
1420
+ prepareInfo.districtId && prepareInfo.districtId > 0
1421
+ ? prepareInfo.districtId
1422
+ : 0;
1423
+ _this.requestProvinceData(true);
1424
+ } else {
1425
+ _this.requestProvinceData(false);
1426
+ }
1427
+ } else {
1428
+ _this.requestProvinceData(false);
1429
+ }
1430
+ } else {
1431
+ _this.requestProvinceData(false);
1432
+ }
1433
+ },
1434
+ /*
1435
+ **根据省份获取城市信息
1436
+ */
1437
+ requestProvinceData(isHistory) {
1438
+ let _this = this;
1439
+ getProvince({}, (res) => {
1440
+ if (!res) {
1441
+ return;
1442
+ }
1443
+ if (typeof res === "string") res = JSON.parse(res);
1444
+ if (res.code == 0) {
1445
+ if (!isHistory) {
1446
+ _this.defaultPosition.countryId = res.value.countryId;
1447
+ _this.defaultPosition.provinceId = res.value.provinceId;
1448
+ _this.defaultPosition.districtId = res.value.districtId;
1449
+ _this.defaultPosition.areaId = res.value.areaId;
1450
+ }
1451
+ res.value.countryList.forEach((element) => {
1452
+ if (element.id == _this.defaultPosition.countryId) {
1453
+ _this.provinceList = element.provinceList;
1454
+ _this.provinceList.unshift({ id: -1, name: "不限" });
1455
+ }
1456
+ });
1457
+ }
1458
+ _this.indexParam.provinceId =
1459
+ _this.defaultPosition.provinceId == 0
1460
+ ? ""
1461
+ : _this.defaultPosition.provinceId;
1462
+ _this.indexParam.districtId =
1463
+ _this.defaultPosition.districtId == 0
1464
+ ? ""
1465
+ : _this.defaultPosition.districtId;
1466
+ _this.indexParam.areaId =
1467
+ _this.defaultPosition.areaId == 0 ? "" : _this.defaultPosition.areaId;
1468
+ _this.requestIndexData();
1469
+ });
1470
+ },
1471
+ },
1472
+ computed: {},
1473
+ };
1474
+ </script>
1475
+ <style lang="scss" scoped>
1476
+ @import "./index.scss";
1477
+ </style>