Parcourir la source

1、解决菜单栏点击流程无法打开流程实例页面问题

fuwb il y a 3 mois
Parent
commit
62088e75bb

+ 8 - 0
client/src/router/modules/remaining.ts

@@ -100,6 +100,14 @@ const remainingRouter: AppRouteRecordRaw[] = [
         meta: {
           title: ''
         }
+      },
+      {
+        path: 'supplier',
+        component: () => import('@/views/OaSystem/searchCenter/supplier/index.vue'),
+        name: 'supplier',
+        meta: {
+          title: '供应商管理'
+        }
       }
     ]
   },

+ 28 - 14
client/src/views/OaSystem/oaLayout/menusActive.vue

@@ -19,13 +19,19 @@
 <script setup lang="ts">
 import { useRouter } from 'vue-router'
 import { generateUUID } from '@/utils'
+import { getFlowTemplateTree, addTProcessEngine } from '@/api/oa/workflow'
+import { openFlow } from '@/utils/flow'
 const { push } = useRouter()
 const props: any = defineProps({
   menuData: {
     type: Object
   }
 })
-
+const router = useRouter()
+/**
+ * 初始化新建流程中流程模板Tree
+ */
+const flowTemplateTree = ref<any>()
 const menuList = ref(props.menuData.children)
 const pushName = ref(props.menuData.path)
 // 获取assets静态资源
@@ -33,26 +39,24 @@ const getAssetsFile = (url: string) => {
   return new URL(`../../../assets/imgs/menus/${url}`, import.meta.url).href
 }
 const menuClick = (item: any) => {
+  const name = item['name']
+  let id = ''
   const path = item['path']
   if (
     path &&
     (path.toLocaleLowerCase().startsWith('http') || path.toLocaleLowerCase().startsWith('https'))
   ) {
-    push({
-      // path: item['componentName'],
-      // query: {
-      //   iframe: '1',
-      //   url: path,
-      //   iFrameId: `${item['componentName']}_001`
-      // }
-      path: '/processContainer',
-      query: {
-        iFrameId: generateUUID(),
-        url: path,
-        title: item['name'],
-        iframe: '1'
+    // 遍历查询对应名称的流程模板ID
+    flowTemplateTree.value.forEach((element: any) => {
+      if (element.name === name) {
+        id = element.id
       }
     })
+    // 根据流程模板ID添加流程实例
+    addTProcessEngine(id).then((result: any) => {
+      // 跳转到流程实例具体页面
+      openFlow(router, result, name)
+    })
     return
   }
   push('/OaSystem/' + pushName.value + '/' + item.path)
@@ -66,9 +70,19 @@ const initAbsolute = () => {
     active.style.top = -(activeAll.bottom - docHeight + 15) + 'px'
   }
 }
+
+// 获取流程模板列表
+const initFlowTemplateTree = () => {
+  getFlowTemplateTree().then((result) => {
+    const tree = result.data[0]['children']
+    flowTemplateTree.value = tree[0].children
+  })
+}
+
 /** 初始化 **/
 onMounted(() => {
   initAbsolute()
+  initFlowTemplateTree()
 })
 </script>
 <style lang="scss" scoped>

+ 2 - 2
client/src/views/system/user/index.vue

@@ -114,7 +114,7 @@
       <ContentWrap>
         <el-table v-loading="loading" :data="list" :height="calculateTableHeight(400)">
           <el-table-column
-            label="工号"
+            label="用户名"
             align="center"
             prop="username"
             width="100"
@@ -134,7 +134,7 @@
             prop="dept.name"
             :show-overflow-tooltip="true"
           />
-          <el-table-column label="手机号码" align="center" prop="mobile" width="150" />
+          <el-table-column label="浙政钉ID" align="center" prop="mobile" width="150" />
           <el-table-column label="状态" key="status" width="80">
             <template #default="scope">
               <el-switch