浏览代码

问题聚焦

wyq 3 年之前
父节点
当前提交
65f993643c
共有 1 个文件被更改,包括 12 次插入11 次删除
  1. 12 11
      src/js/staticInfo.js

+ 12 - 11
src/js/staticInfo.js

@@ -124,11 +124,12 @@ function renderContent(list, contentWrapClassName) {
 function renderContentscale(list, contentWrapClassName, name) {
   var pushInfo = []
   var textType = []
+  var factor, constant
   $('.scaletitle').html(name);
   for (var i = 0; i < list[0].detailList.length; i++) {
     var item = list[0].detailList[i];
     textType.push(item.textType)
-    if (item.textType == 11) {
+    if (item.textType == 11) { 
       item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
       str = '<div class="infoBox scaleBox" data-id="' + item.id + '"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
         '">'
@@ -155,9 +156,11 @@ 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)) + '" resultType="' + item.resultType + '"/>'
+              console.log(item.factor)
+              console.log(item.constant)
+              str += '<label><input class="radio_type" type="radio" name="scale' + its.parentId + '" value="' + parseFloat(((its.score * it.factor + it.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)) + '" resultType="' + item.resultType + '"/>'
+              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + parseFloat(((its.score * it.factor + it.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 + '" resultType="' + item.resultType + '"/>'
             } else if (it.selectType == 22 && item.resultType == 2) {
@@ -230,7 +233,7 @@ function renderContentscale(list, contentWrapClassName, name) {
   adjustHeight();
   adjustWidth()
   getcheck()
-  getResult(pushInfo, textType)
+  getResult(pushInfo, textType, factor, constant)
   copy(name)
   getprinting()
 
@@ -334,7 +337,6 @@ function copy(name) {
     }
     var inputs = document.getElementById("inputs");
     inputs.value = name + '结果为:' + texts.substring(3); // 修改文本框的内容(赋值内容)
-    console.log(inputs.value)
     inputs.select(); // 选中文本
     document.execCommand("copy"); // 执行浏览器复制命令
     Toast('复制成功', 500, 'success')
@@ -355,7 +357,7 @@ function getchecks() {
     }
   });
 }
-function getResult(pushInfo, textType) {
+function getResult(pushInfo, textType, factor, constant) {
   $(".but").click(function () {
     let arr = [];
     let multarr = []
@@ -369,14 +371,11 @@ function getResult(pushInfo, textType) {
     let v
     let numType = false
     isclick = true
-    
     for (var i = 0; i < textType.length; i++) {
-      console.log(textType[i])
       if (textType[i] == 13) {
         numType = true
       }
     }
-    console.log(numType)
     $(".contentList").each(function (i) {
       if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
         $(this).find(".item-title").addClass('chColor');
@@ -393,7 +392,7 @@ function getResult(pushInfo, textType) {
 
     for (var i = 0; i < scrollTop.length; i++) {
       if (scrollTop[i] != undefined){
-        v = i
+        v = scrollTop[i]
         break
       }
     }
@@ -446,6 +445,9 @@ function getResult(pushInfo, textType) {
         result = tmp
         proposal = proposals.join(";");
       }
+      console.log(factor+2)
+      console.log(num)
+      // num = num*factor + constant
       if (result) {
         $(".hel").attr({
           "title": proposal
@@ -504,7 +506,6 @@ function renderTab(detailList, scale) {
     //$(".tabBox .title").html(noticeName);
   }
   if (!!scale && getUrlArgObject('type') == 8) {
-    console.log(1)
     $(".tabList").append(`<span class="tab" data-module="scale" data-title="` + showName + `">评估内容</span>`)
     //$(".tabBox .title").html(noticeName);
   }