adminLeft.vue 2.5 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. top.U.MD.D.I.openApplication('student')
  37. }else if(val == 1){
  38. top.U.MD.D.I.openApplication('class')
  39. }else if(val == 2){
  40. top.U.MD.D.I.openInApplication('teacher')
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. .admin_left {
  46. background: rgba(21, 35, 62);
  47. width: 235px;
  48. height: 100vh;
  49. color: #fff;
  50. .admin_left_title {
  51. padding: 14px 0;
  52. font-size: 20px;
  53. color: #fff;
  54. display: block;
  55. text-align: center;
  56. }
  57. ul {
  58. padding: 8px;
  59. li {
  60. padding: 7px 16px;
  61. border-radius: 3px;
  62. color: rgba(255, 255, 255, 0.55);
  63. display: flex;
  64. flex-direction: row;
  65. align-items: center;
  66. font-size: 14px;
  67. cursor: pointer;
  68. img {
  69. margin-right: 8px;
  70. }
  71. }
  72. .li_active {
  73. background: rgba(54, 129, 252, 1);
  74. color: #fff;
  75. }
  76. }
  77. }
  78. </style>