getters.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. import api from '@/api/api'
  2. const getters = {
  3. modulePage: state => state.dataCache.modulePage,//模块变化
  4. festivalPage: state => state.dataCache.festivalPage,//章变化
  5. chapterExamPage: state => state.dataCache.chapterExamPage,//章卷变化
  6. testPaperPage: state => state.dataCache.testPaperPage,//试卷变化
  7. sidebar: state => state.app.sidebar,
  8. size: state => state.app.size,
  9. device: state => state.app.device,
  10. visitedViews: state => state.tagsView.visitedViews,
  11. cachedViews: state => state.tagsView.cachedViews,
  12. token: state => state.user.token,
  13. avatar: state => state.user.avatar,
  14. name: state => state.user.name,
  15. introduction: state => state.user.introduction,
  16. userId: state => state.user.userId,
  17. roles: state => state.user.roles,
  18. permissions: state => state.user.permissions,
  19. permission_routes: state => state.permission.routes,
  20. topbarRouters: state => state.permission.topbarRouters,
  21. defaultRoutes: state => state.permission.defaultRoutes,
  22. sidebarRouters: state => state.permission.sidebarRouters,
  23. indexnum(state) {
  24. if (!state.dict.indexnum) {
  25. api.inquireGradegradelistUserPeriod({ status: 1, periodStatus: 2, pageSize: 1, pageNum: 1 }).then(res => {
  26. state.dict.indexnum = res.total
  27. })
  28. }
  29. return state.dict.indexnum
  30. },
  31. roleList(state) {
  32. if (!state.dict.roleList) {
  33. api.obtainRoleList({ status: 1 }).then(res => {
  34. state.dict.roleList = res.rows
  35. })
  36. }
  37. return state.dict.roleList
  38. },
  39. educationType(state) {
  40. if (!state.dict.educationType) {
  41. api.inquireCourseEducationType({ status: 1 }).then(res => {
  42. state.dict.educationType = res.rows
  43. })
  44. }
  45. return state.dict.educationType
  46. },
  47. projectType(state) {
  48. if (!state.dict.projectType) {
  49. api.inquireCourseProjectType({ status: 1 }).then(res => {
  50. state.dict.projectType = res.rows
  51. })
  52. }
  53. return state.dict.projectType
  54. },
  55. businessLevel(state) {
  56. if (!state.dict.businessLevel) {
  57. api.inquirebusinessList({ status: 1 }).then(res => {
  58. state.dict.businessLevel = res.rows
  59. })
  60. }
  61. return state.dict.businessLevel
  62. },
  63. sujectType(state) {
  64. if (!state.dict.sujectType) {
  65. api.inquireCourseSubject({ status: 1 }).then(res => {
  66. state.dict.sujectType = res.rows
  67. })
  68. }
  69. return state.dict.sujectType
  70. },
  71. Professional(state) {
  72. if (!state.dict.Professional) {
  73. api.inquireCourseMajor({ status: 1 }).then(res => {
  74. state.dict.Professional = res.rows
  75. })
  76. }
  77. return state.dict.Professional
  78. },
  79. schoolList(state) {
  80. if (!state.dict.schoolList) {
  81. api.inquireUserSchool({ status: 1 }).then(res => {
  82. state.dict.schoolList = res.rows
  83. })
  84. }
  85. return state.dict.schoolList
  86. },
  87. courseExamine(state) {
  88. if (!state.dict.courseExamine) {
  89. api.inquireCourseExamine({ status: 1 }).then(res => {
  90. state.dict.courseExamine = res.rows
  91. })
  92. }
  93. return state.dict.courseExamine
  94. },
  95. certificate(state) {
  96. if (!state.dict.certificate) {
  97. api.inquireBaseCertificate({ status: 1 }).then(res => {
  98. state.dict.certificate = res.rows
  99. })
  100. }
  101. return state.dict.certificate
  102. },
  103. certificateName(state) {
  104. if (!state.dict.certificateName) {
  105. api.inquireBaseCertificatecommon({ status: 1 }).then(res => {
  106. state.dict.certificateName = res.rows
  107. })
  108. }
  109. return state.dict.certificateName
  110. },
  111. certificateTp(state) {
  112. if (!state.dict.certificateTp) {
  113. api.inquireBaseCertificatetp({ status: 1 }).then(res => {
  114. state.dict.certificateTp = res.rows
  115. })
  116. }
  117. return state.dict.certificateTp
  118. },
  119. labelList(state) {
  120. if (!state.dict.labelList) {
  121. api.inquireCourseLabelList({ status: 1 }).then(res => {
  122. state.dict.labelList = res.rows
  123. })
  124. }
  125. return state.dict.labelList
  126. },
  127. payList(state) {
  128. if (!state.dict.payList) {
  129. api.inquirepayaislelist({ status: 1 }).then(res => {
  130. state.dict.payList = res.rows
  131. })
  132. }
  133. return state.dict.payList
  134. },
  135. paypayee(state) {
  136. if (!state.dict.paypayee) {
  137. api.inquirepaypayee({ status: 1 }).then(res => {
  138. state.dict.paypayee = res.rows
  139. })
  140. }
  141. return state.dict.paypayee
  142. },
  143. paysource(state) {
  144. if (!state.dict.paysource) {
  145. api.inquirepaysource({ status: 1 }).then(res => {
  146. state.dict.paysource = res.rows
  147. })
  148. }
  149. return state.dict.paysource
  150. },
  151. payvisit(state) {
  152. if (!state.dict.payvisit) {
  153. api.inquirepayvisit({ status: 1 }).then(res => {
  154. state.dict.payvisit = res.rows
  155. })
  156. }
  157. return state.dict.payvisit
  158. },
  159. payserve(state) {
  160. if (!state.dict.payserve) {
  161. api.inquirepayserve({ status: 1 }).then(res => {
  162. state.dict.payserve = res.rows
  163. })
  164. }
  165. return state.dict.payserve
  166. },
  167. paysupply(state) {
  168. if (!state.dict.paysupply) {
  169. api.inquirepaysupply({ status: 1 }).then(res => {
  170. state.dict.paysupply = res.rows
  171. })
  172. }
  173. return state.dict.paysupply
  174. },
  175. paynature(state) {
  176. if (!state.dict.paynature) {
  177. api.inquirepaynature({ status: 1 }).then(res => {
  178. state.dict.paynature = res.rows
  179. })
  180. }
  181. return state.dict.paynature
  182. },
  183. paycost(state) {
  184. if (!state.dict.paycost) {
  185. api.inquirepaycost({ status: 1 }).then(res => {
  186. state.dict.paycost = res.rows
  187. })
  188. }
  189. return state.dict.paycost
  190. },
  191. paperexam(state) {
  192. if (!state.dict.paperexam) {
  193. api.inquirepaperexamList({ status: 1 }).then(res => {
  194. state.dict.paperexam = res.rows
  195. })
  196. }
  197. return state.dict.paperexam
  198. },
  199. areas(state) {
  200. if (!state.dict.areas) {
  201. api.inquireapplyAreas({ status: 1, areaType: 1 }).then(res => {
  202. state.dict.areas = res.rows
  203. })
  204. }
  205. return state.dict.areas
  206. },
  207. cityList(state) {
  208. if (!state.dict.cityList) {
  209. api.inquireapplyCityList({ status: 1, areaType: 2 }).then(res => {
  210. state.dict.cityList = res.rows
  211. })
  212. }
  213. return state.dict.cityList
  214. },
  215. classList(state) {
  216. if (!state.dict.classList) {
  217. api.inquireGradegradeList({ status: 1 }).then(res => {
  218. state.dict.classList = res.rows
  219. })
  220. }
  221. return state.dict.classList
  222. },
  223. examLists(state) {
  224. if (!state.dict.examLists) {
  225. api.inquiresystemapplyList({ status: "0,1,2" }).then(res => {
  226. state.dict.examLists = res.rows
  227. })
  228. }
  229. return state.dict.examLists
  230. },
  231. examList(state) {
  232. if (!state.dict.examList) {
  233. api.inquiresystemapplyList({ status: 1 }).then(res => {
  234. state.dict.examList = res.rows
  235. })
  236. }
  237. return state.dict.examList
  238. },
  239. applySiteAddress(state) {
  240. if (!state.dict.applySiteAddress) {
  241. api.inquiresystemsite({ status: 1 }).then(res => {
  242. state.dict.applySiteAddress = res.rows
  243. })
  244. }
  245. return state.dict.applySiteAddress
  246. },
  247. beforeList(state) {
  248. if (!state.dict.beforeList) {
  249. api.inquiresystembefore({ status: 1 }).then(res => {
  250. state.dict.beforeList = res.rows
  251. })
  252. }
  253. return state.dict.beforeList
  254. },
  255. beforeLists(state) {
  256. if (!state.dict.beforeLists) {
  257. api.inquiresystembefore({ status: '0,1,2' }).then(res => {
  258. state.dict.beforeLists = res.rows
  259. })
  260. }
  261. return state.dict.beforeLists
  262. },
  263. }
  264. export default getters