Преглед изворни кода

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

yanghao пре 2 недеља
родитељ
комит
393ccb5ce6
1 измењених фајлова са 62 додато и 15 уклоњено
  1. 62 15
      src/views/index.vue

+ 62 - 15
src/views/index.vue

@@ -316,6 +316,30 @@
       </section>
       </section>
     </main>
     </main>
 
 
+    <el-dialog v-model="dialogVisible" title="提示" width="500">
+      <template #header="{ close, titleId, titleClass }">
+        <div class="my-header">
+          <h4 :id="titleId" class="flex gap-2 items-center">
+            <Icon
+              :icon="'si:warning-line'"
+              color="#ef6c1a"
+              size="16"
+              class="text-[20px]"
+            /><span class="text-black">提示</span>
+          </h4>
+        </div>
+      </template>
+      <span class="text-black">SRM系统尚未正式上线使用</span>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="dialogVisible = false">取消</el-button>
+          <el-button type="primary" color="#063e8d" @click="confirmSrm">
+            继续访问
+          </el-button>
+        </div>
+      </template>
+    </el-dialog>
+
     <Footer />
     <Footer />
   </div>
   </div>
 </template>
 </template>
@@ -329,7 +353,7 @@ import Footer from "@components/home/Footer.vue";
 import { useRouter } from "vue-router";
 import { useRouter } from "vue-router";
 import axios from "axios";
 import axios from "axios";
 import { Icon } from "@iconify/vue";
 import { Icon } from "@iconify/vue";
-import { ElLoading } from "element-plus";
+import { ElLoading, ElMessageBox } from "element-plus";
 import {
 import {
   getMCSsoToken,
   getMCSsoToken,
   ssoLogin,
   ssoLogin,
@@ -591,6 +615,24 @@ const protectedOpen = (url: string) => {
   }
   }
 };
 };
 
 
+let dialogVisible = ref(false);
+const confirmSrm = async () => {
+  dialogVisible.value = false;
+  if (userStore.getUser.username && getAccessToken()) {
+    const res = await srmLogin({
+      username: userStore.getUser.username,
+    });
+
+    if (res) {
+      window.open(
+        `https://srmqas.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
+        "_blank",
+      );
+    }
+  } else {
+    router.push({ path: "/login" });
+  }
+};
 const handlePortalAppClick = async (app: PortalApp) => {
 const handlePortalAppClick = async (app: PortalApp) => {
   if (!app.label) return;
   if (!app.label) return;
 
 
@@ -685,20 +727,25 @@ const handlePortalAppClick = async (app: PortalApp) => {
   }
   }
 
 
   if (app.label === "供应商管理(SRM)") {
   if (app.label === "供应商管理(SRM)") {
-    if (userStore.getUser.username && getAccessToken()) {
-      const res = await srmLogin({
-        username: userStore.getUser.username,
-      });
-
-      if (res) {
-        window.open(
-          `https://srmqas.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
-          "_blank",
-        );
-      }
-    } else {
-      router.push({ path: "/login" });
-    }
+    // ElMessageBox.confirm("即将跳转到供应商管理系统,是否继续?", "提示", {
+    //   confirmButtonText: "继续",
+    //   cancelButtonText: "取消",
+    // }).then(async () => {});
+    dialogVisible.value = true;
+    // if (userStore.getUser.username && getAccessToken()) {
+    //   const res = await srmLogin({
+    //     username: userStore.getUser.username,
+    //   });
+
+    //   if (res) {
+    //     window.open(
+    //       `https://srmqas.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
+    //       "_blank",
+    //     );
+    //   }
+    // } else {
+    //   router.push({ path: "/login" });
+    // }
   }
   }
 
 
   if (app.label === "智能钻井") {
   if (app.label === "智能钻井") {