Просмотр исходного кода

Merge branch 'master' of http://git.xt.wenhq.top:8083/wenhongquan/VisualInspection

MSI\liwei 7 лет назад
Родитель
Сommit
ee524d999e

+ 2 - 3
VisualInspection/fwq/js/task/add.js

@@ -242,6 +242,7 @@ function inittAreaable(time, dept) {
             if (checkusersselect != null) {
                 reset();
             }
+
             checkusersselect = $('#check_users').comboTree({
                 source: checkuserlist,
                 isMultiple: true
@@ -264,10 +265,8 @@ function reset() {
     if (checkusersselect != null) {
         $("#check_users").val("");
         checkusersselect.destroy();
+        checkusersselect = null;
     }
-    $("#starttime").val("");
-    $("#endtime").val("");
-
 
 
 }

+ 8 - 8
VisualInspection/js/config.js

@@ -26,8 +26,8 @@ function getserveraddr() {
     } else if (base_ui_url.indexOf("192.168.8.236") != -1) {
         return "http://192.168.8.236:8089/"
     } else {
-        // return "http://10.112.0.199:8089/"
-        return "http://10.112.0.199:7001/"
+        return "http://10.112.0.199:8089/"
+            // return "http://10.112.0.199:7001/"
     }
 }
 
@@ -44,8 +44,8 @@ function getExcelServeraddr() {
     } else if (base_ui_url.indexOf("192.168.8.236") != -1) {
         return "http://192.168.8.236:9000/"
     } else {
-        // return "http://10.112.0.199:9000/"
-        return "http://10.112.0.199:7010/"
+        return "http://10.112.0.199:9000/"
+            // return "http://10.112.0.199:7010/"
     }
 }
 
@@ -62,8 +62,8 @@ function getQzdExcelServeraddr() {
     } else if (base_ui_url.indexOf("192.168.8.236") != -1) {
         return "http://192.168.8.236:9001/"
     } else {
-        // return "http://10.112.0.199:9001/"
-        return "http://10.112.0.199:7011/"
+        return "http://10.112.0.199:9001/"
+            // return "http://10.112.0.199:7011/"
     }
 }
 
@@ -81,8 +81,8 @@ function getImageaddr() {
     } else if (base_ui_url.indexOf("200.200.19.126") != -1) {
         return "http://200.200.19.126:8080/"
     } else {
-        // return "http://10.112.0.199/"
-        return "http://10.112.0.199:7000/"
+        return "http://10.112.0.199/"
+            // return "http://10.112.0.199:7000/"
     }
 }
 

+ 1 - 1
VisualInspection/js/lib/combotree/comboTreePlugin.js

@@ -419,4 +419,4 @@
             return ctArr;
     }
 
-})(jQuery, window, document);
+})(jQuery, window, document)

+ 28 - 14
VisualInspection/js/lib/mytable.js

@@ -23,13 +23,15 @@ String.prototype.replaceAll = function(s1, s2) {
             isShoWPager: true,
             pager: {
                 page_size: 10
-            }
+            },
+            renderfunction: function() {}
         };
         this.options = $.extend(true, {}, DEFAULTS, options);
         this.element = element;
         // this.options = options;
         this.pager = options.pager;
         this.con = $(element);
+        this.renderfunction = options.renderfunction;
         this.obj = this;
         $(element).html('');
         if (flag) return;
@@ -91,6 +93,7 @@ String.prototype.replaceAll = function(s1, s2) {
                 } else {
                     $("#kkpager").css("display", "block");
                 }
+                options.renderfunction();
             }, function(error) {
                 // alert(error);
             });
@@ -183,10 +186,12 @@ String.prototype.replaceAll = function(s1, s2) {
                             }
                         }
                         dArr.push(picStr);
-                    }else if (cols[i].type == "imagebutton") {
+                    } else if (cols[i].type == "imagebutton") {
                         var pics = obj[cols[i].field];
                         //pics ='chart/chart17,chart/chart17,chart/chart17,chart/chart17,chart/chart17';
                         var picStr = '';
+                        picStr = "<div style='padding-bottom:80px;position:relative'>";
+                        picStr += "<div style='border:1px solid #ddd;text-align:left'>";
                         var num = uuid();
                         if (pics) {
                             var picArr = pics.split(',');
@@ -199,6 +204,7 @@ String.prototype.replaceAll = function(s1, s2) {
                                 if (!src.startWith("http"))
                                     src = base_image_server_url + src;
 
+
                                 var videosrc = src;
                                 if (src.indexOf('.avi') != -1) {
                                     src = src.split('.avi')[0] + "_screen_0.png"
@@ -212,22 +218,30 @@ String.prototype.replaceAll = function(s1, s2) {
                                     src = src.split('.mp4')[0] + "_screen_0.png"
                                     ispic = false;
                                 }
-                                var pic = (ispic ? '<a class="card lightbox-toggle" onclick="img_play(\'' + src + '\')" href="javascript:void(0)" style="width:60px;height:50px;float:left;">' : '<a class="card" onclick="video_paly(\'' + videosrc + '\')" href="javascript:void(0)" style="width:60px;height:50px;">') +
-                                    '<img class="pic-class  img-thumbnail" style="width:60px;height:50px;" src="' + src + '" alt="">' + (ispic ? '' : '<i class="icon icon-play-circle" style=" font-size: 30px;position: absolute;top: 10px;left: 15px;color: white;"></i>') +
-                                    '</a>';
+                                // var pic = (ispic ? '<a class="card lightbox-toggle" onclick="img_play(\'' + src + '\')" href="javascript:void(0)" style="width:60px;height:50px;float:left;">' : '<a class="card" onclick="video_paly(\'' + videosrc + '\')" href="javascript:void(0)" style="width:60px;height:50px;">') +
+                                //     '<img class="pic-class  img-thumbnail" style="width:60px;height:50px;" src="' + src + '" alt="">' + (ispic ? '' : '<i class="icon icon-play-circle" style=" font-size: 30px;position: absolute;top: 10px;left: 15px;color: white;"></i>') +
+                                //     '</a>';
+
+                                var pic = '<div class="img_item" style="width:80px;height:45px;display:inline-block;margin-right:5px">' +
+                                    '<a href="javascript:void(0)" onclick="removeVideo(\'' + obj.id + '\',\'' + pics + '\',\'' + j + '\')" style="float:right;position:relative;z-index:100;font-size:10px"><span class="label label-danger" style="padding:0"><i class="icon icon-remove-circle"></i> 删除</span></a>' +
+                                    (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="' + videosrc + '" style="width:80px;height:45px;" src="' + src + '" alt="">' + (ispic ? '' : '<i class="icon icon-play-circle" style=" font-size: 20px;position: absolute;top: 15px;left: 30px;color: white;"></i>') +
+                                    '</a>' +
+                                    '</div>';
                                 picStr += pic;
                             }
                         }
+                        picStr += "</div>";
                         // picStr += '<a href="javascript:void(0)" class="btn-table" onclick=""><i class="icon ' +' text-center' + '"></i>' + "继续上传" + ' </a>';
                         //picStr +="<button onclick='openUpload()' style='width:80%;background-color:#2196F3;color:white'>继续上传</button>"
-                      //  picStr +="<input id='fileupload' type='file' style='display:none'></input>"
-                      picStr +='<div id="uploaderExample_'+obj.id+'" class="uploader">'
-                              +'<div class="file-list" data-drag-placeholder="请拖拽文件到此处" style=""></div>';
-                      picStr +='<button onclick="setRecordId(\''+obj.id+'\',\''+pics+'\')" type="button" class="btn btn-primary uploader-btn-browse" style="float:left;"><i class="icon icon-cloud-upload"></i> 选择文件</button>';
-                              +'</div>'; 
-                      dArr.push(picStr);
-                    }
-                     else if (cols[i].oper != null) {
+                        //  picStr +="<input id='fileupload' type='file' style='display:none'></input>"
+                        picStr += '<div style="position:absolute;bottom:10px;width:200px"><div id="uploaderExample_' + obj.id + '" class="uploader uploadervideo">' +
+                            '<div class="file-list" data-drag-placeholder="请拖拽文件到此处" style="margin-bottom:5px"></div>';
+                        picStr += '<button onclick="setRecordId(\'' + obj.id + '\',\'' + pics + '\')" type="button" class="btn btn-primary uploader-btn-browse" style="float:left;width:100%"><i class="icon icon-cloud-upload"></i> 选择文件</button>'; +
+                        '</div></div>';
+                        picStr += "</div>";
+                        dArr.push(picStr);
+                    } else if (cols[i].oper != null) {
                         var oper = cols[i].oper;
                         var operStr = "";
                         for (var j = 0; j < oper.length; j++) {
@@ -242,7 +256,7 @@ String.prototype.replaceAll = function(s1, s2) {
                                 dArr.push(timeStamp2String(obj[cols[i].field], cols[i].date_type));
                             }
 
-                        } else if (obj[cols[i].field] || obj[cols[i].field]==0) {
+                        } else if (obj[cols[i].field] || obj[cols[i].field] == 0) {
                             if (cols[i].custom) {
                                 dArr.push(obj[cols[i].field] + cols[i].custom);
                             } else {

+ 40 - 53
VisualInspection/qzd/js/task/add.js

@@ -64,13 +64,16 @@ var layindex = null;
 var taskMap = new HashMap();
 
 function inittAreaable(time, dept) {
+
+
+
     layindex = layer.load(0, { shade: false });
     var t = time.replace("/", "-") + "";
     var endtime = moment(t + "-25T23:00:00", "YYYY-MM-DD HH:mm:ss");
     var starttime = moment(moment(t + "-25T23:00:00", "YYYY-MM-DD HH:mm:ss").subtract(1, 'month'));
 
     var param1 = { "startTime": getMomentTimeFormat(starttime), "endTime": getMomentTimeFormat(endtime), "checked_dept": dept }
-    console.log(param1);
+
 
 
     //获取排班情况
@@ -126,54 +129,46 @@ function inittAreaable(time, dept) {
                 records: recodedata
             };
             reloadtableData();
-
-            if (tabledatagride != null) {
-                tabledatagride.dataSource.data = null;
-                tabledatagride.setDataSource(datac);
-                tabledatagride.setPager(1, datac.array.length, datac.array.length);
-                tabledatagride.render();
-            } else {
-
-                $(".completec").mouseover(function() {
-                    var titlehtml = "稽查完成";
-                    layer.tips(titlehtml, "#" + this.id, {
-                        tips: [1, '#8e8e8e'],
-                        time: 0,
-                        width: '240px'
-                    });
+            $(".completec").mouseover(function() {
+                var titlehtml = "稽查完成";
+                layer.tips(titlehtml, "#" + this.id, {
+                    tips: [1, '#8e8e8e'],
+                    time: 0,
+                    width: '240px'
                 });
-                $(".doingc").mouseover(function() {
-                    var titlehtml = "稽查中";
-                    layer.tips(titlehtml, "#" + this.id, {
-                        tips: [1, '#8e8e8e'],
-                        time: 0,
-                        width: '240px'
-                    });
+            });
+            $(".doingc").mouseover(function() {
+                var titlehtml = "稽查中";
+                layer.tips(titlehtml, "#" + this.id, {
+                    tips: [1, '#8e8e8e'],
+                    time: 0,
+                    width: '240px'
                 });
-                $(".unusec").mouseover(function() {
-                    var titlehtml = "无效";
-                    layer.tips(titlehtml, "#" + this.id, {
-                        tips: [1, '#8e8e8e'],
-                        time: 0,
-                        width: '240px'
-                    });
+            });
+            $(".unusec").mouseover(function() {
+                var titlehtml = "无效";
+                layer.tips(titlehtml, "#" + this.id, {
+                    tips: [1, '#8e8e8e'],
+                    time: 0,
+                    width: '240px'
                 });
-                $(".novideoc").mouseover(function() {
-                    var titlehtml = "未上传视屏";
-                    layer.tips(titlehtml, "#" + this.id, {
-                        tips: [1, '#8e8e8e'],
-                        time: 0,
-                        width: '240px'
-                    });
+            });
+            $(".novideoc").mouseover(function() {
+                var titlehtml = "未上传视屏";
+                layer.tips(titlehtml, "#" + this.id, {
+                    tips: [1, '#8e8e8e'],
+                    time: 0,
+                    width: '240px'
                 });
+            });
 
 
-                $(".btn,.btc").mouseout(function() {
-                    layer.close(layer.index);
-                });
+            $(".btn,.btc").mouseout(function() {
+                layer.close(layer.index);
+            });
+
+            $('#myTable05').fixedHeaderTable({ altClass: 'odd', footer: false, fixedColumns: 1 });
 
-                $('#myTable05').fixedHeaderTable({ altClass: 'odd', footer: false, fixedColumns: 1 });
-            }
 
             for (var index in checkuserlist) {
                 var p = checkuserlist[index];
@@ -182,6 +177,7 @@ function inittAreaable(time, dept) {
 
             if (checkusersselect != null) {
                 reset();
+                checkusersselect = null;
             }
             checkusersselect = $('#check_users').comboTree({
                 source: checkuserlist,
@@ -205,15 +201,9 @@ function reset() {
 
     if (checkusersselect != null) {
         $("#check_users").val("");
-        checkusersselect.unbind();
-        checkusersselect.closeDropDownMenu();
-        checkusersselect.bindings();
-        $(".ComboTreeItemChlid").find("input").prop('checked', false);
-
-
+        checkusersselect.destroy();
+        checkusersselect = null;
     }
-    $("#starttime").val("");
-    $("#endtime").val("");
 
 }
 
@@ -345,9 +335,6 @@ function addTask() {
     // }
     // console.log(param);
 
-
-
-    var check_user_list = checkusersselect.getSelectedItemsId();
     var plist = []
     tasklist.forEach(t => {
         plist.push(t.recordInfo);

+ 11 - 8
VisualInspection/qzd/js/task/check.js

@@ -32,10 +32,12 @@ function videorecordstart(type) {
         $("#video_btn_start").removeClass("hidden");
         endTimec = currentTime;
 
+        var idss = videoid.split("/");
+        var filename = idss[idss.length - 1];
         //开始截取视屏
         post_common_service_nohead(base_image_server_url + 'fileServer/file/videocut', {
-            "targetfilename": videoid,
-            "filename": videoid.split(".")[0],
+            "targetfilename": filename,
+            "filename": filename.split(".")[0],
             "startTime": startTimec,
             "endtime": endTimec
         }, function(data) {
@@ -43,11 +45,12 @@ function videorecordstart(type) {
         });
     }
     if (type == "screenshot") {
-
+        var idss = videoid.split("/");
+        var filename = idss[idss.length - 1];
         //开始截取视屏
         post_common_service_nohead(base_image_server_url + 'fileServer/file/videopiccut', {
-            "targetfilename": videoid,
-            "filename": videoid.split(".")[0],
+            "targetfilename": filename,
+            "filename": filename.split(".")[0],
             "startTime": currentTime,
         }, function(data) {
             addPic(data.path)
@@ -117,14 +120,14 @@ function initCheck() {
             $("#videoslist").html(htmlo);
         }
 
-        videoid = videos.split(",")[0]
+        videoid = videos.split(",")[0];
 
         var videoObject = {
             container: '.video', //“#”代表容器的ID,“.”或“”代表容器的class
             variable: 'player', //该属性必需设置,值等于下面的new chplayer()的对象
             //poster: 'pic/wdm.jpg', //封面图片
             autoplay: true,
-            video: base_image_server_url + 'file/' + videoid //视频地址
+            video: base_image_server_url + videoid //视频地址
         };
         videoPlayer = new ckplayer(videoObject);
         videoPlayer.addListener('time', timeHandler);
@@ -141,7 +144,7 @@ function onvideoselect(obj) {
         variable: 'player', //该属性必需设置,值等于下面的new chplayer()的对象
         //poster: 'pic/wdm.jpg', //封面图片
         autoplay: true,
-        video: base_image_server_url + 'file/' + videoid //视频地址
+        video: base_image_server_url + videoid //视频地址
     };
     videoPlayer = new ckplayer(videoObject);
     videoPlayer.addListener('time', timeHandler);

+ 113 - 47
VisualInspection/qzd/js/task/new.js

@@ -124,6 +124,46 @@ function queryTask() {
         'pager': {
             'p_cur': cur_page
         },
+        renderfunction: function() {
+            // console.log("-------------------------")
+
+
+
+            $(".uploadervideo").each(function() {
+                $(this).uploader({
+                    autoUpload: true, // 当选择文件后立即自动进行上传操作
+                    url: base_image_server_url + 'fileServer/file/upload', // 文件上传提交地址
+                    chunk_size: 0,
+                    filters: {
+                        mime_types: [{
+                            title: '视频',
+                            extensions: 'mp4,avi'
+                        }],
+                        // 不允许上传重复文件
+                        prevent_duplicates: true
+                    },
+                    onFileUploaded: function(file, responseObject) {
+                        var file_src = recordVideos;
+                        var datas = eval('(' + responseObject.response + ')');
+                        if (file_src != '' && file_src != null) {
+                            file_src += "," + datas.result_data.path;
+                        } else {
+                            file_src += datas.result_data.path;
+                        }
+                        var data = {
+                            "videos": file_src,
+                            "id": recordId
+                        };
+                        post_common_service('q/record/update', data, function(redata) {
+                            queryTask();
+                        });
+                    },
+                    onFilesRemoved: function(files) {
+                        // alert(files);
+                    }
+                });
+            });
+        }
     });
 
     $.zui.store.set('store_param_' + current_url, data);
@@ -212,56 +252,82 @@ function resert() {
 }
 
 function getRecord() {
-    var t = getTimeByMonth(GV("#start_time"));
-    var data = {
-        "startTime": getMomentTimeFormat(t.starttime),
-        "endTime": getMomentTimeFormat(t.endtime),
-        "dept": $("#deptlist").val(),
-        // "check_status": cur_status
-    };
-    post_common_service('q/record/getall/0/0', data, function(redata) {
-        console.log(redata);
-       for(var index in redata.records){
-           var obj = redata.records[index];
-        var file_src = recordVideos;
-        $("#uploaderExample_"+obj.id).uploader({
-            autoUpload: true, // 当选择文件后立即自动进行上传操作
-            url: base_image_server_url + 'fileServer/file/upload', // 文件上传提交地址
-            chunk_size:0,
-            filters: {
-                mime_types: [ {
-                    title: '视频',
-                    extensions: 'mp4,avi'
-                }],
-                // 不允许上传重复文件
-                prevent_duplicates: true
-            },
-            onFileUploaded: function(file, responseObject) {
-                var datas = eval('(' + responseObject.response + ')');
-                if(file_src != '' && file_src != null){
-                    file_src +=","+ datas.result_data.path ;
-                }else{
-                    file_src += datas.result_data.path ;
-                }
-                var data = {
-                    "videos": file_src,
-                    "id" : recordId
-                };
-                post_common_service('q/record/update', data, function(redata) {
-                    queryTask();
-                });
-            },
-            onFilesRemoved: function(files) {
-                // alert(files);
-            }
-        });
-       }
-    });
+
+    // var t = getTimeByMonth(GV("#start_time"));
+    // var data = {
+    //     "startTime": getMomentTimeFormat(t.starttime),
+    //     "endTime": getMomentTimeFormat(t.endtime),
+    //     "dept": $("#deptlist").val(),
+    //     // "check_status": cur_status
+    // };
+    // post_common_service('q/record/getall/0/0', data, function(redata) {
+    //     console.log(redata);
+    //     for (var index in redata.records) {
+    //         var obj = redata.records[index];
+    //         var file_src = recordVideos;
+    //         $("#uploaderExample_" + obj.id).uploader({
+    //             autoUpload: true, // 当选择文件后立即自动进行上传操作
+    //             url: base_image_server_url + 'fileServer/file/upload', // 文件上传提交地址
+    //             chunk_size: 0,
+    //             filters: {
+    //                 mime_types: [{
+    //                     title: '视频',
+    //                     extensions: 'mp4,avi'
+    //                 }],
+    //                 // 不允许上传重复文件
+    //                 prevent_duplicates: true
+    //             },
+    //             onFileUploaded: function(file, responseObject) {
+    //                 var datas = eval('(' + responseObject.response + ')');
+    //                 if (file_src != '' && file_src != null) {
+    //                     file_src += "," + datas.result_data.path;
+    //                 } else {
+    //                     file_src += datas.result_data.path;
+    //                 }
+    //                 var data = {
+    //                     "videos": file_src,
+    //                     "id": recordId
+    //                 };
+    //                 post_common_service('q/record/update', data, function(redata) {
+    //                     queryTask();
+    //                 });
+    //             },
+    //             onFilesRemoved: function(files) {
+    //                 // alert(files);
+    //             }
+    //         });
+    //     }
+    // });
 
 }
 
-function setRecordId(id,videos){
+function setRecordId(id, videos) {
     recordVideos = videos;
-   recordId = id;
+    recordId = id;
 }
 
+
+function removeVideo(id, videos, index) {
+
+
+    var p = "";
+    var recordVideos = videos;
+    var recordId = id;
+    var vvs = recordVideos.split(",");
+    for (var i = 0; i < vvs.length; i++) {
+        console.log(vvs)
+        if (vvs[i].length > 0 && i != index) {
+            p += vvs[i] + ",";
+        }
+    }
+    p = p.substring(0, p.length - 1);
+
+    var data = {
+        "videos": p,
+        "id": recordId
+    };
+    post_common_service('q/record/update', data, function(redata) {
+        queryTask();
+    });
+
+}

+ 5 - 0
VisualInspection/qzd/view/task/addtask.html

@@ -1,3 +1,8 @@
+<style>
+    td {
+        vertical-align: middle !important;
+    }
+</style>
 <div>
     <form class="form-horizontal" style="margin-top:10px;">
         <div class="form-group" style="margin:0px;width: 100%">

+ 5 - 0
VisualInspection/qzd/view/task/task_list.html

@@ -1,5 +1,10 @@
 <script src="/js/statistics/common_statistic.js?__inline"></script>
 <script src="/qzd/js/task/task_list.js?__inline"></script>
+<style>
+    td {
+        vertical-align: middle !important;
+    }
+</style>
 
 <div class="container-fluid ">
     <div class="row">