|
@@ -153,13 +153,13 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
its.content = its.content && its.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
|
|
|
str = '<div class="radio" name="scale' + its.parentId + '" value="' + its.score + '">';
|
|
|
if (it.selectType == 21 && item.resultType == 1) {
|
|
|
- str += '<label><input class="radio_type" type="radio" name="scale' + its.parentId + '" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '"/>'
|
|
|
+ str += '<label><input class="radio_type" type="radio" name="scale' + its.parentId + '" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '" resultType="' + item.resultType + '"/>'
|
|
|
} else if (it.selectType == 22 && item.resultType == 1) {
|
|
|
- str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '"/>'
|
|
|
+ str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '" resultType="' + item.resultType + '"/>'
|
|
|
} else if (it.selectType == 21 && item.resultType == 2) {
|
|
|
- str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '"/>'
|
|
|
+ str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '" resultType="' + item.resultType + '"/>'
|
|
|
} else if (it.selectType == 22 && item.resultType == 2) {
|
|
|
- str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '"/>'
|
|
|
+ str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '" resultType="' + item.resultType + '"/>'
|
|
|
}
|
|
|
str += its.content
|
|
|
if (item.resultType == 1) {
|
|
@@ -373,7 +373,7 @@ function getResult(pushInfo, textType) {
|
|
|
});
|
|
|
if (!$(".contentList").find(".item-title").hasClass('chColor') && !$(".contentList").find(".item-titles").hasClass('chColor')) {
|
|
|
$('input[type="radio"]:checked').each(function () {
|
|
|
- if (!isNaN($(this).val())) {
|
|
|
+ if ($(this).attr("resultType") == 1) {
|
|
|
num += parseFloat($(this).val())
|
|
|
} else {
|
|
|
arr.push($(this).attr("data_obj"))
|
|
@@ -381,23 +381,34 @@ function getResult(pushInfo, textType) {
|
|
|
}
|
|
|
});
|
|
|
$('input[type="checkbox"]:checkbox:checked').each(function () {
|
|
|
- if (!isNaN($(this).val())) {
|
|
|
+ if ($(this).attr("resultType") == 1) {
|
|
|
num += parseFloat($(this).val())
|
|
|
} else {
|
|
|
+ console.log($(this).attr("data_obj"))
|
|
|
arr.push($(this).attr("data_obj"))
|
|
|
proposals.push($(this).attr("proposal"))
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
+ console.log(arr)
|
|
|
tmp = arr.join(";");
|
|
|
+
|
|
|
if (pushInfo.length > 0) {
|
|
|
for (var i = 0; i < pushInfo.length; i++) {
|
|
|
if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
|
|
|
result = pushInfo[i].result + '(' + num + '分' + ')'
|
|
|
- proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
|
|
|
+ if (proposals.join(";")){
|
|
|
+ proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
|
|
|
+ }else{
|
|
|
+ proposal = pushInfo[i].pushInfo
|
|
|
+ }
|
|
|
break
|
|
|
} else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
|
|
|
result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
|
|
|
- proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
|
|
|
+ if (proposals.join(";")) {
|
|
|
+ proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
|
|
|
+ } else {
|
|
|
+ proposal = pushInfo[i].pushInfo
|
|
|
+ }
|
|
|
break
|
|
|
} else {
|
|
|
result = tmp
|
|
@@ -467,7 +478,8 @@ function renderTab(detailList, scale) {
|
|
|
$(".tabList").append(`<span class="tab" data-module="notice" data-title="` + noticeName + `">注意事项</span>`)
|
|
|
//$(".tabBox .title").html(noticeName);
|
|
|
}
|
|
|
- if (scale || getUrlArgObject('gauge') == 'gauge' || getUrlArgObject('type') == 8) {
|
|
|
+ if (!!scale && getUrlArgObject('type') == 8) {
|
|
|
+ console.log(1)
|
|
|
$(".tabList").append(`<span class="tab" data-module="scale" data-title="` + showName + `">评估内容</span>`)
|
|
|
//$(".tabBox .title").html(noticeName);
|
|
|
}
|
|
@@ -479,9 +491,6 @@ function renderTab(detailList, scale) {
|
|
|
$(".tabList .tab").eq(0).addClass("activeTab")
|
|
|
defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
|
|
|
}
|
|
|
- if (!scale || detailList['静态知识'] == undefined){
|
|
|
- $(".tabList .tab").eq(0).removeClass("activeTab")
|
|
|
- }
|
|
|
$(`.${defaultModuleName}`).css("display", "block")
|
|
|
bindTabClick()
|
|
|
}
|
|
@@ -515,7 +524,7 @@ function adjustHeight() {
|
|
|
function adjustWidth() {
|
|
|
var wt = window.innerWidth || document.documentElement.clientWidth;
|
|
|
$(".titleH2").width(wt - 0.2 * wt - 33 - 200 - 17 - 40 - 15 + 'px')
|
|
|
- $(".content .infos").width(wt - 243 + 'px');
|
|
|
+ $(".content .infos").width(wt - 210 - 33 - 17 - 40 - 15 + 'px');
|
|
|
}
|
|
|
$(window).on('resize', function () {
|
|
|
adjustHeight()
|