Browse Source

Merge branch 'master' of http://git_xt.git.topm.win:8080/wenhongquan/VisualInspection

wenhongquan 9 years ago
parent
commit
7a9be25392

+ 20 - 0
VisualInspection/css/statistics/assess_situation.css

@@ -1,3 +1,16 @@
+.from-label label{
+    width:60px;
+    float:left;
+    padding-top: 6px;
+}
+
+.select-date{
+    width:60px;
+    float:left;
+    padding-top: 6px;
+    margin-left: 100px;
+}
+
 .col-sm-1{
     width:102px;
     float:left;
@@ -62,3 +75,10 @@
     height:43px;
 }
 
+table{
+    border-color:#d9d9d9;
+}
+
+
+
+

+ 30 - 19
VisualInspection/js/mytask/check.js

@@ -3,18 +3,6 @@ function initCheck() {
     $("#ex1").on("slideStop", function(slideEvt) {
         setVideoProcess(slideEvt.value);
     });
-    // setProcessValue(600);
-    // $("#ex1").on("click", function(slideEvt) {
-    //     setVideoProcess(slideEvt.value);
-    // });
-
-    // $("#ex1").on("slideStop", function(slideEvt) {
-    //     setProcessValue(slideEvt.value);
-    // });
-    setProcessValue(300);
-    // setCurrentProcessValue(50);
-
-    // setCurrentProcessValue(60);
 
     event = document.createEvent('MessageEvent');
     var origin = window.location.protocol + '//' + window.location.host;
@@ -49,6 +37,7 @@ function initCheck() {
         format: "yyyy-mm-dd"
     });
     if ($.checkTask) {
+        initCheckAppealBtns();
         setFeSelect("#fsList", $.checkTask.checked_dept);
         setLaneSelect("#lane", $.checkTask.checked_location);
         get_common_service('user/getUserById/' + $.checkTask.checked_person, null, function (data) {
@@ -58,7 +47,6 @@ function initCheck() {
         queryScores();
         //查询录像播放列表
         queryVideoList();
-        initBtns();
     }
      $("select#video_list").change(function(){
         playVideo($(this).val());
@@ -68,7 +56,7 @@ function initCheck() {
 function initInfo() {
 
 }
-function initBtns(){
+function initCheckAppealBtns(){
     if($.checkTask.appeal) {
         $("#btn_appeal_task").show();
         $("#btn_task").hide();
@@ -203,6 +191,14 @@ function genPicstr(src){
                 + '<img class="pic-class img-thumbnail" style="width:100px;height:70px;" src="' + src + '" alt="">'
                 + '</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 lightbox-toggle" onclick="'+src +'" href="javascript:void(0)" style="position:absolute">'
+                + '<img class="pic-class img-thumbnail" style="width:100px;height:70px;" src="' + src + '" alt="">'
+                + '</a>'
+                + '</div>';
+    }
     return pic;
 }
 
@@ -230,8 +226,7 @@ function showChangeUser() {
             if (data[i].pic) pic = base_image_server_url+data[i].pic;
             str = '<div style="width:100px;float:left;margin:5px;">'
                 + '<a class="card" href="javascript:void(0)" onclick="changePerson(\'' + data[i].id + '\')">'
-                + '<img src="' + pic + '" alt="" style="height:100px">'
-                // +   '<a href="#" onclick="changePerson(\''+name+'\')">'+name+'<a href="'+data[i].pic+'class="lightbox-toggle" data-toggle="lightbox" data-group="image-group-1"><img src="../../images/img4.jpg" class="img-rounded" alt="" width="50px"></a></a>'
+                + '<img src="' + pic + '" alt="" style="height:100px;width:100px;">'
                 + '<div class="card-heading"><strong>' + name + '</strong></div>'
                 + '</a>'
                 + '</div>';
@@ -255,13 +250,28 @@ function changePerson(id) {
         alert(error);
     });  
 }
-
+function resetUserImgInfo() {
+    $("#user_img_container").empty();
+    var str = '<a id="person_img" href="../../images/img4.jpg" class="lightbox-toggle">'
+                +'<img src="../../images/img4.jpg" class="img-thumbnail" style="width:50px;height:50px;margin-top:-10px;"></a>'
+                 +   '<label id="checked_person"></label>';
+    $("#user_img_container").html(str);
+}
 function changePersonContent(data) {
+    resetUserImgInfo();
     var name = data.truename;
     if (data.workno) name = data.workno + " " + data.truename;
     $("#checked_person").html(name);
-    $("#person_img").attr("href", data.pic);
-    $("#person_img > img").attr("src", data.pic);
+    var imgSrc = base_image_server_url+data.pic;
+    if(ISCLIENT) {
+        $("#person_img").attr("href", "javascript:void(0)");
+        $("#person_img").click(function(){
+            showClientImg(imgSrc);
+        });
+    }else {       
+        $("#person_img").attr("href", imgSrc);
+    }
+    $("#person_img > img").attr("src", imgSrc);
     $('a.lightbox-toggle').lightbox();
 }
 var scoreLayer;
@@ -402,6 +412,7 @@ function zTreeOnClick(event, treeId, treeNode) {
     };
     no_return_common_service("/score/add", param, function (data) {
         if (scoreLayer) layer.close(scoreLayer);
+        clearAllImg();
         //查询评分情况
         queryScores();
         layer.msg(data, {

+ 12 - 5
VisualInspection/js/statistics/assess_type.js

@@ -129,18 +129,17 @@ function check_people_avg(data){
                 sum = parseFloat(sum)+ parseFloat(filterByZeroHandle(data[k].all_check_score,'0'));
                 sum1 = parseFloat(sum1)+ parseFloat(filterByZeroHandle(data[k].checked_num,'0'));
             if(k==6){
-                dataArray.push(filterByZeroHandle(sum/sum1).toFixed(2),'0');
-                console.log(sum+" "+sum1);
+                dataArray.push(filterJudge(sum,sum1));
                 sum = 0;
                 sum1 = 0;
             }
             if(k==12){  
-                dataArray.push(sum/6);
+                dataArray.push(filterJudge(sum,sum1));
                 sum = 0;
                 sum1 = 0;
             }
             if(k==20){
-                dataArray.push(sum/8);
+                dataArray.push(filterJudge(sum,sum1)); 
                 sum = 0;
                 sum1 = 0;
             }
@@ -199,13 +198,21 @@ function getItemScore(obj, check_item_name){
  * @param {*} default_display_value 
  */
 function filterByZeroHandle(value , default_display_value){
-        if(isNaN(value)|| value=='0.00'){
+        if(isNaN(value) || value=='0.00'){
             return default_display_value ;
         }else{
             return value ;
         }
 }
 
+function filterJudge(num1,num2){
+        if(num2==0){
+            return 0;
+        }else{
+            return (num1/num2).toFixed(2);
+        }
+}
+
 
 
 

+ 3 - 3
VisualInspection/js/user/login.js

@@ -23,9 +23,9 @@ $(document).ready(function() {
             $.zui.store.remove("currentpage");
 
             //获取域名
-            host = "http://"+window.location.host+"/";
-            base_image_server_url = host;
-            base_ui_url = host;
+            // host = "http://"+window.location.host+"/";
+            // base_image_server_url = host;
+            // base_ui_url = host;
             window.location.href = base_ui_url + "view/main.html"
 
         }, function(error) {

+ 25 - 4
VisualInspection/js/util/util.js

@@ -307,16 +307,29 @@ function setCheckmanSelect(div,selectId){
 }
 function genAppeaFiles(file_src){
     initStringfunc();
-    var files = $.checkTask.appeal.file_src.split(",");
+    var files = file_src.split(",");
     var optionStr="";
+    
     for(var i in files) {
         var fileSrc = base_image_server_url+files[i];
         if(fileSrc.endWith("png") || fileSrc.endWith("jpg")||fileSrc.endWith("ico")){
-            optionStr+= '<a href="'+fileSrc+'" target="_blank"><img src="'+fileSrc+'" style="height:55px;margin:5px;"></a>';
+            if(ISCLIENT) {
+                optionStr+= '<a href="javascript:void(0)" onclick="showClientImg('+fileSrc+')"><img src="'+fileSrc+'" style="height:55px;margin:5px;"></a>';
+            }else{
+                optionStr+= '<a href="'+fileSrc+'" target="_blank"><img src="'+fileSrc+'" style="height:55px;margin:5px;"></a>';
+            }
         }else if(fileSrc.endWith("doc")|| fileSrc.endWith("docx")){
-            optionStr+= '<a href="'+fileSrc+'" target="_blank"><i class="icon icon-file-word icon-4x" style="vertical-align: middle"></a>';
+            if(ISCLIENT) {
+                optionStr+= '<a href="javascript:void(0)" onclick="downloadClientfile('+fileSrc+')"><i class="icon icon-file-word icon-4x" style="vertical-align: middle"></a>';
+            }else{
+                optionStr+= '<a href="'+fileSrc+'" target="_blank"><i class="icon icon-file-word icon-4x" style="vertical-align: middle"></a>';
+            }
         }else if(fileSrc.endWith("txt")){
-            optionStr+= '<a href="'+fileSrc+'" target="_blank"><i class="icon icon-file-code icon-3x"></a>';
+            if(ISCLIENT) {
+                optionStr+= '<a href="javascript:void(0)" onclick="downloadClientfile('+fileSrc+')"><i class="icon icon-file-code icon-4x" style="vertical-align: middle"></a>';
+            }else{
+                optionStr+= '<a href="'+fileSrc+'" target="_blank"><i class="icon icon-file-code icon-4x" style="vertical-align: middle"></a>';
+            }
         }
     }
     return optionStr;
@@ -345,4 +358,12 @@ function initStringfunc(){
     }         
     return true;   
     };  
+}
+
+function showClientImg(src){
+    callFunc("showImage", src);
+}
+
+function downloadClientfile(src){
+    callFunc("downloadfile", src);
 }

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

@@ -13,7 +13,7 @@
                     <select class="form-control" id="lane" disabled="disabled"></select>
                 </div>
                 <label class="col-sm-1">考核人员</label>
-                <div class="col-sm-3">
+                <div class="col-sm-3" id="user_img_container">
                     <!-- 使用图片 -->
                     <a id="person_img" href="../../images/img4.jpg" class="lightbox-toggle"><img src="../../images/img4.jpg" class="img-thumbnail" style="width:50px;height:50px;margin-top:-10px;"></a>
                     <label id="checked_person"></label>
@@ -93,7 +93,7 @@
                 <div class="row" class="col-sm-11" style="margin:5px;">
                     <button class="btn btn-primary" type="button" onclick="clearAllImg()" style="margin-right:10px;">清空</button>
                     <button class="btn btn-danger" type="button"  onclick="showScore()" style="margin-right:10px;">评分</button>
-                    <button id="saveEditBtn" class="btn btn-warning" type="button"  onclick="saveEdit()" style="margin-right:10px;">保存修改</button>
+                    <button id="saveEditBtn" class="btn btn-warning" type="button"  onclick="saveEdit()" style="margin-right:10px;display:none;">保存修改</button>
                     <form id="form1" runat="server" method="post" enctype="multipart/form-data" style="float:left;margin-right:10px;"> 
                         <div> 
                             <button id="box" class="btn btn-primary" type="button">上传</button>

+ 2 - 2
VisualInspection/view/statistics/assess_situation.html

@@ -4,7 +4,7 @@
     <div class="form-div">
         <form  class="form-horizontal">
             <div class="form-group">
-            
+                <div class="from-label"><label>查询日期</label></div>
                 <div class="col-sm-3">
                     <input type="text" id="start-time" class="form-control form-date" placeholder="开始日期">
                 </div>
@@ -25,7 +25,7 @@
     <div class="row">
           <!-- 使用一个div来显示数据表格 -->
           <div class="datatable" data-checkable="false" data-sortable="false">
-              <div class="table-head" ><table border="1" width="100%" height="90px" align="center">
+              <div class="table-head" ><table border="1" width="100%" height="90px" align="center" class="a">
                   <thead>
                   <tr>
                   <th rowspan="2" width="110px">道管</th><th rowspan="2" width="80px">道管内排名</th><th rowspan="2" width="90px">站名</th>

+ 1 - 1
VisualInspection/view/statistics/assess_type.html

@@ -4,7 +4,7 @@
     <div class="form-div">
         <form  class="form-horizontal">
             <div class="form-group">
-                
+                <div class="from-label"><label>查询日期</label></div>
                 <div class="col-sm-3">
                     <input type="text" id="start-time" class="form-control form-date" placeholder="开始日期">
                 </div>

+ 1 - 0
VisualInspection/view/statistics/emp_ranking.html

@@ -9,6 +9,7 @@
                     <select class="form-control" id="fsList">
                     </select>
                 </div>
+                <div class="select-date"><label class="select-date1">查询日期</label></div>
                 <div class="col-sm-3">
                     <input type="text" id="start-time" class="form-control form-date" placeholder="开始日期">
                 </div>

+ 6 - 6
VisualInspection_server/src/main/resources/application.properties

@@ -2,8 +2,8 @@ server.port=8089
 spring.thymeleaf.cache=false
 context.listener.classes=com.xintong.SystemInit
 
-master.datasource.url = jdbc:mysql://10.112.0.199:3306/visualinspection?useUnicode=true&characterEncoding=utf-8
-#master.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
+#master.datasource.url = jdbc:mysql://10.112.0.199:3306/visualinspection?useUnicode=true&characterEncoding=utf-8
+master.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://192.168.8.236:3306/visualinspection?useUnicode=true&characterEncoding=utf-8
 master.datasource.username = root
 master.datasource.password = root
@@ -11,8 +11,8 @@ master.datasource.driver-class-name = com.mysql.jdbc.Driver
 master.mapper-locations=classpath:com/xintong/visualinspection/mapper/master/*.xml
 
 ## \u7528\u6237\u6570\u636e\u6e90\u914d\u7f6e
-cluster.datasource.url=jdbc:mysql://10.112.0.199:3306/yanhai?useUnicode=true&characterEncoding=utf8
-#cluster.datasource.url=jdbc:mysql://git.topm.win:6381/yanhai?useUnicode=true&characterEncoding=utf8
+#cluster.datasource.url=jdbc:mysql://10.112.0.199:3306/yanhai?useUnicode=true&characterEncoding=utf8
+cluster.datasource.url=jdbc:mysql://git.topm.win:6381/yanhai?useUnicode=true&characterEncoding=utf8
 cluster.datasource.username=root
 cluster.datasource.password=root
 cluster.datasource.driver-class-name = com.mysql.jdbc.Driver
@@ -53,8 +53,8 @@ spring.datasource.useGlobalDataSourceStat=true
 # Redis\u6570\u636e\u5e93\u7d22\u5f15\uff08\u9ed8\u8ba4\u4e3a0\uff09
 spring.redis.database=0  
 # Redis\u670d\u52a1\u5668\u5730\u5740
-spring.redis.host=10.112.0.199
-#spring.redis.host=git.topm.win
+#spring.redis.host=10.112.0.199
+spring.redis.host=git.topm.win
 # Redis\u670d\u52a1\u5668\u8fde\u63a5\u7aef\u53e3
 #spring.redis.port=6380
 spring.redis.port=6379