Sfoglia il codice sorgente

Merge branch 'flow' of ruiqigogs/yf-portal-vue into master

yanghao 5 giorni fa
parent
commit
443fd92c51
1 ha cambiato i file con 35 aggiunte e 15 eliminazioni
  1. 35 15
      src/views/flow/index.vue

+ 35 - 15
src/views/flow/index.vue

@@ -537,11 +537,11 @@ const go = async (item) => {
 
         if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
           // 钉钉环境
-          const loading = ElLoading.service({
-            lock: true,
-            text: "正在跳转,请稍候...",
-            background: "rgba(0, 0, 0, 0.7)",
-          });
+          // const loading = ElLoading.service({
+          //   lock: true,
+          //   text: "正在跳转,请稍候...",
+          //   background: "rgba(0, 0, 0, 0.7)",
+          // });
 
           // const targetUrl1 = item.indexUrl + "?ssoToken=" + res + "#/main";
           // const targetUrl2 = item.flowUrl;
@@ -567,17 +567,37 @@ const go = async (item) => {
           //     ElMessage.error("打开链接失败,请重试");
           //   },
           // });
+          if (window.dd) {
+            const targetUrl1 =
+              "https://yfding.keruioil.com/spa/workflow/static4mobileform/index.html?_random=1778205102430#/req?iscreate=1&workflowid=681&isagent=0&f_weaver_belongto_userid=&beagenter=0&f_weaver_belongto_usertype=0";
+            dd.biz.util.openLink({
+              url: targetUrl1,
+              onSuccess: () => {},
+              onFail: (err) => {
+                // loading.close();
+                ElMessage.error("打开链接失败,请重试");
+              },
+            });
+          } else if (window.DingTalkPC) {
+            const loading = ElLoading.service({
+              lock: true,
+              text: "正在跳转,请稍候...",
+              background: "rgba(0, 0, 0, 0.7)",
+            });
+
+            const newTab = window.open("", "_blank");
+            newTab.location.href =
+              item.indexUrl + "?ssoToken=" + res + "#/main";
 
-          const targetUrl1 =
-            "https://yfding.keruioil.com/spa/workflow/static4mobileform/index.html?_random=1778205102430#/req?iscreate=1&workflowid=681&isagent=0&f_weaver_belongto_userid=&beagenter=0&f_weaver_belongto_usertype=0";
-          dd.biz.util.openLink({
-            url: targetUrl1,
-            onSuccess: () => {},
-            onFail: (err) => {
-              loading.close();
-              ElMessage.error("打开链接失败,请重试");
-            },
-          });
+            setTimeout(() => {
+              newTab.location.href = item.flowUrl;
+              setTimeout(() => {
+                loading.close();
+              }, 500);
+            }, 100);
+          } else {
+            console.log("❌ 非钉钉环境");
+          }
         } else {
           // 浏览器环境
           const loading = ElLoading.service({