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