Forráskód Böngészése

可视化轮播定时器,文件上传

wangzhe 2 éve
szülő
commit
a3f5008aff

+ 22 - 15
mybusiness/src/main/resources/static/visualization/js/th_jk.js

@@ -78,29 +78,36 @@
             }
         });
 
+        let flag = true;//定时器开关标识
+        let time2;//定时器初始化实例
         $(".tab_div2").mouseenter(function () {//只要用户鼠标在这个tab1区域内,就不自动跳转
-            canmove = false;
+            setOrClearInterval(false);
         }).mouseleave(function () {
-            clearInterval(li_timer2);
-            setTimeout(function () {
-                canmoveu = true;
-            }, 2000);//两秒后自动切换
+            setOrClearInterval(true);
         });
 
+        /**根据标识 初始化定时器**/
+        setOrClearInterval(flag);
+
+        /**设置定时器 5秒切换**/
+        function setOrClearInterval(flag){
+            if(flag){
+                time2 = setInterval(li_timer2, 5000);
+            }else{
+                clearInterval(time2);
+            }
+        }
+
         function li_timer2() {
-            // wid = 100;
-            if (canmoveu) {
-                u++;
-                if (u == $('.tab_tit2 span').length) {
-                    u = 0;
-                }
-                $('.tab_tit2 span').eq(u).addClass('on').siblings().removeClass('on');
-                $('.tab_div2').hide();
-                $('.tab_div2').eq(u).show();
+            u++;
+            if (u == $('.tab_tit2 span').length) {
+                u = 0;
             }
+            $('.tab_tit2 span').eq(u).addClass('on').siblings().removeClass('on');
+            $('.tab_div2').hide();
+            $('.tab_div2').eq(u).show();
         }
 
-        setInterval(li_timer2, 5000);//每两秒切换
         // 归集数据分析
         imputationDataList();
         // 弹框数据归集

+ 2 - 3
mybusiness/src/main/resources/templates/apply/record/uploadFrame.html

@@ -22,8 +22,8 @@
             newFilePs[i] = urlsArr[i];
             let fileType = urlsArr[i].substr(urlsArr[i].lastIndexOf(".")+1,urlsArr[i].length-1);
             let ftype ="image"; //文件类型
-            if(fileType=="pdf"){
-                ftype = "pdf";
+            if(fileType == "pdf" || fileType == "doc" || fileType == "docx"|| fileType == "xls"|| fileType == "xlsx"|| fileType == "ico"){
+                ftype = fileType;
             }
             imgConfig[i] = {
                 url: "/common/removeFile",
@@ -133,7 +133,6 @@
         var initFileDiv = $(".kv-zoom-cache");
         var imgUrl = [];
         initFileDiv.each(function(i,e){
-            debugger
             var fullPath = $(this).find(".kv-preview-data").attr("src");
             if(fullPath!=null&&fullPath!=""&&fullPath.length>=2)
                 imgUrl[i]="/profile/upload/"+(fullPath.split("upload/",fullPath.length-1))[1];