Browse Source

新增的文件提交

luolei 5 năm trước cách đây
mục cha
commit
5d3f7ede00
4 tập tin đã thay đổi với 298 bổ sung0 xóa
  1. 100 0
      src/css/staticSearch.css
  2. 76 0
      src/html/staticSearch.html
  3. BIN
      src/images/del_nor.png
  4. 122 0
      src/js/staticSearch.js

+ 100 - 0
src/css/staticSearch.css

@@ -0,0 +1,100 @@
+.container {
+    width: 80%;
+    background: #fff;
+    margin: 0 auto;
+    padding: 0 30px;
+    position: absolute;
+    /* width: 80%; */
+    left: 30px;
+    right: 30px;
+    height: 100%;
+    overflow: hidden;
+    /* box-sizing: border-box; */
+}
+.staticSearchT {
+    position: relative;
+    padding-right: 80px;
+    padding-bottom: 15px;
+    padding-top: 30px;
+}
+.container .ipt {
+    width: 100%;
+    height: 34px;
+    padding: 5px 25px 5px 5px;
+    vertical-align: top;
+    display: inline-block;
+    box-sizing: border-box;
+    border: 1px #CECECE solid;
+}
+.container .ipt input {
+    width: 100%;
+    position: relative;
+    top: 1px;
+}
+.container .searchScale {
+    display: none;
+}
+.container .staticSearchT button {
+    position: absolute;
+    right: 0;
+    top: 30px;
+    width: 80px;
+    height: 34px;
+    line-height: 34px;
+    color: #fff;
+    background: #2A9BD5;
+    text-align: center;
+    border: none;
+}
+.container .staticSearchT i {
+    position: absolute;
+    width: 15px;
+    height: 15px;
+    right: 85px;
+    top: 40px;
+    display: inline-block;
+    cursor: pointer;
+    background: url(/images/del_nor.png) center center no-repeat;
+    background-size:15px 15px;
+}
+.staticSearchB .tip,.container .staticSearchT i,.staticSearchB .empty {
+    display: none;
+}
+.staticSearchB .empty {
+    color: #979797;
+    text-align: center;
+    line-height: 40px;
+    margin-top: 10px;
+}
+.staticSearchB ul {
+    position: absolute;
+    height: 480px;
+    /* width: 100%; */
+    right: 30px;
+    left: 30px;
+    overflow: auto;
+}
+.staticSearchB ul li {
+    border-bottom: 1px #CECECE solid;
+    line-height: 30px;
+    padding-top: 5px;
+    cursor: pointer;
+}
+.staticSearchB ul li:hover {
+    border-bottom: 2px solid #3B9ED0;
+}
+.staticSearchB ul i {
+    font-size: 12px;
+    color: #2A9BD5;
+}
+.staticSearchB .tip {
+    font-size: 12px;
+    color: #979797;
+    margin-bottom: 10px;
+}
+.staticSearchB ul span {
+    color: #979797;
+    font-size: 12px;
+    margin-bottom: 10px;
+    line-height: 20px;
+}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 76 - 0
src/html/staticSearch.html


BIN
src/images/del_nor.png


+ 122 - 0
src/js/staticSearch.js

@@ -0,0 +1,122 @@
+require('./../css/staticSearch.css');
+require('./../images/del_nor.png')
+var $ = require("jquery");
+var { post,config,getUrlArgObject,openNewWin } = require('./promise.js');
+
+var type = getUrlArgObject("type");
+$(".staticSearchT input").keyup(function(e) {
+    const ev = e||window.event;
+    const val = $(this).val();
+    const place = $(this).attr("placeholder")
+    $(this).parents(".staticSearchT").find("i").css({display:val==""?"none":"inline-block"})
+    
+    if(place == '量表搜索'){
+        if(val == ''){
+            $(".searchScale .staticSearchB .empty").css({display:'none'})
+            $(".searchScale .staticSearchB .tip").css({display:'none'})
+            $(".searchScale .staticSearchB ul").html('')
+        }
+        ev.keyCode == 13&&getScaleData(val);
+    }else if(place == '医学知识搜索'){
+        if(val == ''){
+            $(".searchKnowledge .staticSearchB .empty").css({display:'none'})
+            $(".searchKnowledge .staticSearchB .tip").css({display:'none'})
+            $(".searchKnowledge .staticSearchB ul").html('')
+        }
+        ev.keyCode == 13&&getKnowledgeData(val);
+    }
+})
+if(type == 1){
+    $(".searchScale").css({display:'none'})
+    $(".searchKnowledge").css({display:'block'})
+    $(".searchKnowledge .staticSearchT").on('click','button',function() {
+        var val = $(this).parents(".staticSearchT").find("input").val()
+        val!=''&&getKnowledgeData(val)
+    })
+}else if(type == 2){
+    $(".searchKnowledge").css({display:'none'})
+    $(".searchScale").css({display:'block'})
+    $(".searchScale .staticSearchT").on('click','button',function(e) {
+        var val = $(this).parents(".staticSearchT").find("input").val()
+        val!=''&&getScaleData(val)
+    })
+}
+
+function getKnowledgeData(value) {
+    post(config.getStaticKnowledge,{
+        inputStr: value
+        }).then((res) => {
+        const data = res.data
+        if(data.code == 0) {
+            var knowledgeLis = data.data;
+            var lisStr = ''
+            if(knowledgeLis&&knowledgeLis.length>0){
+                for(var i = 0;i<knowledgeLis.length;i++){
+                    var tmpPart = knowledgeLis[i]
+                    var tmpLi = `<li data-name='${tmpPart.name}' data-type='1'>
+                        <p>${tmpPart.name}<i>${tmpPart.libTypeName?('( '+tmpPart.libTypeName+' )'):''}</i></p>
+                        ${tmpPart.retrievalName?('<span>• '+tmpPart.retrievalName+'</span>'):''}
+                    </li>`
+                    lisStr += tmpLi
+                }
+                $(".searchKnowledge .staticSearchB .empty").css({display:'none'})
+                $(".searchKnowledge .staticSearchB .tip").css({display:'block'})
+                $(".searchKnowledge .staticSearchB ul").html(lisStr)
+            }else{
+                $(".searchKnowledge .staticSearchB .empty").css({display:'block'})
+                $(".searchKnowledge .staticSearchB .tip").css({display:'none'})
+                $(".searchKnowledge .staticSearchB ul").html('')
+            }
+        }else{
+            console.log(res)
+        }
+    })
+}
+function getScaleData(value) {
+    post(config.getStaticScale,{
+        filterName: [],
+        name: value
+    }).then((res) => {
+        const data = res.data
+        if(data.code == 0) {
+            var knowledgeLis = data.data;
+            var lisStr = ''
+            if(knowledgeLis&&knowledgeLis.length>0){
+                for(var i = 0;i<knowledgeLis.length;i++){
+                    var tmpPart = knowledgeLis[i]
+                    var tmpLi = `<li data-name='${tmpPart.name}' data-type='2'>
+                        <p>${tmpPart.name}<i>${tmpPart.libTypeName?('( '+tmpPart.libTypeName+' )'):''}</i></p>
+                    </li>`
+                    lisStr += tmpLi
+                }
+                $(".searchScale .staticSearchB ul").html(lisStr)
+                $(".searchScale .staticSearchB .empty").css({display:'none'})
+                $(".searchScale .staticSearchB .tip").css({display:'block'})
+            }else{
+                $(".searchScale .staticSearchB .empty").css({display:'block'})
+                $(".searchScale .staticSearchB .tip").css({display:'none'})
+                $(".searchScale .staticSearchB ul").html('')
+            }
+        }else{
+            console.log(res)
+        }
+    })
+}
+function adjustHeight() {
+    var ht = window.innerHeight;
+    $(".staticSearchB ul").height(ht - 120 + "px");
+}
+$(window).on('resize', function(){
+    adjustHeight()
+})
+
+$(".staticSearchB ul").on("click","li",function(){
+    const infoMsgName = $(this).attr('data-name')
+    const type = $(this).attr('data-type')
+    if(type == 1){
+        openNewWin(`information.html?type=7&position=0&name=${infoMsgName}`)
+    }else{
+        let msg = JSON.parse(getUrlArgObject("msg"));
+        openNewWin(`scale.html?featureType=21&sex=${msg.sex}&lis=${JSON.stringify(msg.lis)}&diag=${msg.diag}&diseaseName=${msg.diseaseName}&scaleName=${infoMsgName}&symptom=${msg.symptom}&other=${msg.other}&pacs=${msg.pacs}&vital=${msg.vital}&age=${msg.age}`)
+    }
+})