温红权 8 лет назад
Родитель
Сommit
91b27ef395

+ 17 - 19
VisualInspection/js/config.js

@@ -7,32 +7,30 @@ var base_server_url = getserveraddr();
 var base_image_server_url = getImageaddr();
 
 
-function getCurrentaddr(){
-    return "http://"+window.location.host+"/"
+function getCurrentaddr() {
+    return "http://" + window.location.host + "/"
 }
-function getserveraddr(){
-    if(base_ui_url.indexOf("jsjtyxt.com")!=-1){
+
+function getserveraddr() {
+    if (base_ui_url.indexOf("jsjtyxt.com") != -1) {
         return "http://server_yanhai.jsxt.jsjtyxt.com/";
-    }
-    else if(base_ui_url.indexOf("localhost")!=-1){
-        // return "http://server_release_yanhai.jsxt.jsjtyxt.com/"
-         return "http://localhost:8089/"
-    }
-    else if(base_ui_url.indexOf("192.168.8.236")!=-1){
+    } else if (base_ui_url.indexOf("localhost") != -1) {
+        return "http://10.112.0.199:7001/"
+            //  return "http://localhost:8089/"
+    } else if (base_ui_url.indexOf("192.168.8.236") != -1) {
         return "http://192.168.8.236:8089/"
-    }
-    else{
+    } else {
         return "http://10.112.0.199:8089/"
     }
 }
-function getImageaddr(){
-    if(base_ui_url.indexOf("jsjtyxt.com")!=-1){
+
+function getImageaddr() {
+    if (base_ui_url.indexOf("jsjtyxt.com") != -1) {
         return "http://file_yanhai.jsxt.jsjtyxt.com/";
-    }
-    else if(base_ui_url.indexOf("localhost")!=-1){
-        return "http://file_yanhai.jsxt.jsjtyxt.com/"
-        // return "http://localhost:9080/"
-    }else{
+    } else if (base_ui_url.indexOf("localhost") != -1) {
+        return "http://10.112.0.199:7000/"
+            // return "http://localhost:9080/"
+    } else {
         return "http://10.112.0.199/"
     }
 }

+ 51 - 34
VisualInspection/js/mytask/check.js

@@ -125,7 +125,7 @@ function fullscreen() {
         '                                </div>' +
         '                                <div class="row" style="padding:0px 5px 0px 5px;text-align:center;margin:0px">' +
         '                                    <select class="form-control" id="full_video_list" style="width:200px;float:left;display:none;"></select>' +
-        '                                      <div class="col-md-4 hidden" style="padding-left:0">' +
+        '                                      <div class="col-md-4 " style="padding-left:0">' +
         '                                                                      <div class="input-group" style="padding-left:0">' +
         '                                                                          <input type="text" id="full_video_pos" style="height:42px" class="form-control" placeholder="时间偏移值">' +
         '                                                                         <span class="input-group-btn">' +
@@ -138,7 +138,7 @@ function fullscreen() {
         '                                        <button type="button" class="btn btn-info" onclick="doAction(\'stop\')"><i class="icon icon-pause icon-2x"></i></button>' +
         '                                        <button type="button" class="btn btn-info" onclick="doAction(\'fast\')"><i class="icon icon-forward icon-2x"></i><span id=\"full_fast_info\"></span></button>' +
         '                                        <button type="button" class="btn btn-info" onclick="doAction(\'slow\')"><span id=\"full_slow_info\"></span><i class="icon icon-backward icon-2x"></i></button>' +
-        '                                        <button type="button" class="btn btn-danger hidden" style="width:51px;height:42px" id="full_video_btn_start" onclick="doAction(\'video_start\')"><img style="width:30px" src="/images/movie.png"></img></i></button>' +
+        '                                        <button type="button" class="btn btn-danger " style="width:51px;height:42px" id="full_video_btn_start" onclick="doAction(\'video_start\')"><img style="width:30px" src="/images/movie.png"></img></i></button>' +
         '                                        <button type="button" class="btn btn-danger hidden" style="width:51px;height:42px" id="full_video_btn_stop" onclick="doAction(\'video_stop\')"><i class="icon icon-stop icon-2x"></i></button>' +
         '                                        <button type="button" class="btn btn-success" onclick="doAction(\'screenshot\')"><i class="icon icon-camera icon-2x"></i></button>' +
         '                                    </div>' +
@@ -185,33 +185,34 @@ function getUserCheckCount() {
         "id": $.checkTask.id,
         "checked_person": $.checkTask.checked_person
     };
-    post_common_service("/task/getUserCount/", param, function (userList) { 
-        if(userList){
+    post_common_service("/task/getUserCount/", param, function(userList) {
+        if (userList) {
             $("#checked_count").html(userList.length);
-        }else{
-           $("#checked_count").html(0); 
+        } else {
+            $("#checked_count").html(0);
         }
     });
 }
 
 function checkUserCount() {
     var param = {
-        "id":$.checkTask.id,
-        "checked_person":$.checkTask.checked_person,
-        "class_type":$.checkTask.class_type
+        "id": $.checkTask.id,
+        "checked_person": $.checkTask.checked_person,
+        "class_type": $.checkTask.class_type
     };
-    post_common_service("/task/getUserCount/", param, function(data){
-        if(data>=2){
+    post_common_service("/task/getUserCount/", param, function(data) {
+        if (data >= 2) {
             layer.msg("本周期稽查次数已满,不能再被稽查!", {
-                time: 2000//20s后自动关闭
+                time: 2000 //20s后自动关闭
             });
             return false;
         }
         return true;
     });
 }
-function showCheckDetailCount(){
-    
+
+function showCheckDetailCount() {
+
 }
 
 function initCheckAppealBtns() {
@@ -439,17 +440,33 @@ function genPicstr(imgSrc) {
     var src = imgSrc;
     if (!src.startWith("http"))
         src = base_image_server_url + src;
+
+    var ispic = true;
+    var videosrc = src;
+    if (src.indexOf('.avi') != -1) {
+        src = src.split('.avi')[0] + "_screen_0.png"
+        ispic = false;
+    }
+    if (src.indexOf('.mov') != -1) {
+        src = src.split('.mov')[0] + "_screen_0.png"
+        ispic = false;
+    }
+    if (src.indexOf('.mp4') != -1) {
+        src = src.split('.mp4')[0] + "_screen_0.png"
+        ispic = false;
+    }
+
     var pic = '<div class="img_item" style="width:100px;height:90px;float:left;">' +
         '<a href="javascript:void(0)" onclick="removeImg(this)" style="float:right;position:relative;z-index:100;"><span class="label label-danger"><i class="icon icon-remove-circle"></i> 删除</span></a>' +
-        '<a class="card lightbox-toggle" data-group="image-group-1" data-lightbox-group="example-3" href="' + src + '" style="position:absolute">' +
-        '<img class="pic-class img-thumbnail" path="' + imgSrc + '" style="width:100px;height:70px;" src="' + src + '" alt="">' +
+        (ispic ? '<a class="card lightbox-toggle" data-group="image-group-1" data-lightbox-group="example-3" href="' + src + '" style="position:absolute">' : '<a class="card" onclick="video_paly(\'' + videosrc + '\')" href="javascript:void(0)" style="position:absolute">') +
+        '<img class="pic-class img-thumbnail" path="' + imgSrc + '" style="width:100px;height:70px;" src="' + src + '" alt="">' + (ispic ? '' : '<i class="icon icon-play-circle" style=" font-size: 30px;position: absolute;top: 20px;left: 40px;color: white;"></i>') +
         '</a>' +
         '</div>';
     if (ISCLIENT) {
         pic = '<div class="img_item" style="width:100px;height:90px;float:left;">' +
             '<a href="javascript:void(0)" onclick="removeImg(this)" style="float:right;position:relative;z-index:100;"><span class="label label-danger"><i class="icon icon-remove-circle"></i> 删除</span></a>' +
-            '<a class="card" onclick="showClientImg(\'' + src + '\')" href="javascript:void(0)" style="position:absolute">' +
-            '<img class="pic-class img-thumbnail" path="' + imgSrc + '" style="width:100px;height:70px;" src="' + src + '" alt="">' +
+            '<a class="card" onclick="' + (ispic ? 'showClientImg(\'' + src + '\')' : '') + '" href="javascript:void(0)" style="position:absolute">' +
+            '<img class="pic-class img-thumbnail" path="' + imgSrc + '" style="width:100px;height:70px;" src="' + src + '" alt="">' + (ispic ? '' : '<i class="icon icon-play-circle" style=" font-size: 30px;position: absolute;top: 20px;left: 40px;color: white;"></i>') +
             '</a>' +
             '</div>';
     }
@@ -495,37 +512,37 @@ function showChangeUser() {
 }
 
 function changePerson(id) {
-    var flag=true;
+    var flag = true;
     var param = {
-        "id":$.checkTask.id,
-        "checked_person":id,
-        "class_type":$.checkTask.class_type
+        "id": $.checkTask.id,
+        "checked_person": id,
+        "class_type": $.checkTask.class_type
     };
-    post_common_service("/task/getUserCount/", param, function(data){
-        if(data && data.length>=2){
+    post_common_service("/task/getUserCount/", param, function(data) {
+        if (data && data.length >= 2) {
             layer.msg("本周期稽查次数已满,不能再被稽查!", {
-                time: 2000,//20s后自动关闭
-                offset:'r'
+                time: 2000, //20s后自动关闭
+                offset: 'r'
             });
-        }else{
+        } else {
             // $('#checked_person').html(id);
             var param1 = {
                 "id": $.checkTask.id,
                 "checked_person": id,
             }
-            post_common_service("task/update/", param1, function (task_data) {
+            post_common_service("task/update/", param1, function(task_data) {
                 //重置当前任务
                 $.checkTask = task_data;
                 //获取用户信息
-                get_common_service('user/getUserById/' + id, null, function (data) {
-                    changePersonContent(data);
-                })
-                //更新用户次数表
-                no_return_common_service('task/updateUserCount/', param, function (data) {
+                get_common_service('user/getUserById/' + id, null, function(data) {
+                        changePersonContent(data);
+                    })
+                    //更新用户次数表
+                no_return_common_service('task/updateUserCount/', param, function(data) {
                     // changePersonContent(data);
                 })
                 layer.close(changePersonLayer);
-            }, function (error) {
+            }, function(error) {
                 alert(error);
             });
         }

+ 17 - 16
VisualInspection/js/util/media.js

@@ -1,22 +1,23 @@
-function video_paly() {
-   var height = 264;
-   var width = 640;
+function video_paly(src) {
+    var height = 264;
+    var width = 640;
+
+    alert(src)
 
     __inline('/node_modules/video.js/dist/video.min.js');
-    var css = "<style lang='css/text'>"+ __inline('/node_modules/video.js/dist/video-js.min.css')+"  .video-js .vjs-fullscreen-control { display: none;} </style>";
+    var css = "<style lang='css/text'>" + __inline('/node_modules/video.js/dist/video-js.min.css') + "  .video-js .vjs-fullscreen-control { display: none;} </style>";
+
+    var list = src.split(".");
+    var videotype = "x-msvideo"
 
-        
-    var html =css+ '<video' +
+    var html = css + '<video' +
         '    id="my-player"' +
         '    class="video-js"' +
         '    controls' +
         '    preload="auto"' +
-        '    poster="//vjs.zencdn.net/v/oceans.png"' +
-        '    width="'+width+'" height="'+height+'"' +
+        '    width="' + width + '" height="' + height + '"' +
         '    data-setup=\'{}\'>' +
-        '  <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"></source>' +
-        '  <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"></source>' +
-        '  <source src="//vjs.zencdn.net/v/oceans.ogv" type="video/ogg"></source>' +
+        '  <source src="' + src + '" type="video/avi"></source>' +
         '  <p class="vjs-no-js">' +
         '    To view this video please enable JavaScript, and consider upgrading to a' +
         '    web browser that' +
@@ -27,7 +28,7 @@ function video_paly() {
         '</video>';
 
     layer.open({
-        area: [width+"px", height+"px"],
+        area: [width + "px", height + "px"],
         type: 1,
         title: false,
         closeBtn: 0,
@@ -37,8 +38,8 @@ function video_paly() {
 
     var player = videojs('my-player');
 
-    var options = { 
-         
+    var options = {
+
     };
 
     var player = videojs('my-player', options, function onPlayerReady() {
@@ -48,10 +49,10 @@ function video_paly() {
         this.play();
 
         // How about an event listener?
-        this.on('ended', function () {
+        this.on('ended', function() {
             videojs.log('Awww...over so soon?!');
         });
-       
+
     });
 
 }

+ 2 - 2
VisualInspection/view/mytask/check.html

@@ -55,7 +55,7 @@
                                     </div>
                                     <div class="row" style="padding:0px 5px 0px 5px;text-align:center;margin:0px">
                                         <select class="form-control" id="video_list" style="width:200px;float:left;display:none"></select>
-                                        <div class="col-md-4 hidden" style="padding-left:0">
+                                        <div class="col-md-4 " style="padding-left:0">
                                             <div class="input-group" style="padding-left:0">
                                                 <input type="text" id="video_pos" style="height:42px" class="form-control" placeholder="时间偏移值">
                                                 <span class="input-group-btn">
@@ -68,7 +68,7 @@
                                             <button type="button" class="btn btn-info" style="width:51px;height:42px" onclick="doAction('stop')"><i class="icon icon-pause icon-2x"></i></button>
                                             <button type="button" class="btn btn-info" style="width:51px;height:42px" onclick="doAction('fast')"><i class="icon icon-forward icon-2x"></i><span id="fast_info"></span></button>
                                             <button type="button" class="btn btn-info" style="width:51px;height:42px" onclick="doAction('slow')"><span id="slow_info"></span><i class="icon icon-backward icon-2x"></i></button>
-                                            <button type="button" class="btn btn-danger hidden" style="width:51px;height:42px" id="video_btn_start" onclick="doAction('video_start')"><img style="width:30px" src="/images/movie.png"></img></i></button>
+                                            <button type="button" class="btn btn-danger " style="width:51px;height:42px" id="video_btn_start" onclick="doAction('video_start')"><img style="width:30px" src="/images/movie.png"></img></i></button>
                                             <button type="button" class="btn btn-danger hidden" style="width:51px;height:42px" id="video_btn_stop" onclick="doAction('video_stop')"><i class="icon icon-stop icon-2x"></i></button>
                                             <button type="button" class="btn btn-success" style="width:51px;height:42px" onclick="doAction('screenshot')"><i class="icon icon-camera icon-2x"></i></button>
 

BIN
VisualInspection_server/.DS_Store