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