From 1da2f68f3127b05104bca6eba36b898d9811839d Mon Sep 17 00:00:00 2001 From: tangym Date: Sat, 14 Jan 2023 19:17:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BF=9B=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/webmaster/index.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/application/admin/view/webmaster/index.html b/application/admin/view/webmaster/index.html index 4384626..a6f155a 100644 --- a/application/admin/view/webmaster/index.html +++ b/application/admin/view/webmaster/index.html @@ -172,22 +172,23 @@ total = data.data["total"]; pageSize = data.data["pageSize"]; - ajaxCount = Math.ceil(lastPage / 50); + step = 50; + ajaxCount = Math.ceil(lastPage / step); //定义变量 let progressNum = 0; let startPage = 1; let loop = 1; - generateSitemapSplit(pageSize, startPage, startPage + 10 -1, function(data, start) { + generateSitemapSplit(pageSize, startPage, startPage + step - 1, function(data, start) { if (data.code != 1) { layer.msg(data.msg, function(){}); return false; } //每次加10% - progressNum += (i == ajaxCount) ? parseInt(100 / ajaxCount) + 100 % ajaxCount : parseInt(100 / ajaxCount); - console.log(progressNum); + progressNum += (loop == ajaxCount) ? parseInt(100 / ajaxCount) + 100 % ajaxCount : parseInt(100 / ajaxCount); + //改变这个div width属性值 $(progress).children(".progress-bar").attr("style", "width:" + progressNum + "%"); //显示 内容 @@ -202,7 +203,7 @@ if (loop <= ajaxCount) { loop++; - generateSitemapSplit(pageSize, start, start + 10 -1); + generateSitemapSplit(pageSize, start, start + step -1); } });