index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="body">
  3. <div class="db_header">
  4. <!-- <div class="logoTop">Logo</div> -->
  5. <div class="db_header_title">
  6. <div v-if="type == 1">综合数据中心</div>
  7. <div v-if="type == 2">课程数据中心</div>
  8. <div v-if="type == 3">学生数据中心</div>
  9. <div v-if="type == 5">项目数据中心</div>
  10. <div v-if="type == 4">教师数据中心</div>
  11. </div>
  12. <div class="db_check">
  13. <div :class="{ active: type == 1 }" @click="setType(1)">综合数据</div>
  14. <div :class="{ active: type == 2 }" @click="setType(2)">课程数据</div>
  15. <div :class="{ active: type == 5 }" @click="setType(5)" v-if="scourseLength > 0">项目数据</div>
  16. <div :class="{ active: type == 3 }" @click="setType(3)">学生数据</div>
  17. <div :class="{ active: type == 4 }" @click="setType(4)">教师数据</div>
  18. </div>
  19. </div>
  20. <div class="db_body">
  21. <school v-if="type == 1" :oid="oid" :org="org"></school>
  22. <course v-if="type == 2" :oid="oid" :org="org"></course>
  23. <project v-if="type == 5" :oid="oid" :org="org"></project>
  24. <student v-if="type == 3" :oid="oid" :org="org"></student>
  25. <teacher v-if="type == 4" :oid="oid" :org="org"></teacher>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. import school from "./school";
  31. import course from "./course";
  32. import student from "./student";
  33. import teacher from "./teacher";
  34. import project from "./project";
  35. export default {
  36. components: {
  37. school,
  38. course,
  39. student,
  40. teacher,
  41. project,
  42. },
  43. data() {
  44. return {
  45. type: 1,
  46. oid: this.$route.query.oid,
  47. org: this.$route.query.org,
  48. scourseLength: 0,
  49. };
  50. },
  51. methods: {
  52. setType(type) {
  53. this.type = type;
  54. },
  55. getData() {
  56. this.isLoading = true;
  57. let params = [
  58. {
  59. oid: this.oid,
  60. org: this.org,
  61. },
  62. ];
  63. this.ajax
  64. .post(this.$store.state.api + "getCourseLength", params)
  65. .then((res) => {
  66. this.isLoading = false;
  67. this.scourseLength = res.data[0][0].count;
  68. this.$forceUpdate();
  69. })
  70. .catch((err) => {
  71. this.isLoading = false;
  72. console.error(err);
  73. });
  74. },
  75. },
  76. mounted () {
  77. this.getData();
  78. },
  79. };
  80. </script>
  81. <style scoped>
  82. .body {
  83. height: 100%;
  84. width: 100%;
  85. min-width: 1550px;
  86. min-height: 750px;
  87. }
  88. .db_header {
  89. width: 100%;
  90. height: 50px;
  91. display: flex;
  92. justify-content: center;
  93. position: relative;
  94. background: #fff;
  95. align-items: center;
  96. }
  97. .logoTop {
  98. position: absolute;
  99. left: 30px;
  100. }
  101. .db_header_title {
  102. font-weight: bold;
  103. font-size: 20px;
  104. }
  105. .db_header_title > div {
  106. position: relative;
  107. z-index: 9;
  108. }
  109. .db_header_title > div:after {
  110. content: "";
  111. position: absolute;
  112. width: 250px;
  113. height: 10px;
  114. bottom: -30px;
  115. left: -85px;
  116. border-top: 20px solid #fff;
  117. border-left: 20px solid transparent;
  118. border-right: 20px solid transparent;
  119. -webkit-transform: skew(20deg);
  120. transform: skew(359deg);
  121. z-index: 1;
  122. }
  123. .db_check {
  124. display: flex;
  125. align-items: center;
  126. position: absolute;
  127. right: 30px;
  128. height: 100%;
  129. }
  130. .db_check > div {
  131. padding: 14px 20px;
  132. cursor: pointer;
  133. }
  134. .db_check > div:hover {
  135. background: #edf4ff;
  136. }
  137. .db_check > div.active {
  138. font-weight: 700;
  139. color: #297bff;
  140. background: #edf4ff;
  141. border-top: 2px solid #297bff;
  142. box-sizing: border-box;
  143. }
  144. /* .db_check > div + div {
  145. margin-left: 30px;
  146. } */
  147. .db_body {
  148. height: calc(100% - 50px);
  149. width: 100%;
  150. overflow: auto;
  151. background: rgb(231, 242, 252);
  152. }
  153. </style>