소스 검색

站内信消息通知

lipenghui 2 달 전
부모
커밋
7937d0e0b3
4개의 변경된 파일92개의 추가작업 그리고 1개의 파일을 삭제
  1. BIN
      public/images/logo.png
  2. 2 1
      src/permission.ts
  3. 7 0
      src/router/modules/remaining.ts
  4. 83 0
      src/views/pms/dingding.vue

BIN
public/images/logo.png


+ 2 - 1
src/permission.ts

@@ -56,7 +56,8 @@ const whiteList = [
   '/auth-redirect',
   '/bind',
   '/register',
-  '/oauthLogin/gitee'
+  '/oauthLogin/gitee',
+  '/dingding'
 ]
 
 // 路由加载前

+ 7 - 0
src/router/modules/remaining.ts

@@ -70,6 +70,13 @@ const remainingRouter: AppRouteRecordRaw[] = [
       }
     ]
   },
+  {
+    path: '/dingding',
+    component: () => import('@/views/pms/dingding.vue'),
+    meta:{
+      hidden: true,
+    }
+  },
   {
     path: '/deviceattrstemplate',
     component: Layout,

+ 83 - 0
src/views/pms/dingding.vue

@@ -0,0 +1,83 @@
+
+<script setup lang="ts">
+import { onMounted } from 'vue'
+import { useRouter, useRoute } from 'vue-router'
+
+const { push } = useRouter()
+const route = useRoute()
+
+// 设备检测
+const isMobileDevice = (): boolean => {
+  // const ua = navigator.userAgent.toLowerCase()
+  // return /mobile|android|iphone|ipad/i.test(ua) &&
+  //   !/(windows|macintosh|linux)/i.test
+  const userAgentInfo = navigator.userAgent;
+  alert(userAgentInfo)
+  const mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
+
+  const mobileFlag = mobileAgents.some((mobileAgent) => {
+    return userAgentInfo.indexOf(mobileAgent) > 0;
+  });
+
+  return mobileFlag;
+}
+
+// 业务路由映射
+const businessRoutes: Record<string, string> = {
+  'generateInspect': 'InspectOrderWrite',
+  'failureReport': 'BpmProcessInstanceDetail',
+  'maintainOut': 'BpmProcessInstanceDetail',
+  'generateOperation' :'',
+  'generateMaintenance' : ''
+}
+
+onMounted(() => {
+  const { type = '', id = '' } = route.query
+  const isValidType = Object.keys(businessRoutes).includes(type as string)
+
+  if (isMobileDevice()) {
+    // 移动端跳转deepoil协议
+    alert("app")
+    window.location.href = `deepoil://${type}/${id}`
+  } else if (isValidType) {
+    // PC端路由跳转
+    alert('pc')
+    if (type === 'generateInspect') {
+      push({ name:'InspectOrderWrite', params:{id} })
+    }else if(type === 'failureReport') {
+      push({
+        name: 'BpmProcessInstanceDetail',
+        query: {
+          id: id
+        }
+      })
+    } else if (type === 'generateMaintain') {
+      push({ name: 'MaintainEdit', params: {id } })
+    } else if (type === 'maintainOut') {
+      push({
+        name: 'BpmProcessInstanceDetail',
+        query: {
+          id: id
+        }
+      })
+    }
+  } else {
+    // 默认跳转
+    alert('login')
+    push({ name:'Login' })
+  }
+})
+</script>
+
+<template>
+  <div class="loading">跳转处理中...</div>
+</template>
+
+<style scoped>
+.loading {
+  text-align: center;
+  padding-top: 100px;
+  font-size: 16px;
+  color: #666;
+}
+</style>