minitiger 8 лет назад
Родитель
Сommit
59dd17795b

+ 5 - 4
VisualInspection/js/config.js

@@ -13,7 +13,8 @@ function getCurrentaddr(){
 function getserveraddr(){
     if(base_ui_url.indexOf("topm.win")!=-1){
         return "http://server_yanhai.git.topm.win:8080/";
-    }else if(base_ui_url.indexOf("localhost")!=-1){
+    }
+    else if(base_ui_url.indexOf("localhost")!=-1){
         return "http://localhost:8089/"
     }
     else if(base_ui_url.indexOf("192.168.8.236")!=-1){
@@ -26,10 +27,10 @@ function getserveraddr(){
 function getImageaddr(){
     if(base_ui_url.indexOf("topm.win")!=-1){
         return "http://file_yanhai.git.topm.win:8080/";
-    }else if(base_ui_url.indexOf("192.168.8.236")!=-1){
-        return "http://192.168.8.236/"
     }
-    else{
+    else if(base_ui_url.indexOf("localhost")!=-1){
+        return "http://file_yanhai.git.topm.win:8080"
+    }else{
         return "http://10.112.0.199/"
     }
 }

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

@@ -191,6 +191,8 @@ function addPic(pic) {
         var i=0;
         // var imgArr = $("#img_container .pic-class");
         // if(imgArr && imgArr.length>0) i = imgArr.length;
+        if(!pic.startWith("http"))
+		    pic= pic.replace(base_image_server_url,"/"); 
         var picStr = genPicstr(pic);
         $('#img_container').append(picStr);
         $('a.lightbox-toggle').lightbox();
@@ -213,7 +215,8 @@ function showPics(pics, divId) {
 }
 
 function genPicstr(src){
-    
+    if(!src.startWith("http"))
+		src= base_image_server_url+src;
     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">'
@@ -450,7 +453,7 @@ function submitCheck() {
 function showPre(id) {
     // $('#myModal').modal({name:"dd"});
     //预览提交把任务状态改为待提交
-    no_return_common_service('/task/update', {"id":id,"check_status":3})
+    no_return_common_service('/task/update', {"id":$.checkTask.id,"check_status":3})
     changePage("/view/mytask/taskDetail.html");
 }
 function showInvalid() {
@@ -475,7 +478,7 @@ function submitCheck4Appeal() {
 function showPre4Appeal(id) {
     // $('#myModal').modal({name:"dd"});
     //预览提交把任务状态改为待提交
-    no_return_common_service('/task/update', {"id":id,"check_status":13})
+    no_return_common_service('/task/update', {"id":$.checkTask.id,"check_status":13})
     changePage("/view/mytask/taskDetail.html");
 }
 function saveValidReason() {

+ 5 - 2
VisualInspection/js/util/service.js

@@ -342,11 +342,14 @@ function get_common_service(url, param, success, fail) {
 
 
 // 上传文件
-function uploadFile(file, name, successfunc, errorfunc) {
+function uploadFile(file, name, successfunc, errorfunc,parentPath) {
     var dataurl = base_image_server_url+"/fileServer" + FILE_UPLOAD
     var form = new FormData();
     form.append(name, file);
-    form.append('parentPath','head');
+    if(parentPath)
+        form.append('parentPath',parentPath);
+    else
+        form.append('parentPath','head');
     $.ajax({
         url: dataurl,
         type: "POST",

+ 1 - 0
VisualInspection/js/util/util.js

@@ -335,6 +335,7 @@ function genAppeaFiles(file_src){
     }
     return optionStr;
 }
+initStringfunc();
 function initStringfunc(){
     String.prototype.endWith = function(str){  
         if(str==null || str=="" || this.length == 0 ||str.length > this.length){      

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

@@ -239,7 +239,7 @@
             addPic(base_image_server_url + data.path);
         }, function (error) {
             console.log(error)
-        });
+        },"task");
     }
 
 </script>