index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div :class="{ 'has-logo': sidebarLogo }">
  3. <!--混合布局-->
  4. <div
  5. class="flex w-full"
  6. style="
  7. display: flex;
  8. justify-content: space-between;
  9. align-items: center;
  10. padding: 0 20px;
  11. border-bottom: 1px solid #fff;
  12. "
  13. v-if="layout == 'mix'"
  14. >
  15. <!-- <SidebarLogo v-if="sidebarLogo" :collapse="!appStore.sidebar.opened" /> -->
  16. <div style="display: flex; align-items: center">
  17. <img
  18. src="/logo.png"
  19. style="width: 35px; height: 35px; margin-right: 10px"
  20. />
  21. <div class="viewTitle">{{ title }}</div>
  22. </div>
  23. <SidebarMixTopMenu class="flex-1" v-show="false" />
  24. <div>
  25. <el-space>
  26. <div
  27. style="
  28. border-radius: 50%;
  29. display: flex;
  30. justify-content: center;
  31. align-items: center;
  32. "
  33. >
  34. <svg-icon
  35. class="activeNotice"
  36. icon-class="closeI"
  37. size="47"
  38. @click="toExitApp"
  39. />
  40. </div>
  41. <div>
  42. <!-- <div class="name">李明华</div> -->
  43. </div>
  44. </el-space>
  45. </div>
  46. <!-- <NavbarRight /> -->
  47. </div>
  48. <!--左侧布局 || 顶部布局 -->
  49. <template v-else>
  50. <SidebarLogo v-if="sidebarLogo" :collapse="!appStore.sidebar.opened" />
  51. <el-scrollbar>
  52. <SidebarMenu :menu-list="permissionStore.routes" base-path="" />
  53. </el-scrollbar>
  54. <NavbarRight v-if="layout === 'top'" />
  55. </template>
  56. </div>
  57. </template>
  58. <script setup lang="ts">
  59. import { useSettingsStore, usePermissionStore, useAppStore } from "@/store";
  60. const route = useRoute();
  61. const appStore = useAppStore();
  62. const settingsStore = useSettingsStore();
  63. const permissionStore = usePermissionStore();
  64. const title = ref("");
  65. const sidebarLogo = computed(() => settingsStore.sidebarLogo);
  66. const layout = computed(() => settingsStore.layout);
  67. const toExitApp = () => {
  68. if (window.openHarmonyBridge && window.openHarmonyBridge.exitApp) {
  69. window.openHarmonyBridge.exitApp("");
  70. }
  71. };
  72. const setTitle = () => {
  73. const path = route.fullPath.split("/")[1];
  74. switch (path) {
  75. case "deviceList":
  76. title.value = "设备列表";
  77. break;
  78. case "planprocess":
  79. title.value = "生产计划";
  80. break;
  81. case "outsource":
  82. title.value = "质量管理";
  83. break;
  84. case "quality":
  85. title.value = "质量管理";
  86. break;
  87. case "base":
  88. title.value = "工序管理";
  89. break;
  90. }
  91. };
  92. onMounted(() => {
  93. setTitle();
  94. });
  95. </script>
  96. <style lang="scss" scoped>
  97. .has-logo {
  98. .el-scrollbar {
  99. height: calc(100vh - $navbar-height);
  100. }
  101. }
  102. .name {
  103. font-size: 20px;
  104. color: white;
  105. }
  106. .viewTitle {
  107. font-size: 30px;
  108. color: white;
  109. }
  110. </style>