getters.js 6.8 KB

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