wenhongquanjs 6 лет назад
Родитель
Сommit
470dbd043c

+ 5 - 4
VisualInspection/fwq/js/task/check.js

@@ -41,10 +41,11 @@ function initCheck() {
     $("#score_datatable").css("height", ($("#video_content").height() - 120) + "px");
     //设置视屏位置
     if (ISCLIENT) {
-        event = document.createEvent('MessageEvent');
-        var origin = window.location.protocol + '//' + window.location.host;
-        event.initMessageEvent('setvideoposition', true, true, getVideoPosition(null), origin, 1234, window, null);
-        document.dispatchEvent(event);
+        callFunc("setvideoposition",getVideoPosition(null));
+        // event = document.createEvent('MessageEvent');
+        // var origin = window.location.protocol + '//' + window.location.host;
+        // event.initMessageEvent('setvideoposition', true, true, getVideoPosition(null), origin, 1234, window, null);
+        // document.dispatchEvent(event);
     }
 
 

+ 5 - 4
VisualInspection/js/main.js

@@ -460,10 +460,11 @@ function changePage(url, tableObj) {
         }
         isnew = true;
         if (ISCLIENT) {
-            event = document.createEvent('MessageEvent');
-            var origin = window.location.protocol + '//' + window.location.host;
-            event.initMessageEvent('changepage', true, true, CURRENT_PAGE_URL, origin, 1234, window, null);
-            document.dispatchEvent(event);
+            callFunc("changepage",CURRENT_PAGE_URL)
+            // event = document.createEvent('MessageEvent');
+            // var origin = window.location.protocol + '//' + window.location.host;
+            // event.initMessageEvent('changepage', true, true, CURRENT_PAGE_URL, origin, 1234, window, null);
+            // document.dispatchEvent(event);
         }
     }
 }

+ 6 - 5
VisualInspection/js/mytask/check.js

@@ -95,11 +95,12 @@ function initCheck() {
             curVideo = videos[0];
             queryVideoList();
            // if (ISCLIENT) {
-                debugger;
-                event = document.createEvent('MessageEvent');
-                var origin = window.location.protocol + '//' + window.location.host;
-                event.initMessageEvent('setvideoposition', true, true, getVideoPosition(null), origin, 1234, window, null);
-                document.dispatchEvent(event);
+               callFunc("setvideoposition", getVideoPosition(null))
+                // debugger;
+                // event = document.createEvent('MessageEvent');
+                // var origin = window.location.protocol + '//' + window.location.host;
+                // event.initMessageEvent('setvideoposition', true, true, getVideoPosition(null), origin, 1234, window, null);
+                // document.dispatchEvent(event);
            // }
         } else {
             callFunc("showvideoview", "false");

+ 5 - 4
VisualInspection/js/new.js

@@ -256,10 +256,11 @@ function changePage(url, tableObj) {
         }
         isnew = true;
         if (ISCLIENT) {
-            event = document.createEvent('MessageEvent');
-            var origin = window.location.protocol + '//' + window.location.host;
-            event.initMessageEvent('changepage', true, true, CURRENT_PAGE_URL, origin, 1234, window, null);
-            document.dispatchEvent(event);
+            callFunc("changepage",CURRENT_PAGE_URL)
+            // event = document.createEvent('MessageEvent');
+            // var origin = window.location.protocol + '//' + window.location.host;
+            // event.initMessageEvent('changepage', true, true, CURRENT_PAGE_URL, origin, 1234, window, null);
+            // document.dispatchEvent(event);
         }
     }
 }

+ 8 - 4
VisualInspection/js/util/video.js

@@ -249,10 +249,14 @@ function setVideoProcess(value) {
 }
 
 function callFunc(func, param) {
-    var event = document.createEvent('MessageEvent');
-    var origin = window.location.protocol + '//' + window.location.host;
-    event.initMessageEvent(func, true, true, param, origin, 1234, window, null);
-    document.dispatchEvent(event);
+    if("undefined" != typeof jsObj){
+		eval("jsObj."+func+"('"+param+"')");
+	}else{
+      var event = document.createEvent('MessageEvent');
+      var origin = window.location.protocol + '//' + window.location.host;
+      event.initMessageEvent(func, true, true, param, origin, 1234, window, null);
+      document.dispatchEvent(event);
+    }
 }
 
 function playNext(index) {