Browse Source

修改参数

zhangxc 6 years ago
parent
commit
0ce0866162
4 changed files with 88 additions and 125 deletions
  1. 36 36
      src/index.js
  2. 5 26
      src/js/drugInfo.js
  3. 5 21
      src/js/information.js
  4. 42 42
      src/js/scale.js

+ 36 - 36
src/index.js

@@ -6,43 +6,43 @@ import {post,config,getUrlArgObject} from './js/promise.js';
 import {bqtsFun,ybzlFun,cyywFun,knzdFun,jtFun,tjwzFun,tjtgFun,tjhyFun,tjfjFun} from './js/indexDom';
 //地址栏参数 ?age=99&lisJson=&diseaseId=&diagJson=糖尿病&pastJson=无心脏病&otherJson=无高血压&pacsJson=腹部B超:无异常, 报告日期:2019-05-07&sex=男&symptomJson=恶心呕吐腰痛&vitalJson=血压左上肢13/12mmHg
 
-// var msg= {
-// 	age: 28,
-//   diag: "急性胰腺炎",
-//   diseaseId: 280,
-//   featureType: "1,4,5,6,7,8,22",
-//   lis: [
-//     {
-//       detailName: "HGB*3/HCT",
-//       maxValue: "",
-//       minValue: "",
-//       name: "血常规",
-//       otherValue: "",
-//       source: "0",
-//       time: "2019-05-07 17:11",
-//       uniqueName: "血常规-HGB*3/HCT",
-//       units: "",
-//       value: "4"
-//     }
-//   ],
-//   other: "无高血压",
-//   pacs: "腹部B超:无异常, 报告日期:2019-05-07",
-//   sex: 1,
-//   symptom: "恶心呕吐腰痛", //胸痛,背痛,恶心,呕吐     //恶心呕吐腰痛   //牙周袋形成
-//   vital: "血压左上肢13/12mmHg",
-// }
-var msg = {
-  age: getUrlArgObject('age'),
-  diseaseId: getUrlArgObject('diseaseId') || 21773,
-  sex: getUrlArgObject('sex') == '男'?1:(getUrlArgObject('sex') == '女'?2:(getUrlArgObject('sex') == '通用'?3:getUrlArgObject('sex'))),
-  symptom: getUrlArgObject('symptomJson'),
-  vital: getUrlArgObject('vitalJson'),
-  lis: getUrlArgObject('lisJson')? JSON.parse(getUrlArgObject('lisJson')) : [],
-  pacs: getUrlArgObject('pacsJson'),
-  diag: getUrlArgObject('diagJson'),
+var msg= {
+	age: 28,
+  diag: "急性胰腺炎",
+  diseaseId: 280,
   featureType: "1,4,5,6,7,8,22",
-  other: getUrlArgObject('otherJson') + getUrlArgObject('pastJson'),
-}//推送相关信息
+  lis: [
+    {
+      detailName: "HGB*3/HCT",
+      maxValue: "",
+      minValue: "",
+      name: "血常规",
+      otherValue: "",
+      source: "0",
+      time: "2019-05-07 17:11",
+      uniqueName: "血常规-HGB*3/HCT",
+      units: "",
+      value: "4"
+    }
+  ],
+  other: "无高血压",
+  pacs: "腹部B超:无异常, 报告日期:2019-05-07",
+  sex: 1,
+  symptom: "恶心呕吐腰痛", //胸痛,背痛,恶心,呕吐     //恶心呕吐腰痛   //牙周袋形成
+  vital: "血压左上肢13/12mmHg",
+}
+// var msg = {
+//   age: getUrlArgObject('age'),
+//   diseaseId: getUrlArgObject('diseaseId') || 21773,
+//   sex: getUrlArgObject('sex') == '男'?1:(getUrlArgObject('sex') == '女'?2:(getUrlArgObject('sex') == '通用'?3:getUrlArgObject('sex'))),
+//   symptom: getUrlArgObject('symptomJson'),
+//   vital: getUrlArgObject('vitalJson'),
+//   lis: getUrlArgObject('lisJson')? JSON.parse(getUrlArgObject('lisJson')) : [],
+//   pacs: getUrlArgObject('pacsJson'),
+//   diag: getUrlArgObject('diagJson'),
+//   featureType: "1,4,5,6,7,8,22",
+//   other: getUrlArgObject('otherJson') + getUrlArgObject('pastJson'),
+// }//推送相关信息
 
 window.msg = msg
 window.pushMessage = {}

+ 5 - 26
src/js/drugInfo.js

@@ -1,23 +1,18 @@
-import {post, imageUrlPrefix} from './promise.js';
+import {post, imageUrlPrefix,getUrlArgObject, throttle} 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 urlParam = parseUrlParams();
-        console.log(urlParam)
+      
         var param = {
-            "type": urlParam.type,
-            "questionId": urlParam.questionId,
-            // "type": 8,
-            // "questionId": 145,
-            "position": 5
+            "type":  getUrlArgObject('type'),
+            "questionId":  getUrlArgObject('questionId'),
+            "position": getUrlArgObject('position')
         };
         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("暂时没有数据");
@@ -66,22 +61,6 @@ import {post, imageUrlPrefix} from './promise.js';
 
     }
 
-    function parseUrlParams(){
-        // var url = 'http://localhost:8082/scale.html?type=8&questionId=145'
-        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("=");
-            if (tmp[0] && tmp[1]) {
-                obj[tmp[0]] = tmp[1];
-            }
-        }
-        //});
-        return obj;
-    }
 
     function addLinkClickEvent(){
         $("li:first").addClass("active");

+ 5 - 21
src/js/information.js

@@ -1,18 +1,17 @@
-import {post, throttle, imageUrlPrefix} from './promise.js';
+import {post, throttle, imageUrlPrefix, getUrlArgObject} 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 urlParam = parseUrlParams();
-        console.log(urlParam)
+       
         var param = {
-            "type": urlParam.type || 7,
-            "questionId": urlParam.questionId || 21773,
+            "type":  getUrlArgObject('type'),
+            "questionId":  getUrlArgObject('questionId'),
             // "type": 7,
             // "questionId": 21773,
-            "position":2
+            "position": getUrlArgObject('position')
         };
 
         post(infoUrl, param).then((res) => {
@@ -72,21 +71,6 @@ import {post, throttle, imageUrlPrefix} from './promise.js';
 
     }
 
-    function parseUrlParams(){
-        // var url = 'http://localhost:8082/scale.html?type=7&questionId=21733'
-        var url = window.location.search;
-        var params = url.substring(url.indexOf('?')+1).split("&");
-        var tmp = '',obj = {},it={};
-        for(var i=0;i<params.length;i++) {
-            it = params[i];
-            tmp = it.split("=");
-            if (tmp[0] && tmp[1]) {
-                obj[tmp[0]] = tmp[1];
-            }
-        }
-        return obj;
-        
-    }
 
     function addLinkClickEvent(){
         $("li:first").addClass("active");

+ 42 - 42
src/js/scale.js

@@ -50,54 +50,54 @@ $(function(){
                     } 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
-                        }
-                        scaleList.group[indexList[0]].rows[indexList[1]].row[indexList[2]].details[indexList[3]].select = 1
-                        // console.log('this',$(this).parent().parent().parent().attr('class'))
-                        const className = $(this).parent().parent().parent().attr('data-group')
-                        for(let i = 0; i < $('.'+className).length; i++) {
-                            $('.'+className).eq(i).removeClass('noSelect')
-                        }
-                        // for(let i = 0; i < $(this).parent().parent().parent().parent().find(className).length; i++) {
-                        //     $(this).parent().parent().parent().parent().find(className).eq(i).removeClass('noSelect')
-                        // }
-                        // $(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++) {
-                                if(scaleList.group[i].rows[j].required == 1) {
-                                    let itemSelect = false
-                                    for (let x = 0; x < scaleList.group[i].rows[j].row.length; x++) {
-                                        
-                                        // 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().attr('class'))
+                    const className = $(this).parent().parent().parent().attr('data-group')
+                    for(let i = 0; i < $('.'+className).length; i++) {
+                        $('.'+className).eq(i).removeClass('noSelect')
+                    }
+                    // for(let i = 0; i < $(this).parent().parent().parent().parent().find(className).length; i++) {
+                    //     $(this).parent().parent().parent().parent().find(className).eq(i).removeClass('noSelect')
+                    // }
+                    // $(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++) {
+                            if(scaleList.group[i].rows[j].required == 1) {
+                                let itemSelect = false
+                                for (let x = 0; x < scaleList.group[i].rows[j].row.length; x++) {
+                                    
+                                    // 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).addClass('noSelect')
-                                    }
                                 }
-                                
+                                if(!itemSelect) {
+                                    allSelect = false
+                                    $('.' + i + j).addClass('noSelect')
+                                }
                             }
+                            
                         }
-                        if(allSelect) {
-                            getCalcuResult(scaleList)
-                        }
-                    })
+                    }
+                    if(allSelect) {
+                        getCalcuResult(scaleList)
+                    }
+                })
     
-                }
               }