index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div>
  3. <div class="bg-white dark:bg-regal-dark rounded flex flex-col sm:flex-row justify-between">
  4. <div class="w-full sm:w-[40rem] flex flex-row p1-1 sm:pl-3 items-center justify-between min-h-28 border-b pb-2 sm:pb-0 sm:border-b-0 border-gray-400">
  5. <img :src="avatar" class="rounded-full w-16 h-16" />
  6. <div class="flex flex-col w-[34rem] pl-4 sm:pl-0 pt-2 sm:pt-3">
  7. <div class="text-lg text-zinc-800 dark:text-gray-200">很高兴见到你👋 ,{{ nickname }}!{{ itsTimeDo }}</div>
  8. <div class="text-sm text-gray-400 break-words pt-0 sm:pt-2">{{ context }}</div>
  9. </div>
  10. </div>
  11. <div class="flex items-center h-28 w-full sm:w-[23rem] justify-between pl-2 pr-2 sm:pr-3">
  12. <div class="flex flex-col text-center">
  13. <div class="text-lg text-gray-600 dark:text-gray-400">项目数</div>
  14. <div class="text text-gray-400 dark:text-gray-200">1000</div>
  15. </div>
  16. <el-divider direction="vertical" />
  17. <div class="flex flex-col text-center">
  18. <div class="text-lg text-gray-600 dark:text-gray-400">国内排名</div>
  19. <div class="text text-gray-400 dark:text-gray-200">1000</div>
  20. </div>
  21. <el-divider direction="vertical" border-style="dashed" />
  22. <div class="flex flex-col text-center">
  23. <div class="text-lg text-gray-600 dark:text-gray-400">团队成员</div>
  24. <div class="text text-gray-400 dark:text-gray-200">1000</div>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="flex flex-col sm:flex-row mt-4 justify-between">
  29. <Introduce />
  30. <Project />
  31. </div>
  32. </div>
  33. </template>
  34. <script lang="ts" setup>
  35. import { computed } from 'vue'
  36. import { useUserStore } from '/admin/stores/modules/user'
  37. import Introduce from './introduce.vue'
  38. import Project from './project.vue'
  39. const userStore = useUserStore()
  40. const nickname = computed(() => {
  41. return userStore.getNickname
  42. })
  43. const avatar = computed(() => {
  44. return userStore.getAvatar
  45. })
  46. const itsTimeDo = computed(() => {
  47. const date = new Date()
  48. const now = date.getHours()
  49. if (isInRange(now, 2, 5)) {
  50. return '凌晨了,该休息了!注意身体!😪'
  51. } else if (isInRange(now, 5, 8)) {
  52. return '早晨,开始全新的一天!😊'
  53. } else if (isInRange(now, 8, 12)) {
  54. return '上午好,开始摸鱼的一天!😄'
  55. } else if (isInRange(now, 12, 18)) {
  56. return '下午好,快要下班了!再坚持下💪'
  57. } else if (isInRange(now, 18, 23)) {
  58. return '晚上了,请点击右上角关闭!👉'
  59. } else {
  60. return '深夜了,为什么还在打开该系统?💢'
  61. }
  62. })
  63. const context = computed(() => {
  64. const contexts: string[] = [
  65. '资本主义社会里的民主是一种残缺不全的,贫乏和虚伪和民主,是只供富人,只供少数人享受的民主',
  66. '资本来到世间,从头到脚,每个毛孔都滴着血和肮脏的东西',
  67. '既然掠夺给少数人造成了天然的权利,那么多数人就只得积聚足够的力量,来取得夺回他们被夺去的一切的天然权利',
  68. '资本家有百分之五十的利润,就会铤而走险;有了百分之一百的利润就敢践踏人间一切法律;有了百分之三百的利润就敢冒上绞刑架的危险',
  69. ]
  70. return contexts[Math.floor(Math.random() * contexts.length)]
  71. })
  72. function isInRange(compare: number, min: number, max: number) {
  73. return compare >= min && compare < max
  74. }
  75. </script>