123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- require('./../images/toast-1.png').replace(/^undefined/g, '');
- require('./../images/toast-2.png').replace(/^undefined/g, '');
- require('./../images/toast-3.png').replace(/^undefined/g, '');
- require('./../images/toast-4.png').replace(/^undefined/g, '');
- const transConf = function (arr) {
- window.arr = arr;
- // var arr = [
- // {hospitalCode: "A001", sysType: 16, name: "推荐诊断", code: "diagnose_show", value: 1},
- // {hospitalCode: "A001", sysType: 16, name: "问诊症状", code: "inquiry_show", value: 1},
- // {hospitalCode: "A001", sysType: 16, name: "体格检查", code: "health_show", value: 1},
- // {hospitalCode: "A001", sysType: 16, name: "病情提示", code: "illness_show", value: 1},
- // {hospitalCode: "A001", sysType: 16, name: "治疗方案", code: "cure_show", value: 0},
- // {hospitalCode: "A001", sysType: 16, name: "检验检查", code: "lispacs_show", value: 1},
- // {hospitalCode: "A001", sysType: 16, name: "推荐诊断", code: "diagnose_no", value: 7},
- // {hospitalCode: "A001", sysType: 16, name: "问诊症状", code: "inquiry_no", value: 1},
- // {hospitalCode: "A001", sysType: 16, name: "体格检查", code: "health_no", value: 2},
- // {hospitalCode: "A001", sysType: 16, name: "病情提示", code: "illness_no", value: 3},
- // {hospitalCode: "A001", sysType: 16, name: "治疗方案", code: "cure_no", value: 6},
- // {hospitalCode: "A001", sysType: 16, name: "检验检查", code: "lispacs_no", value: 5},
- // {hospitalCode: "A001", sysType: 16, name: "是否对接", code: "connect", value: 1},
- // {hospitalCode: "A001", sysType: 16, name: "医学知识", code: "knowledge_show", value: 0},
- // {hospitalCode: "A001", sysType: 16, name: "医学知识", code: "knowledge_no", value: 19},
- // {hospitalCode: "A001", sysType: 16, name: "全部量表", code: "scale_show", value: 0},
- // {hospitalCode: "A001", sysType: 16, name: "全部量表", code: "scale_no", value: 10},
- // {hospitalCode: "A001", sysType: 16, name: "警惕诊断", code: "vigilant_show", value: 1},
- // {hospitalCode: "A001", sysType: 16, name: "警惕诊断", code: "vigilant_no", value: 3}
- // ]
- const reg = /_show$/g;
- let newArr = arr.filter(item => item.code.match(reg) && +item.value === 1)
- for (let i = 0; i < newArr.length; i++) {
- for (let j = 0; j < arr.length; j++) {
- if (arr[j].code.match(/_no$/g) && arr[j].code.replace('_no', ' ') === newArr[i].code.replace('_show', ' ')) {
- newArr[i].orderNo = +arr[j].value
- }
- if (arr[j].code.match(/_num$/g) && arr[j].code.replace('_num', ' ') === newArr[i].code.replace('_show', ' ')) {
- newArr[i].showNum = +arr[j].value
- }
- }
- }
- newArr.sort((a, b) => {
- return a.orderNo - b.orderNo
- })
- let showLabsNum, showPacsNum, labsAndPacMode
- showLabsNum = arr.filter(item => item.code === 'inspeclis_num')[0] && arr.filter(item => item.code === 'inspeclis_num')[0].value
- showPacsNum = arr.filter(item => item.code === 'inspecpacs_num')[0] && arr.filter(item => item.code === 'inspecpacs_num')[0].value
- labsAndPacMode = arr.filter(item => item.code === 'lispacs_place')[0] && arr.filter(item => item.code === 'lispacs_place')[0].value
- return {
- confArr: newArr,
- showLabsNum,
- showPacsNum,
- labsAndPacMode
- }
- }
- const $ = require("jquery");
- function toggleWarnBox(text) {
- if (text) {
- $(".warning-box .content span").text(text);
- $(".warning-box").show();
- } else {
- $(".warning-box").hide();
- }
- }
- (function () {
- $.extend({
- /****
- * toast提示
- * 入参:type如下注释,必填;
- * text显示的提示语,必填,
- * time几毫秒秒后消失,可选,默认2000
- * 用法:$.toast('error','请求出错',3000);
- * ***/
- "toast": function (type, text, time = 3000, name, i) {
- if ($('#toast:visible').length) {
- $("#toast").remove()
- }
- var typeClass = {
- 'toast1': '../images/toast-1.png',
- 'toast2': '../images/toast-2.png',
- 'toast3': '../images/toast-3.png',
- 'toast4': '../images/toast-4.png',
- };
- if (type == 'toast1' || type == 'toast2') {
- $(name).find(".box[data-index=" + i + "] ").find(".moduleCenter").append(`<img id="toast" class="toast" src=${typeClass[type]}/>`)
- } else {
- console.log(123);
- $(name).find(".moduleBox ").find(".pushItemBox[data-index=" + i + "] ").append(`<img id="toast" class="toast" src=${typeClass[type]}/>`)
- }
- $("#toast").fadeOut(time, function () {
- $("#toast").remove()
- });
- },
- });
- })();
- module.exports = {
- transConf,
- toggleWarnBox
- }
|