濮阳杆衣贸易有限公司

主頁 > 知識庫 > JSP數(shù)據(jù)分頁導(dǎo)出下載顯示進度條樣式

JSP數(shù)據(jù)分頁導(dǎo)出下載顯示進度條樣式

熱門標(biāo)簽:南京新思維電話機器人 聊城智能電銷機器人外呼 南昌市地圖標(biāo)注app 如何用中國地圖標(biāo)注數(shù)字點 百度地圖添加標(biāo)注圖標(biāo)樣式 好操作的電話機器人廠家 泰州泰興400電話 怎么申請 企業(yè)怎么在聯(lián)通申請400電話 地圖標(biāo)注市場怎么樣

1、思路

分頁數(shù)據(jù)查詢,同時緩存設(shè)置進度(為當(dāng)前取出數(shù)據(jù)點總數(shù)據(jù)比例)

2、界面進度條 為 異步請求緩存比例

3、代碼

css:

body{
position:relative;
}
.mask{
position:absolute;
left:0px;
top:0px;
height:100%;
width:100%;
background-color: #eee;
display:none;
filter:alpha(opacity=50); /*IE濾鏡,透明度50%*/
-moz-opacity:0.5; /*Firefox私有,透明度50%*/
opacity:0.9;/*其他,透明度50%*/
z-index:999;
}
.out{
margin:auto;
margin-top:20%;
text-align:center;
height:30px;
width:500px;
background-color: #fff;
border:1px solid red;
position:relative;
}
.in{
position:absolute;
left:-1px;
top:0px;
height:28px;
width:0px;
background-color: red;
}
.num{
position:absolute;
left:0px;
top:0px;
height:30px;
line-height:30px;
width:500px;
text-align:center;
position:relative;
}

js:

$(function(){
$(.donwload).click(function(){
var ulr = ----;
var key = new Date().getTime();
url+="?key="+key;
downloadFile(url);
process(key);
});
});
function downloadFile(url) {
try{
var elemIF = document.createElement("iframe")
elemIF.style.display = "none";
document.body.appendChild(elemIF);
elemIF.src = url;
}catch(e){
}
}
function process(key){
$.ajax({
type: 'GET',
url: ----------,
async:true,
success:function (data) {
if(data){
data = parseFloat(data).toFixed(2);
$(".in").css("width",(data/100*500)+"px");
$(".num").text(data+"%");
if(data >= 100){
setTimeout(function(){
$(".mask").hide();
}, 3000);
}else{
setTimeout(function(){
process(key);
}, 1000);
}
}
},
error:function () {
}
});
}

downaction

try{
redisTemplate.opsForValue().set("down_process_"+qm.getKey(),0.1);
int i = 0;
while(true){
qm.getPage().setNowPage(i++);
qm.getPage().setPageSize(100);
Page dbpage = 取當(dāng)前頁數(shù)據(jù)
List> list = (List>) dbpage.getResult();
if(list != null  list.size() > 0){
if(list.size()  100) {
redisTemplate.opsForValue().set("down_process_"+qm.getKey(), 100);
}else{
double process = i * 100.0 / dbpage.getTotalCount() * 100;
if(process  0.1)process=0.1d;
redisTemplate.opsForValue().set("down_process_"+qm.getKey(), process);
}
}
logger.info("-------value:" + redisTemplate.opsForValue().get("down_process_"+qm.getKey()));
if(list == null || list.size()  100) {
redisTemplate.opsForValue().set("down_process_"+qm.getKey(),100);
break;
}
logger.info("-------value:" + redisTemplate.opsForValue().get("down_process_"+qm.getKey()));
continue;
}
}catch(){
}finally{
redisTemplate.opsForValue().set("down_process_"+qm.getKey(),100);
redisTemplate.expire("down_process_"+qm.getKey(),5, TimeUnit.MINUTES);
}
public double process(HttpServletRequest request, HttpServletResponse response,@PathVariable(value ="key") String key) throws IOException {
Double process = 0.1d;
try{
int i = 0;
while(true) {
if(i>=2){
process = 100d;
break;
}
i++;
if (redisTemplate.opsForValue().get("down_process_"+key) == null) {
Thread.currentThread().sleep(1000l);
continue;
}else{
process = Double.valueOf(redisTemplate.opsForValue().get("down_process_"+key).toString());
break;
}
}
}catch (Exception e){
process = 0.1d;
e.printStackTrace();
}finally {
return process;
}
}

以上所述是小編給大家介紹的JSP數(shù)據(jù)分頁導(dǎo)出下載顯示進度條樣式,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

您可能感興趣的文章:
  • jsp頁面數(shù)據(jù)分頁模仿百度分頁效果(實例講解)
  • nodejs個人博客開發(fā)第六步 數(shù)據(jù)分頁
  • JS代碼實現(xiàn)table數(shù)據(jù)分頁效果
  • jsp+servlet+javabean實現(xiàn)數(shù)據(jù)分頁方法完整實例
  • 無JS,完全php面向過程數(shù)據(jù)分頁實現(xiàn)代碼
  • JSP數(shù)據(jù)庫操數(shù)據(jù)分頁顯示
  • jquery+json實現(xiàn)數(shù)據(jù)列表分頁示例代碼
  • js前臺分頁顯示后端JAVA數(shù)據(jù)響應(yīng)
  • JS實現(xiàn)table表格數(shù)據(jù)排序功能(可支持動態(tài)數(shù)據(jù)+分頁效果)
  • js對象實現(xiàn)數(shù)據(jù)分頁效果

標(biāo)簽:自貢 銅川 開封 臨汾 吉林 山南 白銀 烏蘭察布

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《JSP數(shù)據(jù)分頁導(dǎo)出下載顯示進度條樣式》,本文關(guān)鍵詞  JSP,數(shù)據(jù),分頁,導(dǎo)出,下載,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《JSP數(shù)據(jù)分頁導(dǎo)出下載顯示進度條樣式》相關(guān)的同類信息!
  • 本頁收集關(guān)于JSP數(shù)據(jù)分頁導(dǎo)出下載顯示進度條樣式的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    卢龙县| 通许县| 秭归县| 澎湖县| 会理县| 司法| 广州市| 习水县| 楚雄市| 温宿县| 鄂托克前旗| 前郭尔| 巴里| 淮滨县| 会泽县| 陇西县| 舟山市| 桓台县| 万荣县| 信丰县| 彭山县| 汝城县| 辉县市| 汾阳市| 乐业县| 天柱县| 噶尔县| 龙州县| 永丰县| 新和县| 景洪市| 尼玛县| 南漳县| 霍林郭勒市| 桓仁| 汉沽区| 延吉市| 玛多县| 长乐市| 双城市| 衡阳县|