index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div class="page">
  3. <div class="gva-card-box">
  4. <div class="gva-card gva-top-card">
  5. <div class="gva-top-card-left">
  6. <div class="gva-top-card-left-title">早安,管理员,请开始一天的工作吧</div>
  7. <div class="gva-top-card-left-dot">{{ weatherInfo }}</div>
  8. </div>
  9. <img
  10. src="@/assets/dashboard.png"
  11. class="gva-top-card-right"
  12. alt
  13. >
  14. </div>
  15. </div>
  16. <div class="gva-card-box">
  17. <div class="gva-card">
  18. <div class="gva-card-title">数据统计</div>
  19. <div class="p-4">
  20. <el-row :gutter="20">
  21. <el-col
  22. :xs="24"
  23. :sm="18"
  24. >
  25. <echarts-line />
  26. </el-col>
  27. <el-col
  28. :xs="24"
  29. :sm="6"
  30. >
  31. <dashboard-table />
  32. </el-col>
  33. </el-row>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <script setup>
  40. import EchartsLine from '@/view/dashboard/dashboardCharts/echartsLine.vue'
  41. import DashboardTable from '@/view/dashboard/dashboardTable/dashboardTable.vue'
  42. import { ref } from 'vue'
  43. import { useRouter } from 'vue-router'
  44. import { useWeatherInfo } from '@/view/dashboard/weather.js'
  45. import SelectImage from '@/components/selectImage/selectImage.vue'
  46. defineOptions({
  47. name: 'Dashboard'
  48. })
  49. const weatherInfo = useWeatherInfo()
  50. const toolCards = ref([
  51. {
  52. label: '用户管理',
  53. icon: 'monitor',
  54. name: 'user',
  55. color: '#ff9c6e',
  56. bg: 'rgba(255, 156, 110,.3)'
  57. },
  58. {
  59. label: '角色管理',
  60. icon: 'setting',
  61. name: 'authority',
  62. color: '#69c0ff',
  63. bg: 'rgba(105, 192, 255,.3)'
  64. },
  65. {
  66. label: '菜单管理',
  67. icon: 'menu',
  68. name: 'menu',
  69. color: '#b37feb',
  70. bg: 'rgba(179, 127, 235,.3)'
  71. },
  72. {
  73. label: '代码生成器',
  74. icon: 'cpu',
  75. name: 'autoCode',
  76. color: '#ffd666',
  77. bg: 'rgba(255, 214, 102,.3)'
  78. },
  79. {
  80. label: '表单生成器',
  81. icon: 'document-checked',
  82. name: 'formCreate',
  83. color: '#ff85c0',
  84. bg: 'rgba(255, 133, 192,.3)'
  85. },
  86. {
  87. label: '关于我们',
  88. icon: 'user',
  89. name: 'about',
  90. color: '#5cdbd3',
  91. bg: 'rgba(92, 219, 211,.3)'
  92. }
  93. ])
  94. const router = useRouter()
  95. const toTarget = (name) => {
  96. router.push({ name })
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .page {
  101. @apply p-0;
  102. .gva-card-box{
  103. @apply p-4;
  104. &+.gva-card-box{
  105. @apply pt-0;
  106. }
  107. }
  108. .gva-card {
  109. @apply box-border bg-white rounded h-auto px-6 py-8 overflow-hidden shadow-sm;
  110. .gva-card-title{
  111. @apply pb-5 border-t-0 border-l-0 border-r-0 border-b border-solid border-gray-100;
  112. }
  113. }
  114. .gva-top-card {
  115. @apply h-72 flex items-center justify-between text-gray-500;
  116. &-left {
  117. @apply h-full flex flex-col w-auto;
  118. &-title {
  119. @apply text-3xl text-gray-600;
  120. }
  121. &-dot {
  122. @apply mt-4 text-gray-600 text-lg;
  123. }
  124. &-item{
  125. +.gva-top-card-left-item{
  126. margin-top: 24px;
  127. }
  128. margin-top: 14px;
  129. }
  130. }
  131. &-right {
  132. height: 600px;
  133. width: 600px;
  134. margin-top: 28px;
  135. }
  136. }
  137. ::v-deep(.el-card__header){
  138. @apply p-0 border-gray-200;
  139. }
  140. .card-header{
  141. @apply pb-5 border-b border-solid border-gray-200 border-t-0 border-l-0 border-r-0;
  142. }
  143. .quick-entrance-items {
  144. @apply flex items-center justify-center text-center text-gray-800;
  145. .quick-entrance-item {
  146. @apply px-8 py-6 flex items-center flex-col transition-all duration-100 ease-in-out rounded-lg cursor-pointer;
  147. &:hover{
  148. @apply shadow-lg;
  149. }
  150. &-icon {
  151. @apply flex items-center h-16 w-16 rounded-lg justify-center mx-0 my-auto text-2xl;
  152. }
  153. p {
  154. @apply mt-2.5;
  155. }
  156. }
  157. }
  158. }
  159. .dashboard-icon {
  160. @apply flex items-center text-xl mr-2 text-blue-400;
  161. }
  162. </style>