|
@@ -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);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 设置本地缓存
|
|
|
*
|