adminLeft.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div class="admin_left">
  3. <router-link to="/" class="admin_left_title">
  4. <img :src="Logo" alt="">
  5. </router-link>
  6. <ul>
  7. <li :class="selectValue == 0 ? 'li_active' : ''" @click="getSelectionValue(0)">
  8. <img :src="selectValue == 0 ? StudentImgSelect : StudentImg" alt="">
  9. <span>学生管理</span>
  10. </li>
  11. <li :class="selectValue == 1 ? 'li_active' : ''" @click="getSelectionValue(1)">
  12. <img :src="selectValue == 1 ? ClassImgSelect : ClassImg" alt="">
  13. <span>班级管理</span>
  14. </li>
  15. <li :class="selectValue == 2 ? 'li_active' : ''" @click="getSelectionValue(2)">
  16. <img :src="selectValue == 2 ? TeacherImgSelect : TeacherImg" alt="">
  17. <span>教师管理</span>
  18. </li>
  19. </ul>
  20. </div>
  21. </template>
  22. <script setup>
  23. import { ref } from 'vue';
  24. import Logo from '../../assets/img/admin_left_logo.png'
  25. import StudentImg from '../../assets/img/student.png'
  26. import ClassImg from '../../assets/img/banji.png'
  27. import TeacherImg from '../../assets/img/jiaoshi.png'
  28. import StudentImgSelect from '../../assets/img/studentSelect.png'
  29. import ClassImgSelect from '../../assets/img/banjiSelect.png'
  30. import TeacherImgSelect from '../../assets/img/jiaoshiSelect.png'
  31. const selectValue = ref(0)
  32. const getSelectionValue = val => {
  33. selectValue.value = val
  34. // U.MD.D.I.openApplication('studentStudy') 学习中心
  35. if(val == 0){
  36. }else if(val == 1){
  37. U.MD.D.I.openApplication('project')
  38. }else if(val == 2){
  39. U.MD.D.I.openInApplication('teacher')
  40. }
  41. }
  42. </script>
  43. <style lang="scss">
  44. .admin_left {
  45. background: rgba(21, 35, 62);
  46. width: 235px;
  47. height: 100vh;
  48. color: #fff;
  49. .admin_left_title {
  50. padding: 14px 0;
  51. font-size: 20px;
  52. color: #fff;
  53. display: block;
  54. text-align: center;
  55. }
  56. ul {
  57. padding: 8px;
  58. li {
  59. padding: 7px 16px;
  60. border-radius: 3px;
  61. color: rgba(255, 255, 255, 0.55);
  62. display: flex;
  63. flex-direction: row;
  64. align-items: center;
  65. font-size: 14px;
  66. cursor: pointer;
  67. img {
  68. margin-right: 8px;
  69. }
  70. }
  71. .li_active {
  72. background: rgba(54, 129, 252, 1);
  73. color: #fff;
  74. }
  75. }
  76. }
  77. </style>