index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <div class="home">
  3. <div class="home-top">
  4. <el-button class="create" size="medium" @click="jump('/create_project')">
  5. 教材创建 <i class="el-icon-plus"> </i>
  6. </el-button>
  7. </div>
  8. <div class="home-content">
  9. <div
  10. v-for="{ color, title, path, icon } in itemList"
  11. :key="title"
  12. class="item"
  13. :style="{ backgroundColor: color }"
  14. @click="jump(path)"
  15. >
  16. <span class="title">{{ title }}</span>
  17. <span class="icon" :style="{ backgroundColor: color }">
  18. <SvgIcon :icon-class="icon" size="36" />
  19. </span>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. name: 'HomePage',
  27. data() {
  28. return {
  29. itemList: [
  30. {
  31. color: '#667EE5',
  32. title: '教材管理',
  33. path: '/personal_workbench/project',
  34. icon: 'manage',
  35. },
  36. {
  37. color: '#F5B131',
  38. title: '教材制作',
  39. path: '/personal_workbench/edit_task',
  40. icon: 'make',
  41. },
  42. {
  43. color: '#E25E5C',
  44. title: '教材审核',
  45. path: '/personal_workbench/check_task',
  46. icon: 'audit',
  47. },
  48. ],
  49. };
  50. },
  51. methods: {
  52. jump(path) {
  53. this.$router.push({ path });
  54. },
  55. },
  56. };
  57. </script>
  58. <style lang="scss" scoped>
  59. .home {
  60. display: flex;
  61. flex-direction: column;
  62. height: 100%;
  63. padding: 12px;
  64. background-color: #f1f1f1;
  65. &-top {
  66. display: flex;
  67. justify-content: flex-end;
  68. margin: 40px 20px 8%;
  69. .create {
  70. color: #f5f5f5;
  71. background-color: #46bc84;
  72. }
  73. }
  74. &-content {
  75. display: flex;
  76. flex: 1;
  77. align-items: flex-start;
  78. justify-content: space-evenly;
  79. .item {
  80. display: flex;
  81. flex-direction: column;
  82. align-items: center;
  83. justify-content: space-between;
  84. width: 15%;
  85. min-width: 300px;
  86. aspect-ratio: 3 / 4;
  87. padding: 4% 0 2%;
  88. cursor: pointer;
  89. border-radius: 8px;
  90. .title {
  91. font-size: 36px;
  92. font-weight: bold;
  93. color: #fff;
  94. text-align: center;
  95. }
  96. .icon {
  97. width: 64px;
  98. height: 64px;
  99. overflow: hidden;
  100. line-height: 84px;
  101. text-align: center;
  102. filter: brightness(1.15) saturate(1.1);
  103. border-radius: 50%;
  104. }
  105. }
  106. }
  107. }
  108. </style>