yanghao hai 3 días
pai
achega
4b2bcb57ce

+ 0 - 4
src/components/home/CardItem.vue

@@ -337,10 +337,6 @@ const handleView = async (item: Item) => {
       router.push({ path: "/login" });
     }
   }
-
-  if (item.label === "人力资源(EHR)") {
-    router.push({ path: "/ehr" });
-  }
 };
 </script>
 

+ 10 - 2
src/components/home/header.vue

@@ -18,8 +18,12 @@
           <li><a class="hover:text-[#02409b] cursor-pointer">解决方案</a></li>
           <li><a class="hover:text-[#02409b] cursor-pointer">典型案例</a></li>
           <li><a class="hover:text-[#02409b] cursor-pointer">平台服务</a></li>
-          <li><a class="hover:text-[#02409b] cursor-pointer">应用市场</a></li>
-          <li><a class="hover:text-[#02409b] cursor-pointer">开源社区</a></li>
+
+          <li>
+            <a class="hover:text-[#02409b] cursor-pointer" @click="goFlow"
+              >流程门户</a
+            >
+          </li>
         </ul>
       </nav>
 
@@ -370,6 +374,10 @@ const login = () => {
   });
 };
 
+const goFlow = () => {
+  router.push({ path: "/flow" });
+};
+
 const onUserCommand = async (command: string) => {
   if (command === "logout") {
     // await userStore.loginOut();

+ 5 - 5
src/router/index.ts

@@ -5,7 +5,7 @@ import {
 } from "vue-router";
 
 import Home from "@/views/index.vue";
-import EHR from "@/views/ehr/index.vue";
+import Flow from "@/views/flow/index.vue";
 import Login from "@/views/login.vue";
 
 import { getAccessToken } from "@utils/auth";
@@ -31,11 +31,11 @@ const routes: RouteRecordRaw[] = [
   },
 
   {
-    path: "/ehr",
-    name: "EHR",
-    component: EHR,
+    path: "/flow",
+    name: "Flow",
+    component: Flow,
     meta: {
-      title: "DeepOil 智慧经营平台 | EHR",
+      title: "DeepOil 智慧经营平台 | 流程门户",
     },
   },
 ];

+ 23 - 2
src/views/ehr/index.vue → src/views/flow/index.vue

@@ -100,7 +100,11 @@ import Header from "@components/home/header.vue";
 import Footer from "@components/home/Footer.vue";
 import { computed, ref, onMounted } from "vue";
 import { Icon } from "@iconify/vue";
-import { getFlows } from "@/api/user";
+import { getFlows, ssoLogin } from "@/api/user";
+import { useUserStore } from "@/stores/useUserStore";
+import { getAccessToken } from "@/utils/auth";
+
+const userStore = useUserStore();
 
 const tabs = ref([]);
 
@@ -171,8 +175,25 @@ const getById = (tab) => {
   activeKey.value = tab.groupName;
 };
 
-const go = (item) => {
+const go = async (item) => {
   console.log("跳转", item);
+  if (userStore.getUser.username && getAccessToken()) {
+    const res = await ssoLogin({
+      username: userStore.getUser.username,
+    });
+
+    if (res) {
+      const newTab = window.open("", "_blank");
+
+      newTab.location.href = item.indexUrl + "?ssoToken=" + res + "#/main";
+
+      setTimeout(function () {
+        newTab.location.href = item.flowUrl;
+      }, 1000);
+    }
+  } else {
+    router.push({ path: "/login" });
+  }
 };
 
 onMounted(async () => {