App.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 MethodName = "/OrgServer/DictManager/GetStudyPhaseList";
  23. let typeListAll = [{
  24. study_phase: -1,
  25. study_phase_name: '全部'
  26. }]
  27. let typeList = []
  28. await getLogin(MethodName, {})
  29. .then((res) => {
  30. if (res.status === 1) {
  31. typeListAll = typeListAll.concat(res.study_phase_list)
  32. typeList = res.study_phase_list
  33. }
  34. })
  35. .catch(() => {
  36. });
  37. this.$store.commit('setStudyTypeAll',typeListAll)
  38. this.$store.commit('setStudyType',typeList)
  39. let MethodNames = "/OrgServer/DictManager/GetOrgTypeList";
  40. let typeListAlls = [{
  41. type: -1,
  42. type_name: '全部'
  43. }]
  44. let typeLists = []
  45. await getLogin(MethodNames, {})
  46. .then((res) => {
  47. if (res.status === 1) {
  48. typeListAlls = typeListAlls.concat(res.type_list)
  49. typeLists = res.type_list
  50. }
  51. })
  52. .catch(() => {
  53. });
  54. this.$store.commit('setOrgTypeAll',typeListAlls)
  55. this.$store.commit('setOrgType',typeLists)
  56. let provinceCityListAll = [{
  57. label: '全部',
  58. value: '0',
  59. leaf: true
  60. }]
  61. let provinceCityList = []
  62. await getLogin('/OrgServer/DictManager/GetAllProvinceCityList', {})
  63. .then((res) => {
  64. if (res.status === 1) {
  65. res.province_list.forEach(item => {
  66. let obj = {
  67. label: item.name,
  68. value: item.id,
  69. children: []
  70. }
  71. item.city_list.forEach(items=>{
  72. let objs = {
  73. label: items.name,
  74. value: items.id,
  75. leaf: true
  76. }
  77. obj.children.push(objs)
  78. })
  79. provinceCityList.push(obj)
  80. provinceCityListAll.push(obj)
  81. });
  82. }
  83. })
  84. .catch(() => {
  85. });
  86. this.$store.commit('setProviceCity',provinceCityList)
  87. this.$store.commit('setProviceCityAll',provinceCityListAll)
  88. let searchStatusList = [{
  89. status:-1,
  90. status_name:'全部'
  91. }]
  92. await getLogin('/OrgServer/DictManager/GetSysUserStatusList', {})
  93. .then((res) => {
  94. if(res.status===1){
  95. searchStatusList = searchStatusList.concat(res.status_list)
  96. }
  97. })
  98. .catch(() => {
  99. this.loading = false
  100. });
  101. this.$store.commit('setSearchStatusList',searchStatusList)
  102. await getLogin('/OrgServer/Manager/SysConfigManager/GetSysConfig_Preview', {})
  103. .then((res) => {
  104. if(res.status===1){
  105. this.$store.commit('setPreviewUrl',res.preview_server_url)
  106. }
  107. })
  108. .catch(() => {
  109. this.loading = false
  110. });
  111. }
  112. }
  113. },
  114. mounted(){
  115. },
  116. };
  117. </script>
  118. <style lang="scss" scoped>
  119. #app{
  120. background: #F7F8FA;
  121. min-width: 1440px;
  122. min-height: 100%;
  123. }
  124. </style>