浏览代码

Merge branch 'dynamicScale0609' into testNew

wyq 4 年之前
父节点
当前提交
cfae142ff8
共有 5 个文件被更改,包括 172 次插入132 次删除
  1. 39 0
      src/css/informationOut.less
  2. 1 0
      src/css/staticInfo.less
  3. 26 26
      src/html/informationOut.html
  4. 105 105
      src/js/informationOut.js
  5. 1 1
      src/js/staticInfo.js

+ 39 - 0
src/css/informationOut.less

@@ -346,6 +346,45 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
   background: url("../images/link.png") 0 -2px no-repeat;
   background-size: 25px 25px;
 }
+.footer{
+  width: 100%;
+  height: 52px;
+  background: #172238;
+  padding-top: 8px;
+  position: absolute;
+  bottom: 0;
+  z-index: 1;
+  p{
+    color:#fff;
+    text-align: center;
+    font-size: 12px;
+    white-space: nowrap;
+  }
+}
+
+.infos::-webkit-scrollbar, .anchors::-webkit-scrollbar {
+  /*滚动条整体样式*/
+  width: 6px;
+  height: 100px;
+  /*高宽分别对应横竖滚动条的尺寸*/
+  background: #ebeef5;
+  -webkit-box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.2);
+}
+
+.infos::-webkit-scrollbar-thumb, .anchors::-webkit-scrollbar-thumb {
+  /*滚动条里面小方块*/
+  width: 6px;
+  border-radius: 5px;
+  background: @staticMainColor;
+  height: 100px;
+}
+
+.infos::-webkit-scrollbar-track, .anchors::-webkit-scrollbar-track {
+  /*滚动条里面轨道*/
+  border-radius: 2px;
+  background: #f0f2f5;
+  opacity: .2;
+}
 
 .scaletitle{
   font-size: 20px;

+ 1 - 0
src/css/staticInfo.less

@@ -52,6 +52,7 @@
     font-weight: 600;
     border-left: 4px solid @staticMainColor;
     /*line-height: 30px;*/
+    color: #333333;
   }
 
   .content {

文件差异内容过多而无法显示
+ 26 - 26
src/html/informationOut.html


+ 105 - 105
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
@@ -20,13 +20,13 @@ require("./jquery-migrate");
 const jqprint = require("../js/jquery.PrintArea")
 let printing = require('./../images/printing.png');
 let printing2 = require('./../images/printing2.png');
-let showName,noticeName,clinicalPathwayName,showLis=[],selectedDrop=0,selectedTab=0
+let showName, noticeName, clinicalPathwayName, showLis = [], selectedDrop = 0, selectedTab = 0
 
 //如果是子窗口,隐藏网页查看按钮
-if(window.opener){
-    selectedDrop=getUrlArgObject("d")||0;
-    selectedTab=getUrlArgObject("t")||0;
-    $("#openWin,.footer").hide();
+if (window.opener) {
+  selectedDrop = getUrlArgObject("d") || 0;
+  selectedTab = getUrlArgObject("t") || 0;
+  $("#openWin,.footer").hide();
 }
 let icond = require('./../images/d.png').replace(/^undefined/g, '')
 function getInfomation() {
@@ -41,7 +41,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) {
@@ -50,42 +50,42 @@ 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;
       }
-      showLis=data
-      for(let i = 0;i < showLis.length;i++){
+      showLis = data
+      for (let i = 0; i < showLis.length; i++) {
         let tmp = showLis[i]
-        str+=`<li data-idx="${i}" title="${tmp.name}(${tmp.hisName})">${tmp.name}(${tmp.hisName})</li>`
+        str += `<li data-idx="${i}" title="${tmp.name}(${tmp.hisName})">${tmp.name}(${tmp.hisName})</li>`
       }
       $(".showWhich ul").html(str);
-        sName=showLis[selectedDrop].name+"("+showLis[selectedDrop].hisName+")";
-      $(".showWhichSelect").html(sName).attr("title",sName)
-      showName = data[selectedDrop].name+"("+data[selectedDrop].hisName+")";
+      sName = showLis[selectedDrop].name + "(" + showLis[selectedDrop].hisName + ")";
+      $(".showWhichSelect").html(sName).attr("title", sName)
+      showName = data[selectedDrop].name + "(" + data[selectedDrop].hisName + ")";
       showInfoSelect()
       showInfo(data[selectedDrop])
-        renderTitleShow();
-      $('.content img').bind('contextmenu', function(){
+      renderTitleShow();
+      $('.content img').bind('contextmenu', function () {
         return false
       })
-    }else{
+    } else {
       showEmpty();
     }
   })
 }
 getInfomation();
-function showEmpty(){
-  const str=`<div class="empty"><img src="../images/empty3.png" alt=""><p>暂无静态知识</p></div>`;
-  $(".tabBox").html(str).css("border-bottom","none");
-  $("body").css('background','#fff');
+function showEmpty() {
+  const str = `<div class="empty"><img src="../images/empty3.png" alt=""><p>暂无静态知识</p></div>`;
+  $(".tabBox").html(str).css("border-bottom", "none");
+  $("body").css('background', '#fff');
 }
-function showInfo(data){
+function showInfo(data) {
   var detailList = data.details
   var scale = data.scale
   var staticKnowList = detailList['静态知识']
@@ -101,75 +101,75 @@ function showInfo(data){
   //   "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+")";
+    let name = $(this).html(), str = ''
+    selectedDrop = idx;
+    selectedTab = 0;
+    showName = showLis[idx].name + "(" + showLis[idx].hisName + ")";
     showInfo(showLis[idx])
     renderTitleShow();
     $('.content .infos').scrollTop(0)
-    $(".showWhich ul").css("display","none")
-    $(".showWhichSelect").html(name).attr("title",name)
+    $(".showWhich ul").css("display", "none")
+    $(".showWhichSelect").html(name).attr("title", name)
   })
-  $(".showWhichSelect").click(function(e){
+  $(".showWhichSelect").click(function (e) {
     e.stopPropagation()
     $(".showWhich ul").slideToggle()
   })
-  $(document).click(function(){
-    $(".showWhich ul").css("display","none")
+  $(document).click(function () {
+    $(".showWhich ul").css("display", "none")
   })
 }
-function renderTitleShow(){
-    document.title = showName;
-    $(".titleCont .title").html($(".tabList .tab:eq("+selectedTab+")").attr("data-title"));
+function renderTitleShow() {
+  document.title = showName;
+  $(".titleCont .title").html($(".tabList .tab:eq(" + selectedTab + ")").attr("data-title"));
 }
-function renderContent(list, contentWrapClassName){
+function renderContent(list, contentWrapClassName) {
   $(`.${contentWrapClassName} .infos`).html('');
   $(`.${contentWrapClassName} .anchors ul`).html('');
-    for (var i = 0; i < list.length; i++) {
-        var item = list[i];
-        item.content = item.content&&item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
-        anchors = '<li><i></i><a href="#' + contentWrapClassName+i +
-          '">' + item.title + '</a></li><li class="anchor-line"></li>';
-        str = '<div class="infoBox"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName+i +
-          '">'
-        if (getUrlArgObject('type') == 8) {
-          str += '【' + item.title + '】'
-        } else {
-          str += item.title
-        }
-        str += '</h2></div>' +
-          '<div class="contentWrapper"><pre>' + item.content + '</pre><div></div>';
-          str = `<div class="infoWrapper">${str}</div>`
-        $(`.${contentWrapClassName} .infos`).append(str);
-        $(`.${contentWrapClassName} .anchors ul`).append(anchors);
+  for (var i = 0; i < list.length; i++) {
+    var item = list[i];
+    item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
+    anchors = '<li><i></i><a href="#' + contentWrapClassName + i +
+      '">' + item.title + '</a></li><li class="anchor-line"></li>';
+    str = '<div class="infoBox"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
+      '">'
+    if (getUrlArgObject('type') == 8) {
+      str += '【' + item.title + '】'
+    } else {
+      str += item.title
     }
+    str += '</h2></div>' +
+      '<div class="contentWrapper"><pre>' + item.content + '</pre><div></div>';
+    str = `<div class="infoWrapper">${str}</div>`
+    $(`.${contentWrapClassName} .infos`).append(str);
+    $(`.${contentWrapClassName} .anchors ul`).append(anchors);
+  }
 
-    function addScrollEvent() {
-      var scrollTop = $(`.${contentWrapClassName} .infos`).scrollTop()
+  function addScrollEvent() {
+    var scrollTop = $(`.${contentWrapClassName} .infos`).scrollTop()
 
-      var divHeight = 0;
-      for (var i = 0; i < list.length; i++) {
-        divHeight = divHeight + parseInt($('#'+contentWrapClassName+i).css('height')) + parseInt($('#'+contentWrapClassName+i).parent().next().css('height')) + 20
-        if (divHeight > scrollTop) {
-          var anchor = 2 * i;
-          $(`.${contentWrapClassName} .anchors ul`).children().eq(anchor).addClass('active').siblings().removeClass('active');
-          return;
-        }
+    var divHeight = 0;
+    for (var i = 0; i < list.length; i++) {
+      divHeight = divHeight + parseInt($('#' + contentWrapClassName + i).css('height')) + parseInt($('#' + contentWrapClassName + i).parent().next().css('height')) + 20
+      if (divHeight > scrollTop) {
+        var anchor = 2 * i;
+        $(`.${contentWrapClassName} .anchors ul`).children().eq(anchor).addClass('active').siblings().removeClass('active');
+        return;
       }
     }
-    $(`.${contentWrapClassName} .infos`).scroll(throttle(addScrollEvent, 200));
-    addLinkClickEvent(contentWrapClassName);
-    adjustHeight();
-    adjustWidth()
+  }
+  $(`.${contentWrapClassName} .infos`).scroll(throttle(addScrollEvent, 200));
+  addLinkClickEvent(contentWrapClassName);
+  adjustHeight();
+  adjustWidth()
 }
 
 function renderContentscale(list, contentWrapClassName, name) {
@@ -459,7 +459,7 @@ function getResult(pushInfo, textType) {
         $(".foot").css('display', 'block')
       }
     } else {
-      Toast('温馨提示:必填选项不能为空~', 50000000, 'warn')
+      Toast('温馨提示:必填选项不能为空~', 500, 'warn')
     }
   })
   $(".printing").hover(
@@ -477,26 +477,26 @@ function addLinkClickEvent(contentWrapClassName) {
   $(`.${contentWrapClassName}  .anchors li>a`).on("click", function () {
 
     const that = this
-    setTimeout(function(){
+    setTimeout(function () {
       $(`.${contentWrapClassName} .anchors .active`).removeClass('active');
       $(that).parent().addClass("active");
-    },20)
+    }, 20)
 
   });
 }
 
-function renderTab(detailList, scale){
+function renderTab(detailList, scale) {
   $(".tabList").html('')
-  if(detailList['静态知识']){
-    $(".tabList").append(`<span class="tab" data-module="staticKnowledge" data-title="`+showName+`">静态知识</span>`)
+  if (detailList['静态知识']) {
+    $(".tabList").append(`<span class="tab" data-module="staticKnowledge" data-title="` + showName + `">静态知识</span>`)
     //$(".titleCont .title").html(showName);
   }
-  if(detailList['临床路径']){
-    $(".tabList").append(`<span class="tab" data-module="clinicalPathway" data-title="`+clinicalPathwayName+`">临床路径</span>`)
+  if (detailList['临床路径']) {
+    $(".tabList").append(`<span class="tab" data-module="clinicalPathway" data-title="` + clinicalPathwayName + `">临床路径</span>`)
     //$(".titleCont .title").html(clinicalPathwayName);
   }
-  if(detailList['注意事项']){
-    $(".tabList").append(`<span class="tab" data-module="notice" data-title="`+noticeName+`">注意事项</span>`)
+  if (detailList['注意事项']) {
+    $(".tabList").append(`<span class="tab" data-module="notice" data-title="` + noticeName + `">注意事项</span>`)
     //$(".titleCont .title").html(noticeName);
   }
   if (scale) {
@@ -505,43 +505,43 @@ function renderTab(detailList, scale){
   }
   $(".tabList .tab").eq(selectedTab).addClass("activeTab")
   let defaultModuleName = $(".tabList .tab").eq(selectedTab).attr("data-module")
-  $(`.${defaultModuleName}`).css("display","block")
+  $(`.${defaultModuleName}`).css("display", "block")
   bindTabClick()
 }
-function bindTabClick(){
-  $(".tabList .tab").on("click", function(){
+function bindTabClick() {
+  $(".tabList .tab").on("click", function () {
     const moduleName = $(this).attr("data-module")
     //const display = $(`.${moduleName}`).css("display")
-      selectedTab=$('.tabList .tab').index(this);
-      $(".titleCont .title").html($(this).attr('data-title'));
+    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")
-      $(`.${moduleName} .infos`).scrollTop(0)
+    $(".activeTab").removeClass("activeTab")
+    $(this).addClass("activeTab")
+    $(".container").css("display", "none")
+    $(`.${moduleName}`).css("display", "block")
+    $(`.${moduleName} .infos`).scrollTop(0)
     //}
   })
-  $("#openWin").on("click",function(){
-    const type= getUrlArgObject('type');
-    const hospitalId= getUrlArgObject('hospitalId');
-    const hisName= getUrlArgObject('hisName');
-    const hisDetailName= getUrlArgObject('hisDetailName');
-    openNewWin("informationOut.html?hospitalId="+encodeURIComponent(hospitalId)+"&hisName="+encodeURIComponent(hisName)+"&hisDetailName="+encodeURIComponent(hisDetailName||'')+"&type="+encodeURIComponent(type)+"&d="+selectedDrop+"&t="+selectedTab);
+  $("#openWin").on("click", function () {
+    const type = getUrlArgObject('type');
+    const hospitalId = getUrlArgObject('hospitalId');
+    const hisName = getUrlArgObject('hisName');
+    const hisDetailName = getUrlArgObject('hisDetailName');
+    openNewWin("informationOut.html?hospitalId=" + encodeURIComponent(hospitalId) + "&hisName=" + encodeURIComponent(hisName) + "&hisDetailName=" + encodeURIComponent(hisDetailName || '') + "&type=" + encodeURIComponent(type) + "&d=" + selectedDrop + "&t=" + selectedTab);
   })
 }
 function adjustHeight() {
-  const extHt = window.opener?60:0;
+  const extHt = window.opener ? 60 : 0;
   var ht = window.innerHeight || document.documentElement.clientHeight;
-    $(".content,.content .infos").height(ht - 158 + extHt + "px");
+  $(".content,.content .infos").height(ht - 158 + extHt + "px");
   /*$(".anchors").height(ht - 258 + "px");*/
 }
 function adjustWidth() {
   var wt = window.innerWidth || document.documentElement.clientWidth;
-  $(".titleH2").width(wt- 0.2*wt -33 - 200 - 17 - 40 -15 + 'px')
-    //$("pre").width(wt- 0.2*wt - 200 + 'px')
+  $(".titleH2").width(wt - 0.2 * wt - 33 - 200 - 17 - 40 - 15 + 'px')
+  //$("pre").width(wt- 0.2*wt - 200 + 'px')
 }
-$(window).on('resize', function(){
+$(window).on('resize', function () {
   adjustHeight()
   adjustWidth()
 })

+ 1 - 1
src/js/staticInfo.js

@@ -399,7 +399,7 @@ function getResult(pushInfo, textType) {
         $(".foot").css('display', 'block')
       }
     } else {
-      Toast('温馨提示:必填选项不能为空~', 50000000, 'warn')
+      Toast('温馨提示:必填选项不能为空~', 500, 'warn')
     }
   })
   $(".printing").hover(