cdssHorizontal.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. if(!Promise){
  2. var Promise = require("bluebird");
  3. // Configure
  4. Promise.config({
  5. longStackTraces: true,
  6. warnings: true // note, run node with --trace-warnings to see full stack traces for warnings
  7. })
  8. }
  9. const $ = require("jquery");
  10. require('./../css/reset.css');
  11. require('./../css/cdssHorizontal.less');
  12. require('./../css/popup.css');
  13. require('./../css/staticSearch.css')
  14. require('./../js/staticSearch.js')
  15. require('./../images/empty2.png').replace(/^undefined/g, '')
  16. require('./../images/loading.gif').replace(/^undefined/g, '')
  17. let emptyImg = require('./../images/empty3.png').replace(/^undefined/g, '')
  18. require('./../images/new2.png').replace(/^undefined/g, '')
  19. const { post,config,getUrlArgObject,openNewWin,titleConfigH,throttle, } = require('./promise.js');
  20. let infoImg = require('./../images/icon_info.png').replace(/^undefined/g, '')
  21. let infoImgOn = require('./../images/icon_info_on.png').replace(/^undefined/g, '')
  22. let iconArrowUp = require('./../images/icon_arrow_up.png').replace(/^undefined/g, '')
  23. let iconArrowDown = require('./../images/icon_arrow_down.png').replace(/^undefined/g, '')
  24. let showImg = require('./../images/show2.png').replace(/^undefined/g, '')
  25. let collapseImg = require('./../images/collapse2.png').replace(/^undefined/g, '')
  26. let treatDisName,treatUniqueName
  27. let generalTreatInfo
  28. const { renderFollowUp } = require('./followUp.js');
  29. setWidth()
  30. let moduleConfig={
  31. auxiliary:"recommendWrap",
  32. qc:"qcWrap",
  33. medical:"medicalKonwledgeWrap",
  34. followup:'followUpWrap'
  35. }
  36. let allInterface = 0
  37. let hasCompleteTnterface = 0
  38. let moduleNum = 0
  39. let mrId = getUrlArgObject('mrId')
  40. let pushMrId = getUrlArgObject('pushMrId')
  41. const tipsMode = getUrlArgObject('tipsMode') || 1
  42. let planCode = getUrlArgObject('planCode') || 'all'
  43. let hospitalIdUrl = getUrlArgObject('hospitalId') || ''
  44. let msg;
  45. let tipsMsg;
  46. let caseWriteStandradList;
  47. function getMRInfo() {
  48. return post(config.getMr2,{mrId:mrId})
  49. }
  50. function getConf() {
  51. var msg = window.msg
  52. return post(config.getPushSet,{hospitalId:hospitalIdUrl||msg.hospitalId||1,planCode: planCode})
  53. }
  54. function getPushInfo() {
  55. return post(config.pushInner,Object.assign({},msg,{featureType: '1,4,5,6,7,8,9,10',hospitalId:hospitalIdUrl||msg.hospitalId,ruleType:config.ruleTypeMap['22']}))
  56. }
  57. function getPusgWarning(){
  58. const indPush = pushMrId ? config.indicationPushCache : config.indicationPush;
  59. return post(indPush, Object.assign({}, msg, {mrId: pushMrId || mrId}))
  60. }
  61. function getWriteStandardPush(){
  62. return post(config.caseWritingPrompt,Object.assign({},msg,{hospitalId:2||msg.hospitalId}))
  63. }
  64. if(mrId){
  65. Promise.all([getConf(),getMRInfo()]).then(([res1,res2])=>{
  66. const data = res1.data.data&&res1.data.data[0]
  67. msg = res2.data.data ||{}
  68. if(!(msg&&msg.diseaseName&&msg.diseaseName.name)){
  69. msg.diseaseName={}
  70. }
  71. window.msg = msg
  72. renderPage(data)
  73. })
  74. } else{
  75. getConf().then(res =>{
  76. if(res.data.code == '0'){
  77. // const configArr = res.data.data.pushSetList || []
  78. // getPageInfo(configArr)
  79. const data = res.data.data&&res.data.data[0]
  80. renderPage(data)
  81. }
  82. })
  83. }
  84. function renderPage(pageSet){
  85. if(!pageSet || !pageSet.sysSetInfo){
  86. return
  87. }
  88. renderTab(pageSet.sysSetInfo)
  89. const iframeHei = $(".bodyWrap").height()
  90. const tabHei = $(".tabList").height()
  91. $(".contentWrapper").css("height",iframeHei-tabHei-10-20-30+'px')
  92. const hasAuxiliary = hasTab("辅助信息",pageSet.sysSetInfo)
  93. const hasMedical = hasTab("医学知识",pageSet.sysSetInfo)
  94. const hasFollowUp = hasTab("随访计划",pageSet.sysSetInfo)
  95. if(hasAuxiliary){
  96. renderModuleWrapper(hasAuxiliary.planDetails)
  97. let needPush = isNeedPush(hasAuxiliary.planDetails)
  98. let needPushWarning = isNeedPushWarning(hasAuxiliary.planDetails)
  99. let needWriteStandardPush = isNeedwriteStandardPush(hasAuxiliary.planDetails)
  100. if(needPush || needPushWarning){
  101. renderPushData()
  102. allInterface++
  103. }
  104. if(needPushWarning){
  105. renderPushWarning()
  106. allInterface++
  107. }
  108. if(needWriteStandardPush){
  109. renderCaseWrite()
  110. allInterface++
  111. }
  112. if(hasFollowUp){
  113. renderFollowUp(msg,1)
  114. }
  115. }
  116. }
  117. function renderTab(tabList){
  118. if(!tabList){
  119. return
  120. }
  121. let tabStr = ''
  122. let TabNum = 0
  123. for(let i = 0; i < tabList.length; i++){
  124. if(tabList[i].status == '1'){
  125. TabNum++
  126. tabStr += `<span class="tab" style="border-bottom:${tabList.length==i+1?'0':'1px solid #3B9ED0'}" data-name="${tabList[i].code}" ><span class="tabName">${tabList[i].name}</span><span class="activeLine"></span></span>`
  127. }
  128. }
  129. $(".tabList").append(tabStr)
  130. $(".tabList .tab").eq(0).addClass("activeTab")
  131. $(".tabList .tab").css("height", 1/TabNum * 100 + '%')
  132. let showModuleName = $(".tabList .tab").eq(0).attr("data-name")
  133. getModuleShow(moduleConfig[showModuleName])
  134. bindTabClick()
  135. setTabNameTop()
  136. }
  137. function hasTab(tabName,tabList){
  138. for(let i = 0; i < tabList.length; i++){
  139. if(tabList[i].name == tabName){
  140. return tabList[i]
  141. }
  142. }
  143. return false
  144. }
  145. function renderModuleWrapper(moduleList){
  146. if(!moduleList){
  147. return
  148. }
  149. let moduleStr = '',treatStr=""
  150. for(let i = 0; i < moduleList.length; i++){
  151. if(moduleList[i].status !='0'){
  152. if(moduleList[i].code == 'general' || moduleList[i].code == 'medicine' || moduleList[i].code == 'operation'){
  153. treatStr += `<div class="moduleItem ${moduleList[i].code }" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  154. }else if(moduleList[i].code == 'critical'){
  155. moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  156. // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  157. }else{
  158. moduleStr += `<div class="moduleItem ${moduleList[i].code }" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  159. }
  160. }
  161. }
  162. $(".recommendWrap .leftBox").append(moduleStr)
  163. $(".recommendWrap .rightBox").append(treatStr)
  164. }
  165. function isNeedPush(list){
  166. let pushCode = ["diag","lis","pacs","symptom","vital"]
  167. for(let i = 0; i < list.length; i++){
  168. if(pushCode.indexOf(list[i].code)>-1){
  169. if(list[i].status == "1"){
  170. return true
  171. }
  172. }
  173. }
  174. return false
  175. }
  176. function isNeedPushWarning(list){
  177. let pushCode = ["tips"]
  178. for(let i = 0; i < list.length; i++){
  179. if(pushCode.indexOf(list[i].code)>-1){
  180. if(list[i].status == "1"){
  181. return true
  182. }
  183. }
  184. }
  185. return false
  186. }
  187. function isNeedwriteStandardPush(list){
  188. let pushCode = ["casewriting"]
  189. for(let i = 0; i < list.length; i++){
  190. if(pushCode.indexOf(list[i].code)>-1){
  191. if(list[i].status == "1"){
  192. return true
  193. }
  194. }
  195. }
  196. return false
  197. }
  198. function bindTabClick(){
  199. $(".tabList .tab").on("click", function(){
  200. $(".activeTab").removeClass("activeTab")
  201. $(this).addClass("activeTab")
  202. const moduleName = $(this).attr("data-name")
  203. getModuleShow(moduleConfig[moduleName])
  204. })
  205. }
  206. function getModuleShow(moduleClassName){
  207. if( $(`.${moduleClassName}`).css("display") =="none"){
  208. $(".moduleWrapper").css("display","none")
  209. $(`.${moduleClassName}`).css("display","block")
  210. }
  211. }
  212. function setTabNameTop(){
  213. tabNameList = $(".tabList .tab .tabName")
  214. for(let i = 0; i < tabNameList.length; i++){
  215. let tabNameHei = $(".tabList .tab .tabName").eq(i).height()
  216. $(".tabList .tab .tabName").eq(i).css("marginTop",-tabNameHei/2+"px")
  217. }
  218. }
  219. function renderCaseWrite(){
  220. getWriteStandardPush().then(res =>{
  221. hasCompleteTnterface++
  222. if(res.data.code == '0'){
  223. const caseWriteList = res.data.data || {}
  224. let caseWritePush = Object.keys(caseWriteList) || []
  225. renderwriteStandardPage(caseWritePush)
  226. if($(".moduleItem.casewriting")){
  227. let casewritingHei = $(".moduleItem.casewriting")[0].scrollHeight
  228. if(casewritingHei > 81){
  229. $(".casewriting").append(`<span class="showMoreCaseWrite">更多</span>`)
  230. caseWriteStandradList = caseWritePush
  231. showMoreCaseWrite()
  232. }
  233. }
  234. }
  235. })
  236. }
  237. function renderPushData(){
  238. return getPushInfo().then(res =>{
  239. hasCompleteTnterface++
  240. if(res.data.code == "0"){
  241. const result = res.data.data
  242. let diagPush = result.dis ||{}
  243. let lisPush = result.lis || []
  244. let pacsPush = result.pacs || []
  245. let symptomPush = result.symptom ||[]
  246. let checkupPush = result.vital ||[]
  247. let medicinesPush = result.medicines || []
  248. let operationsPush = result.operations ||[]
  249. let treatPush = result.treat&&result.treat[0] ||{}
  250. treatDisName = treatPush&&treatPush["name"]
  251. treatUniqueName = treatPush&&treatPush["uniqueName"]
  252. let generaTreatPush = treatPush&&treatPush["generaTreat"]
  253. generalTreatInfo = generaTreatPush
  254. // let lisPush =[{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  255. // let pacsPush = [{name:"胸部x射线",hisNameList:null},{name:"心电图",hisNameList:null}]
  256. // let checkupPush = [{name:"神志表情",hisNameList:null},{name:"面部表情",hisNameList:null}]
  257. let lisNum = $(".moduleItem.lis").attr("data-num") || 5
  258. let pacsNum = $(".moduleItem.pacs").attr("data-num") || 5
  259. let checkupNum = $(".moduleItem.vital").attr("data-num") || 5
  260. let symptomNum = $(".moduleItem.symptom").attr("data-num") || 5
  261. let medicinesNum = $(".moduleItem.medicine").attr("data-num") || 5
  262. let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
  263. renderLis(lisPush,lisNum,3,true)
  264. renderPacs(pacsPush,pacsNum,5,true)
  265. renderCheckup(checkupPush,checkupNum,null,true)
  266. renderSymptomPush(symptomPush,symptomNum,null,true)
  267. renderDiag(diagPush)
  268. if(medicinesPush.length > 0 || operationsPush.length > 0||generaTreatPush){
  269. let str = `<img class="treatIcon" src = ${titleConfigH["treat"].icon} /><span>${titleConfigH["treat"].name}</span>`
  270. $(".rightBoxTitle").append(str)
  271. renderDisName()
  272. $(".rightWrapper").css("display","inline-block")
  273. $(".leftWrapper").css("borderRight","1px solid #E6E6E6")
  274. }else{
  275. $(".leftWrapper").css({
  276. borderRight: "0px",
  277. width: "100%"
  278. })
  279. }
  280. if((!$(".moduleItem.medicine")&&!$(".moduleItem.operation")&&!(".moduleItem.general")) ||($(".moduleItem.general").length === 0&&$(".moduleItem.medicine").length === 0&&$(".moduleItem.operation").length === 0)){
  281. $(".rightWrapper").css("display","none")
  282. $(".leftWrapper").css({
  283. borderRight: "0px",
  284. width: "100%"
  285. })
  286. }
  287. rendergeneraTreatPush(generaTreatPush)
  288. renderMedicinesPush(medicinesPush,1,2,true)
  289. renderOperationPush(operationsPush,1,6,true)
  290. // if(hasCompleteTnterface === allInterface){
  291. // $('.loading').css("display","none")
  292. // if(moduleNum === 0){
  293. // empty()
  294. // }
  295. // }icon
  296. bindOpenInfo()
  297. bindSlide()
  298. moreInfo()
  299. }
  300. })
  301. }
  302. function renderLis(list,showNum,type,hasInfo){
  303. if(list.length > 0 && $(".moduleItem.lis").length > 0){
  304. moduleNum++
  305. $('.moduleItem.lis .moduleItemTitBox').append(titleStr("lisPush"))
  306. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  307. $('.moduleItem.lis').append(shortStr)
  308. $('.moduleItem.lis').append(renderLongStr(titleConfigH["lisPush"].name,longStr,titleConfigH["lisPush"].location))
  309. $('.moduleItem.lis').css("display","block")
  310. }
  311. }
  312. function renderPacs(list,showNum,type,hasInfo){
  313. if(list.length > 0 && $(".moduleItem.pacs").length > 0){
  314. moduleNum++
  315. $('.moduleItem.pacs .moduleItemTitBox').append(titleStr("pacsPush"))
  316. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  317. $(".moduleItem.pacs").append(shortStr)
  318. $(".moduleItem.pacs").append(renderLongStr(titleConfigH["pacsPush"].name,longStr,titleConfigH["pacsPush"].location))
  319. $('.moduleItem.pacs').css("display","block")
  320. }
  321. }
  322. function renderSymptomPush(list,showNum,type,hasInfo){
  323. if(list.length > 0 && $(".moduleItem.symptom").length > 0){
  324. moduleNum++
  325. $('.moduleItem.symptom .moduleItemTitBox').append(titleStr("symptomPush"))
  326. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  327. $(".moduleItem.symptom").append(shortStr)
  328. $(".moduleItem.symptom").append(renderLongStr(titleConfigH["symptomPush"].name,longStr,titleConfigH["symptomPush"].location))
  329. $('.moduleItem.symptom').css("display","block")
  330. }
  331. }
  332. function renderMedicinesPush(list,showNum,type,hasInfo){
  333. if(list.length > 0 && $(".moduleItem.medicine").length > 0){
  334. moduleNum++
  335. $('.moduleItem.medicine .moduleItemTitBox').append(titleStr("drugPush"))
  336. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  337. $(".moduleItem.medicine").append(shortStr)
  338. $(".moduleItem.medicine").append(renderLongStr(titleConfigH["drugPush"].name,longStr,titleConfigH["drugPush"].location))
  339. $(".moduleItem.medicine").css("display","block")
  340. }
  341. }
  342. function renderOperationPush(list,showNum,type,hasInfo){
  343. if(list.length > 0 && $(".moduleItem.operation").length > 0){
  344. moduleNum++
  345. $('.moduleItem.operation .moduleItemTitBox').append(titleStr("operationPush"))
  346. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  347. $(".moduleItem.operation").append(shortStr)
  348. $(".moduleItem.operation").append(renderLongStr(titleConfigH["operationPush"].name,longStr,titleConfigH["operationPush"].location))
  349. $(".moduleItem.operation").css("display","block")
  350. }
  351. }
  352. function renderDisName(){
  353. $(".disName").append(`${treatDisName}`)
  354. }
  355. function rendergeneraTreatPush(list){
  356. if(list&&list.length > 0 && $(".moduleItem.general").length > 0){
  357. moduleNum++
  358. $('.moduleItem.general .moduleItemTitBox').append(titleStr("generaTreatPush"))
  359. let str = `<div class="generalTreatInfo clearfix isOverFlow">${list}</div>`
  360. $(".moduleItem.general").append(str)
  361. setTimeout(function(){
  362. let generaTreatHei = $(".moduleItem .generalTreatInfo")[0].scrollHeight
  363. if(generaTreatHei >81){
  364. $(".moduleItem .generalTreatInfo").append(`<span class="showMoreGeneralTreat">更多</span>`)
  365. bindGeneralSlide()
  366. }
  367. })
  368. $(".moduleItem.general").css("display","block")
  369. }
  370. }
  371. function renderCheckup(list,showNum,type,hasInfo){
  372. if(list.length > 0 && $(".moduleItem.vital").length > 0){
  373. moduleNum++
  374. $(".moduleItem.vital .moduleItemTitBox").append(titleStr("checkupPush"))
  375. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  376. $(".moduleItem.vital").append(shortStr)
  377. $(".moduleItem.vital").append(renderLongStr(titleConfigH["checkupPush"].name,longStr,titleConfigH["checkupPush"].location))
  378. $('.moduleItem.vital').css("display","block")
  379. }
  380. }
  381. function renderDiag(diagPush){
  382. let possibleDiagPush = diagPush["可能诊断"] || []
  383. let firstDiagPush = diagPush["初步诊断"] || []
  384. let identifyDiagPush = diagPush["鉴别诊断"] || []
  385. let warningDiagPush = diagPush["警惕"] || []
  386. let number = $('.moduleItem.diag').attr("data-num") || 5
  387. let warnNumber = $('.moduleItem.warning').attr("data-num") || 5
  388. $('.moduleItem.diag .moduleItemTitBox').append(titleStr("diagPush"))
  389. // let warningDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  390. // let firstDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  391. // let identifyDiagPush = diagPush["鉴别诊断"] || [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  392. renderDiagItem(possibleDiagPush,"可能诊断",number)
  393. renderDiagItem(firstDiagPush,"初步诊断",number)
  394. renderDiagItem(identifyDiagPush,"鉴别诊断",number)
  395. renderWarningDiag(warningDiagPush,"警惕",1000)
  396. moreInfo()
  397. }
  398. function renderDiagItem(list,name,number){
  399. if(list.length === 0){
  400. return
  401. }
  402. let titleStr = `<span class="moduleBoxName">${name}</span>`
  403. let {shortStr, longStr} = renderItemWrapper(list,number,1,true)
  404. let boxStr = `<div class="moduleBox">
  405. ${titleStr}
  406. ${shortStr}
  407. </div>`
  408. $(".diag").append(boxStr)
  409. $(".diag").append(renderLongStr(name,longStr,"left"))
  410. $('.moduleItem.diag').css("display","block")
  411. }
  412. function renderWarningDiag(list,name,showNum){
  413. if(list.length > 0 && $(".moduleItem.warning").length > 0){
  414. moduleNum++
  415. $('.moduleItem.warning .moduleItemTitBox').append(titleStr("vigilancePush"))
  416. let {shortStr, longStr} = renderItemWrapper(list,showNum,1,true)
  417. $('.moduleItem.warning').append(shortStr)
  418. $('.moduleItem.warning').css("display","block")
  419. }
  420. }
  421. function renderwriteStandardPage(list){
  422. if(list.length > 0 && $(".moduleItem.casewriting").length > 0){
  423. moduleNum++
  424. $(".moduleItem.casewriting .moduleItemTitBox").append(titleStr("casewritingPush"))
  425. let str = ``
  426. for(let i = 0; i < list.length; i++){
  427. str += `<p>${list[i]}</p>`
  428. }
  429. $(".moduleItem.casewriting").append(str)
  430. $('.moduleItem.casewriting').css("display","block")
  431. }
  432. }
  433. function renderPushWarning(){
  434. return getPusgWarning().then(res =>{
  435. hasCompleteTnterface++
  436. if(res.data.code == '0'){
  437. const result = res.data.data
  438. let billMsgList = result.billMsgList || [] //开单合理性提醒
  439. let highRiskList = result.highRiskList || [] //高危药品、手术
  440. let criticalValList = result.criticalValList || [] //危急值提醒
  441. let noteList = result.noteList || [] //检查内容注意事项
  442. let dubugStr = result.dubugStr || [] //注意调试信息
  443. let otherList = result.otherList || [] //其他提醒
  444. $('.moduleItem.tips .moduleItemTitBox').append(titleStr('warning'))
  445. renderBillingPush(billMsgList,'开单合理性')
  446. renderBillingPush(highRiskList,'高风险提示')
  447. renderBillingPush(criticalValList,'危急值提醒')
  448. renderBillingPush(noteList,'检查注意事项')
  449. renderBillingPush(otherList,'其他提醒')
  450. moreInfo()
  451. if($(".moduleItem.tips")){
  452. let tipsHei = $(".moduleItem.tips")[0].scrollHeight
  453. if(tipsHei > 81){
  454. $(".tips").append(`<span class="showMoreNewPage">更多</span>`)
  455. tipsMsg = result
  456. showMoreNewPage()
  457. }
  458. }
  459. // renderBillingPush(dubugStr,'注意调试信息')
  460. }
  461. if(hasCompleteTnterface === allInterface){
  462. $('.loading').css("display","none")
  463. if(moduleNum === 0){//console.log(999)
  464. // empty()
  465. }
  466. }
  467. })
  468. }
  469. function renderBillingPush(list,name){
  470. if(list.length === 0){
  471. return
  472. }
  473. let str = ``
  474. for(let i = 0; i < list.length; i++){
  475. str += `<div class="billingPushItem">${list[i].msg}</div>`
  476. }
  477. let titleStr = `<span class="moduleBoxName">${name}</span>`
  478. let boxStr = `<div class="moduleBox">
  479. ${titleStr}
  480. ${str}
  481. </div>`
  482. $(".tips").append(boxStr)
  483. $('.moduleItem.tips').css("display","block")
  484. }
  485. function renderLongStr(name,longStr,location){
  486. if(!longStr){
  487. return
  488. }
  489. let str = `
  490. <div class="longStrBox" data-location="${location}">
  491. <span class="longStrBoxTitle">${name}:</span>
  492. ${longStr}
  493. </div>
  494. `
  495. return str
  496. }
  497. function renderItemWrapper(list,showNum,type,hasInfo){
  498. let showNum1 = showNum || 5
  499. let shortStr = '', longStr = ''
  500. for(let i = 0; i < list.length; i++){
  501. if(i <= showNum1-1){
  502. shortStr += renderPushItem(list[i],type)
  503. }
  504. longStr += renderPushItem(list[i],type)
  505. }
  506. if(showNum1 >= list.length){
  507. return {
  508. shortStr:`<div class="shortBox">${shortStr}</div>`,
  509. longStr:''
  510. }
  511. }else{
  512. shortStr += `<span class="showMore"> <img class="iconArrowImg" src="${showImg}"></span>`
  513. longStr += `<span class="showLess"><img class="iconArrowImg" src="${collapseImg}"></span>`
  514. return {
  515. shortStr:`<div class="shortBox clearfix">${shortStr}</div>`,
  516. longStr:`<div class="longBox clearfix">${longStr}</div>`
  517. }
  518. }
  519. }
  520. function renderPushItem(item,type){
  521. str= `<span class="pushItemBox" data-name="${item.name}" data-type="${type}"><span class="pushItemName">${item.name}</span>${item.hasInfo=="1"?`<img class="infoImg" src="${infoImg}">`:""}</span>`
  522. return str
  523. }
  524. function bindOpenInfo(){
  525. $(".infoImg").on("mouseenter", function(){
  526. $(this).attr("src", infoImgOn)
  527. }).on("mouseleave", function(){
  528. $(this).attr("src", infoImg)
  529. })
  530. }
  531. function titleStr(type){
  532. let titleStr = ''
  533. titleStr += `<div class="moduleTitle"><img class="titleIcon" src=${titleConfigH[type].icon}>${titleConfigH[type].name}:</div>`
  534. return titleStr
  535. }
  536. function bindSlide(){
  537. $(".showMore").on("click", function(){
  538. $(".longStrBox").css("display","none")
  539. $(this).parents(".moduleItem ").find(".longStrBox").css("display","block")
  540. let location = $(this).parents(".moduleItem ").find(".longStrBox").attr("data-location")
  541. let scrollTop = getLongTop(location)
  542. $(this).parents(".moduleItem ").find(".longStrBox").css("top", 5 +Number(scrollTop)+ "px")
  543. })
  544. $(".showLess").on("click", function(){
  545. $(this).parent().parent().css("display","none")
  546. })
  547. addScrollEvent()
  548. }
  549. function showMoreNewPage(){
  550. $(".showMoreNewPage").on("click", function(){
  551. // openNewWin(`smartAlert.html?billMsgList=${encodeURIComponent(billMsgList)}&highRiskList=${encodeURIComponent(highRiskList)}&criticalValList=${encodeURIComponent(criticalValList)}&noteList=${encodeURIComponent(noteList)}`)
  552. openNewWin(`smartAlert.html?mrId=${mrId}&hospitalId=${hospitalIdUrl}`)
  553. })
  554. }
  555. function showMoreCaseWrite(){
  556. $(".showMoreCaseWrite").on("click", function(){
  557. // openNewWin(`smartAlert.html?billMsgList=${encodeURIComponent(billMsgList)}&highRiskList=${encodeURIComponent(highRiskList)}&criticalValList=${encodeURIComponent(criticalValList)}&noteList=${encodeURIComponent(noteList)}`)
  558. openNewWin(`caseWriteStandard.html?caseWriteStandradList=${encodeURIComponent(JSON.stringify(caseWriteStandradList))}`)
  559. })
  560. }
  561. function bindGeneralSlide(){
  562. $(".showMoreGeneralTreat").on("click",function(){
  563. openNewWin(`generalTreat.html?disName=${treatDisName}&name=${treatUniqueName}`)
  564. })
  565. }
  566. function setWidth(){
  567. let winWidth = $(".bodyWrap").css("width")
  568. $(".contentBox").css("width",winWidth)
  569. }
  570. //医学知识搜索
  571. searchMedical()
  572. function searchMedical(){
  573. $(".medicalKonwledgeWrap .search").on("click", function(){
  574. openNewWin(`staticSearch.html?searchType=1`)
  575. })
  576. }
  577. function moreInfo() {
  578. $('.infoImg').off("click").click(function(){
  579. const name = $(this).parent().attr('data-name')
  580. const type = $(this).parent().attr('data-type')
  581. openNewWin(`information.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}`)
  582. })
  583. }
  584. function getVersion() {
  585. return post(config.getVersion, 'confArr').then((res) => {
  586. const data = res.data.data;
  587. const ver = localStorage.getItem('versionTime');
  588. const time = data.refreshTime;
  589. if(!ver||ver===time+"=new"||time!==ver.replace("=new","")){ //判断版本是否更新
  590. $(".versionBottom").addClass('new-icon');
  591. localStorage.setItem('versionTime',time+"=new"); //保存版本更新时间
  592. }else{
  593. $(".versionBottom").removeClass("new-icon");
  594. }
  595. })
  596. }
  597. function getLongTop(type){
  598. let scrollTop = 0
  599. if(type === "left"){
  600. scrollTop = $(".leftWrapper").scrollTop() || 0
  601. }else if(type === "right"){
  602. scrollTop = $(".rightWrapper").scrollTop() || 0
  603. }
  604. return scrollTop
  605. }
  606. function addScrollEvent(){
  607. $(`.leftWrapper`).off("scroll").scroll(throttle(function(){
  608. if($(".leftWrapper .longStrBox").css("display") === "block"){
  609. $(".leftWrapper .longStrBox").css("top",Number(getLongTop("left"))+5+"px")
  610. }
  611. }, 100));
  612. $(`.rightWrapper`).off("scroll").scroll(throttle(function(){
  613. if($(".rightWrapper .longStrBox").css("display") === "block"){
  614. $(".rightWrapper .longStrBox").css("top",Number(getLongTop("right"))+5+"px")
  615. }
  616. }, 100));
  617. }
  618. $(function(){
  619. getVersion()
  620. $(window).on("resize",function(){
  621. setWidth()
  622. })
  623. $(".versionTop").on("click", function(){
  624. openNewWin("disclaimer.html")
  625. });
  626. $(".versionBottom").on("click", function(){
  627. const ver = localStorage.getItem('versionTime');
  628. $(".versionBottom").removeClass('new-icon');
  629. localStorage.setItem('versionTime',ver.replace("=new",""));
  630. openNewWin("version.html");
  631. });
  632. })
  633. // function empty(){
  634. // $(".responsibility").css("display","none")
  635. // $('.recommendWrap .empty').css("display","block")
  636. // }