App.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div id="app">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script>
  7. import { getLogin } from "@/api/ajax";
  8. import { getToken } from '@/utils/auth'
  9. export default {
  10. name: "App",
  11. data() {
  12. return {
  13. };
  14. },
  15. created() {
  16. this.fn()
  17. },
  18. methods:{
  19. async fn() {
  20. let userInfor = getToken();
  21. if (userInfor) {
  22. let MethodNames = "/OrgServer/DictManager/GetOrgTypeList";
  23. let typeListAlls = [{
  24. type: -1,
  25. type_name: '全部'
  26. }]
  27. let typeLists = []
  28. await getLogin(MethodNames, {})
  29. .then((res) => {
  30. if (res.status === 1) {
  31. typeListAlls = typeListAlls.concat(res.type_list)
  32. typeLists = res.type_list
  33. }
  34. })
  35. .catch(() => {
  36. });
  37. this.$store.commit('setOrgTypeAll',typeListAlls)
  38. this.$store.commit('setOrgType',typeLists)
  39. let searchStatusList = [{
  40. status:-1,
  41. status_name:'全部'
  42. }]
  43. await getLogin('/OrgServer/DictManager/GetSysUserStatusList', {})
  44. .then((res) => {
  45. if(res.status===1){
  46. searchStatusList = searchStatusList.concat(res.status_list)
  47. }
  48. })
  49. .catch(() => {
  50. this.loading = false
  51. });
  52. this.$store.commit('setSearchStatusList',searchStatusList)
  53. }
  54. let MethodName = "/OrgServer/DictManager/GetStudyPhaseList";
  55. let typeListAll = [{
  56. study_phase: -1,
  57. study_phase_name: '全部'
  58. }]
  59. let typeList = []
  60. await getLogin(MethodName, {})
  61. .then((res) => {
  62. if (res.status === 1) {
  63. typeListAll = typeListAll.concat(res.study_phase_list)
  64. typeList = res.study_phase_list
  65. }
  66. })
  67. .catch(() => {
  68. });
  69. this.$store.commit('setStudyTypeAll',typeListAll)
  70. this.$store.commit('setStudyType',typeList)
  71. let provinceCityListAll = [{
  72. label: '全部',
  73. value: '0',
  74. leaf: true
  75. }]
  76. let provinceCityList = []
  77. await getLogin('/OrgServer/DictManager/GetAllProvinceCityList', {})
  78. .then((res) => {
  79. if (res.status === 1) {
  80. res.province_list.forEach(item => {
  81. let obj = {
  82. label: item.name,
  83. value: item.id,
  84. children: []
  85. }
  86. item.city_list.forEach(items=>{
  87. let objs = {
  88. label: items.name,
  89. value: items.id,
  90. leaf: true
  91. }
  92. obj.children.push(objs)
  93. })
  94. provinceCityList.push(obj)
  95. provinceCityListAll.push(obj)
  96. });
  97. }
  98. })
  99. .catch(() => {
  100. });
  101. this.$store.commit('setProviceCity',provinceCityList)
  102. this.$store.commit('setProviceCityAll',provinceCityListAll)
  103. await getLogin('/OrgServer/Client/SysConfigQuery/GetSysConfig_Preview', {})
  104. .then((res) => {
  105. if(res.status===1){
  106. this.$store.commit('setPreviewUrl',res.preview_server_url)
  107. }
  108. })
  109. .catch(() => {
  110. this.loading = false
  111. });
  112. }
  113. },
  114. mounted(){
  115. },
  116. };
  117. </script>
  118. <style lang="scss" scoped>
  119. #app{
  120. background: #F2F3F5;
  121. min-width: 1440px;
  122. min-height: 100%;
  123. padding-top: 64px;
  124. }
  125. </style>