Browse Source

智能警示弹窗

zhangxc 4 years ago
parent
commit
f739bca4b1
6 changed files with 136 additions and 4 deletions
  1. 13 3
      src/css/cdssHorizontal.less
  2. 58 0
      src/html/smartAlert.html
  3. 18 1
      src/js/cdssHorizontal.js
  4. 8 0
      src/js/information.js
  5. 25 0
      src/js/smartAlert.js
  6. 14 0
      webpack.config.js

+ 13 - 3
src/css/cdssHorizontal.less

@@ -182,6 +182,7 @@
     max-height: 81px;
     overflow-y: hidden;
     background: #FFE8DD;
+    position: relative;
 }
 .moduleItem.tips .moduleTitle{
    color: #FF7836;
@@ -193,6 +194,15 @@
     line-height: 27px;
     color: #3B9ED0;
 }
+.showMoreNewPage{
+    display: inline-block;
+    cursor: pointer;
+    position: absolute;
+    line-height: 27px;
+    color: #3B9ED0;
+    right: 5px;
+    bottom: 0;
+}
 .longStrBox{
     position: absolute;
     width: 100%;
@@ -236,15 +246,15 @@
 .diag .moduleBoxName{
     position: absolute;
     left: 0;
-    font-size: 12px;
+    font-size: 4px;
     color:#1E1E1E;
     background: #E2EAF2;
     border: 0px;
     display: inline-block;
     line-height: 16px;
     border-radius: 2px;
-    top: 6px;
-    padding: 0 4px;
+    top: 4px;
+    padding: 2px 5px;
 }
 .rightBoxTitle{
     height: 36px;

File diff suppressed because it is too large
+ 58 - 0
src/html/smartAlert.html


+ 18 - 1
src/js/cdssHorizontal.js

@@ -38,6 +38,7 @@ const tipsMode = getUrlArgObject('tipsMode') || 1
 let planCode = getUrlArgObject('planCode') || 'all'
 let hospitalIdUrl = getUrlArgObject('hospitalId') || ''
 let msg;
+let tipsMsg;
 
 function getMRInfo() {
   return post(config.getMr2,{mrId:mrId})
@@ -206,7 +207,7 @@ function isNeedPush(list){
       let medicinesNum = $(".moduleItem.medicine").attr("data-num") || 5
       let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
 
-      renderLis(lisPush,lisNum,3,true)
+      renderLis(lisPush,1,3,true)
       renderPacs(pacsPush,pacsNum,5,true)
       renderCheckup(checkupPush,checkupNum,null,true)
       renderSymptomPush(symptomPush,symptomNum,null,true)
@@ -360,6 +361,15 @@ function renderPushWarning(){
       renderBillingPush(criticalValList,'危急值提醒')
       renderBillingPush(noteList,'检查注意事项')
       moreInfo()
+      if($(".moduleItem.tips")){
+        let tipsHei = $(".moduleItem.tips")[0].scrollHeight
+        if(tipsHei > 81){
+          $(".tips").append(`<span class="showMoreNewPage">更多</span>`)
+          tipsMsg = result
+          showMoreNewPage()
+        }
+      }
+ 
       // renderBillingPush(dubugStr,'注意调试信息')
      
     }
@@ -455,6 +465,13 @@ function bindSlide(){
     $(this).parent().parent().css("display","none")
   })
 }
+function showMoreNewPage(){
+[]
+  $(".showMoreNewPage").on("click", function(){
+    // openNewWin(`smartAlert.html?billMsgList=${encodeURIComponent(billMsgList)}&highRiskList=${encodeURIComponent(highRiskList)}&criticalValList=${encodeURIComponent(criticalValList)}&noteList=${encodeURIComponent(noteList)}`)
+    openNewWin(`smartAlert.html?tipsMsg=${encodeURIComponent(JSON.stringify(tipsMsg ))}`)
+  })
+}
 
 function setWidth(){
   let winWidth = $(".bodyWrap").css("width")

+ 8 - 0
src/js/information.js

@@ -1,3 +1,11 @@
+if(!Promise){
+  var Promise = require("bluebird");
+// Configure
+  Promise.config({
+    longStackTraces: true,
+    warnings: true // note, run node with --trace-warnings to see full stack traces for warnings
+  })
+}
 require('../css/information.less')
 const {
   post,

+ 25 - 0
src/js/smartAlert.js

@@ -0,0 +1,25 @@
+const $ = require("jquery");
+const {getUrlArgObject} = require('./promise.js');
+
+$(function(){
+  let tipsMsg = JSON.parse(getUrlArgObject("tipsMsg")) || {}
+ 
+  let billMsgList = tipsMsg.billMsgList || []
+  let highRiskList = tipsMsg.highRiskList || []
+  let criticalValList = tipsMsg.criticalValList || []
+  let noteList = tipsMsg.noteList || 
+  renderBillingPush(billMsgList,'开单合理性')
+  renderBillingPush(highRiskList,'高风险提示')
+  renderBillingPush(criticalValList,'危急值提醒')
+  renderBillingPush(noteList,'检查注意事项')
+  function renderBillingPush(list,name){
+    if(list.length === 0){
+      return
+    }
+    let str = `<p>${name}</p>`
+    for(let i = 0; i < list.length; i++){
+      str+= `<div>${list[i].msg}</div>`
+    }
+    $(".content").append(str)
+  }
+})

+ 14 - 0
webpack.config.js

@@ -22,6 +22,7 @@ module.exports = {
     view: path.resolve(__dirname, 'src/js', 'view.js'),
     cdss: path.resolve(__dirname, 'src/js', 'cdss.js'),
     cdssHorizontal: path.resolve(__dirname, 'src/js', 'cdssHorizontal.js'),
+    smartAlert: path.resolve(__dirname, 'src/js', 'smartAlert.js'),
     vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
   },
   output: {
@@ -47,6 +48,19 @@ module.exports = {
         collapseWhitespace: true //删除空白符与换行符
       }
     }),
+    new HtmlWebpackPlugin({
+      title: '智能警示',
+      template: path.resolve(__dirname, 'src/html', 'smartAlert.html'),
+      filename: 'smartAlert.html',
+      chunks: ['smartAlert', 'vendor', 'common'],
+      inject: true,
+      hash: true, //防止缓存
+      minify: {
+        removeAttributeQuotes: true, //压缩 去掉引号
+        removeComments: true, //移除HTML中的注释
+        collapseWhitespace: true //删除空白符与换行符
+      }
+    }),
     new HtmlWebpackPlugin({
       title: '病情提示',
       template: path.resolve(__dirname, 'src/html', 'illness.html'),