消毒机设备
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.4 KiB

2 months ago
2 weeks ago
2 months ago
2 weeks ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <script lang="ts" setup>
  2. import SettingFormulaConfig from 'components/formula/SettingFormulaConfig.vue'
  3. import { useSystemStore } from 'stores/systemStore'
  4. import { ref } from 'vue'
  5. import Device from '@/components/setting/Device.vue'
  6. import SystemDate from '@/components/setting/SystemDate.vue'
  7. import User from '@/components/setting/User.vue'
  8. import { useSettingStore } from '@/stores/settingStore'
  9. const systemStore = useSystemStore()
  10. const settingStore = useSettingStore()
  11. const currentUserRoleType = JSON.parse(localStorage.getItem('user') || '{}')?.roleType
  12. const settingMenus = settingStore.settingMenus.filter((item): boolean => item.roleType.includes(currentUserRoleType))
  13. const selectedMenuCode = ref('defaultFormula')
  14. // 选择菜单项的方法
  15. const selectItem = (menuCode: string) => {
  16. selectedMenuCode.value = menuCode
  17. }
  18. </script>
  19. <template>
  20. <div class="dashboard-container">
  21. <main class="main-content">
  22. <div class="setting-left">
  23. <div class="menu-container">
  24. <ul class="menu-container">
  25. <li
  26. v-for="item in settingMenus"
  27. :key="item.code"
  28. :class="{ active: selectedMenuCode === item.code }"
  29. class="setting-menu-li menu-item"
  30. @click="selectItem(item.code)"
  31. >
  32. {{ item.name }}
  33. </li>
  34. </ul>
  35. </div>
  36. </div>
  37. <div class="setting-right">
  38. <SettingFormulaConfig
  39. v-if="selectedMenuCode === 'defaultFormula'"
  40. :editable="systemStore.systemUser?.roleType === 'admin'"
  41. />
  42. <template v-if="selectedMenuCode === 'user'">
  43. <User />
  44. </template>
  45. <div v-if="selectedMenuCode === 'date'">
  46. <SystemDate />
  47. </div>
  48. <div v-if="selectedMenuCode === 'deviceInfo'">
  49. <Device />
  50. </div>
  51. </div>
  52. </main>
  53. </div>
  54. </template>
  55. <style lang="scss" scoped>
  56. .main-content {
  57. display: grid;
  58. grid-template-columns: repeat(3, 1fr);
  59. height: 100%;
  60. gap: 10px;
  61. overflow: hidden;
  62. .setting-left {
  63. background: linear-gradient(180deg, rgba(147, 203, 255, 0.01) 50%, #ffffff 24%);
  64. box-shadow: 0 0 4px #0000001f;
  65. border-radius: 10px;
  66. border: 1px solid #e1e1e1;
  67. overflow: hidden;
  68. }
  69. .setting-right {
  70. grid-column: 2 / 4;
  71. box-shadow: 0 1px 5px 0 rgba(9, 39, 62, 0.15);
  72. background: #ffffff;
  73. border: 1px solid #e1e1e1;
  74. background: linear-gradient(180deg, rgba(147, 203, 255, 0.01) 50%, #ffffff 24%);
  75. border-radius: 10px;
  76. overflow: hidden;
  77. padding: 10px;
  78. }
  79. }
  80. .menu-container {
  81. padding: 5px 0;
  82. width: 100%;
  83. height: 100%;
  84. overflow: auto;
  85. .setting-menu-li {
  86. font-size: 18px;
  87. }
  88. }
  89. ul {
  90. list-style-type: none;
  91. margin: 0;
  92. padding: 0;
  93. }
  94. li {
  95. padding: 15px 15px;
  96. font-size: 15px;
  97. display: flex;
  98. align-items: center;
  99. //border-radius: 10px;
  100. height: 60px;
  101. border-left: 5px solid #fff;
  102. transition: border-left-color 0.3s ease;
  103. }
  104. li.active {
  105. border-left: 5px solid #2892f3;
  106. // color: #e6f7ff;
  107. background: #e8f3ff;
  108. //border-radius: 10px;
  109. color: #2892f3;
  110. }
  111. .menu-container {
  112. width: 100%; /* 占满父容器 */
  113. background: #fff;
  114. // border: 1px solid #eee;
  115. overflow: hidden; /* 配合圆角,避免阴影/边框溢出 */
  116. }
  117. .menu-item {
  118. padding: 14px 20px; /* 更大触摸区域 */
  119. font-size: 15px; /* 适配手机阅读 */
  120. border-bottom: 1px solid #f5f5f5;
  121. }
  122. /* 最后一项去掉分隔线 */
  123. .menu-item:last-child {
  124. border-bottom: none;
  125. }
  126. </style>