welcome.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. import avatars from "/@/assets/avatars.jpg";
  11. const date: Date = new Date();
  12. let loading = ref<boolean>(true);
  13. setTimeout(() => {
  14. loading.value = !loading.value;
  15. }, 800);
  16. let greetings = computed(() => {
  17. if (date.getHours() >= 0 && date.getHours() < 12) {
  18. return "上午阳光明媚,祝你薪水翻倍🌞!";
  19. } else if (date.getHours() >= 12 && date.getHours() < 18) {
  20. return "下午小风娇好,愿你青春不老😃!";
  21. } else {
  22. return "折一根天使羽毛,愿拂去您的疲惫烦恼忧伤🌛!";
  23. }
  24. });
  25. const openDepot = (): void => {
  26. window.open("https://github.com/xiaoxian521/vue-pure-admin");
  27. };
  28. </script>
  29. <template>
  30. <div class="welcome">
  31. <el-card class="top-content">
  32. <div class="left-mark">
  33. <img :src="avatars" title="直达仓库地址" @click="openDepot" />
  34. <span>{{ greetings }}</span>
  35. </div>
  36. </el-card>
  37. <el-row :gutter="24" style="margin: 20px">
  38. <el-col
  39. :xs="24"
  40. :sm="24"
  41. :md="12"
  42. :lg="12"
  43. :xl="12"
  44. style="margin-bottom: 20px"
  45. v-motion
  46. :initial="{
  47. opacity: 0,
  48. y: 100
  49. }"
  50. :enter="{
  51. opacity: 1,
  52. y: 0,
  53. transition: {
  54. delay: 200
  55. }
  56. }"
  57. >
  58. <el-card style="height: 360px">
  59. <template #header>
  60. <span style="font-size: 16px; font-weight: 500">GitHub信息</span>
  61. </template>
  62. <el-skeleton animated :rows="7" :loading="loading">
  63. <template #default>
  64. <ReGithub />
  65. </template>
  66. </el-skeleton>
  67. </el-card>
  68. </el-col>
  69. <el-col
  70. :xs="24"
  71. :sm="24"
  72. :md="12"
  73. :lg="12"
  74. :xl="12"
  75. style="margin-bottom: 20px"
  76. v-motion
  77. :initial="{
  78. opacity: 0,
  79. y: 100
  80. }"
  81. :enter="{
  82. opacity: 1,
  83. y: 0,
  84. transition: {
  85. delay: 200
  86. }
  87. }"
  88. >
  89. <el-card style="height: 360px">
  90. <template #header>
  91. <span style="font-size: 16px; font-weight: 500"
  92. >GitHub滚动信息</span
  93. >
  94. </template>
  95. <el-skeleton animated :rows="7" :loading="loading">
  96. <template #default>
  97. <ReInfinite />
  98. </template>
  99. </el-skeleton>
  100. </el-card>
  101. </el-col>
  102. <el-col
  103. :xs="24"
  104. :sm="24"
  105. :md="12"
  106. :lg="8"
  107. :xl="8"
  108. style="margin-bottom: 20px"
  109. v-motion
  110. :initial="{
  111. opacity: 0,
  112. y: 100
  113. }"
  114. :enter="{
  115. opacity: 1,
  116. y: 0,
  117. transition: {
  118. delay: 400
  119. }
  120. }"
  121. >
  122. <el-card>
  123. <template #header>
  124. <span style="font-size: 16px; font-weight: 500"
  125. >GitHub饼图信息</span
  126. >
  127. </template>
  128. <el-skeleton animated :rows="7" :loading="loading">
  129. <template #default>
  130. <RePie />
  131. </template>
  132. </el-skeleton>
  133. </el-card>
  134. </el-col>
  135. <el-col
  136. :xs="24"
  137. :sm="24"
  138. :md="12"
  139. :lg="8"
  140. :xl="8"
  141. style="margin-bottom: 20px"
  142. v-motion
  143. :initial="{
  144. opacity: 0,
  145. y: 100
  146. }"
  147. :enter="{
  148. opacity: 1,
  149. y: 0,
  150. transition: {
  151. delay: 400
  152. }
  153. }"
  154. >
  155. <el-card>
  156. <template #header>
  157. <span style="font-size: 16px; font-weight: 500"
  158. >GitHub折线图信息</span
  159. >
  160. </template>
  161. <el-skeleton animated :rows="7" :loading="loading">
  162. <template #default>
  163. <ReLine />
  164. </template>
  165. </el-skeleton>
  166. </el-card>
  167. </el-col>
  168. <el-col
  169. :xs="24"
  170. :sm="24"
  171. :md="24"
  172. :lg="8"
  173. :xl="8"
  174. style="margin-bottom: 20px"
  175. v-motion
  176. :initial="{
  177. opacity: 0,
  178. y: 100
  179. }"
  180. :enter="{
  181. opacity: 1,
  182. y: 0,
  183. transition: {
  184. delay: 400
  185. }
  186. }"
  187. >
  188. <el-card>
  189. <template #header>
  190. <span style="font-size: 16px; font-weight: 500"
  191. >GitHub柱状图信息</span
  192. >
  193. </template>
  194. <el-skeleton animated :rows="7" :loading="loading">
  195. <template #default>
  196. <ReBar />
  197. </template>
  198. </el-skeleton>
  199. </el-card>
  200. </el-col>
  201. </el-row>
  202. </div>
  203. </template>
  204. <style module scoped>
  205. .size {
  206. height: 335px;
  207. }
  208. </style>
  209. <style lang="scss" scoped>
  210. .main-content {
  211. margin: 0 !important;
  212. }
  213. .welcome {
  214. height: 100%;
  215. .top-content {
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. height: 60px;
  220. background: #fff;
  221. .left-mark {
  222. display: flex;
  223. align-items: center;
  224. img {
  225. display: block;
  226. width: 50px;
  227. height: 50px;
  228. border-radius: 50%;
  229. margin-right: 10px;
  230. cursor: pointer;
  231. }
  232. span {
  233. font-size: 14px;
  234. }
  235. }
  236. }
  237. }
  238. </style>