Browse Source

Merge branch 'test' of http://192.168.2.236:10080/zhouna/icssDService into test

Luolei 6 năm trước cách đây
mục cha
commit
d5b098fa06
8 tập tin đã thay đổi với 250 bổ sung290 xóa
  1. 1 3
      src/html/drugInfo.html
  2. 1 2
      src/html/information.html
  3. 1 0
      src/index.js
  4. 7 17
      src/js/disclaimer.js
  5. 44 81
      src/js/drugInfo.js
  6. 51 92
      src/js/information.js
  7. 27 1
      src/js/promise.js
  8. 118 94
      src/js/scale.js

+ 1 - 3
src/html/drugInfo.html

@@ -41,10 +41,8 @@
             position: relative;
         }
         .infos{
-
             height: 100%;
-            overflow-y: auto;
-            overflow-x: hidden;
+            overflow: auto;
         }
         .infos>div{
             margin-left: 210px;

+ 1 - 2
src/html/information.html

@@ -41,8 +41,7 @@
         }
         .infos{
             height: 100%;
-            overflow-y: auto;
-            overflow-x: hidden;
+            overflow: auto;
             padding: 0 60px 0 0;
         }
         .infos>div{

+ 1 - 0
src/index.js

@@ -49,6 +49,7 @@ window.pushMessage = {}
 
 
 post(config.pushInner,msg).then((res)=>{
+  console.log('index')
   var data = res.data
   if(data.code == 0){
     var result = data.data;

+ 7 - 17
src/js/disclaimer.js

@@ -1,24 +1,14 @@
+import {post} from './promise.js';
+
 (function(){
     getDisclaimer();
-    console.log(11111111111)
     function getDisclaimer() {
         var url ='http://192.168.2.236:5050/api/icss/disclaimerInformation/getDisclaimerInformations';
-        $.ajax({
-            type: 'post',
-            url: url,
-            data: '',
-            headers: {
-                // 'Accept': 'application/json, text/plain, */*',
-                'Content-Type':'application/json; charset=utf-8'
-            },
-            success: function(res) {
-                console.log('res', res)
-                $("h1").html(res.data[2].title);
-                $(".content").html(res.data[2].description);
-            },
-            error: function(error) {
-                console.log('err')
-            }
+        post(url, '').then((res) => {
+            const data = res.data.data;
+            $("h1").html(data[2].title);
+            $(".content").html(data[2].description);
         })
+
     }
 })()

+ 44 - 81
src/js/drugInfo.js

@@ -1,11 +1,10 @@
-// import { imageUrlPrefix } from '@utils/config.js';
+import {post, imageUrlPrefix} from './promise.js';
 (function(){
     getInfomation();
     function getInfomation(){
         // var infoUrl ="http://" + window.location.host+'/icss-web/kl/introduce/get_by_itemidAndType';
         // var infoUrl ="http://" + window.location.host+'/api/icss/introduceInfo/getByQuestionId';
         var infoUrl ='http://192.168.2.236:5050/api/icss/introduceInfo/getByQuestionId'
-        var imageUrlPrefix = 'http://192.168.2.241:82'
         var urlParam = parseUrlParams();
         console.log(urlParam)
         var param = {
@@ -15,91 +14,55 @@
             // "questionId": 145,
             "position": 5
         };
-        $.ajax({
-            type: 'POST',
-            url: infoUrl,
-            data: JSON.stringify(param),
-            headers: {
-                // 'Accept': 'application/json, text/plain, */*',
-                'Content-Type':'application/json; charset=utf-8'
-            },
-            success: function(res) {
-                   console.log(res) 
-                   var str='',anchors='',item='';
-                if(!res.data){
-                    $("h1").html("暂时没有数据");
-                    $(".anchors").css("display", "none");
-                    return;
-                }
-                var list  = res.data.introduceDetailList;
-                $("h1").html(res.data.tagName);
-                //list.map((item,i) =>{
-                for(var i=0;i<list.length;i++) {
-                    item = list[i];
-                    item.content = item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)
-                    anchors = '<li><i></i><a href="#' + item.id +
-                        '">' + item.title + '</a></li><li class="anchor-line"></li>';
-                    str = '<div class="title"><h2 id="' + item.id +
-                        '">' + '【'+ item.title + '】'+
-                        '</h2></div>' +
-                        '<div class="contentBox">' + item.content + '<div>';
-                    $(".infos").append(str);
-                    $(".anchors ul").append(anchors);
-                    //});
-                }
-                addLinkClickEvent();
-                adjustHeight();
+        post(infoUrl, param).then((res) => {
+            console.log('ressssssss', res)
+            const data = res.data.data
+            console.log(res) 
+            var str='',anchors='',item='';
+            if(!data){
+                $("h1").html("暂时没有数据");
+                $(".anchors").css("display", "none");
+                return;
+            }
+            var list  = data.introduceDetailList;
+            $("h1").html(data.tagName);
+            //list.map((item,i) =>{
+            for(var i=0;i<list.length;i++) {
+                item = list[i];
+                item.content = item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)
+                anchors = '<li><i></i><a href="#' + item.id +
+                    '">' + item.title + '</a></li><li class="anchor-line"></li>';
+                str = '<div class="title"><h2 id="' + item.id +
+                    '">' + '【'+ item.title + '】'+
+                    '</h2></div>' +
+                    '<div class="contentBox">' + item.content + '<div>';
+                $(".infos").append(str);
+                $(".anchors ul").append(anchors);
+                //});
+            }
+            addLinkClickEvent();
+            adjustHeight();
 
-                $(".infos").scroll(function() {
-                    var scrollTop = $('.infos').scrollTop()
-                    var divHeight = 0;
-                    for (var i = 0; i < list.length; i++) {
-                        divHeight = divHeight + parseInt($('#' + list[i].id).css('height')) + parseInt($('#' + list[i].id).parent().next().css('height')) +40
-                        if(divHeight > scrollTop) {
-                            // this.setState({
-                            //     currentIndex: i
-                            // })
-                            var anchor = 2*i
+            function addScrollEvent() {
+                var scrollTop = $('.infos').scrollTop()
+                var divHeight = 0;
+                for (var i = 0; i < list.length; i++) {
+                    divHeight = divHeight + parseInt($('#' + list[i].id).css('height')) + parseInt($('#' + list[i].id).parent().next().css('height')) +40
+                    if(divHeight > scrollTop) {
+                        // this.setState({
+                        //     currentIndex: i
+                        // })
+                        var anchor = 2*i
 
-                            $('.anchors ul').children().eq(anchor).addClass('active').siblings().removeClass('active')
-                            return
-                        }
+                        $('.anchors ul').children().eq(anchor).addClass('active').siblings().removeClass('active')
+                        return
                     }
-                })
-
+                }
             }
+            $(".infos").scroll(throttle(addScrollEvent,200))
+
         })
 
-        // $.post(infoUrl,param,function(res){
-        //     console.log('resssss', res)
-        //     if(res.ret == 0){
-        //         var str='',anchors='',item='';
-        //         if(!res.data){
-        //             $("h1").html("暂时没有数据");
-        //             return;
-        //         }
-        //         var list  = res.data.introduceDetailList;
-        //         $("h1").html(res.data.shortName);
-        //         //list.map((item,i) =>{
-        //         for(var i=0;i<list.length;i++) {
-        //             item = list[i];
-        //             anchors = '<li><i></i><a href="#anchor' + i +
-        //                 '">' + item.title + '</a></li><li class="anchor-line"></li>';
-        //             str = '<div class="title"><h2 id="anchor' + i +
-        //                 '">' + item.title +
-        //                 '</h2><div class="line"></div></div>' +
-        //                 '<div>' + item.description + '<div>';
-        //             $(".infos").append(str);
-        //             $(".anchors ul").append(anchors);
-        //             //});
-        //         }
-        //         addLinkClickEvent();
-        //         adjustHeight();
-        //     }else{
-        //         $(".container").html(res.msg);
-        //     }
-        // }
-        // );
 
     }
 

+ 51 - 92
src/js/information.js

@@ -1,11 +1,10 @@
-// import { imageUrlPrefix } from '@utils/config.js';
+import {post, throttle, imageUrlPrefix} from './promise.js';
 (function(){
     getInfomation();
     function getInfomation(){
         // var infoUrl ="http://" + window.location.host+'/icss-web/kl/introduce/get_by_itemidAndType';
         // var infoUrl ="http://" + window.location.host+'/api/icss/introduceInfo/getByQuestionId';
         var infoUrl ='http://192.168.2.236:5050/api/icss/introduceInfo/getByQuestionId'
-        var imageUrlPrefix = 'http://192.168.2.241:82'
         var urlParam = parseUrlParams();
         console.log(urlParam)
         var param = {
@@ -15,97 +14,61 @@
             // "questionId": 21773,
             "position":2
         };
-        $.ajax({
-            type: 'POST',
-            url: infoUrl,
-            data: JSON.stringify(param),
-            headers: {
-                // 'Accept': 'application/json, text/plain, */*',
-                'Content-Type':'application/json; charset=utf-8'
-            },
-            success: function(res) {
-                   console.log(res) 
-                   var str='',anchors='',item='';
-                if(!res.data){
-                    $("h1").html("暂时没有数据");
-                    $(".anchors").css("display", "none");
-                    return;
-                }
-                var list  = res.data.introduceDetailList;
-                $("h1").html(res.data.tagName);
-                $("h1").css({"color": "#267FD7","borderBottom":"4px solid  #E9E9E9","padding":"0px 60px 50px 0px"});
-                //list.map((item,i) =>{
-                for(var i=0;i<list.length;i++) {
-                    item = list[i];
-                    item.content = item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)
-                    anchors = '<li><i></i><a href="#' + item.id +
-                        '">' + item.title + '</a></li><li class="anchor-line"></li>';
-                    str = '<div class="title"><h2 id="' + item.id +
-                        '">' + item.title +
-                        '</h2></div>' +
-                        '<div>' + item.content + '<div>';
-                    if(i != list.length-1) {
-                        str +=  '<div class="line"></div>'
-                    }
-                    $(".infos").append(str);
-                    $(".anchors ul").append(anchors);
-                    //});
-                }
-                addLinkClickEvent();
-                adjustHeight();
 
-                $(".infos").scroll(function() {
-                    var scrollTop = $('.infos').scrollTop()
-                    var divHeight = 0;
-                    for (var i = 0; i < list.length; i++) {
-                        divHeight = divHeight + parseInt($('#' + list[i].id).css('height')) + parseInt($('#' + list[i].id).parent().next().css('height')) +40
-                        if(divHeight > scrollTop) {
-                            // this.setState({
-                            //     currentIndex: i
-                            // })
-                            var anchor = 2*i
+        post(infoUrl, param).then((res) => {
 
-                            $('.anchors ul').children().eq(anchor).addClass('active').siblings().removeClass('active')
-                            return
-                        }
-                    }
-                })
+            const data = res.data.data
+            console.log(res) 
+            var str='',anchors='',item='';
+            if(!data){
+                $("h1").html("暂时没有数据");
+                $(".anchors").css("display", "none");
+                return;
+            }
+            var list  = data.introduceDetailList;
+            $("h1").html(data.tagName);
+            $("h1").css({"color": "#267FD7","borderBottom":"4px solid  #E9E9E9","padding":"0px 60px 50px 0px"});
+            //list.map((item,i) =>{
+            for(var i=0;i<list.length;i++) {
+                item = list[i];
+                item.content = item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)
+                anchors = '<li><i></i><a href="#' + item.id +
+                    '">' + item.title + '</a></li><li class="anchor-line"></li>';
+                str = '<div class="title"><h2 id="' + item.id +
+                    '">' + item.title +
+                    '</h2></div>' +
+                    '<div>' + item.content + '<div>';
+                if(i != list.length-1) {
+                    str +=  '<div class="line"></div>'
+                }
+                $(".infos").append(str);
+                $(".anchors ul").append(anchors);
+                //});
+            }
+            addLinkClickEvent();
+            adjustHeight();
+            
 
-                
+            function addScrollEvent() {
+                var scrollTop = $('.infos').scrollTop()
+                var divHeight = 0;
+                for (var i = 0; i < list.length; i++) {
+                    divHeight = divHeight + parseInt($('#' + list[i].id).css('height')) + parseInt($('#' + list[i].id).parent().next().css('height')) +40
+                    if(divHeight > scrollTop) {
+                        // this.setState({
+                        //     currentIndex: i
+                        // })
+                        var anchor = 2*i
 
+                        $('.anchors ul').children().eq(anchor).addClass('active').siblings().removeClass('active')
+                        return
+                    }
+                }
             }
-        })
+            $(".infos").scroll(throttle(addScrollEvent,200))
+           
 
-        // $.post(infoUrl,param,function(res){
-        //     console.log('resssss', res)
-        //     if(res.ret == 0){
-        //         var str='',anchors='',item='';
-        //         if(!res.data){
-        //             $("h1").html("暂时没有数据");
-        //             return;
-        //         }
-        //         var list  = res.data.introduceDetailList;
-        //         $("h1").html(res.data.shortName);
-        //         //list.map((item,i) =>{
-        //         for(var i=0;i<list.length;i++) {
-        //             item = list[i];
-        //             anchors = '<li><i></i><a href="#anchor' + i +
-        //                 '">' + item.title + '</a></li><li class="anchor-line"></li>';
-        //             str = '<div class="title"><h2 id="anchor' + i +
-        //                 '">' + item.title +
-        //                 '</h2><div class="line"></div></div>' +
-        //                 '<div>' + item.description + '<div>';
-        //             $(".infos").append(str);
-        //             $(".anchors ul").append(anchors);
-        //             //});
-        //         }
-        //         addLinkClickEvent();
-        //         adjustHeight();
-        //     }else{
-        //         $(".container").html(res.msg);
-        //     }
-        // }
-        // );
+        })
 
     }
 
@@ -114,7 +77,6 @@
         var url = window.location.search;
         var params = url.substring(url.indexOf('?')+1).split("&");
         var tmp = '',obj = {},it={};
-        //params.map((it) =>{
         for(var i=0;i<params.length;i++) {
             it = params[i];
             tmp = it.split("=");
@@ -122,11 +84,8 @@
                 obj[tmp[0]] = tmp[1];
             }
         }
-        //});
         return obj;
-        // var obj={};
-        // url.replace(/([^?&=]+)=([^&]+)/g,(_,k,v)=>q[k]=v);
-        // return obj;
+        
     }
 
     function addLinkClickEvent(){

+ 27 - 1
src/js/promise.js

@@ -4,6 +4,7 @@ const config = {
   pushInner:'/api/icss/push/pushInner',
   calculate:'/api/icss/calc/calculate',
 }
+const imageUrlPrefix = 'http://192.168.2.241:82';
 const getUrlArgObject = (parm) => {  
   var query = window.location.search;
   // console.log(window.location)
@@ -27,8 +28,33 @@ const post = function(url,data){
     });
   });
 }
+
+const throttle =  function throttle(fn, threshhold) {
+  var timeout
+  var start = new Date;
+  var threshhold = threshhold || 160
+  return function () {
+ 
+  var context = this, args = arguments, curr = new Date() - 0
+  
+  clearTimeout(timeout)//总是干掉事件回调
+  if(curr - start >= threshhold){ 
+      // console.log("now", curr, curr - start)//注意这里相减的结果,都差不多是160左右
+      fn.apply(context, args) //只执行一部分方法,这些方法是在某个时间段内执行一次
+      start = curr
+  }else{
+  //让方法在脱离事件后也能执行一次
+      timeout = setTimeout(function(){
+         fn.apply(context, args) 
+      }, threshhold);
+     }
+   }
+ }
+
 export {
   config,
   post,
-  getUrlArgObject
+  getUrlArgObject,
+  imageUrlPrefix,
+  throttle
 }

+ 118 - 94
src/js/scale.js

@@ -1,5 +1,4 @@
-const qs = require('qs');
-import {post,config,getUrlArgObject} from './promise.js';
+import {post,getUrlArgObject} from './promise.js';
 
 $(function(){
     // 从地址栏获取参数,请求量表内容
@@ -14,6 +13,7 @@ $(function(){
     var name = GetQueryString('name') || "密西根糖尿病周围神经病评分(MDNS)";
     var url = "http://192.168.2.236:5050/api/icss/push/pushInner";
     var urlParam = parseUrlParams(); //参数
+    console.log('urlParam', urlParam.lis)
     // 用GetQueryString方法从地址栏获取参数,暂时写死
     var params = {
       "age": getUrlArgObject('age') || 28,
@@ -33,69 +33,65 @@ $(function(){
       // "lis":  []
     
     }
+
     if(id){
-      $.ajax({
-        method:'post',
-        url:url,
-        data:JSON.stringify(params),
-        dataType:'json',
-        contentType:'application/json',
-        success:function(res){ 
-          if(res.code==0){
-            scaleInfo = res.data.scale;
-            console.log('量表数据为:',scaleInfo);
-            for (var i = 0; i < scaleInfo.length; i++) {
-                if( scaleInfo[i].type == 1) {
-                    var scaleList = JSON.parse(scaleInfo[i].content)
-                    // console.log('scaleList', scaleList)
-                    renderCalcu(scaleList)
-                   
-                } else {
-                    $('.content').append(scaleInfo[i].content)
-                }
-                
-                $('input').on('change', function(e) {
-                    var indexList = $(this).attr('data-index').split(',')
-                    for (var i = 0; i < scaleList.group[indexList[0]].rows[indexList[1]].row[indexList[2]].details.length; i++) {
-                        scaleList.group[indexList[0]].rows[indexList[1]].row[indexList[2]].details[i].select = 0
+
+        post(url, params).then((res) => {
+            const data = res.data.data
+            if(res.data.code==0){
+                scaleInfo = data.scale;
+                // console.log('量表数据为:',scaleInfo);
+                for (var i = 0; i < scaleInfo.length; i++) {
+                    if( scaleInfo[i].type == 1) {
+                        var scaleList = JSON.parse(scaleInfo[i].content)
+                        // console.log('scaleList', scaleList)
+                        renderCalcu(scaleList)
+                       
+                    } else {
+                        $('.content').append(scaleInfo[i].content)
                     }
-                    scaleList.group[indexList[0]].rows[indexList[1]].row[indexList[2]].details[indexList[3]].select = 1
-                    // console.log('this',$(this).parent().parent().parent())
-                    $(this).parent().parent().parent().removeClass('noSelect')
-                })
-
-                $('.calcuBtn').on('click', function() {
-                    // console.log('scaleList', scaleList)
-                    let allSelect = true
-                    for (let i = 0; i < scaleList.group.length; i++) {
-                        for (let j = 0; j < scaleList.group[i].rows.length; j++) {
-                            for (let x = 0; x < scaleList.group[i].rows[j].row.length; x++) {
-                                let itemSelect = false 
-                                // console.log('scaleList.group[i].rows[j].row[x].details', scaleList.group[i].rows[j].row[x].details)
-                                for (let y = 0; y < scaleList.group[i].rows[j].row[x].details.length; y++) {
-                                    if (scaleList.group[i].rows[j].row[x].details[y].select == 1) {
-                                        itemSelect = true
+                    
+                    $('input').on('change', function(e) {
+                        var indexList = $(this).attr('data-index').split(',')
+                        for (var i = 0; i < scaleList.group[indexList[0]].rows[indexList[1]].row[indexList[2]].details.length; i++) {
+                            scaleList.group[indexList[0]].rows[indexList[1]].row[indexList[2]].details[i].select = 0
+                        }
+                        scaleList.group[indexList[0]].rows[indexList[1]].row[indexList[2]].details[indexList[3]].select = 1
+                        // console.log('this',$(this).parent().parent().parent())
+                        $(this).parent().parent().parent().removeClass('noSelect')
+                    })
+    
+                    $('.calcuBtn').on('click', function() {
+                        // console.log('scaleList', scaleList)
+                        let allSelect = true
+                        for (let i = 0; i < scaleList.group.length; i++) {
+                            for (let j = 0; j < scaleList.group[i].rows.length; j++) {
+                                for (let x = 0; x < scaleList.group[i].rows[j].row.length; x++) {
+                                    let itemSelect = false 
+                                    // console.log('scaleList.group[i].rows[j].row[x].details', scaleList.group[i].rows[j].row[x].details)
+                                    for (let y = 0; y < scaleList.group[i].rows[j].row[x].details.length; y++) {
+                                        if (scaleList.group[i].rows[j].row[x].details[y].select == 1) {
+                                            itemSelect = true
+                                        }
+                                    }
+                                    if(!itemSelect) {
+                                        allSelect = false
+                                        $('#' + i + j + x).addClass('noSelect')
                                     }
-                                }
-                                if(!itemSelect) {
-                                    allSelect = false
-                                    $('#' + i + j + x).addClass('noSelect')
                                 }
                             }
                         }
-                    }
-                    if(allSelect) {
-                        getCalcuResult(scaleList)
-                    }
-                })
+                        if(allSelect) {
+                            getCalcuResult(scaleList)
+                        }
+                    })
+    
+                }
+              }
 
-            }
-          }
-        },
-        error:function(err){
-          console.log('请求失败:',err);
-        }
-      })
+
+        })
+    
     }
 
   })
@@ -141,7 +137,7 @@ function renderCalcu(scaleList) {
 }
 
 function parseUrlParams(){
-    // var url = 'http://localhost:8082/scale.html?age=28&featureType=21&scaleId=40744&scaleName=密西根糖尿病周围神经病评分(MDNS)&sex=1&diag=肺结核(复诊);&lis=[]'
+    // var url = 'http://localhost:8082/scale.html?age=28&featureType=21&scaleId=40744&scaleName=密西根糖尿病周围神经病评分(MDNS)&sex=1&diag=肺结核(复诊);&lis=[{detailName: "HGB*3/HCT",maxValue: "",minValue: "",name: "血常规",otherValue: "",source: "0",time: "2019-05-07 17:11",uniqueName: "血常规-HGB*3/HCT",units: "",value: "4"}]'
     var url = window.location.search;
     var params = url.substring(url.indexOf('?')+1).split("&");
     var tmp = '',obj = {},it={};
@@ -164,46 +160,74 @@ function parseUrlParams(){
         type: 1,
         data: data
     }
-    $.ajax({
-        type: 'post',
-        url: url,
-        headers: {
-            // 'Accept': 'application/json, text/plain, */*',
-            'Content-Type':'application/json; charset=utf-8'
-        },
-        data: JSON.stringify(param),
-        success: function(res) {
-            // console.log('calcaRes', res, data)
-            if (res.code == 0) {
-
-                data.calculate.result = res.data.calcalculate.result
-                for(let i = 0; i < res.data.group.length; i++) {
-                    for(let j = 0; j < data.group.length; j++) {
-                        if (res.data.group[i].groupName == data.group[j].groupName) {
-                            data.group[j].groupCalculate.result = res.data.group[i].groupCalculate.result
-                        }
+    post(url, param).then((res) => {
+        const data = res.data.data
+        if (res.data.code == 0) {
+
+            data.calculate.result = data.calcalculate.result
+            for(let i = 0; i < data.group.length; i++) {
+                for(let j = 0; j < data.group.length; j++) {
+                    if (data.group[i].groupName == data.group[j].groupName) {
+                        data.group[j].groupCalculate.result = data.group[i].groupCalculate.result
                     }
                 }
-                if($('.calcu')) {
-                    for (let i = 0; i < $('.calcu').length; i++) {
-                        let calcuItemName  = $('.calcu').eq(i).prev().find('.groupName').html();
-                        let calcuItem = data.group.filter(function(item) {
-                            return item.groupName == calcuItemName
-                        })[0]
-                        $('.calcu').eq(i).html('记分:' + calcuItem.groupCalculate.result.value +  ' ' +  calcuItem.groupCalculate.result.text)
-                    }
+            }
+            if($('.calcu')) {
+                for (let i = 0; i < $('.calcu').length; i++) {
+                    let calcuItemName  = $('.calcu').eq(i).prev().find('.groupName').html();
+                    let calcuItem = data.group.filter(function(item) {
+                        return item.groupName == calcuItemName
+                    })[0]
+                    $('.calcu').eq(i).html('记分:' + calcuItem.groupCalculate.result.value +  ' ' +  calcuItem.groupCalculate.result.text)
                 }
-                $('.allCalcu').eq(0).html('总分:' + data.calculate.result.value +  ' ' + data.calculate.result.text)
+            }
+            $('.allCalcu').eq(0).html('总分:' + data.calculate.result.value +  ' ' + data.calculate.result.text)
 
 
-            } else {
-                alert(res.msg)
-            }
-           
-            
-        },
-        error: function(error) {
-            console.log(error)
+        } else {
+            alert(res.msg)
         }
     })
+    // $.ajax({
+    //     type: 'post',
+    //     url: url,
+    //     headers: {
+    //         // 'Accept': 'application/json, text/plain, */*',
+    //         'Content-Type':'application/json; charset=utf-8'
+    //     },
+    //     data: JSON.stringify(param),
+    //     success: function(res) {
+    //         // console.log('calcaRes', res, data)
+    //         if (res.code == 0) {
+
+    //             data.calculate.result = res.data.calcalculate.result
+    //             for(let i = 0; i < res.data.group.length; i++) {
+    //                 for(let j = 0; j < data.group.length; j++) {
+    //                     if (res.data.group[i].groupName == data.group[j].groupName) {
+    //                         data.group[j].groupCalculate.result = res.data.group[i].groupCalculate.result
+    //                     }
+    //                 }
+    //             }
+    //             if($('.calcu')) {
+    //                 for (let i = 0; i < $('.calcu').length; i++) {
+    //                     let calcuItemName  = $('.calcu').eq(i).prev().find('.groupName').html();
+    //                     let calcuItem = data.group.filter(function(item) {
+    //                         return item.groupName == calcuItemName
+    //                     })[0]
+    //                     $('.calcu').eq(i).html('记分:' + calcuItem.groupCalculate.result.value +  ' ' +  calcuItem.groupCalculate.result.text)
+    //                 }
+    //             }
+    //             $('.allCalcu').eq(0).html('总分:' + data.calculate.result.value +  ' ' + data.calculate.result.text)
+
+
+    //         } else {
+    //             alert(res.msg)
+    //         }
+           
+            
+    //     },
+    //     error: function(error) {
+    //         console.log(error)
+    //     }
+    // })
 }