jsp页面有显示进度条(精细度 、评分 、 打印时长),根据需求将这三个改成什么都没有选择 100
RT,以下是jsp里的代码<scripttype="text/javascript">$(document).ready(function(){vargrade="${m...
RT,以下是jsp里的代码
<script type="text/javascript">
$(document).ready(function() {
var grade = "${modelInfo.grade}";//总体打分
var precision = "${modelInfo.precision}";
var printHour = "${modelInfo.printHour}";
//判断
//显示模型精度
var preStr = "未评分";
if (precision == 1) {
preStr = "粗糙";
} else if (precision == 2) {
preStr = "较粗糙";
} else if (precision == 3) {
preStr = "普通 ";
} else if (precision == 4) {
preStr = "较精细 ";
} else if (precision == 5) {
preStr = "精细";
}
$("#precision1").html(preStr);
var sss = $("#precision1").html();
//显示打分进度条
gradeShow(grade);
//控制显示的进度条
var prec = parseInt(precision) * 20 + "%";
$("#precision").css("width", prec);
printHourShow(printHour); //显示打印时长
});
//显示打分进度
function gradeShow(grade) {
var i = 1;
if (grade <= 1 && grade > 0) {
i = 1;
} else if (grade <= 2 && grade > 1) {
i = 2;
} else if (grade <= 3 && grade >= 2) {
i = 3;
} else if (grade <= 4 && grade > 3) {
i = 4;
} else if (grade <= 5 && grade > 4) {
i = 5;
} else {
i = 5;
}
var gra = parseInt(i) * 17 + "px";
$("#grade").css("width", gra); //控制显示的进度条
}
//显示打印时长 进度条
function printHourShow(hour) {
var i = 1;
if (hour >= 300) {
i = 10;//5小时以上
} else if (hour >= 240 && hour < 300) {
i = 8;
} else if (hour >= 180 && hour < 240) {
i = 7;
} else if (hour >= 120 && hour < 180) {
i = 6;
} else if (hour >= 60 && hour < 120) {
i = 5;
} else if (hour >= 30 && hour < 60) {
i = 4;
} else if (hour >= 15 && hour < 30) {
i = 3;
} else if (hour >= 10 && hour < 15) {
i = 2;
} else {
i = 1;
}
var prin = parseInt(i) * 10 + "%";
$("#printHour").css("width", prin); //控制显示的进度条
} 展开
<script type="text/javascript">
$(document).ready(function() {
var grade = "${modelInfo.grade}";//总体打分
var precision = "${modelInfo.precision}";
var printHour = "${modelInfo.printHour}";
//判断
//显示模型精度
var preStr = "未评分";
if (precision == 1) {
preStr = "粗糙";
} else if (precision == 2) {
preStr = "较粗糙";
} else if (precision == 3) {
preStr = "普通 ";
} else if (precision == 4) {
preStr = "较精细 ";
} else if (precision == 5) {
preStr = "精细";
}
$("#precision1").html(preStr);
var sss = $("#precision1").html();
//显示打分进度条
gradeShow(grade);
//控制显示的进度条
var prec = parseInt(precision) * 20 + "%";
$("#precision").css("width", prec);
printHourShow(printHour); //显示打印时长
});
//显示打分进度
function gradeShow(grade) {
var i = 1;
if (grade <= 1 && grade > 0) {
i = 1;
} else if (grade <= 2 && grade > 1) {
i = 2;
} else if (grade <= 3 && grade >= 2) {
i = 3;
} else if (grade <= 4 && grade > 3) {
i = 4;
} else if (grade <= 5 && grade > 4) {
i = 5;
} else {
i = 5;
}
var gra = parseInt(i) * 17 + "px";
$("#grade").css("width", gra); //控制显示的进度条
}
//显示打印时长 进度条
function printHourShow(hour) {
var i = 1;
if (hour >= 300) {
i = 10;//5小时以上
} else if (hour >= 240 && hour < 300) {
i = 8;
} else if (hour >= 180 && hour < 240) {
i = 7;
} else if (hour >= 120 && hour < 180) {
i = 6;
} else if (hour >= 60 && hour < 120) {
i = 5;
} else if (hour >= 30 && hour < 60) {
i = 4;
} else if (hour >= 15 && hour < 30) {
i = 3;
} else if (hour >= 10 && hour < 15) {
i = 2;
} else {
i = 1;
}
var prin = parseInt(i) * 10 + "%";
$("#printHour").css("width", prin); //控制显示的进度条
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询