Explorar o código

1. 样式更新
2. 导入Excel,waiting改为进度条

MaiXinRong %!s(int64=5) %!d(string=hai) anos
pai
achega
8b8573d92f

+ 20 - 3
app/public/css/main.css

@@ -60,6 +60,14 @@ font-size: .875rem;
 .bs-popover-auto[x-placement^="bottom"] .arrow::after, .bs-popover-bottom .arrow::after{
   border-bottom-color:#000;
 }
+/*在谷歌下移除input[number]的上下箭头*/
+input.nospin[type='number']::-webkit-outer-spin-button,
+input.nospin[type='number']::-webkit-inner-spin-button{
+    -webkit-appearance: none !important;
+    margin: 0;
+}
+/*在firefox下移除input[number]的上下箭头*/
+input.nospin[type="number"]{-moz-appearance:textfield;}
 /*自定义css*/
 .in-1{padding-left:5px!important}
 .in-2{padding-left:21px!important}
@@ -103,9 +111,14 @@ font-size: .875rem;
 }
 .sjs-bar-1,.sjs-bar-2,.sjs-bar-3,.sjs-bar-4{
   height:30px;
+  padding-top:3px;
 }
 .sjs-bar{
   height:30px;
+  padding-top:3px;
+}
+.sjs-bar .nav {
+  margin-top:-3px;
 }
 .sjs-bottom{
   height:400px;
@@ -364,7 +377,7 @@ font-size: .875rem;
   width:5px;
   height:100%;
   float: left;
-  margin-left:-15px;
+  margin-left:-5px;
   cursor: w-resize;
   z-index: 999
 }
@@ -564,7 +577,7 @@ font-size: .875rem;
   padding:0 0 5px
 }
 .c-body{
-  padding:6px 6px 4px 6px;
+  padding:1px;
   background:#fff;
 }
 .right-nav{
@@ -741,7 +754,7 @@ body{
 }
 .panel-content{
   padding-top:35px;
-  overflow-x: hidden
+  overflow: hidden
 }
 .panel-content .content-wrap{
  margin:0;
@@ -809,6 +822,7 @@ label{
 }
 .panel-sidebar + .panel-content{
   padding:35px 0 0 120px;
+  overflow: hidden;
 }
 .contarl-box{
   padding:1rem 1rem;
@@ -890,4 +904,7 @@ legend {
   font-size:10px;
   padding:.2em .4em;
   top:0;
+}
+.custom-switch .custom-control-label::after{
+  top:.25rem;
 }

+ 113 - 16
app/public/js/global.js

@@ -18,19 +18,19 @@ function autoFlashHeight(){
     var pBarz = getObjHeight($(".toolsbar-f"));
     var bdtopc = getObjHeight($(".body-height-top"));
     var bcontent = getObjHeight($(".bcontent-wrap"));
-    $(".sjs-height-0").height($(window).height()-cHeader-90+45);
-    $(".sjs-height-1").height($(window).height()-cHeader-bcontent-90+45);
-    $(".sjs-height-2").height($(window).height()-cHeader-sBarz-110);
-    $(".sjs-height-3").height($(window).height()-cHeader-sBar-492+15);/*492*/
-    $(".sjs-height-4").height($(window).height()-cHeader-pBarz-110+65);
-    $(".sjs-height-5").height($(window).height()-cHeader-sBar-492+45);/*492*/
-    $(".sp-wrap").height(bcontent-40);
+    $(".sjs-height-0").height($(window).height()-cHeader-90+53);
+    $(".sjs-height-1").height($(window).height()-cHeader-bcontent-90+53);
+    $(".sjs-height-2").height($(window).height()-cHeader-sBarz-120);
+    $(".sjs-height-3").height($(window).height()-cHeader-sBar-492+25);/*492*/
+    $(".sjs-height-4").height($(window).height()-cHeader-pBarz-110+75);
+    $(".sjs-height-5").height($(window).height()-cHeader-sBar-492+55);/*492*/
+    $(".sp-wrap").height(bcontent-30);
     /*侧栏高度*/
-    $(".sjs-sh-1").height($(window).height()-cHeader-sBar1-92+45);
-    $(".sjs-sh-2").height($(window).height()-cHeader-sBar2-92+45);
-    $(".sjs-sh-3").height($(window).height()-cHeader-sBar3-92+45);
-    $(".sjs-sh-4").height($(window).height()-cHeader-sBar4-92+45);
-    $(".sjs-sh-5").height($(window).height()-cHeader-sBar5-92+45);
+    $(".sjs-sh-1").height($(window).height()-cHeader-sBar1-92+55);
+    $(".sjs-sh-2").height($(window).height()-cHeader-sBar2-92+55);
+    $(".sjs-sh-3").height($(window).height()-cHeader-sBar3-92+55);
+    $(".sjs-sh-4").height($(window).height()-cHeader-sBar4-92+55);
+    $(".sjs-sh-5").height($(window).height()-cHeader-sBar5-92+55);
 };
 $(window).resize(autoFlashHeight);
 /*全局自适应高度结束*/
@@ -171,8 +171,9 @@ const postData = function (url, data, successCallback, errorCallBack, showWaitin
  * @param {function} successCallback - 返回成功回调
  * @param {function} errorCallBack - 返回失败回调
  */
-const postDataCompress = function (url, data, successCallback, errorCallBack, showWaiting = true) {
-    if (showWaiting) showWaitingView();
+const postDataCompress = function (url, data, successCallback, errorCallBack, htype = 'progress') {
+    if (htype === 'wait') showWaitingView();
+    if (htype === 'progress') showProgress();
     $.ajax({
         type:"POST",
         url: url,
@@ -185,6 +186,7 @@ const postDataCompress = function (url, data, successCallback, errorCallBack, sh
             xhr.setRequestHeader('x-csrf-token', csrfToken);
         },
         success: function(result){
+            if (htype === 'progress') doneProgress();
             if (result.err === 0) {
                 if (successCallback) {
                     successCallback(result.data);
@@ -195,14 +197,16 @@ const postDataCompress = function (url, data, successCallback, errorCallBack, sh
                     errorCallBack(result.msg);
                 }
             }
-            if (showWaiting) closeWaitingView();
+            if (htype === 'wait') closeWaitingView();
+            if (htype === 'progress') closeProgress();
         },
         error: function(jqXHR, textStatus, errorThrown){
             toastr.error('error: ' + textStatus + " " + errorThrown);
             if (errorCallBack) {
                 errorCallBack();
             }
-            if (showWaiting) closeWaitingView();
+            if (htype === 'wait') closeWaitingView();
+            if (htype === 'progress') closeProgress();
         }
     });
 };
@@ -340,6 +344,99 @@ function showWaitingView() {
     }, 1000);
 }
 
+let progressInterval;
+function showProgress() {
+    var sWidth, sHeight;
+    sWidth = document.body.clientWidth;
+    sHeight = document.body.clientHeight;
+    //背景遮罩层div
+    var bgObj = document.createElement("div");
+    bgObj.setAttribute('id', 'bgDiv');
+    bgObj.style.zIndex = '9998';
+    bgObj.style.position = "absolute";
+    bgObj.style.top = "0px";
+    bgObj.style.background = "#888";
+    bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
+    bgObj.style.opacity = "0.6";
+    bgObj.style.left = "0px";
+    bgObj.style.width = sWidth + "px";
+    bgObj.style.height = sHeight + "px";
+    document.body.appendChild(bgObj);
+
+    //信息提示层div
+    var msgObj = document.createElement("div");
+    msgObj.classList.add('progress');
+    msgObj.style.zIndex = '9999';
+    msgObj.style.position = "absolute";
+    msgObj.setAttribute("id", "progressDiv");
+    msgObj.style.height = "2px";
+    msgObj.style.width = "600px";
+    msgObj.style.top = (document.documentElement.scrollTop + sHeight / 2) + "px";
+    msgObj.style.left = (sWidth - 600) / 2 + "px";
+    document.body.appendChild(msgObj);
+    msgObj.innerHTML = '<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>';
+    const processObj = $('.progress-bar');
+
+    let count = 0;
+    progressInterval = setInterval(function () {
+        const pos = parseInt(processObj.attr('aria-valuenow'));
+        if (pos < 20) {                                       // 1
+            processObj.attr('aria-valuenow', pos + 2);
+            processObj.width((pos + 2) + '%');
+        } else if (pos < 40) {                                // 2
+            processObj.attr('aria-valuenow', pos + 1);
+            processObj.width((pos + 1) + '%');
+        } else if (pos < 60) {                         // 4
+            count += 1;
+            if (count % 2 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+                processObj.width((pos + 1) + '%');
+            }
+        } else if (pos < 80) {                         // 10
+            count += 1;
+            if (count % 5 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+                processObj.width((pos + 1) + '%');
+            }
+        } else if (pos < 90) {                        // 10
+            count += 1;
+            if (count % 10 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+                processObj.width((pos + 1) + '%');
+            }
+        }  else if (pos < 95) {                       // 15
+            count += 1;
+            if (count % 30 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+                processObj.width((pos + 1) + '%');
+            }
+        } else if (pos < 100) {                       // 25
+            count += 1;
+            if (count % 50 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+            }
+        }
+    }, 100);
+}
+function doneProgress() {
+    $('.progress-bar').attr('aria-valuenow', 100).width('100%');
+}
+function closeProgress() {
+    setTimeout(function () {
+        var bgDiv = document.getElementById("bgDiv");
+        var msgDiv = document.getElementById("progressDiv");
+        //移除背景遮罩层div
+        if(bgDiv != null){
+            document.body.removeChild(bgDiv);
+        }
+        //移除中间信息提示层div
+        if(msgDiv != null){
+            document.body.removeChild(msgDiv);
+        }
+        clearInterval(progressInterval);
+    }, 300);
+}
+
 /**
  * 设置本地缓存
  *

+ 1 - 1
app/public/js/ledger.js

@@ -2141,7 +2141,7 @@ $(document).ready(function() {
                 pos.loadDatas(result.pos);
                 posOperationObj.loadCurPosData();
                 $('#upload-ledger').modal('hide');
-            }, null, true);
+            }, null);
         }
     });
     $('#upload-ledger').bind('hidden.bs.modal', function () {

+ 1 - 0
app/public/js/tender_list.js

@@ -325,6 +325,7 @@ function bindTenderUrl() {
 }
 
 $(document).ready(() => {
+    autoFlashHeight();
     sortCategory();
     // 初始化分类数据
     initCategoryLevelNode();

+ 1 - 0
app/public/js/tender_list_info.js

@@ -361,6 +361,7 @@ function bindTenderUrl() {
 }
 
 $(document).ready(() => {
+    autoFlashHeight();
     sortCategory();
     // 初始化分类数据
     initCategoryLevelNode();

+ 1 - 0
app/public/js/tender_list_manage.js

@@ -337,6 +337,7 @@ function bindTenderUrl() {
 }
 
 $(document).ready(() => {
+    autoFlashHeight();
     sortCategory();
     // 初始化分类数据
     initCategoryLevelNode();

+ 1 - 0
app/public/js/tender_list_progress.js

@@ -338,6 +338,7 @@ function bindTenderUrl() {
 }
 
 $(document).ready(() => {
+    autoFlashHeight();
     sortCategory();
     // 初始化分类数据
     initCategoryLevelNode();

+ 3 - 1
app/view/tender/index.ejs

@@ -1,7 +1,9 @@
 <div class="panel-content">
     <% include ./sub_menu.ejs %>
     <div class="content-wrap">
-        <div class="c-body">
+        <div class="sjs-height-0">
+            <div class="c-body">
+            </div>
         </div>
     </div>
 </div>

+ 3 - 1
app/view/tender/info.ejs

@@ -1,7 +1,9 @@
 <div class="panel-content">
     <% include ./sub_menu.ejs %>
     <div class="content-wrap">
-        <div class="c-body">
+        <div class="sjs-height-0">
+            <div class="c-body">
+            </div>
         </div>
     </div>
 </div>

+ 3 - 1
app/view/tender/manage.ejs

@@ -1,7 +1,9 @@
 <div class="panel-content">
     <% include ./sub_menu.ejs %>
     <div class="content-wrap">
-        <div class="c-body">
+        <div class="sjs-height-0">
+            <div class="c-body">
+            </div>
         </div>
     </div>
 </div>

+ 3 - 1
app/view/tender/progress.ejs

@@ -1,7 +1,9 @@
 <div class="panel-content">
     <% include ./sub_menu.ejs %>
     <div class="content-wrap">
-        <div class="c-body">
+        <div class="sjs-height-0">
+            <div class="c-body">
+            </div>
         </div>
     </div>
 </div>