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/reset.css');
require('./../css/cdss.less');
require('./../css/popup.css');
require('./../css/followUpV.less');
require('../css/staticSearch.less')
require('./../js/staticSearch.js');//静态知识搜索
require('./../images/empty.png').replace(/^undefined/g, '')
require('./../images/icon_admin.png').replace(/^undefined/g, '')
require('./../images/empty2.png').replace(/^undefined/g, '')
require('./../images/empty3.png').replace(/^undefined/g, '')
require('./../images/icon_no.png').replace(/^undefined/g, '')
require('./../images/loading.gif').replace(/^undefined/g, '')
require('./../images/right.png').replace(/^undefined/g, '')
require('./../images/new.png').replace(/^undefined/g, '')
require('./../images/t1.png').replace(/^undefined/g, '')
require('./../images/t2.png').replace(/^undefined/g, '')
require('./../images/t3.png').replace(/^undefined/g, '')
require('./../images/go.png').replace(/^undefined/g, '')
require('./../images/g1.png').replace(/^undefined/g, '')
// require('./popupEdit.js');
let infoImg = require('./../images/icon_info.png').replace(/^undefined/g, '')
let infoImgOn = require('./../images/icon_info_on.png').replace(/^undefined/g, '')
let iconArrowUp = require('./../images/icon_arrow_up.png').replace(/^undefined/g, '')
let iconArrowDown = require('./../images/icon_arrow_down.png').replace(/^undefined/g, '')
let iconMark = require('./../images/icon_mark.png').replace(/^undefined/g, '')
let warnImg = require('./../images/icon_warning.png').replace(/^undefined/g, '')
let warnImgWhite = require('./../images/icon_waring_white.png').replace(/^undefined/g, '')
let down = require('./../images/d1.png').replace(/^undefined/g, '')
let more = require('./../images/more.png').replace(/^undefined/g, '')
let up = require('./../images/icon-up.png').replace(/^undefined/g, '')
let maydiagnoseList = [], hasdiagnoseList = [];
let maydiagnoseType = false, hasdiagnoseType = false;
const $ = require("jquery");
const { post, config, getUrlArgObject, openNewWin, titleConfig } = require('./promise.js');
const { renderFollowUp, followEmpty } = require('./followUp.js');
const { getTcmMr } = require('./tcmiss.js');
const { transConf } = require('./util.js');
//静态知识类型: 1:诊断 2.药品 3.化验套餐 4.化验明细 5.辅检 6.手术和操作
let moduleConfig = {
auxiliary: "recommendWrap",
qc: "qcWrap",
medical: "medicalKonwledgeWrap",
followup: "followUpWrap",
tcmiss: 'tcmWarp',
}
let allInterface = 0; //需要调用的推送接口的个数
let hasCompleteTnterface = 0; //已返回的推送接口的个数
let moduleNum = 0
let indexNow
let mrId = getUrlArgObject('mrId')
let isTcm = getUrlArgObject('isTcm')
let pushMrId = getUrlArgObject('pushMrId')
const tipsMode = getUrlArgObject('tipsMode') || 1
let planCode = getUrlArgObject('planCode') || 'all'
let hospitalIdUrl = getUrlArgObject('hospitalId') || ''
let msg;
let treatDisName;
function getMRInfo() {
return post(config.getMr2, { mrId: mrId })
}
let ifInputParam; //是否有入参,显示输入空状态用
if (mrId) {
Promise.all([getConf(), getMRInfo()]).then(([res1, res2]) => {
const data = res1.data.data && res1.data.data[0]
msg = res2.data.data || {}
if (!(msg && msg.diseaseName && msg.diseaseName.name)) {
msg.diseaseName = null
}
window.msg = msg;
renderPage(data)
})
} else {
getConf().then(res => {
if (res.data.code == '0') {
// const configArr = res.data.data.pushSetList || []
// getPageInfo(configArr)
const data = res.data.data && res.data.data[0]
renderPage(data)
}
})
followEmpty()
}
function hasInputParam() {
const checkKeys = ["chief", "diag", "diseaseName", "drug", "drugOrder", "lis", "lisOrder", 'marital', 'menstrual', "operation", "operationOrder", "otherIndex", "otherOrder", "pacs", "pacsOrder", "pasts", "personal", "symptom", "transfusion", "transfusionOrder", "vital"];
let res = false;
let val;
checkKeys.map((it) => {
val = msg[it];
if (typeof val === 'string') {
if (val !== '') {
res = true;
}
} else {
const str = JSON.stringify(val);
if (!(str === '{}' || str === '[]')) {
res = true;
}
}
});
return res;
}
function getConf() {
var msg = window.msg
return post(config.getPushSet, { hospitalId: hospitalIdUrl || msg.hospitalId || 1, planCode: planCode })
}
function getPushInfo() {
return post(config.pushInner, Object.assign({}, msg, {
featureType: '1,4,5,6,7,8,9,10,12,13',
hospitalId: hospitalIdUrl || msg.hospitalId,
ruleType: config.ruleTypeMap['22'],
}))
}
function pushByDisease(name, i) {
return post(config.pushInner, Object.assign({}, msg, {
featureType: '1,4,5,6,7,8,9,10,12,13',
hospitalId: hospitalIdUrl || msg.hospitalId,
ruleType: config.ruleTypeMap['22'],
diseaseName: {
name: name,
uniqueName: name
}
}))
}
function getPusgWarning() {
const indPush = pushMrId ? config.indicationPushCache : config.indicationPush;
return post(indPush, Object.assign({}, msg, { ruleType: '1,2,3,4', mrId: pushMrId || mrId }))
}
function getWriteStandardPush() {
return post(config.caseWritingPrompt, Object.assign({}, msg, { hospitalId: 2 || msg.hospitalId }))
}
function getHosptDeptUsal() {
var msg = window.msg
const param = {
age: msg.age,
deptName: msg.deptName,
hospitalCode: msg.hosCode,
sexType: msg.sex,
type: 1,
}
return post(config.getHosptDeptUsal, param)
}
function getPushData(res) {
if (res && res.data && res.data.data && res.data.data.dis && res.data.data.dis) {
let dis = res.data.data.dis;
//急诊显示规则,主诊断有急诊优先显示,没有则显示推送的,推送也没有就不显示
if (dis && dis['页面急诊'] && (dis['页面急诊'].length > 0)) {
let name = dis['页面急诊'][0].name || ''
$(".allDis .disName").html(name)
disName = name
if (name) {
$(".singleDis").css("display", "block")
}
} else if (dis && dis['急诊'] && dis['急诊'].length > 0) {
let name = dis['急诊'][0].name || ''
$(".allDis .disName").html(name)
disName = name
if (name) {
$(".singleDis").css("display", "block")
}
}
}
}
let disName = ""
function handleShow() {
const newinConf = {
width: '600', //窗口的文档显示区的宽度。以像素计。
height: '826', //窗口文档显示区的高度。以像素计。
left: '0', //窗口的 x 坐标。以像素计。
top: '0', //窗口的 y 坐标。以像素计。
openMode: "_blank" //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
}
const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top} scrollbars=yes`
window.open('./emergency.html?disName=' + disName, newinConf.openMode, newWindowLocation)
}
$(document).on('click', ".allDis .allName", function () {
handleShow()
})
$(document).on('click', ".singleDis", function () {
$(this).next().css("display", "block")
$(this).css("display", "none")
})
$(document).on('click', ".allDis .right,.allDis .secDis", function () {
$(".allDis").css("display", "none")
$(".singleDis").css("display", "block")
})
function moreInfo() {
$('.infoImg').off("click").click(function () {
const name = $(this).parents(".pushItemBox").attr('data-name')
const type = $(this).parents(".pushItemBox").attr('data-type')
openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&mrId=${encodeURIComponent(mrId)}`)
})
$('.evaluationtitle').off("click").click(function () {
const name = $(this).parents(".pushItemBox").attr('data-name')
const type = $(this).parents(".pushItemBox").attr('data-type')
openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&page=1&mrId=${encodeURIComponent(mrId)}&gauge=gauge`)
})
}
function getVersion() {
return post(config.getVersion, 'confArr').then((res) => {
const data = res.data.data;
const ver = localStorage.getItem('versionTime');
const time = data.refreshTime;
if (!ver || ver === time + "=new" || time !== ver.replace("=new", "")) { //判断版本是否更新
$(".version-tip").addClass('new-icon');
localStorage.setItem('versionTime', time + "=new"); //保存版本更新时间
} else {
$(".version-tip").removeClass("new-icon");
}
})
}
function getDisclaimer() {
return post(config.disclaimer, {}).then((res) => {
const data = res.data.data.filter(item => item.disclaimerCode == "2");
$(".responsibility").html((data[0] || {}).description);
// $(".iframeWrap").css({height: $(window).height()-115-$(".responsibility").height()+"px"})
})
}
function renderPage(pageSet) {
const setInfo = pageSet.sysSetInfo;
if (!pageSet || !setInfo) {
return
}
renderTab(setInfo)
adjustHei()
const hasAuxiliary = hasTab("辅助信息", setInfo);
const hasMedical = hasTab("医学知识", setInfo)
const hasFollowUp = hasTab("随访计划", setInfo)
const hasTcm = hasTab("中医辅助", setInfo);
//所有模块都未开启配置,显示功能未开启(无tab)
if (hasAuxiliary.status === 0 && hasMedical.status === 0 && hasFollowUp.status === 0 && hasTcm.status === 0) {
const nullTxt = `
功能未开启
`
$(".contentWrapper").html(nullTxt);
return;
}
if (hasTcm) {
getTcmMr(mrId, hasTcm);
}
if (!mrId) {
return
}
if (hasFollowUp) {
renderFollowUp(msg)
}
const planDetail = hasAuxiliary.planDetails;
const configs = planDetail.filter((it) => it.status !== 0) || [];
if (!configs[0]) { //没有开启辅助信息各项配置
$('.empty-box').hide();
$('.recommendBox .empty-right').show();
return;
}
if (hasAuxiliary) {
$('.empty-box').hide();
$(".loading").show();
renderModuleWrapper(planDetail)
let needPush = isNeedPush(planDetail)
let needPushWarning = isNeedPushWarning(planDetail)
let needWriteStandardPush = isNeedwriteStandardPush(planDetail);
if (needPush) {
renderPushData()
allInterface++
}
if (needPushWarning) {
renderPushWarning()
allInterface++
}
if (needWriteStandardPush) {
renderWriteStandard()
allInterface++
}
}
}
function renderPushData() {
return getPushInfo().then(res => {
$(".loading").hide();
hasCompleteTnterface++
if (res.data.code == "0") {
const result = res.data.data
let diagList = result.clickPosDis || [] //可能诊断
let AffList = result.clickAffDis || [] //已诊断疾病
let diagPush = result.dis || {}
let lisPush = result.lis || []
let scalePush = result.scale || []
let pacsPush = result.pacs || []
let symptomPush = result.symptom || []
let checkupPush = result.vital || []
let medicinesPush = result.medicines || []
let operationsPush = result.operations || []
let treatPush = result.treat && result.treat[0] || {}
let nursePush = result.nurse || []
treatDisName = treatPush && treatPush["name"]
let generaTreatPush = treatPush && treatPush["generaTreat"]
let lisNum = $(".moduleItem.lis").attr("data-num") || 5
let scaleNum = $(".moduleItem.evaluation").attr("data-num") || 5
let pacsNum = $(".moduleItem.pacs").attr("data-num") || 5
let checkupNum = $(".moduleItem.vital").attr("data-num") || 5
let symptomNum = $(".moduleItem.symptom").attr("data-num") || 5
let medicinesNum = $(".moduleItem.medicine").attr("data-num") || 5
let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
let nurseNum = $(".moduleItem.nurse").attr("data-num") || 5
renderLis(lisPush, lisNum)
renderScale(scalePush, scaleNum)
renderPacs(pacsPush, pacsNum)
renderCheckup(checkupPush, checkupNum)
renderSymptomPush(symptomPush, symptomNum)
renderDiag(diagPush)
renderMedicinesPush(medicinesPush, medicinesNum)
renderOperationPush(operationsPush, operationsNum)
rendergeneraTreatPush(generaTreatPush)
renderNurse(nursePush, nurseNum)
renderDiagList(diagList)
renderAffListList(AffList)
bindOpenInfo()
moreInfo()
bindSlide();
}
empty(); //判断是否显示空状态
})
}
function renderpushByMayDisease(name, i) {
return pushByDisease(name, i).then(res => {
$(".loading").hide();
hasCompleteTnterface++
if (res.data.code == "0") {
const result = res.data.data
let symptomPush = result.symptom || []
let vitalPush = result.vital || []
let lisPush = result.lis || []
let pacsPush = result.pacs || []
let scalePush = result.scale || []
let disPush = result.dis['大数据推送诊断'] || []
let treatPush = result.treat || []
let medicinesPush = result.medicines || []
let operationsPush = result.operations || []
let nursePush = result.nurse || []
console.log(maydiagnoseType);
if (symptomPush.length == 0 && vitalPush.length == 0 && lisPush.length == 0 && pacsPush.length == 0 && scalePush.length == 0 && disPush.length == 0 && treatPush.length == 0 && medicinesPush.length == 0 && operationsPush.length == 0 && nursePush.length == 0) {
$.toast('toast1', '', 3000,'.maydiagnose',i);
} else if(maydiagnoseType){
$.toast('toast2', '', 3000,'.maydiagnose',i);
}else{
renderMaySymptomPush(symptomPush)
renderMayVitalPush(vitalPush)
renderMayLisPush(lisPush)
renderMayPacsPush(pacsPush)
renderMayScalePush(scalePush)
renderMayDisPush(disPush)
renderMayPush(treatPush, medicinesPush, operationsPush, nursePush)
bindOpenInfo()
moreInfo()
bindSlide();
}
// renderMaySymptomPush(symptomPush)
// renderMayVitalPush(vitalPush)
// renderMayLisPush(lisPush)
// renderMayPacsPush(pacsPush)
// renderMayScalePush(scalePush)
// renderMayDisPush(disPush)
// renderMayPush(treatPush, medicinesPush, operationsPush, nursePush)
// bindOpenInfo()
// moreInfo()
// bindSlide();
}
})
}
function renderpushByHasDisease(name, i) {
return pushByDisease(name, i).then(res => {
$(".loading").hide();
hasCompleteTnterface++
if (res.data.code == "0") {
const result = res.data.data
let symptomPush = result.symptom || []
let vitalPush = result.vital || []
let lisPush = result.lis || []
let pacsPush = result.pacs || []
let scalePush = result.scale || []
let disPush = result.dis['鉴别诊断'] || {}
let treatPush = result.treat || {}
let medicinesPush = result.medicines || {}
let operationsPush = result.operations || {}
let nursePush = result.nurse || {}
console.log(hasdiagnoseType);
if (symptomPush.length == 0 && vitalPush.length == 0 && lisPush.length == 0 && pacsPush.length == 0 && scalePush.length == 0 && disPush.length == 0 && treatPush.length == 0 && medicinesPush.length == 0 && operationsPush.length == 0 && nursePush.length == 0) {
$.toast('toast1', '', 3000,'.hasdiagnose',i);
} else if(hasdiagnoseType){
$.toast('toast2', '', 3000,'.hasdiagnose',i);
}else {
renderHasSymptomPush(symptomPush)
renderHasVitalPush(vitalPush)
renderHasLisPush(lisPush)
renderHasPacsPush(pacsPush)
renderHasScalePush(scalePush)
renderHasDisPush(disPush)
renderHasPush(treatPush, medicinesPush, operationsPush, nursePush)
bindOpenInfo()
moreInfo()
bindSlide();
}
}
})
}
function adjustHei() {
const iframeHei = $(".bodyWrap").height()
$(".contentWrapper").css("height", iframeHei - 20 - 30 - 60 + 3 + 19 + 'px')
$(".tabList").css("height", iframeHei + 'px')
}
function isNeedPush(list) {
let pass = false;
let pushCode = ['critical', "diag", "lis", "pacs", "symptom", "vital", "treat", "medicines", 'evaluation', 'general', 'medicine', 'operation', 'nurse']
for (let i = 0; i < list.length; i++) {
if (pushCode.indexOf(list[i].code) > -1) {
if (list[i].status == "1") {
pass = true
}
}
}
return pass;
}
function isNeedwriteStandardPush(list) {
let pass = false;
let pushCode = ["casewriting"]
for (let i = 0; i < list.length; i++) {
if (pushCode.indexOf(list[i].code) > -1) {
if (list[i].status == "1") {
pass = true
}
}
}
return pass
}
function isNeedPushWarning(list) {
let pushCode = ["crivalue", "rationali", "highrisk", "otherremind"];
let pass = false;
for (let i = 0; i < list.length; i++) {
if (pushCode.indexOf(list[i].code.trim()) > -1) {
if (+list[i].status === 1) {
pass = true
}
}
}
return pass
}
//let popNum = 0;//气泡显示数字
function renderPushWarning() {
return getPusgWarning().then(res => {
$(".loading").hide();
hasCompleteTnterface++
if (res.data.code == '0') {
const result = res.data.data;
let billMsgList = result.billMsgList || [] //开单合理性提醒
let highRiskList = result.highRiskList || [] //高危药品、手术
let criticalValList = result.criticalValList || [] //危急值提醒
let otherList = result.otherList || [] //其他提醒
renderBillingPush(billMsgList, '开单合理性提醒', 'rationali')
renderBillingPush(highRiskList, '高风险提示', 'highrisk')
renderBillingPush(criticalValList, '危急值提醒', 'crivalue')
//renderBillingPush(noteList,'检查内容注意事项')
renderBillingPush(otherList, '其他提醒', 'otherremind')
//moreInfo()
$(".moduleItem.tips").wrapAll("");
updatePopNum();
$(titleStr('warning')).insertBefore('.tips-cont .moduleItem:first-child')
}
empty();
})
}
function renderWriteStandard() {
return getWriteStandardPush().then(res => {
$(".loading").hide();
hasCompleteTnterface++
if (res.data.code == '0') {
const list = res.data.data || {}
let casewritingNum = $(".moduleItem.casewriting").attr("data-num") || 5
renderwriteStandardPage(list, casewritingNum)
} else {
empty();
}
})
}
function renderwriteStandardPage(list, casewritingNum) {
let arr = Object.keys(list);
if (arr.length > 0 && $(".moduleItem.casewriting").length > 0) {
moduleNum++
$(".moduleItem.casewriting").append(titleStr("casewritingPush"))
let longStr = ``
let shortStr = ``
for (let i = 0; i < arr.length; i++) {
if (i < casewritingNum) {
shortStr += `
${arr[i]}
`
}
longStr += `
${arr[i]}
`
}
let shortStrBox = `${shortStr}
`
let longStrBox = `${longStr}
`
let allStr = ``
$(".moduleItem.casewriting").append(allStr)
$(".casewritingWrapper").append(shortStrBox)
if (arr.length > casewritingNum) {
$(".shortStrBox .billingPushItem").eq($(".shortStrBox .billingPushItem").length - 1).append(`
`)
// $(".moduleItem .generalTreatInfo").append(`收起
`)
$(".casewritingWrapper").append(longStrBox)
$(".longStrBox .billingPushItem").eq($(".longStrBox .billingPushItem").length - 1).append(`
`)
}
$('.moduleItem.casewriting').css("display", "block")
updatePopNum();
bindSlideCaseWriting()
}
empty();
}
function renderBillingPush(list, name, code) {
if (list.length === 0) {
return
}
moduleNum++
let str = ``
for (let i = 0; i < list.length; i++) {
str += `
${list[i].msg}
`
}
let titleStr = titleStr2(name)
let boxStr = `
${titleStr}
${str}
`
$("." + code).append(boxStr)
$('.moduleItem.' + code).addClass("tips").css("display", "block")
//输血后血常规提醒,传参给his
$(".otherremind .billingPushItem:contains('输血完成后,请及时复查血常规')").css("cursor", "pointer").click(() => {
window.parent.postMessage({
"mrn": msg.mrn, //病历号 getMr返回-技术服务返回
"series": msg.series, //就诊次数
"orders": [
{
"type": 1,
"orders": [
'输血(血小板)'
]
}
]
}, '*')
})
}
//更新消息个数
function updatePopNum() {
const writeNum = $(".casewriting .longStrBox").length ? $(".casewriting .longStrBox .billingPushItem").length : $(".casewriting .shortStrBox .billingPushItem").length;
const warnNum = $(".tips-cont .billingPushItem").length + writeNum; //病例书写规范有隐藏元素
if (warnNum === 0) {
$(".tabList .numPop").hide();
return;
}
$(".tabList .numPop").text(warnNum).show()
}
function renderDiag(diagPush) {
let possibleDiagPush = diagPush["可能诊断"] || []
let previousDiagPush = diagPush["既往诊断"] || []
let firstDiagPush = diagPush["初步诊断"] || []
let identifyDiagPush = diagPush["鉴别诊断"] || []
let warningDiagPush = diagPush["警惕"] || []
let number = $('.moduleItem.diag').attr("data-num") || 5
let warnNumber = $('.moduleItem.warning').attr("data-num") || 5
$('.moduleItem.diag').append(titleStr("diagPush"))
// let warningDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
// let firstDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
// let identifyDiagPush = diagPush["鉴别诊断"] || [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
renderDiagItem(possibleDiagPush, "可能诊断", number)
renderDiagItem(previousDiagPush, "既往诊断", number)
renderDiagItem(firstDiagPush, "初步诊断", number)
renderDiagItem(identifyDiagPush, "鉴别诊断", number)
renderWarningDiag(warningDiagPush, "警惕", warnNumber)
moreInfo()
}
function renderDiagItem(list, name, number) {
if (list.length === 0) {
return
}
moduleNum++
let titleStr = titleStr2(name)
let { shortStr, longStr } = renderItemWrapper(list, number)
let boxStr = `
${titleStr}
${shortStr}
${longStr}
`
$(".diag").append(boxStr)
$('.moduleItem.diag').css("display", "block")
}
function renderWarningDiag(list, name, number) {
if (list.length > 0 && $(".moduleItem.warning").length > 0) {
moduleNum++
$('.moduleItem.warning').append()
let str = `
警惕`
for (let i = 0; i < list.length; i++) {
str += renderPushItem(list[i], 1)
}
$('.moduleItem.warning').append(str)
$('.moduleItem.warning').css("display", "block")
}
}
function renderDiagList(list, showNum) {
if (list.length > 0 && $(".moduleItem.maydiagnose").length > 0) {
moduleNum++
let str = ``
$('.moduleItem.maydiagnose').append(titleStr("maydiagnosePush"))
for (var i = 0; i < list.length; i++) {
const item = list[i];
str +=
`
${item.name}
`
}
str += `${list.length > 3 ? `
加载更多
` : ''}
`
$('.moduleItem.maydiagnose').append(str)
$('.moduleItem.maydiagnose').css("display", "block")
$('.maydiagnose .goDetail').on("click", function (e) {
e.preventDefault()
const name = $(this).attr('data-name');
const i = $(this).attr('data-index');
indexNow = i
const showList = $(".box[data-index=" + i + "]").find(".moduleCenter").css("display")
if (showList == "none" || !showList) {
$(".loading").show();
$(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").html('')
$(".maydiagnose .box").find(".moduleCenter").css("display", "none")
$(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "block")
renderpushByMayDisease(name, i)
} else {
$(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "none")
}
});
}
}
function renderAffListList(list, showNum) {
if (list.length > 0 && $(".moduleItem.hasdiagnose").length > 0) {
moduleNum++
let str = ``
$('.moduleItem.hasdiagnose').append(titleStr("hasdiagnosePush"))
for (var i = 0; i < list.length; i++) {
const item = list[i];
str +=
`
${item.name}
`
}
str += `${list.length > 3 ? `
加载更多
` : ''}
`
$('.moduleItem.hasdiagnose').append(str)
$('.moduleItem.hasdiagnose').css("display", "block")
$('.hasdiagnose .goDetail').on("click", function (e) {
e.preventDefault()
const name = $(this).attr('data-name');
const i = $(this).attr('data-index');
indexNow = i
const showList = $(".box[data-index=" + i + "]").find(".moduleCenter").css("display")
if (showList == "none" || !showList) {
$(".loading").show();
$(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").html('')
$(".hasdiagnose .box").find(".moduleCenter").css("display", "none")
$(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "block")
renderpushByHasDisease(name, i)
} else {
$(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "none")
}
});
}
}
function renderSymptomPush(list, showNum) {
$(".moduleItem.symptom").append(titleStr('symptomPush'))
if (list.length > 0 && $(".moduleItem.symptom").length > 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, showNum)
$(".moduleItem.symptom").append(shortStr).append(longStr)
$(".moduleItem.symptom").css("display", "block")
}
}
function renderLis(list, showNum) {
if (list.length > 0 && $(".moduleItem.lis").length > 0) {
moduleNum++
$('.moduleItem.lis').append(titleStr("lisPush"))
let { shortStr, longStr } = renderItemWrapper(list, showNum)
$('.moduleItem.lis').append(shortStr).append(longStr)
$('.moduleItem.lis').css("display", "block")
}
}
function renderScale(list, showNum) {
if (list.length > 0 && $(".moduleItem.evaluation").length > 0) {
moduleNum++
$('.moduleItem.evaluation').append(titleStr("scalePush"))
let { shortStr, longStr } = renderItemWrapper(list, showNum)
$('.moduleItem.evaluation').append(shortStr).append(longStr)
$('.moduleItem.evaluation').css("display", "block")
}
}
function renderNurse(list, showNum) {
if (list.length > 0 && $(".moduleItem.nurse").length > 0) {
moduleNum++
$('.moduleItem.nurse').append(titleStr("nursePush"))
let { shortStr, longStr } = renderItemWrapper(list, showNum)
$('.moduleItem.nurse').append(shortStr).append(longStr);
$('.moduleItem.nurse').css("display", "block")
}
}
function renderPacs(list, showNum) {
if (list.length > 0 && $(".moduleItem.pacs").length > 0) {
moduleNum++
$(".moduleItem.pacs").append(titleStr("pacsPush"))
let { shortStr, longStr } = renderItemWrapper(list, showNum)
$(".moduleItem.pacs").append(shortStr).append(longStr)
$('.moduleItem.pacs').css("display", "block")
}
}
function renderCheckup(list, showNum) {
if (list.length > 0 && $(".moduleItem.vital").length > 0) {
moduleNum++
$(".moduleItem.vital").append(titleStr("checkupPush"))
let { shortStr, longStr } = renderItemWrapper(list, showNum)
$(".moduleItem.vital").append(shortStr).append(longStr)
$('.moduleItem.vital').css("display", "block")
}
}
function renderMaySymptomPush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'maysymptom') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '症状')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append(``)
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .maysymptom").append(shortStr).append(longStr)
}
}
function renderHasSymptomPush(list,) {
let num, state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'hassymptom') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '症状')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append(``)
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .hassymptom").append(shortStr).append(longStr)
}
}
function renderMayVitalPush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'mayvital') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '体征')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .mayvital").append(shortStr).append(longStr)
}
}
function renderHasVitalPush(list) {
let num, state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'mayvital') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '体征')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .hasvital").append(shortStr).append(longStr)
}
}
function renderMayLisPush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'maylis') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检验')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .maylis").append(shortStr).append(longStr)
}
}
function renderHasLisPush(list) {
let num, state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'haslis') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检验')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .haslis").append(shortStr).append(longStr)
}
}
function renderMayPacsPush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'maypacs') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检查')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .maypacs").append(shortStr).append(longStr)
}
}
function renderHasPacsPush(list) {
let num, state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'haspacs') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检查')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .haspacs").append(shortStr).append(longStr)
}
}
function renderMayScalePush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'mayevaluation') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '推荐量表')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .mayevaluation").append(shortStr).append(longStr)
}
}
function renderHasScalePush(list) {
let num, state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'hasevaluation') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '推荐量表')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .hasevaluation").append(shortStr).append(longStr)
}
}
function renderMayDisPush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'mayantidias') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
console.log(123);
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '鉴别诊断')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .mayantidias").append(shortStr).append(longStr)
}
}
function renderHasDisPush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'hasantidias') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num, '鉴别诊断')
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
$(".box[data-index=" + indexNow + "]").find(".moduleCenter .hasantidias").append(shortStr).append(longStr)
}
}
function renderMayPush(treatPush, medicinesPush, operationsPush, nursePush) {
$(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
let str = `
${treatPush.length > 0 ? `- 一般治疗
` : ''}
${medicinesPush.length > 0 ? `- 推荐用药
` : ''}
${operationsPush.length > 0 ? `- 推荐手术/操作
` : ''}
${nursePush.length > 0 ? `- 推荐护理
` : ''}
${treatPush.length > 0 ? `
` : ''}
${medicinesPush.length > 0 ? `
` : ''}
${operationsPush.length > 0 ? `
` : ''}
${nursePush.length > 0 ? `
` : ''}
`
$(".maydiagnose .box[data-index=" + indexNow + "]").find(".moduleCenter .centerBox").append(str)
renderMayTreatPush(treatPush)
renderMayMedicPush(medicinesPush)
renderMayOperationsPush(operationsPush)
renderMayNursePush(nursePush)
$('.maydiagnose .centerBox ul li').click(function () {
var i = $(this).index();
if ($(this).hasClass('active')) {
$(this).removeClass('active');
$(".maydiagnose .checkBox[data-index=" + i + "]").removeClass('onshow');
} else {
$(this).addClass('active').siblings().removeClass('active');
$(".maydiagnose .checkBox[data-index=" + i + "]").addClass('onshow').siblings().removeClass('onshow');
}
});
}
function renderHasPush(treatPush, medicinesPush, operationsPush, nursePush) {
$(".hasdiagnose .box[data-index=" + indexNow + "]").find(".moduleCenter").append("")
let str = `
${treatPush.length > 0 ? `- 一般治疗
` : ''}
${medicinesPush.length > 0 ? `- 推荐用药
` : ''}
${operationsPush.length > 0 ? `- 推荐手术/操作
` : ''}
${nursePush.length > 0 ? `- 推荐护理
` : ''}
${treatPush.length > 0 ? `
` : ''}
${medicinesPush.length > 0 ? `
` : ''}
${operationsPush.length > 0 ? `
` : ''}
${nursePush.length > 0 ? `
` : ''}
`
$(".hasdiagnose .box[data-index=" + indexNow + "]").find(".moduleCenter .centerBox").append(str)
renderHasTreatPush(treatPush)
renderHasMedicPush(medicinesPush)
renderHasOperationsPush(operationsPush)
renderHasNursePush(nursePush)
$('.hasdiagnose .centerBox ul li').click(function () {
var i = $(this).index();
if ($(this).hasClass('active')) {
$(this).removeClass('active');
$(".hasdiagnose .checkBox[data-index=" + i + "]").removeClass('onshow');
} else {
$(this).addClass('active').siblings().removeClass('active');
$(".hasdiagnose .checkBox[data-index=" + i + "]").addClass('onshow').siblings().removeClass('onshow');
}
});
}
function renderMayTreatPush(list) {
let state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'maygeneral') {
state = item.status
}
}
if (list.length > 0 && state != 0) {
let str = ''
for (let i = 0; i < list.length; i++) {
const item = list[i];
str = `${item.generaTreat}`
}
$(".maygeneral").append(str)
}
}
function renderHasTreatPush(list) {
let state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'hasgeneral') {
state = item.status
}
}
if (list.length > 0 && state != 0) {
let str = ''
for (let i = 0; i < list.length; i++) {
const item = list[i];
str = `${item.generaTreat}`
}
$(".hasgeneral").append(str)
}
}
function renderMayMedicPush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'maymedicine') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num)
$(".maymedicine").append(shortStr).append(longStr)
}
}
function renderHasMedicPush(list) {
let num, state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'hasmedicine') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num)
$(".hasmedicine").append(shortStr).append(longStr)
}
}
function renderMayOperationsPush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'mayoperation') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num)
$(".mayoperation").append(shortStr).append(longStr)
}
}
function renderHasOperationsPush(list) {
let num, state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'hasoperation') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num)
$(".hasoperation").append(shortStr).append(longStr)
}
}
function renderMayNursePush(list) {
let num, state
for (let i = 0; i < maydiagnoseList.length; i++) {
const item = maydiagnoseList[i];
if (item.code == 'maynurse') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num)
$(".maynurse").append(shortStr).append(longStr)
}
}
function renderHasNursePush(list) {
let num, state
for (let i = 0; i < hasdiagnoseList.length; i++) {
const item = hasdiagnoseList[i];
if (item.code == 'hasnurse') {
num = item.number
state = item.status
}
}
if (list.length > 0 && state != 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, num)
$(".hasnurse").append(shortStr).append(longStr)
}
}
function rendergeneraTreatPush(list) {
if (list && $(".moduleItem.general").length > 0) {
$(".moduleItem.general").append(titleStr('generaTreatPush'))
moduleNum++
let str = `${list}
`
$(".moduleItem.general").append(str)
$(".moduleItem.general").css("display", "block")
let generaTreatHei = $(".moduleItem .generalTreatInfo")[0].scrollHeight
if (generaTreatHei > 50) {
$(".moduleItem .generalTreatInfo").append(`
`)
$(".moduleItem .generalTreatInfo").append(`
`)
bindGeneralSlide()
}
}
}
function renderMedicinesPush(list, showNum) {
$(".moduleItem.medicine").append(titleStr('drugPush'))
if (list.length > 0 && $(".moduleItem.medicine").length > 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, showNum)
$(".moduleItem.medicine").append(shortStr).append(longStr)
$(".moduleItem.medicine").css("display", "block")
}
}
function renderOperationPush(list, showNum) {
$(".moduleItem.operation").append(titleStr('operationPush'))
if (list.length > 0 && $(".moduleItem.operation").length > 0) {
moduleNum++
let { shortStr, longStr } = renderItemWrapper(list, showNum)
$(".moduleItem.operation").append(shortStr).append(longStr)
$(".moduleItem.operation").css("display", "block")
}
}
function renderItemWrapper(list, showNum, name) {
let showNum1 = showNum || 5
let shortStr = '', longStr = ''
for (let i = 0; i < list.length; i++) {
if (i <= showNum1 - 1) {
shortStr += renderPushItem(list[i])
}
longStr += renderPushItem(list[i])
}
if (showNum1 >= list.length) {
return {
shortStr: `${name ? name + ':' : ''}${shortStr}
`,
longStr: ''
}
} else {
shortStr += `
`
longStr += `
`
return {
shortStr: `${name ? name + ':' : ''}${shortStr}
`,
longStr: `${name ? name + ':' : ''}${longStr}
`
}
}
}
function renderPushItem(item) {
const infoIcon = `${item.hasInfo == "1" ? `
` : ""}`;
str = ``
str += `${item.type == 8 ? ('【' + item.name + '】') : item.name} ${infoIcon}`
str += ``;
return str
}
function bindOpenInfo() {
$(".infoImg").on("mouseenter", function () {
$(this).attr("src", infoImgOn)
}).on("mouseleave", function () {
$(this).attr("src", infoImg)
})
}
function bindSlide() {
$(".showMore").off("click").on("click", function () {
$(this).parent().parent().find(".longBox").css("display", "block")
$(this).parent().parent().find(".shortBox").css("display", "none")
})
$(".showLess").off("click").on("click", function () {
$(this).parent().parent().find(".longBox").css("display", "none")
$(this).parent().parent().find(".shortBox").css("display", "block")
})
}
function renderModuleWrapper(moduleList) {
if (!moduleList) {
return
}
let moduleStr = ''
for (let i = 0; i < moduleList.length; i++) {
if (moduleList[i].status != '0') {
if (moduleList[i].code == 'critical') {
moduleStr += ``
// moduleStr += ``
} else if (moduleList[i].code == 'maydiagnose') {
maydiagnoseList = moduleList[i].planDetails
moduleStr += ``
let arr = []
for (let j = 0; j < moduleList[i].planDetails.length; j++) {
let item = moduleList[i].planDetails[j]
arr.push(item.status)
}
if(arr.indexOf(1) == -1){
maydiagnoseType = true
}
} else if (moduleList[i].code == 'hasdiagnose') {
hasdiagnoseList = moduleList[i].planDetails
moduleStr += ``
let arr = []
for (let j = 0; j < moduleList[i].planDetails.length; j++) {
let item = moduleList[i].planDetails[j]
arr.push(item.status)
}
if(arr.indexOf(1) == -1){
hasdiagnoseType = true
}
} else {
moduleStr += ``
}
}
}
$(".recommendWrap").append(moduleStr)
}
function hasTab(tabName, tabList) {
if (!tabList) {
return
}
for (let i = 0; i < tabList.length; i++) {
if (tabList[i].name == tabName) {
return tabList[i]
}
}
return false
}
function renderTab(tabList) {
let tabStr = ''
for (let i = 0; i < tabList.length; i++) {
if (tabList[i].status == '1') {
tabStr += `- ${tabList[i].name}
`
}
}
tabStr += `
`;
$(".tabList").append(tabStr)
let tabNum = 0;
if (isTcm == 'true') {
tabNum = $(".tabList .tab").length - 1;
}
$(".tabList .tab").eq(tabNum).addClass("activeTab")
let showModuleName = $(".tabList .tab").eq(tabNum).attr("data-name")
getModuleShow(moduleConfig[showModuleName])
bindTabClick()
}
function titleStr(type) {
let titleStr = ''
titleStr += `
${titleConfig[type].name}
`
return titleStr
}
function titleStr2(name) {
let titleStr = ''
titleStr += `${name}:
`
return titleStr
}
function bindTabClick() {
$(".tabList .tab").off("click").on("click", function () {
$(".activeTab").removeClass("activeTab")
$(this).addClass("activeTab")
const moduleName = $(this).attr("data-name")
getModuleShow(moduleConfig[moduleName])
if (moduleName == "medical") {
$(".staticSearchT .ipt").find("input").focus()
//$(".contentWrapper").css("overflowY","hidden")
} else if (moduleName == 'followup') {
// $(".contentWrapper").css("overflowY","auto")
}
})
}
function getModuleShow(moduleClassName) {
if ($(`.${moduleClassName}`).css("display") == "none") {
$(".moduleWrapper").css("display", "none")
$(`.${moduleClassName}`).css("display", "block")
}
}
function bindGeneralSlide() {
$(".showMoreGeneralTreat").off("click").on("click", function () {
$(".generalTreatInfo").toggleClass("isOverFlow")
$(".showMoreGeneralTreat").toggle()
})
$(".showLessGeneralTreat").off("click").on("click", function () {
$(".generalTreatInfo").toggleClass("isOverFlow")
$(".showMoreGeneralTreat").toggle()
})
}
function bindSlideCaseWriting() {
$(".showMoreCaseWriting").off("click").on("click", function () {
$(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display", "none")
$(this).parents(".casewritingWrapper ").find(".longStrBox").css("display", "block")
})
$(".showLessCaseWriting").off("click").on("click", function () {
$(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display", "block")
$(this).parents(".casewritingWrapper ").find(".longStrBox").css("display", "none")
})
}
//显示空状态
function empty() {
ifInputParam = hasInputParam();
if (!ifInputParam) { //没有输入数据时
$(".recommendBox .empty-box").hide();
$(".recommendBox .empty").show();
return;
}
if (hasCompleteTnterface === allInterface) { //需调的推送接口全部返回后
setTimeout(function () {
const emptyShownBox = $('.recommendWrap .empty-box:visible').length;
const configShownBox = $('.recommendWrap .moduleItem:visible').length;
if (configShownBox === 0 && emptyShownBox === 0) { //有配置但没数据
$('.empty-box').hide();
$('.recommendBox .empty-null').show();
return;
}
$(".empty-box").hide();
}, 200);
}
/*setTimeout(function(){
const emptyShownBox = $('.recommendWrap .empty-box:visible').length;
const configShownBox = $('.recommendWrap .moduleItem:visible').length;
if(configShownBox===0&&emptyShownBox===0){ //有配置但没数据
$('.empty-box').hide();
$('.recommendBox .empty-null').show();
return;
}
$(".empty-box").hide();
},200);*/
}
$(function () {
//隐藏logo
if (getUrlArgObject("hideLg")) {
$(".disclaimer .logo").hide();
}
getDisclaimer(); //获取免责声明
getVersion(); //获取版本信息
$(".disclaimerInfo").on("click", function () {
openNewWin("disclaimer.html")
});
$(".version-tip").on("click", function () {
const ver = localStorage.getItem('versionTime');
$(".version-tip").removeClass('new-icon');
localStorage.setItem('versionTime', ver.replace("=new", ""));
openNewWin("version.html");
});
$.fn.extend({
"preventScroll": function () {
$(this).each(function () {
var _this = this;
if (navigator.userAgent.indexOf('Firefox') >= 0) { //firefox
_this.addEventListener('DOMMouseScroll', function (e) {
_this.scrollTop += e.detail > 0 ? 60 : -60;
e.preventDefault();
}, false);
} else {
_this.onmousewheel = function (e) {
e = e || window.event;
_this.scrollTop += e.wheelDelta > 0 ? -60 : 60;
return false;
};
}
})
}
});
$(window).on("resize", function () {
adjustHei()
})
});
//展开更多
$(document).on("click", ".toogle", (e) => {
if ($(e.target).is(".up")) {
$(e.target).removeClass("up").html("加载更多").append(`
`);
$(e.target).parents(".item").find(".box-1").css("display", 'none');
return;
}
$(".item").each(function (i) {
$(this).find('.toogle').removeClass("up")
$(this).find(".box-1").css("display", 'none');
$(this).find('.toogle').html("加载更多").append(`
`);
});
$(e.target).addClass("up").html("收起").append(`
`);
$(e.target).parents(".item").find(".box-1").css("display", 'block');
});