index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <UiEditorLayout class="layout" :class="layoutClass">
  3. <UiEditorHead class="header">
  4. <!-- <div-->
  5. <!-- class="menu"-->
  6. <!-- :class="{ abs: isFull }"-->
  7. <!-- @click="customMap.sysView = isFull ? 'auto' : 'full'"-->
  8. <!-- >-->
  9. <!-- <ui-icon :type="isFull ? 'menu' : 'close'" ctrl />-->
  10. <!-- </div>-->
  11. <slot name="header" />
  12. </UiEditorHead>
  13. <slot/>
  14. <Menu
  15. :menu="menus"
  16. :active-key="activeMenuKey"
  17. @update:active-key="val => emit('update:activeMenuKey', val)"
  18. />
  19. </UiEditorLayout>
  20. </template>
  21. <script setup lang="ts">
  22. import UiEditorLayout from "@/components/base/editor/layout/index.vue";
  23. import UiEditorHead from "@/components/base/editor/layout/Head.vue";
  24. import UiIcon from "@/components/base/components/icon/index.vue";
  25. import Menu from '@/views/sys/menu'
  26. import {MenuAtom, MenuRaw} from "@/views/sys/menu/menu.js";
  27. import { customMap } from "@/hook/custom";
  28. import { computed, ref } from "vue";
  29. import "@/preset/pc.scss"
  30. import "@/preset/style.scss"
  31. const props = defineProps<{
  32. menus: MenuRaw,
  33. activeMenuKey: string,
  34. }>();
  35. const emit = defineEmits<{
  36. (e: 'update:activeMenuKey', t: MenuAtom['name']): void
  37. }>()
  38. const isFull = computed(() => customMap.sysView === 'full' )
  39. const layoutClass = computed(() => ({
  40. ["sys-view-full"]: isFull.value
  41. }))
  42. </script>
  43. <style scoped lang="scss">
  44. .layout {
  45. --header-top: 0px;
  46. &.sys-view-full {
  47. --header-top: calc(-1 * var(--editor-head-height));
  48. }
  49. }
  50. .header {
  51. color: rgba(var(--colors-primary-fill), 0.8);
  52. display: flex;
  53. align-items: center;
  54. justify-content: center;
  55. padding: 0 20px;
  56. transition: top 0.3s ease;
  57. top: var(--header-top);
  58. }
  59. .header .menu {
  60. transition: background 0.3s ease;
  61. position: absolute;
  62. left: 0;
  63. top: 0;
  64. margin: calc((var(--editor-head-height) - 42px) / 2)
  65. calc((var(--editor-menu-width) - 42px) / 2);
  66. width: 42px;
  67. height: 42px;
  68. display: flex;
  69. align-items: center;
  70. justify-content: center;
  71. cursor: pointer;
  72. .icon {
  73. font-size: 16px;
  74. }
  75. &.abs {
  76. top: 100%;
  77. left: 0;
  78. background: rgba(27, 27, 28, 0.8);
  79. border-radius: 4px;
  80. border: 1px solid #000000;
  81. backdrop-filter: blur(4px);
  82. .icon {
  83. font-size: 24px;
  84. }
  85. }
  86. }
  87. .main {
  88. flex: 1;
  89. text-align: center;
  90. font-size: var(--big-size);
  91. .title {
  92. font-size: 1em;
  93. font-weight: bold;
  94. display: inline-block;
  95. span {
  96. font-size: 12px;
  97. color: rgba(255, 255, 255, 0.5);
  98. }
  99. }
  100. }
  101. </style>