welcome.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <script setup lang="ts">
  2. import {
  3. ReGithub,
  4. ReInfinite,
  5. RePie,
  6. ReLine,
  7. ReBar
  8. } from "/@/components/ReCharts/index";
  9. import { ref, computed } from "vue";
  10. const date: Date = new Date();
  11. let loading = ref<boolean>(true);
  12. setTimeout(() => {
  13. loading.value = !loading.value;
  14. }, 500);
  15. let greetings = computed(() => {
  16. if (date.getHours() >= 0 && date.getHours() < 12) {
  17. return "上午阳光明媚,祝你薪水翻倍🌞!";
  18. } else if (date.getHours() >= 12 && date.getHours() < 18) {
  19. return "下午小风娇好,愿你青春不老😃!";
  20. } else {
  21. return "折一根天使羽毛,愿拂去您的疲惫烦恼忧伤🌛!";
  22. }
  23. });
  24. const openDepot = (): void => {
  25. window.open("https://github.com/xiaoxian521/vue-pure-admin");
  26. };
  27. </script>
  28. <template>
  29. <div class="welcome">
  30. <el-card class="top-content">
  31. <div class="left-mark">
  32. <img
  33. src="https://avatars.githubusercontent.com/u/44761321?s=400&u=30907819abd29bb3779bc247910873e7c7f7c12f&v=4"
  34. title="直达仓库地址"
  35. @click="openDepot"
  36. />
  37. <span>{{ greetings }}</span>
  38. </div>
  39. </el-card>
  40. <el-row :gutter="24" style="margin: 20px">
  41. <el-col
  42. :xs="24"
  43. :sm="24"
  44. :md="12"
  45. :lg="12"
  46. :xl="12"
  47. style="margin-bottom: 20px"
  48. >
  49. <el-skeleton animated :rows="7" :loading="false">
  50. <template #default>
  51. <el-card>
  52. <h4>GitHub信息</h4>
  53. <ReGithub />
  54. </el-card>
  55. </template>
  56. </el-skeleton>
  57. </el-col>
  58. <el-col
  59. :xs="24"
  60. :sm="24"
  61. :md="12"
  62. :lg="12"
  63. :xl="12"
  64. style="margin-bottom: 20px"
  65. >
  66. <el-skeleton animated :rows="7" :loading="false">
  67. <template #default>
  68. <el-card>
  69. <h4>GitHub滚动信息</h4>
  70. <ReInfinite />
  71. </el-card>
  72. </template>
  73. </el-skeleton>
  74. </el-col>
  75. <el-col
  76. :xs="24"
  77. :sm="24"
  78. :md="12"
  79. :lg="8"
  80. :xl="8"
  81. style="margin-bottom: 20px"
  82. >
  83. <el-skeleton animated :rows="7" :loading="false">
  84. <template #default>
  85. <el-card>
  86. <h4>GitHub饼图信息</h4>
  87. <RePie />
  88. </el-card>
  89. </template>
  90. </el-skeleton>
  91. </el-col>
  92. <el-col
  93. :xs="24"
  94. :sm="24"
  95. :md="12"
  96. :lg="8"
  97. :xl="8"
  98. style="margin-bottom: 20px"
  99. >
  100. <el-skeleton animated :rows="7" :loading="false">
  101. <template #default>
  102. <el-card>
  103. <h4>GitHub折线图信息</h4>
  104. <ReLine />
  105. </el-card>
  106. </template>
  107. </el-skeleton>
  108. </el-col>
  109. <el-col
  110. :xs="24"
  111. :sm="24"
  112. :md="24"
  113. :lg="8"
  114. :xl="1"
  115. style="margin-bottom: 20px"
  116. >
  117. <el-skeleton animated :rows="7" :loading="false">
  118. <template #default>
  119. <el-card>
  120. <h4>GitHub柱状图信息</h4>
  121. <ReBar />
  122. </el-card>
  123. </template>
  124. </el-skeleton>
  125. </el-col>
  126. </el-row>
  127. </div>
  128. </template>
  129. <style module scoped>
  130. .size {
  131. height: 335px;
  132. }
  133. </style>
  134. <style lang="scss" scoped>
  135. .main-content {
  136. margin: 0;
  137. }
  138. .welcome {
  139. height: 100%;
  140. .top-content {
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. height: 60px;
  145. background: #fff;
  146. .left-mark {
  147. display: flex;
  148. align-items: center;
  149. img {
  150. display: block;
  151. width: 50px;
  152. height: 50px;
  153. border-radius: 50%;
  154. margin-right: 10px;
  155. cursor: pointer;
  156. }
  157. span {
  158. font-size: 14px;
  159. }
  160. }
  161. }
  162. }
  163. </style>