const qs = require('qs');
const $ = require('jquery');
const axios = require('axios');
var Utils = require('./rePromise');
require("./modal.js")
const {
  ywCheckApi
} = require('./api.js');

require('./scrollBar.js');
const baseUrl = '';
//页面映射
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',
  'YH-KSZR-GMKQXZB_XQ': 'mukuai.html?from=2',
  'YH-KSZR-TMQXZB_XQ': 'singleVeto.html?from=2&special=1',
  'YH-ZKK-GMKQXZB_XQ': 'mukuaiControl.html?from=1',
  'YH-ZKK-TMQXZB_XQ': 'singleVeto.html?from=1&special=1',
  'YH-YCSJJK': 'abnormal.html',
  'YH-ZKK-KSPJZYTS_XQ': 'dayDetail.html',
  'YH-ZKK-KSPJZYHF_XQ': 'payDetail.html',

  'YH-ZKK-GKSQXZB_XQ': 'deptScoreDetailControl.html',//各科室缺陷占比

  'YH-KSZR-KSQXZB_XQ': 'deptScoreDetailControlDept.html?from=2',
  'YH-ZKK-GKSJJBLZB_XQ': 'jiaji.html',

  'YH-ZKK-BASYHGLZB_XQ': 'partDetailControl.html',
  'YH-KSZR-BASYHGLZB_XQ': 'partDetailControlDept.html',
  'YH-ZKK-ZKHCTJ': 'checkControl.html',

  'YH-KSZR-ZKHCTJ_XQ': 'checkControlDept.html',
  'YH-KSZR-SXXXGTJ_XQ': 'uncorrectedCasesStatisticsDept.html',
  'YH-KSZR-31TZRYRS_XQ': 'readmissionDept.html',
  'YH-KSZR-ZMBLJCS_XQ': 'uncorrectedCopyDept.html',
  'YH-KSZR-YXBLJCS_XQ': 'uncorrectedCopyDept.html',

  'YH-JCSJWH-ZKLXWH': 'assertType.html',
  'YH-BLZK-ZKPFYLZ': 'qcListDocteam.html',
  'YH-ZKK-GJTMQXZB': 'keyItemFlawControl.html',
  'YH-ZKK-BASYHGLYSZB_XQ': 'qualifiedPhysician.html',
  'YH-KSZR-BASYHGLYSZB_XQ': 'deptQualifiedPhysician.html',
  'YH-ZKK-CYRSTJ': 'qcListOutHospital.html',
  'YH-ZKK-RYRSTJ': 'qcListOutHospital.html?inner=2',
  'YH-ZKK-WZGBLTJ': 'uncorrectedCasesStatistics.html',
  'YH-ZKK-31TZRYRS': 'readmission.html',
  'YH-ZKK-YXBLJCB': 'uncorrectedCopy.html',
  'YH-ZKK-ZMBLJCB': 'uncorrectedCopy.html',

  'YH-KSZR-GJTMQXZB_XQ': 'keyItemFlawControlDept.html',
  'YH-KSZR-CYRSTJ_XQ': 'qcListOutHospitalDept.html?from=2',
  'YH-KSZR-RYRSTJ_XQ': 'qcListOutHospitalDept.html?inner=2&from=2',
  'YH-ZKK-BLZK_XQ': 'qcListYw.html',
  'YH-KSZR-BLZK_XQ': 'qcListDeptYw.html',
  'YH-ZKHC-SCHCRW': 'creatCheckTask.html', //义乌-生成核查任务
  'YH-ZKHC-FPHCRW': 'allotCheckTask.html', //义乌-分配核查任务
  'YH-ZKHC-HCRWLB': 'checkTaskList.html', //义乌-核查任务列表
  'YH-ZKK-YLZLKZZB_XQ': 'qualityControl.html',
  'YH-SJBJ': 'editableDetail.html', //数据编辑
  'YH-ZKK-TMQXGSTJ': 'improveStatistics.html', //条目缺陷改善统计
  "YH-ZKK-LCZKSYTJ": 'useStatistics.html', //临床质控使用统计
  'YH-KSZR-TMQXGSTJ': 'improveStatisticsDept.html', //条目缺陷改善统计（科室）
  "YH-KSZR-LCZKSYTJ": 'useStatisticsDept.html', //临床质控使用统计（科室）

  "YH-SSXX-SSJL": 'appealHistory.html', //申诉记录
  "YH-SSXX-SSSH": 'appealCheck.html', //申诉审核
  "YH-SSXX-SSFQ": 'appealInit.html', //申诉发起列表
};

//导出时间天数
const exportTimeLimit = {
  defectTime: 90,
  normalTime: 7,
  yiwuTime: 30,
};

//重写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 getUrlArgObjectNew = function (name, srcUrl) {
  if (srcUrl.indexOf('?') == -1) {
    return '';
  }
  var r = srcUrl.split('?')[1].split('&'),
    obj = {};
  for (let i = 0; i < r.length; i++) {
    let tmp = r[i].split('=');
    obj[tmp[0]] = tmp[1];
  }
  return obj[name];
};
window.abortAjax = '';

const post = function (url, data, opts) {
  const token = localStorage.getItem('accessToken');
  if (localStorage.getItem('toLogin') === '1' && token) {
    //如果前面已经被标记为登录失效，接下来的请求都不发送
    return new Promise(() => { });
  }
  let isPlacefile = getCookie('isPlacefile') || 1;
  if (!token && window.location.href.indexOf('login') == -1) {
    setCookie('behosDateStart', '');
    setCookie('behosDateEnd', '');
  }
  for (let i = 0; i < $('.typeFilter').children().length; i++) {
    if (
      $('.typeFilter')
        .children()
        .eq(i)
        .html() == '出院日期：' &&
      isPlacefile == 0
    ) {
      $('.typeFilter')
        .children()
        .eq(i)
        .html('入院日期：');
    }
  }
  let need = window.location.href.indexOf('localhost') != -1;

  return new Utils((resolve, reject) => {
    abortAjax = $.ajax({
      method: 'post',
      url: (need ? baseUrl : '') + url,
      async: true,
      cache: false,
      processData: false,
      data: (opts && opts.needqs) ? qs.stringify(data) : JSON.stringify(Object.assign({}, data, {
        isPlacefile: (opts && opts.noPlacefile ? undefined : isPlacefile)
      })),
      contentType: 'application/json; charset=UTF-8',
      beforeSend: function (xmlHttp) {
        if (url.indexOf("sys/user/getHospitalMark") === -1) {
          xmlHttp.setRequestHeader('If-Modified-Since', '0');
          xmlHttp.setRequestHeader('Cache-Control', 'no-cache');
          xmlHttp.setRequestHeader('Authorization', token ? 'Bearer ' + token : '');
        }
      },
      success: function (resq) {
        const doc = parent ? parent.document : document;
        //console.log($(doc).find(".alertModal:visible"))
        //失效后不点知道了直接刷新处理：跳回登录页
        if (localStorage.getItem('toLogin') === '1' && $(doc).find(".alertModal:visible").length === 0) {
          (parent || window).location.href = 'login.html';
        }
        let res = resq;
        if (typeof resq === 'string') {
          res = JSON.parse(resq);
        }
        const code = res.code;
        const isOut = code === '10020011' || code === '10020012' || code === '10020013';
        if (isOut) {
          //登录信息失效处理
          unloginPop(res.msg);
        }else if(code === '00020007'){
          toast(res.msg)
        } else {
          resolve({
            data: res
          });
        }
      },
      error: function (error) {
        if (error.status === 403 || error.status === 401) {
          setCookie('behosDateStart', '');
          setCookie('behosDateEnd', '');
          if (!token && window.location.href.indexOf('login') == -1) {
          } else {
            if ($(".alertModal:visible").length) {
              return;
            }
            $.alerModal({
              "message": "没有该权限" + error.status,
              type: "tip",
              time: '1000',
              isFather: true,
              fatherWrapper: $("#mainBox", parent.document)
            });
          }
        } else if (error.status === 500 || error.status === 501 || error.status === 404 ) {
          $.alerModal({
            "message": '接口错误',
            type: "tip",
            time: '1000',
            isFather: true,
            fatherWrapper: $("#mainBox", parent.document)
          });
        }
        reject(error);
      },
    });
  });
};

//登录失效弹窗处理
function unloginPop(msg) {
  /*const isOut = code === '10020011' || code === '10020012' || code === '10020013';
  if(isOut){*/
  const isQcScore = parent && parent.location.href.indexOf("qcScore.html") === -1;
  if (self != top && isQcScore) {//子窗口并且不是病例列表
    const dialogmessage = {
      iframemessage: 1,
      data: msg
    }
    console.log('子窗口')
    window.parent.postMessage(JSON.stringify(dialogmessage), '*')
  } else {
    console.log('父窗口')
    $.alerModal({
      gobackBtn: true,
      title: "提示",
      type: "modal",
      width: '470',
      time: 1000,
      cancalText: '我知道了',
      isFather: true,
      fatherWrapper: $("#mainBox", parent.document),
      sureBtn: false,
      message: msg || '登录过期',
      callback: function () {
        clearAllCookie();
        (parent || window).location.href = 'login.html'
      }
    });
    //失效后不点知道了直接刷新处理标记
    localStorage.setItem('toLogin', 1);
  }
  /*}else{
  callback()
  }*/

}

// 导出
const expJson = (url, data) => {
  const token = localStorage.getItem('accessToken');
  if (!token && window.location.href.indexOf('login') == -1) {
    setCookie('behosDateStart', '');
    setCookie('behosDateEnd', '');
    window.location.href = '../login.html';
  }
  let need = window.location.href.indexOf('localhost') != -1;
  return axios({
    method: 'post',
    url: (need ? baseUrl : '') + url,
    data: data,
    contentType: 'application/vnd.ms-excel',
    responseType: 'blob', //必须添加，否则会乱码
    headers: {
      Authorization: 'Bearer ' + token,
    },
  });
};

//导出接口返回流下载
function downloadExportedData(data, fileName) {
  var blob = new Blob([data], {
    type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
  }); //application/vnd.openxmlformats-officedocument.spreadsheetml.sheet这里表示xlsx类型
  var downloadElement = document.createElement('a');
  var href = window.URL.createObjectURL(blob); //创建下载的链接
  downloadElement.href = href;
  downloadElement.download = fileName; //下载后文件名
  document.body.appendChild(downloadElement);
  downloadElement.click(); //点击下载
  document.body.removeChild(downloadElement); //下载完成移除元素
  window.URL.revokeObjectURL(href);
}

//判断浏览器是否为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;
};
const setLocal = function (name, value) {
  localStorage.setItem(name, value);
};

//读取cookies
const getLocal = function (name) {
  return localStorage.getItem(name);
};
//删除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();
};
const clearAllCookie = function () {
  var keys = document.cookie.match(/[^ =;]+(?=\=)/g);
  if (keys) {
    for (var i = keys.length; i--;)
      document.cookie = keys[i] + '=0;expires=' + new Date(0).toUTCString()
  }
}

//弹窗关闭事件
$('.modal .close').click(function () {
  $('.modal').hide();
});
//计算容器高度
function setBoxHeight() {
  const ht = window.innerHeight;
  const hw = window.innerWidth;
  if (hw < 1169) {
    $('.content-box').height(ht - 110 + 'px');
  } else {
    $('.content-box').height(ht - 60 + 'px');
  }
  //$('.content-box').height(ht - 60 + 'px');
  $('.flaw-table').height(ht - 70 + 'px');
  $('.content-ht').height(ht - 120 + 'px');
  $('.scroll-table tbody').css('max-height', ht - 210 + 'px');
}
setBoxHeight();
$(window).resize(function () {
  setBoxHeight();
});

//判断有无某一权限
function hasData(data) {
  let lis = JSON.parse(getCookie('codeLis')) || [];
  if (lis.indexOf(data) > -1) {
    //有权限
    return true;
  }
  return false;
}
//定位对应明细菜单
function focusMenuItem(code) {
  const ele = $(parent.document).find('.menu .page[code=' + code + ']');
  const parEle = ele.parents('.list-1');
  if (!parEle.is('.list-1-show')) {
    parEle.click();
  }
  //console.log($(parent.document).find(".menu .page[code='YH-ZKK-GMKQXZB_XQ']"))
  ele.click();
}

function emptyBox(name, showNum, type) {
  let showNumer = showNum || 30;
  let str = `<tr><td colspan="${showNumer}" style="text-align: center;color: #aaa">
  <img style="margin-top:50px;width:${type ? '110' : '140'}px;" src="${type ? require('../images/dataing.png') : require('../images/empty1.png')
    }" />
  <p style="margin-top:20px;margin-bottom:30px;color:#ccc;position:relative;left:5px;">${name ||
    '暂无数据~'}</p>
  </td></tr>`;
  return str;
}

function picEmptyData(dom, str) {
  let empty = `<div class="emptyBoxHome">
      <img src="${require('../images/emptyHome.png')}">
      <p>${str || '暂无数据~'}</p>
  </div>
  `;
  $(dom)
    .css({
      position: 'relative',
      display: 'block'
    })
    .html(empty);
}

function setTitleTxt(dom, from) {
  if (!from) {
    $(dom ? dom : '.partTitle')
      .find('a')
      .remove();
  }
}

//mode=1:本月，mode=2:本年，mode="default":默认情况（1周） startDateDefault：mode不等于1和2开始日期，endDateDefault：mode不等于1和2结束日期
function setDatePicker(picker1, picker2, mode, startDateDefault, endDateDefault) {
  $.datepicker.regional['zh-CN'] = {
    clearText: '清除',
    clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
    closeText: '关闭',
    closeStatus: '不改变当前选择',
    prevText: '<上月',
    prevStatus: '显示上月',
    prevBigText: '<<',
    prevBigStatus: '显示上一年',
    nextText: '下月>',
    nextStatus: '显示下月',
    nextBigText: '>>',
    nextBigStatus: '显示下一年',
    currentText: '今天',
    currentStatus: '显示本月',
    monthNames: [
      '一月',
      '二月',
      '三月',
      '四月',
      '五月',
      '六月',
      '七月',
      '八月',
      '九月',
      '十月',
      '十一月',
      '十二月',
    ],
    monthNamesShort: [
      '一月',
      '二月',
      '三月',
      '四月',
      '五月',
      '六月',
      '七月',
      '八月',
      '九月',
      '十月',
      '十一月',
      '十二月',
    ],
    yearNamesShort: [
      '一月',
      '二月',
      '三月',
      '四月',
      '五月',
      '六月',
      '七月',
      '八月',
      '九月',
      '十月',
      '十一月',
      '十二月',
    ],
    monthStatus: '选择月份',
    yearStatus: '选择年份',
    weekHeader: '周',
    weekStatus: '年内周次',
    dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
    dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
    dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
    dayStatus: '设置 DD 为一周起始',
    dateStatus: '选择 m月 d日, DD',
    dateFormat: 'yy-mm-dd',
    firstDay: 1,
    initStatus: '请选择日期',
    isRTL: false,
  };
  $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
  let startDate = '',
    endDate = new Date();
  let year = new Date().getFullYear();
  let month = new Date().getMonth() + 1;
  if (mode == '1') {
    startDate = new Date(`${year}-${month}-01`);
  } else if (mode == '2') {
    startDate = new Date(`${year}-01-01`);
  } else if (mode == 'default') {
    startDate = new Date(`${year}-01-01`);
  } else {
    startDate = startDateDefault || new Date();
    endDate = endDateDefault || new Date();
  }
  if (picker1) {
    picker1
      .datepicker({
        yearRange: '2015:' + year,
        changeMonth: true,
        changeYear: true,
        dateFormat: 'yy/mm/dd',
      })
      .datepicker('setDate', startDate);
  }
  if (picker2) {
    picker2
      .datepicker({
        yearRange: '2015:' + year,
        changeMonth: true,
        changeYear: true,
        dateFormat: 'yy/mm/dd',
      })
      .datepicker('setDate', endDate);
  }
}

//mode=1获取开始时间，mode=2获取结束时间
function getPickerDate(picker, mode) {
  if (!picker) {
    return;
  }
  let date = picker.val();
  console.log(date);
  if (mode == 1) {
    return date + ' 00:00:00';
    // return date.replace(/\//g,'-') + ' 00:00:00'
  } else if (mode == 2) {
    return date + ' 23:59:59';
    // return date.replace(/\//g,'-') + ' 23:59:59'
  }
}

function isMac() {
  var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
  return isMac;
}

function initScroll(el, sliderDir, sliderMode, top) {
  if (!$('.' + el + '_scroll_cont')[0]) {
    $('.' + el).addClass('scroll_cont');
    $('.' + el).addClass(el + '_scroll_cont');
    $('.' + el).wrap(`<div class="scroll_wrap ${el + '_scroll_wrap'}"></div>`);
    $(`${'.' + el + '_scroll_wrap'}`).append(`<div class="scroll_bar  ${el + '_scroll_bar'}">
        <div class="scroll_slider ${el + '_scroll_slider'}"></div>
    </div>`);
    if (sliderDir === 'YX') {
      $(`${'.' + el + '_scroll_wrap'}`).append(`<div class="scroll_bar  ${el + '_scroll_bar2'}">
          <div class="scroll_slider ${el + '_scroll_slider2'}"></div>
      </div>`);
    }
  }

  if (sliderDir == 'YX') {
    new CusScrollBar({
      contentSelector: `${'.' + el + '_scroll_cont'}`, //滚动内容区
      barSelector: `${'.' + el + '_scroll_bar'}`, //滚动条
      sliderSelector: `${'.' + el + '_scroll_slider'}`, //滚动滑块
      scrollDir: 'Y',
      sliderMode: sliderMode || 1,
      top: top || '0px',
    });
    new CusScrollBar({
      contentSelector: `${'.' + el + '_scroll_cont'}`, //滚动内容区
      barSelector: `${'.' + el + '_scroll_bar2'}`, //滚动条
      sliderSelector: `${'.' + el + '_scroll_slider2'}`, //滚动滑块
      scrollDir: 'X',
      sliderMode: sliderMode || 1,
    });
  } else {
    new CusScrollBar({
      contentSelector: `${'.' + el + '_scroll_cont'}`, //滚动内容区
      barSelector: `${'.' + el + '_scroll_bar'}`, //滚动条
      sliderSelector: `${'.' + el + '_scroll_slider'}`, //滚动滑块
      scrollDir: sliderDir || 'Y',
      sliderMode: sliderMode || 1,
      top: top || '0px',
    });
  }
}
//获取筛选分值、任务来源列表
function getScoreTabList(fn, isSource) {
  /*let val='';
  if(isSource){
      val = localStorage.getItem('sourceList');
  }else{
      val = localStorage.getItem('valueList');
  }

  if((val||'').trim()){
      fn(isSource?JSON.parse(val):val.split(","));
      return;
  }*/
  post(ywCheckApi.getCheckType).then(res => {
    if (res.data.code == '0') {
      const data = res.data.data;
      //localStorage.setItem('sourceList',JSON.stringify(data.source));
      //localStorage.setItem('valueList',data.value.join(","));
      fn(isSource ? data.source : data.value)
    } else {
      const token = localStorage.getItem('accessToken');
      if (!token && window.location.href.indexOf('login') == -1) {
        //alert('无token判断，跳回登录')
      } else {
        $.alerModal({
          "message": res.data.msg,
          type: "tip",
          time: '1000',
          isFather: true,
          fatherWrapper: $("#mainBox", parent.document)
        });
      }

    }
  }).catch((e) => {
    $.alerModal({
      "message": '获取任务来源及筛选分值数据失败',
      type: "tip",
      time: '1000',
      isFather: true,
      fatherWrapper: $("#mainBox", parent.document)
    });
  })
}

function listenScroll(dom) {
  $(dom ? dom : '.container').scroll(() => {
    $.datepicker._hideDatepicker($('#datepicker')[0]);
    $.datepicker._hideDatepicker($('#datepicker2')[0]);
    $.datepicker._hideDatepicker($('#datepickerFp1')[0]);
    $.datepicker._hideDatepicker($('#datepickerFp2')[0]);
    $.datepicker._hideDatepicker($('#datepickerQc1')[0]);
    $.datepicker._hideDatepicker($('#datepickerQc2')[0]);
    $('#datepicker').trigger('blur');
    $('#datepicker2').trigger('blur');
    $('#datepickerFp1').trigger('blur');
    $('#datepickerFp2').trigger('blur');
    $('#datepickerQc1').trigger('blur');
    $('#datepickerQc2').trigger('blur');
  });
}
//获取隐藏/替换logo参数
function getLogoParam() {
  const otherLogo = window.parent.location.search.indexOf("adLg=") > -1;
  const hideLogo = window.parent.location.search.indexOf("hideLg=") > -1;
  const otherLogoPm = otherLogo ? '&adLg=1' : '';
  const hideLogoPm = hideLogo ? '&hideLg=1' : '';
  return otherLogoPm + hideLogoPm;
}

function toast(msg) {
  return $.alerModal({
    "message": msg,
    type: "tip",
    time: '1000',
    isFather: true,
    fatherWrapper: $("#mainBox", parent.document)
  });
}
const explainTitle = {
  科室编码: 'deptId',
  科室: 'deptName',
  医疗组: 'doctorName',
  入院记录24小时内: 'ryjlw_24',
  首次病程记录8小时内: 'scbcjlw_8h',
  '副主任/主任医师首次查房72小时内完成': 'zrsccfw_72h',
  '入院后连记3天病程(不包括术后首程)': 'ryhljbcw_3d',
  '每周至少2次副主任/主任医师查房': 'zrcfw_2w',
  每周至少3次主治医师查房记录: 'zzcfw_3w',
  抢救记录6小时内完成: 'qjjlw_6h',
  会诊记录在会诊申请后24小时完成: 'hzjlw_24h',
  '术前讨论、术前小结完成': 'sqtlxjw',
  手术记录术后24小时内完成: 'sxjlsw_24h',
  术后首程在术后30分钟内完成: 'xhscw_30m',
  术后主刀查房24小时内完成: 'shzdcfw_24h',
  '术后连记3天病程(包括术后首程)': 'shjbcw_3d',
  '转科后连记3天病程(包括专科记录)': 'zkjbcw_3d',
  转接科记录专科后24小时内完成: 'zkjlw_24',
  '病危/重患者每日记录病程': 'bwzhjlbcw_md',
  输血后完成输血记录: 'sxhwjl',
  '24小时完成输血后评价': 'sxpjw_24',
  危急值记录: 'wjzwjl',
  住院30天阶段小结: 'wywwcxj',
};
module.exports = {
  pageMap,
  exportTimeLimit,
  post,
  getUrlArgObject,
  getUrlArgObjectNew,
  isIe8,
  setCookie,
  getCookie,
  delCookie,
  clearAllCookie,
  getLocal,
  setLocal,
  setBoxHeight,
  hasData,
  focusMenuItem,
  emptyBox,
  picEmptyData,
  setTitleTxt,
  downloadExportedData,
  expJson,
  setDatePicker,
  getPickerDate,
  isMac,
  initScroll,
  listenScroll,
  explainTitle,
  getScoreTabList,
  getLogoParam,
  toast
};