소스 검색

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/pms/dingding.vue
zhangcl 2 달 전
부모
커밋
b18a87d96f

+ 3 - 1
src/api/login/index.ts

@@ -15,7 +15,9 @@ export interface SmsLoginVO {
 export const login = (data: UserLoginVO) => {
   return request.post({ url: '/system/auth/login', data })
 }
-
+export const simpleLogin = (id: any) => {
+  return request.post({ url: '/system/auth/simple/login/'+id })
+}
 // 注册
 export const register = (data: RegisterVO) => {
   return request.post({ url: '/system/auth/register', data })

+ 7 - 2
src/layout/components/Message/src/Message.vue

@@ -62,9 +62,14 @@ const routerDetail = (item) =>{
       params: { id }
     })
   }else if(item.businessType === 'generateOperation'){
+    const param = JSON.parse(item.templateParams)
+    const deptId = param.deptId
+    const orderStatus = param.orderStatus
+    const createTime = param.createTime
+    const userId = param.userId
     push({
-      name: 'IotOpeationFill',
-      params: { id }
+      name: 'FillOrderInfo',
+      params: { deptId,userId,createTime,id,orderStatus }
     })
   }
 }

+ 2 - 1
src/permission.ts

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

+ 3 - 3
src/views/Login/components/LoginForm.vue

@@ -259,9 +259,9 @@ const handleLogin = async (params: any) => {
     const loginDataLoginForm = { ...loginData.loginForm }
     loginDataLoginForm.captchaVerification = params.captchaVerification
     const res = await LoginApi.login(loginDataLoginForm)
-    if (!res) {
-      return
-    }
+    // if (!res) {
+    //   return
+    // }
     loading.value = ElLoading.service({
       lock: true,
       text: '正在加载系统中...',

+ 25 - 17
src/views/pms/dingding.vue

@@ -1,25 +1,23 @@
 
 <template>
   <div v-if="isMobileDevice&&!isDingTalk()" class="loading">跳转处理中...</div>
-  <a ref="myLink" :href="href" v-show="false">跳转app</a>
-  <div v-if="isMobileDevice()&&isDingTalk()" class="wxtip" id="JweixinTip">
-    <span class="wxtip-icon"></span>
-<!--    <p class="wxtip-txt">点击右上角<br/>选择在浏览器中打开</p>-->
-  </div>
+<!--  <a ref="myLink" :href="href" v-show="false">跳转app</a>-->
+<!--  <div v-if="isMobileDevice()&&isDingTalk()" class="wxtip" id="JweixinTip">-->
+<!--    <span class="wxtip-icon"></span>-->
+<!--  </div>-->
 </template>
 
 <script setup lang="ts">
 import { onMounted } from 'vue'
 import { useRouter, useRoute } from 'vue-router'
+import * as LoginApi from "@/api/login";
+import * as authUtil from "@/utils/auth";
 
 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;
   const mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod","OpenHarmony"];
 
@@ -52,10 +50,15 @@ const clickA = () =>{
   myLink.value.click();
 }
 
-onMounted(() => {
-  const { type = '', id = '' } = route.query
+onMounted(async () => {
+  const { type = '', id = '', userId='', deptId='',createTime='',orderStatus='' } = route.query
   const isValidType = Object.keys(businessRoutes).includes(type as string)
   if (isMobileDevice()) {
+    if (type==='generateOperation') {
+      window.location.href = 'https://iot.deepoil.cc/deepoil/#/?type=' + type+'&id='+id+'&userId='+userId+'&deptId='+deptId+'&createTime='+createTime+'&orderStatus='+orderStatus;
+    }else {
+      window.location.href = 'https://iot.deepoil.cc/deepoil/#/?type=' + type+'&id='+id+'&userId='+userId;
+    }
     // 移动端跳转deepoil协议
     // try{
     //   const typelower = type.toLowerCase();
@@ -63,11 +66,16 @@ onMounted(() => {
     // }catch (error) {
     //   alert(error.message)
     // }
-    href.value = 'deepoil://'+type+'/'+id
-    nextTick(()=>{
-      setTimeout(clickA,1000)
-    })
+    // href.value = 'deepoil://'+type+'/'+id
+    // nextTick(()=>{
+    //   setTimeout(clickA,1000)
+    // })
   } else if (isValidType) {
+    const res = await LoginApi.simpleLogin(userId)
+    if (!res) {
+      return
+    }
+    authUtil.setToken(res)
     // PC端路由跳转
     if (type === 'generateInspect') {
       push({ name:'InspectOrderWrite', params:{id} })
@@ -87,10 +95,10 @@ onMounted(() => {
           id: id
         }
       })
-    } else if (type === 'generateMaintenance') {
+    }else if(type === 'generateOperation'){
       push({
-        name: 'IotMainWorkOrderBom',
-        params: { id }
+        name: 'FillOrderInfo',
+        params: { deptId,userId,createTime,id,orderStatus }
       })
     }
   } else {

+ 1 - 0
src/views/pms/maintain/index.vue

@@ -151,6 +151,7 @@
           </el-table-column>
 <!--          <el-table-column label="故障编码" align="center" prop="failureCode" />-->
 <!--          <el-table-column label="故障名称" align="center" prop="failureName" />-->
+          <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" />
           <el-table-column :label="t('maintain.deviceName')" align="center" prop="deviceName" />
           <el-table-column :label="t('maintain.status')" align="center" prop="status" >
             <template #default="scope">