Browse Source

提交一下

1
mo 4 years ago
parent
commit
459c82d3e4
2 changed files with 57 additions and 32 deletions
  1. 14 0
      src/layout/components/api.js
  2. 43 32
      src/layout/components/instructions.vue

+ 14 - 0
src/layout/components/api.js

@@ -0,0 +1,14 @@
+import request from '@/utils/request'
+import request2 from '@/utils/request2'
+import qs from 'qs'
+let api = '/api-web'
+
+
+export function operationLog (data) {
+  return request2({
+    url: api + `/operationLog/save`,
+    method: 'GET',
+    params: data,
+    data: {},
+  })
+}

+ 43 - 32
src/layout/components/instructions.vue

@@ -105,6 +105,7 @@
 import screenfull from "screenfull";
 import VueDragResize from "vue-drag-resize";
 import { instructionList } from "@/constant/instructionList";
+import { operationLog } from "./api"
 const defaultSettings = require("@/settings.js");
 
 export default {
@@ -132,6 +133,7 @@ export default {
   },
   mounted() {
     this.initSize();
+          this.setBtnStatus(this.$route)
     // document.onfullscreenchange = this.resizeI;
   },
   beforeDestroy() {},
@@ -215,6 +217,44 @@ export default {
     showInstructions() {
       this.isShow = !this.isShow;
     },
+        setBtnStatus(to){
+          let str = ''
+      if (instructionList.hasOwnProperty(to.path)) {
+        this.isShowBtn = true;
+        // console.log(Object.prototype.toString.call(instructionList[to.path]),instructionList[to.path])
+        if (
+          Object.prototype.toString.call(instructionList[to.path]) ===
+          "[object Object]"
+        ) {
+          // 对象 肯定是详情页
+          if (!to.query.tabrouter) {
+           let some = Object.keys(instructionList[to.path])[0]
+            this.url = `/html/index.html#g=1&p=${
+              instructionList[to.path][some]
+            }`;
+            str =  instructionList[to.path][some]
+          } else {
+            if(instructionList[to.path][to.query.tabrouter]){
+               this.url = `/html/index.html#g=1&p=${
+              instructionList[to.path][to.query.tabrouter]
+            }`;
+            str = instructionList[to.path][to.query.tabrouter]
+            }else{
+              this.isShowBtn = false;
+            }
+
+          }
+        } else {
+          // 字符串
+          this.url = `/html/index.html#g=1&p=${instructionList[to.path]}`;
+          str = instructionList[to.path]
+        }
+
+      } else {
+        this.isShowBtn = false;
+      }
+      console.log(str)
+    },
     showFullPage() {},
     resetVideo() {},
   },
@@ -255,45 +295,16 @@ export default {
         this.y == 130
       );
     },
+
   },
   watch: {
     $route(to, from) {
       this.isShow = false;
-      console.log(to);
-
-      if (instructionList.hasOwnProperty(to.path)) {
-        this.isShowBtn = true;
-        console.log(Object.prototype.toString.call(instructionList[to.path]),instructionList[to.path])
-        if (
-          Object.prototype.toString.call(instructionList[to.path]) ===
-          "[object Object]"
-        ) {
-          // 对象 肯定是详情页
-          if (!to.query.tabrouter) {
-           let some = Object.keys(instructionList[to.path])[0]
-            this.url = `/html/index.html#g=1&p=${
-              instructionList[to.path][some]
-            }`;
-          } else {
-            if(instructionList[to.path][to.query.tabrouter]){
-               this.url = `/html/index.html#g=1&p=${
-              instructionList[to.path][to.query.tabrouter]
-            }`;
-            }else{
-              this.isShowBtn = false;
-            }
-
-          }
-        } else {
-          // 字符串
-          this.url = `/html/index.html#g=1&p=${instructionList[to.path]}`;
-        }
-      } else {
-        this.isShowBtn = false;
-      }
+      this.setBtnStatus(to)
     },
     isShow(val) {
       if (val) {
+
         this.$nextTick((res) => {
           let outFrame = this.$refs.iframe;
           let outFrameWindow = this.$refs.iframe.contentWindow;