Browse Source

新增打开本地软件的按钮

李文 3 years ago
parent
commit
618ed3b292

File diff suppressed because it is too large
+ 1 - 0
public/libs/vrv-pcsdk.js


+ 24 - 0
src/assets/scss/smp.scss

@@ -2178,4 +2178,28 @@ $list: apiwg bzdlys bzdxsj bzqxyx bzslwp bzswmx bzyxsj clda czrz dawh dazdy dddl
   100%{
     opacity:0.5;
   }
+}
+
+// 打开桌面软件按钮
+.open-pcexe-btn{
+  position:fixed;
+  bottom:40px;
+  left:-20px;
+  width:40px;
+  height:40px;
+  background-color:$smp--color-blue;
+  border-radius: 50px;
+  box-shadow: $smp--box-shadow;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  cursor: pointer;
+  background-repeat: no-repeat;
+  background-position: center center;
+  transition: left 0.5s, background-color 1s, box-shadow 1s;
+  &:hover{
+    left:4px;
+    box-shadow: 0 0 5px 3px #53a9ff;
+    background-color: #05b8ff;
+  }
 }

+ 1 - 1
src/views/main/main-content.vue

@@ -1,6 +1,6 @@
 <template>
   <main class="smp-content" :class="{'isIframe':isIframe}">
-    <iframe :key="iframeIndex" v-if="isIframe" ref="myIframe" :src="iframeURL" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
+    <iframe :key="iframeIndex" v-if="isIframe" ref="myIframe" :src="iframeURL" width="100%" height="100%" frameborder="0" scrolling="yes" allowfullscreen="true"></iframe>
     <router-view v-else />
   </main>
 </template>

+ 4 - 1
src/views/main/main.vue

@@ -22,6 +22,7 @@
     </template>
     <noticePop ref="noticePop"></noticePop>
     <taskPop ref="taskPop"></taskPop>
+    <openPcexeBtn ref="openPcexeBtn"></openPcexeBtn>
   </div>
 </template>
 
@@ -33,6 +34,7 @@ import debounce from 'lodash/debounce'
 import ContentCrumb from './main-content-crumb'
 import noticePop from './notice-pop'
 import taskPop from './task-pop'
+import openPcexeBtn from './openPcexeBtn'
 import basicCom from '@/views/modules/demo/basicComponent/basic-com'
 import { clearLoginInfo } from '@/utils'
 import shuiyin from '@/utils/shuiyin'
@@ -72,7 +74,8 @@ export default {
     ContentCrumb,
     basicCom,
     noticePop,
-    taskPop
+    taskPop,
+    openPcexeBtn
   },
   watch: {
     $route: 'routeHandle'

+ 45 - 0
src/views/main/openPcexeBtn.vue

@@ -0,0 +1,45 @@
+<template>
+  <div class="open-pcexe-btn smp-ni-nav_fxyp_n" @click="gotoExe">
+  </div>
+</template>
+
+<script>
+import Cookies from 'js-cookie'
+export default {
+  components: {
+  },
+  props: {
+
+  },
+  watch: {
+
+  },
+  data () {
+    return {
+      vrv: ''
+    }
+  },
+  mounted () {
+    this.setJS()
+  },
+  methods: {
+    setJS () {
+      window.$('head').append("<script src='./libs/vrv-pcsdk.js'>")
+      this.vrv = window.vrv
+    },
+    gotoExe () {
+      this.vrv.pcsdk.startProcess({
+        ip: '10.110.35.108', // 服务器标识
+        token: Cookies.get('token') // 第三方登录token
+      }).then(res => {
+        console.log('res', res)
+      }).catch(error => {
+        console.log('error', error)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+</style>