瀏覽代碼

运行质控

zhangxc 5 年之前
父節點
當前提交
108df0a4bd
共有 8 個文件被更改,包括 327 次插入6 次删除
  1. 73 2
      src/css/index.less
  2. 7 0
      src/css/reset.less
  3. 二進制
      src/images/icon_warn.png
  4. 15 1
      src/index.html
  5. 47 1
      src/index.js
  6. 6 0
      src/js/api.js
  7. 176 0
      src/js/util.js
  8. 3 2
      webpack.config.js

+ 73 - 2
src/css/index.less

@@ -1,4 +1,75 @@
 @import './reset.less';
-div{
-  color: red;
+.container{
+  padding: 10px;
+  // min-width: 360px;
+  overflow-y: hidden;
+}
+.content{
+  border: 1px solid #E2E5EF;
+}
+.title{
+  height: 44px;
+  line-height: 44px;
+  padding: 0 15px;
+  border-bottom: 1px solid #E2E5EF;
+  .line{
+    display: inline-block;
+    width: 4px;
+    height: 18px;
+    background: #5799CC;
+    position: relative;
+    top: 4px;
+  }
+  .titleTxt{
+    font-size:16px;
+    font-weight:bold;
+    color: #333;
+  }
+  .numBox{
+    font-size: 14px;
+    color: #AAA;
+  }
+}
+.flawList{
+  padding: 0 15px 20px;
+  overflow-y: auto;
+}
+.flawItem{
+  border-bottom: 1px solid #E2E5EF;
+  line-height: 20px;
+  padding: 10px 100px 10px 20px;
+  position: relative;
+}
+.flawItemIconBox{
+  position: absolute;
+  display: inline-block;
+  width: 16px;
+  height: 16px;
+  left: 0;
+  top: 13px;
+}
+.flawItemIcon{
+  width: 16px;
+  
+}
+.flawItemMsgBox{
+  display: inline-block;
+  width: 100%;
+  border-right: 1px solid #E2E5EF;
+  box-sizing: border-box;
+}
+.flawItemScore{
+  position: absolute;
+  width: 100px;
+  text-align: right;
+  height: 20px;
+  line-height: 20px;
+  top: 50%;
+  margin-top: -10px;
+}
+.flawItemNum{
+  display: inline-block;
+  width: 30px;
+  text-align: left;
+  color: #FF4D4F;
 }

+ 7 - 0
src/css/reset.less

@@ -67,6 +67,13 @@ textarea {
   padding: 0;
   outline: none;
 }
+.fl{
+  float: left;
+}
+.fr{
+  float: right;
+}
+
 .clearfix:after{
   content: ""; 
   display: block; 

二進制
src/images/icon_warn.png


+ 15 - 1
src/index.html

@@ -13,7 +13,21 @@
 
 <body>
   <div class="container">
-      运行质控
+    <div class="content">
+      <div class="title clearfix">
+        <span class="line"></span>
+        <span class="titleTxt">缺陷详情</span>
+        <span class="numBox fr">
+          <span class="flawNum">*</span>
+          <span>条</span>
+        </span>
+        
+      </div>
+      <div class="flawList">
+
+      </div>
+    </div>
+      
   </div>
 </body>
 

+ 47 - 1
src/index.js

@@ -1,3 +1,49 @@
 require('./css/index.less');
-console.log(111)
+const $ = require("jquery");
+const {post,getUrlArgObject } = require('./js/util.js');
+const {api} = require('./js/api.js');
+const iconWarn = require("./images/icon_warn.png")
 
+let behospitalCode = getUrlArgObject("behospitalCode") ||'10003464_9'
+let hospitalId = getUrlArgObject("hospitalId") ||'3'
+let modeId = getUrlArgObject("modeId") || 1
+function setListHei(){
+    $(".flawList").css({
+        height:$(window).height()-90+'px'
+    })
+}
+setListHei()
+
+function getFLawList(){
+    post(api.analyzeRun,{behospitalCode:behospitalCode,hospitalId:hospitalId, modeId:modeId}).then(function(res){
+      if(res.data.code==='0'){
+        const data = res.data.data&&res.data.data.msgDTOList;
+        renderFlawList(data)
+       
+      }else{
+
+      }
+
+    }).catch(e =>{
+            
+    });
+};
+getFLawList()
+
+function renderFlawList(flawList){
+    let str = ``
+    for(let i = 0; i < flawList.length; i++){
+        let flawItem = `<div class="flawItem">
+            <span class="flawItemIconBox"><img class="flawItemIcon" src="${iconWarn}" /></span>
+            <span class="flawItemMsgBox">${flawList[i].msg}${flawList[i].info ? "("+flawList[i].info + ")" :''}</span>
+            <span class="flawItemScore fr">评分: <span class="flawItemNum">-${flawList[i].score}</span></span>
+        </div>`
+        str += flawItem
+        
+    }
+    $('.flawList').html(str)
+    $('.flawNum').html(flawList.length)
+}
+$(window).on("resize", function(){
+    setListHei()
+})

+ 6 - 0
src/js/api.js

@@ -0,0 +1,6 @@
+const api = {
+    analyzeRun:'/qc/behospitalInfo/analyze_run',
+}
+module.exports = {
+    api
+};

+ 176 - 0
src/js/util.js

@@ -0,0 +1,176 @@
+const qs = require('qs');
+const $ = require("jquery");
+var Utils = require('./rePromise');
+
+//页面映射
+const pageMap={
+  'YH-KZT':'console.html',
+  'YH-KZTKS':'deptConsole.html',
+  'YH-JCSJWH-MKSJWH':'moduleManager.html',
+  'YH-JCSJWH-TMSJWH':'itemManager.html',
+  'YH-BLZK-ZKPF':'qcList.html',
+  'YH-BLZK-ZKPFKS':'qcListDept.html',
+  'YH-BLZK-ZKPFGR':'qcListPerson.html',
+  'YH-TJFX':'statistics.html',
+  'YH-QXGL-YHGL':'userManager.html',
+  'YH-QXGL-JSGL':'roleManager.html',
+};
+const api={
+  getMenu:'/sys/user/getUserOrgMenu',     //获取菜单
+  midifyPassword:'/sys/user/midifyPassword',     //修改密码
+  getSubMenu:'/qc/mode/getMenu',   //获取质控评分菜单
+  delScore:'/qc/behospitalInfo/delCase' ,//删除评分项
+  editScore:'/qc/behospitalInfo/updCase' ,//修改评分
+  addScore:'/qc/behospitalInfo/addCase' ,//添加评分项
+  getRecordDetail:'/qc/behospitalInfo/getByBehospitalCode', //获取病例明细
+  getInfoModule:'/qc/module/getById',
+  getModuleById:'/qc/module/getModuleMap'
+};
+
+//重写assign方法
+if (typeof Object.assign != 'function') {
+  Object.assign = function (target) {
+    'use strict';
+    if (target == null) {
+      throw new TypeError('Cannot convert undefined or null to object');
+    }
+
+    target = Object(target);
+    for (var index = 1; index < arguments.length; index++) {
+      var source = arguments[index];
+      if (source != null) {
+        for (var key in source) {
+          if (Object.prototype.hasOwnProperty.call(source, key)) {
+            target[key] = source[key];
+          }
+        }
+      }
+    }
+    return target;
+  };
+}
+
+window.console = window.console || (function () {
+  var c = {}; c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
+    = c.clear = c.exception = c.trace = c.assert = function () { };
+  return c;
+})();
+
+const getUrlArgObject = function getQueryString(name) {
+  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+  var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
+  var r = window.location.search.substr(1).match(reg);
+  var q = window.location.pathname.substr(1).match(reg_rewrite);
+  if (r != null) {
+    return decodeURIComponent(r[2]);
+  } else if (q != null) {
+    return decodeURIComponent(q[2]);
+  } else {
+    return null;
+  }
+}
+
+const post = function (url, data) {
+  const token = getCookie('accessToken')
+  if(!token&&window.location.href.indexOf('login')==-1){
+    window.location.href = "../login.html"
+  }
+  return new Utils((resolve, reject) => {
+    $.ajax({
+      method: 'post',
+      url: url,
+      data: JSON.stringify(data),
+      contentType: "application/json; charset=UTF-8",
+      beforeSend: function (xmlHttp) {
+        xmlHttp.setRequestHeader("If-Modified-Since", "0");
+        xmlHttp.setRequestHeader("Cache-Control", "no-cache");
+        // xmlHttp.setRequestHeader("Authorization",token?"Bearer "+token:'')
+      },
+      success: function (res) {
+        resolve({ data: res });
+      },
+      error: function (error) {
+        // if(error.status===403||error.status===401){
+        //   const wd = window.parent.window||window;
+        //   wd.location.href = "../login.html";
+        // }
+        reject(error);
+      },
+    });
+  });
+}
+
+//判断浏览器是否为Ie8
+const isIe8 = function () {
+  var DEFAULT_VERSION = 8.0;
+  var ua = navigator.userAgent.toLowerCase();
+  var isIE = ua.indexOf("msie") > -1;
+  var safariVersion;
+  if (isIE) {
+    safariVersion = ua.match(/msie ([\d.]+)/)[1];
+  }
+  if (safariVersion <= DEFAULT_VERSION) {
+    return true
+  }
+}
+const setCookie = function(name,value){
+  let Days = 30;
+  let exp = new Date();
+  exp.setTime(exp.getTime() + Days*24*60*60*1000);
+  document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
+}
+
+//读取cookies
+const getCookie =function(name){
+  let arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
+  if(arr=document.cookie.match(reg))
+      return unescape(arr[2]);
+  else
+      return null;
+}
+
+//删除cookies
+const delCookie = function(name){
+  let exp = new Date();
+  exp.setTime(exp.getTime() - 1);
+  let cval=getCookie(name);
+  if(cval!=null)
+      document.cookie= name + "="+cval+";expires="+exp.toGMTString();
+};
+
+//弹窗关闭事件
+$(".modal .close").click(function(){
+  $(".modal").hide();
+});
+//计算容器高度
+function setBoxHeight(){
+  const ht=window.innerHeight;
+  $(".main-part").height((ht-60)+'px');
+  $(".content-ht").height((ht-126)+"px");
+}
+setBoxHeight();
+$(window).resize(function(){
+  setBoxHeight();
+});
+
+//判断有无某一权限
+function hasData(data){
+  let lis = JSON.parse(getCookie("codeLis"))
+  if(lis.indexOf(data)>-1){//有权限
+    return true
+  }
+  return false;
+}
+
+module.exports = {
+  pageMap,
+  api,
+  post,
+  getUrlArgObject,
+  isIe8,
+  setCookie,
+  getCookie,
+  delCookie,
+  setBoxHeight,
+  hasData
+};

+ 3 - 2
webpack.config.js

@@ -4,7 +4,7 @@ const CleanWebpackPlugin = require('clean-webpack-plugin'); // 清空打包目
 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 const webpack = require('webpack');
-const proxyHost = "http://192.168.2.236:5050";
+const proxyHost = "http://192.168.2.236:5858";
 module.exports = {
   entry: {
     index: path.resolve(__dirname, 'src', 'index.js'),
@@ -124,9 +124,10 @@ module.exports = {
   devServer: {
     contentBase: "./dist", //静态文件根目录
     proxy: {
-      '/api': proxyHost
+      '/': proxyHost
     },
     hot: true,
+    openPage:'index.html?behospitalCode=10003464_9&hospitalId=3&modeId=1'
   },
   stats: { children: false }
 }