Browse Source

打开网页定位问题

wyq 3 năm trước cách đây
mục cha
commit
2ef526f88f
2 tập tin đã thay đổi với 74 bổ sung45 xóa
  1. 39 17
      src/css/informationOut.less
  2. 35 28
      src/js/informationOut.js

+ 39 - 17
src/css/informationOut.less

@@ -173,7 +173,7 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
   height: 10px;
   position: absolute;
   top: 28px;
-  left: 25px;
+  left: 27px;
   z-index: 1;
   background: url('../images/icon-circular2.png');
   background-repeat: no-repeat;
@@ -186,15 +186,15 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
 }
 .anchors .a-circle:last-child{
   position: initial;
-  margin-left: 25px;
-  margin-top: 0;
+  margin-left: 28px;
+  margin-top: -17px;
 }
 .anchors i {
   position: absolute;
   display: inline-block;
   width: 10px;
   height: 10px;
-  left: -7px;
+  left: -6px;
   top: 8px;
   z-index: 1;
   background: url('../images/icon-circular.png');
@@ -230,7 +230,7 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
   width: 18px;
   height: 9px;
   top: 10px;
-  left: -10px;
+  left: -6px;
   border: none;
   background: url('../images/icon_current.png');
   background-repeat: no-repeat;
@@ -405,6 +405,7 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
   line-height: 28px;
   margin: 30px 0 8px 0;
   text-align: center;
+  display: none;
 }
 .scaleBox{
   border-bottom: none;
@@ -424,15 +425,13 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
     }
     .item-content{
       margin: 10px 0;
-      display: flex;
-      flex-flow: wrap;
+      display: inline-block;
       .radio {
         display: flex;
         margin: 5px;
         margin-right: 25px;
+        float: left;
         label{
-          display: flex;
-          align-items: center;
           font-weight: 400;
           color: #666666;
           line-height: 20px;
@@ -488,10 +487,9 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
   text-align: center;
   .result_box{
     padding:25px 56px;
-    position: relative;
+    display: inline-block;
     .result_left{
-      display: inline-block;
-      position: absolute;
+      float: left;
       .hel{
         background: #2C96E5;
         border-radius: 50%;
@@ -503,8 +501,7 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
     }
     .result_title{
       max-width: 85%;
-      display: inline-block;
-      margin-left: 70px;
+      float: left;
     }
   }
   
@@ -563,12 +560,12 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
 #Print{
   width: 100%!important;
   overflow-x: hidden;
+  overflow: auto;
 }
 .scale{
   .infos-box{
-    border: 1px solid #E6E6E6;
+    
     margin: 0 71px 20px 38px;
-    padding-top: 20px;
     .infoWrapper {
       padding: 0 75px;
     }
@@ -579,4 +576,29 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
 }
 .chColor{
   color: red!important;
-}
+}
+.info_left {
+    width: 527px;
+    margin: auto;
+    display: none;
+    overflow: hidden;
+    margin-top: 10px;
+    border:1px solid #D8D8D8;
+    li {
+      width: 50%;
+      height: 30px;
+      padding: 0 10px;
+      box-sizing: border-box;
+      border: 1px solid #bbbfc1;
+      border-right: none;
+      font-size: 14px;
+      float: left;
+      border-bottom: none;
+    }
+    &:nth-child(1) {
+      border-top: none;
+    }
+    &:nth-child(odd) {
+      border-left: none;
+    }
+  }

+ 35 - 28
src/js/informationOut.js

@@ -1,6 +1,6 @@
-if(!Promise){
+if (!Promise) {
   var Promise = require("bluebird");
-// Configure
+  // Configure
   Promise.config({
     longStackTraces: true,
     warnings: true // note, run node with --trace-warnings to see full stack traces for warnings
@@ -21,7 +21,7 @@ const print = require("../js/jQuery.print")
 let printing = require('./../images/printing.png');
 let printing2 = require('./../images/printing2.png');
 let hel = require('./../images/icon-hel.png');
-let showName, noticeName, clinicalPathwayName, showLis = [], selectedDrop = 0, selectedTab = 0, isclick,num
+let showName, noticeName, clinicalPathwayName, showLis = [], selectedDrop = 0, selectedTab = 0, isclick, num
 
 //如果是子窗口,隐藏网页查看按钮
 function myBrowser() {
@@ -49,7 +49,7 @@ function getInfomation() {
     "hospitalId": getUrlArgObject('hospitalId'),
     "hisName": getUrlArgObject('hisName'),
     "hisDetailName": getUrlArgObject('hisDetailName'),
-    "contentTypes":[1,2,3]
+    "contentTypes": [1, 2, 3]
   };
   //showName = param.hisName;
   // if (param.type == 5 || param.type == 51) {
@@ -58,12 +58,12 @@ function getInfomation() {
   // }
 
   post(config.getStaticKnowledgeForHIS, param).then((res) => {
-    if(res.data.code==='0'){
+    if (res.data.code === '0') {
       const data = res.data.data
       var str = '';
       var anchors = '';
-      let sName ='';
-      if (!data||data.length===0) {
+      let sName = '';
+      if (!data || data.length === 0) {
         showEmpty();
         return;
       }
@@ -77,7 +77,7 @@ function getInfomation() {
       $(".showWhichSelect").html(sName).attr("title", sName)
       showName = data[selectedDrop].name + "(" + data[selectedDrop].hisName + ")";
       showInfoSelect()
-      showInfo(data[selectedDrop],1)
+      showInfo(data[selectedDrop], 1)
       renderTitleShow();
       $('.content img').bind('contextmenu', function () {
         return false
@@ -93,7 +93,7 @@ function showEmpty() {
   $(".tabBox").html(str).css("border-bottom", "none");
   $("body").css('background', '#fff');
 }
-function showInfo(data,type) {
+function showInfo(data, type) {
   var detailList = data.details
   var scale = data.scale
   var staticKnowList = detailList['静态知识']
@@ -109,20 +109,21 @@ function showInfo(data,type) {
   //   "padding": "0px 60px 50px 0px"
   // });
   renderTab(detailList, scale)
-  staticKnowList&&renderContent(staticKnowList,'staticKnowledge')
-  noticeInfo&&renderContent(noticeInfo,'notice')
-  clinicalPathwayInfo&&renderContent(clinicalPathwayInfo,'clinicalPathway')
+  staticKnowList && renderContent(staticKnowList, 'staticKnowledge')
+  noticeInfo && renderContent(noticeInfo, 'notice')
+  clinicalPathwayInfo && renderContent(clinicalPathwayInfo, 'clinicalPathway')
   scaleInfo && renderContentscale(scaleInfo, 'scale', name)
 }
-function showInfoSelect(){
-  $('.showWhich li').click(function(){
+function showInfoSelect() {
+  $('.showWhich li').click(function () {
     let idx = $(this).attr('data-idx')
     let name = $(this).html(), str = ''
     selectedDrop = idx;
     selectedTab = 0;
     showName = showLis[idx].name + "(" + showLis[idx].hisName + ")";
     num = $(".activeTab").attr('data-num')
-    showInfo(showLis[idx],2)
+    
+    showInfo(showLis[idx], 2)
     $('.content .infos').scrollTop(0)
     $(".showWhich ul").css("display", "none")
     $(".showWhichSelect").html(name).attr("title", name)
@@ -141,6 +142,7 @@ function renderTitleShow() {
   // $(".titleCont .title").html($(".tabList .tab:eq(" + selectedTab + ")").attr("data-title"));
   $(".titleCont .title").html($(".showWhich .showWhichSelect").attr("title"));
   
+
 }
 function renderContent(list, contentWrapClassName) {
   $(`.${contentWrapClassName} .infos`).html('');
@@ -526,6 +528,7 @@ function addLinkClickEvent(contentWrapClassName) {
 
 function renderTab(detailList, scale) {
   $(".tabList").html('')
+  $(".container").css("display", "none")
   if (detailList['静态知识']) {
     $(".tabList").append(`<span class="tab" data-num="1" data-module="staticKnowledge" data-title="` + showName + `">静态知识</span>`)
   }
@@ -542,32 +545,35 @@ function renderTab(detailList, scale) {
     //$(".tabBox .title").html(noticeName);
   }
   let defaultModuleName
-  if ((getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) || (getUrlArgObject('scale') == 'scale' && detailList['静态知识']) || num == 2) {
+  if ((getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) || (getUrlArgObject('scale') && getUrlArgObject('scale') != 'staticKnowledge' && detailList['静态知识']) || num == 2) {
+    console.log(1)
     $(".tabList .tab").eq(1).addClass("activeTab")
     defaultModuleName = $(".tabList .tab").eq(1).attr("data-module")
   } else {
     $(".tabList .tab").eq(0).addClass("activeTab")
     defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
   }
-
+  if ($('.tabList').children('.tab').length == 1) {
+    $(".tabList .tab").eq(0).addClass("activeTab")
+    defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
+  }
   $(`.${defaultModuleName}`).css("display", "block")
   bindTabClick()
 }
-function bindTabClick(){
-  $(".tabList .tab").on("click", function(){
-    if ($('.tabList').children('.tab').length == 1){
+function bindTabClick() {
+  $(".tabList .tab").on("click", function () {
+    if ($('.tabList').children('.tab').length == 1) {
       return
     }
     const moduleName = $(this).attr("data-module")
     const display = $(`.${moduleName}`).css("display")
-      selectedTab=$('.tabList .tab').index(this);
-      // $(".titleCont .title").html($(this).attr('data-title'));
-    
-    if(display == "none"){
+    selectedTab = $('.tabList .tab').index(this);
+    // $(".titleCont .title").html($(this).attr('data-title'));
+    if (display == "none") {
       $(".activeTab").removeClass("activeTab")
       $(this).addClass("activeTab")
-      $(".container").css("display","none")
-      $(`.${moduleName}`).css("display","block")
+      $(".container").css("display", "none")
+      $(`.${moduleName}`).css("display", "block")
       $(`.${moduleName} .infos`).scrollTop(0)
     }
   })
@@ -577,11 +583,12 @@ function bindTabClick(){
     const hisName = getUrlArgObject('hisName');
     const hisDetailName = getUrlArgObject('hisDetailName');
     const scale = $('.activeTab').attr('data-module')
+    console.log(scale)
     openNewWin("informationOut.html?hospitalId=" + encodeURIComponent(hospitalId) + "&hisName=" + encodeURIComponent(hisName) + "&hisDetailName=" + encodeURIComponent(hisDetailName || '') + "&type=" + encodeURIComponent(type) + "&d=" + selectedDrop + "&t=" + selectedTab + "&scale=" + scale);
   })
 }
 function adjustHeight() {
-  const extHt = window.opener?60:0;
+  const extHt = window.opener ? 60 : 0;
   var ht = window.innerHeight || document.documentElement.clientHeight;
   $(".content").height(ht - 160 + "px");
   $(".content .infos").height(ht - 170 + "px");
@@ -592,7 +599,7 @@ function adjustWidth() {
   $(".titleH2").width(wt - 0.2 * wt - 33 - 200 - 17 - 40 - 15 + 'px')
   $(".content .infos").width(wt - 155 - 33 - 17 - 40 - 15 + 'px');
 }
-$(window).on('resize', function(){
+$(window).on('resize', function () {
   adjustHeight()
   adjustWidth()
 })