App.vue 3.6 KB

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