Sfoglia il codice sorgente

fix(@six/smart-pharmacy): 智慧药事系统第一版菜单栏修改

cmj 1 mese fa
parent
commit
c0b5af0649

+ 1 - 19
apps/smart-pharmacy/src/layouts/basic.vue

@@ -1,9 +1,7 @@
 <script lang="ts" setup>
 import type { NotificationItem } from '@vben/layouts';
-import type { MenuRecordRaw } from '@vben/types';
 
 import { computed, ref, watch } from 'vue';
-import { useRouter } from 'vue-router';
 
 import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
 import { useWatermark } from '@vben/hooks';
@@ -12,7 +10,6 @@ import { preferences } from '@vben/preferences';
 import { useAccessStore, useUserStore } from '@vben/stores';
 
 import LoginForm from '#/core/authentication/login.vue';
-import { $t } from '#/locales';
 import { useAuthStore } from '#/store';
 
 const notifications = ref<NotificationItem[]>([]);
@@ -20,7 +17,6 @@ const notifications = ref<NotificationItem[]>([]);
 const userStore = useUserStore();
 const authStore = useAuthStore();
 const accessStore = useAccessStore();
-const router = useRouter();
 const { destroyWatermark, updateWatermark } = useWatermark();
 
 computed(() => notifications.value.some((item) => !item.isRead));
@@ -40,20 +36,6 @@ async function handleLogout() {
   await authStore.logout(false);
 }
 
-function collectLeafMenus(menus: MenuRecordRaw[]): MenuRecordRaw[] {
-  return menus.flatMap((menu) =>
-    menu.children?.length ? collectLeafMenus(menu.children) : [menu],
-  );
-}
-
-const dropdownMenus = computed(() =>
-  collectLeafMenus(accessStore.accessMenus).map((menu) => ({
-    text: $t(menu.name),
-    icon: menu.icon ?? 'mdi:circle-small',
-    handler: () => router.push(menu.path),
-  })),
-);
-
 watch(
   () => preferences.app.watermark,
   async (enable) => {
@@ -77,7 +59,7 @@ watch(
       <UserDropdown
         :avatar
         :text
-        :menus="dropdownMenus"
+        :menus="[]"
         :description="userStore.userInfo?.desc"
         @logout="handleLogout"
       />

+ 1 - 4
apps/smart-pharmacy/src/preferences.ts

@@ -12,13 +12,10 @@ export const overridesPreferences = defineOverridesPreferences({
   app: {
     name: import.meta.env.VITE_APP_TITLE,
     authPageLayout: 'panel-center',
-    layout: 'header-nav',
+    layout: 'sidebar-nav',
     enablePreferences: false,
     defaultHomePath: '/prescription/management',
   },
-  header: {
-    menuAlign: 'center',
-  },
   logo: {
     source: import.meta.env.VITE_APP_LOGO || '',
   },