فهرست منبع

1.1.2 优化菜单tab,增加OA审批固定菜单

liuyanpeng 14 ساعت پیش
والد
کامیت
7fcbb1d713
3فایلهای تغییر یافته به همراه35 افزوده شده و 3 حذف شده
  1. 1 1
      package.json
  2. 27 2
      src/client/MenuWidget.vue
  3. 7 0
      src/client/WorkTab.vue

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v5",
   "description": "Leanwo Prodog Client",
-  "version": "1.1.1",
+  "version": "1.1.2",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "ins": "npm install --registry https://npm.leanwo.com",

+ 27 - 2
src/client/MenuWidget.vue

@@ -18,6 +18,12 @@
         </template>
         <span>首页</span>
       </a-menu-item>
+      <a-menu-item key="approval" style="padding-left: 20px !important;" @click="goApproval">
+        <template #icon>
+          <AuditOutlined />
+        </template>
+        <span>OA审批</span>
+      </a-menu-item>
 
       <template v-for="rootNode in filteredMenu" :key="rootNode.key">
         <a-sub-menu :title="Language.getMenuNameTrl($i18n.locale, rootNode)">
@@ -34,14 +40,15 @@
 </template>
 
 <script setup>
-import { ref, computed, watch, onMounted, defineProps } from 'vue';
-import { HomeOutlined } from '@ant-design/icons-vue';
+import { ref, computed, watch, onMounted, nextTick, defineProps } from 'vue';
+import { HomeOutlined, AuditOutlined } from '@ant-design/icons-vue';
 import Common from '../common/Common.js';
 import Language from '../common/Language.js';
 import MenuNode from './MenuNode.vue';
 import { useRoleStateSingleton } from './RoleState.js';
 import { Uuid } from 'pc-component-v3';
 import { useRouter } from 'vue-router';
+import { menuClickedEvent } from '../common/eventBus.js';
 
 const props = defineProps({
   width: {
@@ -191,6 +198,24 @@ const goHome = () => {
   router.push('/desktop/dashboard');
 };
 
+// 跳转OA审批
+const goApproval = () => {
+  const menuInfo = {
+    title: 'OA审批',
+    menuNodeType: 'STATIC',
+    no: 'approval',
+  };
+  router.push('/desktop/formCenter');
+  nextTick(() => {
+    setTimeout(() => {
+      menuClickedEvent.value = {
+        path: router.currentRoute.value.fullPath,
+        menuInfo,
+      };
+    }, 50);
+  });
+};
+
 // 监听角色状态变化
 watch(() => roleStateInstance.value.userRoleOrTemplate, (newVal, oldVal) => {
   if(newVal || newVal === null) loadMenuData();

+ 7 - 0
src/client/WorkTab.vue

@@ -41,6 +41,11 @@ const activeKey = ref('/desktop/dashboard');
 // 菜单节点映射表 - 存储路径与菜单节点的对应关系
 const pathMenuMap = ref({});
 
+// 固定菜单路由标题(非动态菜单项)
+const STATIC_ROUTE_TITLES = {
+  '/desktop/formCenter': 'OA审批',
+};
+
 // 获取不含 query 的路径,用于标题解析等
 const getPathname = fullPath => fullPath.split('?')[0];
 
@@ -219,6 +224,8 @@ const getMenuTitle = async fullPath => {
       // 这里可以添加获取Info窗口标题的逻辑
       return `信息窗口-${infoWindowNo}`;
     }
+  } else if (STATIC_ROUTE_TITLES[path]) {
+    return STATIC_ROUTE_TITLES[path];
   }
 
   return '';