Michael Wang 3 жил өмнө
parent
commit
22eaf3d0b7

+ 13 - 9
src/components/Layout.vue

@@ -2,29 +2,29 @@
   <div class="tw-h-screen tw-flex">
     <div class="tw-bg-white">
       <div class="tw-text-center tw-py-10">qm logo</div>
-      <a-menu style="width: 240px" mode="inline">
+      <a-menu style="width: 240px" mode="inline" :open-keys="['sub1', 'sub2']">
         <a-sub-menu key="sub1">
           <template #icon> icon </template>
           <template #title>基础管理</template>
-          <a-menu-item key="1">
+          <a-menu-item key="11">
             <router-link active-class="active-route" to="/rootOrg">
               顶级机构管理
             </router-link>
           </a-menu-item>
-          <a-menu-item key="2">
+          <a-menu-item key="12">
             <router-link active-class="active-route" to="/subOrg">
               机构管理
             </router-link>
           </a-menu-item>
-          <a-menu-item key="3">角色管理</a-menu-item>
-          <a-menu-item key="4">用户管理</a-menu-item>
-          <a-menu-item key="5">科目管理</a-menu-item>
+          <a-menu-item key="13">角色管理</a-menu-item>
+          <a-menu-item key="14">用户管理</a-menu-item>
+          <a-menu-item key="15">科目管理</a-menu-item>
         </a-sub-menu>
         <a-sub-menu key="sub2">
           <template #icon> icon </template>
           <template #title>项目管理</template>
-          <a-menu-item key="1">项目列表</a-menu-item>
-          <a-menu-item key="2">关联分析</a-menu-item>
+          <a-menu-item key="21">项目列表</a-menu-item>
+          <a-menu-item key="22">关联分析</a-menu-item>
         </a-sub-menu>
       </a-menu>
     </div>
@@ -33,7 +33,11 @@
         class="tw-bg-white tw-flex tw-justify-between"
         style="border-left: 1px solid var(--app-main-bg-color)"
       >
-        <div>当前所在位置:<span class="location-teleport"></span></div>
+        <div>
+          当前所在位置:<span class="location-teleport">{{
+            store.currentLocation
+          }}</span>
+        </div>
         <div class="tw-flex tw-cursor-pointer">
           <div>{{ store.userInfo.displayName }}</div>
 

+ 4 - 0
src/features/rootOrg/RootOrg.vue

@@ -45,8 +45,12 @@
 
 <script setup lang="ts">
 import { getRootOrgList } from "@/api/rootOrgPage";
+import { useMainStore } from "@/store";
 import { ref, onMounted } from "vue";
 
+const store = useMainStore();
+store.currentLocation = "基础管理 / 顶级机构管理";
+
 let code = $ref("");
 let name = $ref("");
 let enable = $ref(undefined as undefined | string);

+ 1 - 0
src/features/subOrg/SubOrg.vue

@@ -61,6 +61,7 @@ import { useMainStore } from "@/store";
 import { watch, onMounted } from "vue";
 
 const store = useMainStore();
+store.currentLocation = "基础管理 / 机构管理";
 
 let rootOrgId = $ref(null);
 let code = $ref("");

+ 1 - 0
src/store/index.ts

@@ -18,6 +18,7 @@ export const useMainStore = defineStore("main", {
         token: "",
         roleList: [] as Role[],
       },
+      currentLocation: "",
     };
   },
   getters: {},