getters.js 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. merList(state) {
  32. if (!state.dict.merList) {
  33. api.mallmerchantlist({ status: 1 }).then(res => {
  34. state.dict.merList = res.rows
  35. })
  36. }
  37. return state.dict.merList
  38. },
  39. roleList(state) {
  40. if (!state.dict.roleList) {
  41. api.obtainRoleList({ status: 1 }).then(res => {
  42. state.dict.roleList = res.rows
  43. })
  44. }
  45. return state.dict.roleList
  46. },
  47. systemtenantlist(state) {
  48. if (!state.dict.systemtenantlist) {
  49. api.systemtenantlist({ status: 1 }).then(res => {
  50. state.dict.systemtenantlist = res.rows
  51. })
  52. }
  53. return state.dict.systemtenantlist
  54. },
  55. educationType(state) {
  56. if (!state.dict.educationType) {
  57. api.inquireCourseEducationType({ status: 1 }).then(res => {
  58. state.dict.educationType = res.rows
  59. })
  60. }
  61. return state.dict.educationType
  62. },
  63. projectType(state) {
  64. if (!state.dict.projectType) {
  65. api.inquireCourseProjectType({ status: 1 }).then(res => {
  66. state.dict.projectType = res.rows
  67. })
  68. }
  69. return state.dict.projectType
  70. },
  71. businessLevel(state) {
  72. if (!state.dict.businessLevel) {
  73. api.inquirebusinessList({ status: 1 }).then(res => {
  74. state.dict.businessLevel = res.rows
  75. })
  76. }
  77. return state.dict.businessLevel
  78. },
  79. sujectType(state) {
  80. if (!state.dict.sujectType) {
  81. api.inquireCourseSubject({ status: 1 }).then(res => {
  82. state.dict.sujectType = res.rows
  83. })
  84. }
  85. return state.dict.sujectType
  86. },
  87. Professional(state) {
  88. if (!state.dict.Professional) {
  89. api.inquireCourseMajor({ status: 1 }).then(res => {
  90. state.dict.Professional = res.rows
  91. })
  92. }
  93. return state.dict.Professional
  94. },
  95. schoolList(state) {
  96. if (!state.dict.schoolList) {
  97. api.inquireUserSchool({ status: 1 }).then(res => {
  98. state.dict.schoolList = res.rows
  99. })
  100. }
  101. return state.dict.schoolList
  102. },
  103. courseExamine(state) {
  104. if (!state.dict.courseExamine) {
  105. api.inquireCourseExamine({ status: 1 }).then(res => {
  106. state.dict.courseExamine = res.rows
  107. })
  108. }
  109. return state.dict.courseExamine
  110. },
  111. certificate(state) {
  112. if (!state.dict.certificate) {
  113. api.inquireBaseCertificate({ status: 1 }).then(res => {
  114. state.dict.certificate = res.rows
  115. })
  116. }
  117. return state.dict.certificate
  118. },
  119. certificateName(state) {
  120. if (!state.dict.certificateName) {
  121. api.inquireBaseCertificatecommon({ status: 1 }).then(res => {
  122. state.dict.certificateName = res.rows
  123. })
  124. }
  125. return state.dict.certificateName
  126. },
  127. certificateTp(state) {
  128. if (!state.dict.certificateTp) {
  129. api.inquireBaseCertificatetp({ status: 1 }).then(res => {
  130. state.dict.certificateTp = res.rows
  131. })
  132. }
  133. return state.dict.certificateTp
  134. },
  135. labelList(state) {
  136. if (!state.dict.labelList) {
  137. api.inquireCourseLabelList({ status: 1 }).then(res => {
  138. state.dict.labelList = res.rows
  139. })
  140. }
  141. return state.dict.labelList
  142. },
  143. payList(state) {
  144. if (!state.dict.payList) {
  145. api.inquirepayaislelist({ status: 1 }).then(res => {
  146. state.dict.payList = res.rows
  147. })
  148. }
  149. return state.dict.payList
  150. },
  151. paypayee(state) {
  152. if (!state.dict.paypayee) {
  153. api.inquirepaypayee({ status: 1 }).then(res => {
  154. state.dict.paypayee = res.rows
  155. })
  156. }
  157. return state.dict.paypayee
  158. },
  159. paysource(state) {
  160. if (!state.dict.paysource) {
  161. api.inquirepaysource({ status: 1 }).then(res => {
  162. state.dict.paysource = res.rows
  163. })
  164. }
  165. return state.dict.paysource
  166. },
  167. payvisit(state) {
  168. if (!state.dict.payvisit) {
  169. api.inquirepayvisit({ status: 1 }).then(res => {
  170. state.dict.payvisit = res.rows
  171. })
  172. }
  173. return state.dict.payvisit
  174. },
  175. payserve(state) {
  176. if (!state.dict.payserve) {
  177. api.inquirepayserve({ status: 1 }).then(res => {
  178. state.dict.payserve = res.rows
  179. })
  180. }
  181. return state.dict.payserve
  182. },
  183. paysupply(state) {
  184. if (!state.dict.paysupply) {
  185. api.inquirepaysupply({ status: 1 }).then(res => {
  186. state.dict.paysupply = res.rows
  187. })
  188. }
  189. return state.dict.paysupply
  190. },
  191. paynature(state) {
  192. if (!state.dict.paynature) {
  193. api.inquirepaynature({ status: 1 }).then(res => {
  194. state.dict.paynature = res.rows
  195. })
  196. }
  197. return state.dict.paynature
  198. },
  199. paycost(state) {
  200. if (!state.dict.paycost) {
  201. api.inquirepaycost({ status: 1 }).then(res => {
  202. state.dict.paycost = res.rows
  203. })
  204. }
  205. return state.dict.paycost
  206. },
  207. paperexam(state) {
  208. if (!state.dict.paperexam) {
  209. api.inquirepaperexamList({ status: 1 }).then(res => {
  210. state.dict.paperexam = res.rows
  211. })
  212. }
  213. return state.dict.paperexam
  214. },
  215. areas(state) {
  216. if (!state.dict.areas) {
  217. api.inquireapplyAreas({ status: 1, areaType: 1 }).then(res => {
  218. state.dict.areas = res.rows
  219. })
  220. }
  221. return state.dict.areas
  222. },
  223. cityList(state) {
  224. if (!state.dict.cityList) {
  225. api.inquireapplyCityList({ status: 1, areaType: 2 }).then(res => {
  226. state.dict.cityList = res.rows
  227. })
  228. }
  229. return state.dict.cityList
  230. },
  231. classList(state) {
  232. if (!state.dict.classList) {
  233. api.inquireGradegradeList({ status: 1 }).then(res => {
  234. state.dict.classList = res.rows
  235. })
  236. }
  237. return state.dict.classList
  238. },
  239. examLists(state) {
  240. if (!state.dict.examLists) {
  241. api.inquiresystemapplyList({ status: "0,1,2" }).then(res => {
  242. state.dict.examLists = res.rows
  243. })
  244. }
  245. return state.dict.examLists
  246. },
  247. examList(state) {
  248. if (!state.dict.examList) {
  249. api.inquiresystemapplyList({ status: 1 }).then(res => {
  250. state.dict.examList = res.rows
  251. })
  252. }
  253. return state.dict.examList
  254. },
  255. applySiteAddress(state) {
  256. if (!state.dict.applySiteAddress) {
  257. api.inquiresystemsite({ status: 1 }).then(res => {
  258. state.dict.applySiteAddress = res.rows
  259. })
  260. }
  261. return state.dict.applySiteAddress
  262. },
  263. beforeList(state) {
  264. if (!state.dict.beforeList) {
  265. api.inquiresystembefore({ status: 1 }).then(res => {
  266. state.dict.beforeList = res.rows
  267. })
  268. }
  269. return state.dict.beforeList
  270. },
  271. beforeLists(state) {
  272. if (!state.dict.beforeLists) {
  273. api.inquiresystembefore({ status: '0,1,2' }).then(res => {
  274. state.dict.beforeLists = res.rows
  275. })
  276. }
  277. return state.dict.beforeLists
  278. },
  279. }
  280. export default getters