informationOut.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  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. require('../css/informationOut.less')
  10. const {
  11. post,
  12. throttle,
  13. imageUrlPrefix,
  14. config,
  15. getUrlArgObject,
  16. openNewWin,
  17. Toast
  18. } = require('./promise.js');
  19. const $ = require("jquery");
  20. require("./jquery-migrate");
  21. const jqprint = require("../js/jquery.PrintArea")
  22. let printing = require('./../images/printing.png');
  23. let printing2 = require('./../images/printing2.png');
  24. let hel = require('./../images/icon-hel.png');
  25. let showName, noticeName, clinicalPathwayName, showLis = [], selectedDrop = 0, selectedTab = 0, isclick
  26. //如果是子窗口,隐藏网页查看按钮
  27. function myBrowser() {
  28. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  29. var isOpera = userAgent.indexOf("Opera") > -1;
  30. if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
  31. return "IE";
  32. }; //判断是否IE浏览器
  33. }
  34. if (window.opener) {
  35. selectedDrop = getUrlArgObject("d") || 0;
  36. selectedTab = getUrlArgObject("t") || 0;
  37. $("#openWin,.footer").hide();
  38. }
  39. let icond = require('./../images/d.png').replace(/^undefined/g, '')
  40. function getInfomation() {
  41. // var param = {
  42. // "type": getUrlArgObject('type'),
  43. // "name": getUrlArgObject('name'),
  44. // "position": getUrlArgObject('position'),
  45. // "contentTypes":[1,2,3]
  46. // };
  47. var param = {
  48. "type": getUrlArgObject('type'),
  49. "hospitalId": getUrlArgObject('hospitalId'),
  50. "hisName": getUrlArgObject('hisName'),
  51. "hisDetailName": getUrlArgObject('hisDetailName'),
  52. "contentTypes":[1,2,3]
  53. };
  54. //showName = param.hisName;
  55. // if (param.type == 5 || param.type == 51) {
  56. // param.type = 12;
  57. // param.name = uname;
  58. // }
  59. post(config.getStaticKnowledgeForHIS, param).then((res) => {
  60. if(res.data.code==='0'){
  61. const data = res.data.data
  62. var str = '';
  63. var anchors = '';
  64. let sName ='';
  65. if (!data||data.length===0) {
  66. showEmpty();
  67. return;
  68. }
  69. showLis = data
  70. for (let i = 0; i < showLis.length; i++) {
  71. let tmp = showLis[i]
  72. str += `<li data-idx="${i}" title="${tmp.name}(${tmp.hisName})">${tmp.name}(${tmp.hisName})</li>`
  73. }
  74. $(".showWhich ul").html(str);
  75. sName = showLis[selectedDrop].name + "(" + showLis[selectedDrop].hisName + ")";
  76. $(".showWhichSelect").html(sName).attr("title", sName)
  77. showName = data[selectedDrop].name + "(" + data[selectedDrop].hisName + ")";
  78. showInfoSelect()
  79. showInfo(data[selectedDrop],1)
  80. renderTitleShow();
  81. $('.content img').bind('contextmenu', function () {
  82. return false
  83. })
  84. } else {
  85. showEmpty();
  86. }
  87. })
  88. }
  89. getInfomation();
  90. function showEmpty() {
  91. const str = `<div class="empty"><img src="../images/empty3.png" alt=""><p>暂无静态知识</p></div>`;
  92. $(".tabBox").html(str).css("border-bottom", "none");
  93. $("body").css('background', '#fff');
  94. }
  95. function showInfo(data,type) {
  96. var detailList = data.details
  97. var scale = data.scale
  98. var staticKnowList = detailList['静态知识']
  99. var noticeInfo = detailList['注意事项']
  100. var clinicalPathwayInfo = detailList['临床路径']
  101. var name = data.name
  102. noticeName = data.noticeName || "注意事项"
  103. clinicalPathwayName = data.clinicalPathwayName || "临床路径"
  104. var scaleInfo = data.scale ? data.scale.scaleDetails : ''
  105. // $("h1").css({
  106. // "color": "#267FD7",
  107. // "borderBottom": "4px solid #E9E9E9",
  108. // "padding": "0px 60px 50px 0px"
  109. // });
  110. if(type == 1){
  111. renderTab(detailList, scale)
  112. }
  113. staticKnowList&&renderContent(staticKnowList,'staticKnowledge')
  114. noticeInfo&&renderContent(noticeInfo,'notice')
  115. clinicalPathwayInfo&&renderContent(clinicalPathwayInfo,'clinicalPathway')
  116. scaleInfo && renderContentscale(scaleInfo, 'scale', name)
  117. }
  118. function showInfoSelect(){
  119. $('.showWhich li').click(function(){
  120. let idx = $(this).attr('data-idx')
  121. let name = $(this).html(), str = ''
  122. selectedDrop = idx;
  123. selectedTab = 0;
  124. showName = showLis[idx].name + "(" + showLis[idx].hisName + ")";
  125. showInfo(showLis[idx],2)
  126. $('.content .infos').scrollTop(0)
  127. $(".showWhich ul").css("display", "none")
  128. $(".showWhichSelect").html(name).attr("title", name)
  129. renderTitleShow();
  130. })
  131. $(".showWhichSelect").click(function (e) {
  132. e.stopPropagation()
  133. $(".showWhich ul").slideToggle()
  134. })
  135. $(document).click(function () {
  136. $(".showWhich ul").css("display", "none")
  137. })
  138. }
  139. function renderTitleShow() {
  140. document.title = showName;
  141. // $(".titleCont .title").html($(".tabList .tab:eq(" + selectedTab + ")").attr("data-title"));
  142. $(".titleCont .title").html($(".showWhich .showWhichSelect").attr("title"));
  143. }
  144. function renderContent(list, contentWrapClassName) {
  145. $(`.${contentWrapClassName} .infos`).html('');
  146. $(`.${contentWrapClassName} .anchors ul`).html('');
  147. for (var i = 0; i < list.length; i++) {
  148. var item = list[i];
  149. item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
  150. anchors = '<li><i></i><a href="#' + contentWrapClassName + i +
  151. '">' + item.title + '</a></li><li class="anchor-line"></li>';
  152. str = '<div class="infoBox"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
  153. '">'
  154. if (getUrlArgObject('type') == 8) {
  155. str += '【' + item.title + '】'
  156. } else {
  157. str += item.title
  158. }
  159. str += '</h2></div>' +
  160. '<div class="contentWrapper"><pre>' + item.content + '</pre><div></div>';
  161. str = `<div class="infoWrapper">${str}</div>`
  162. $(`.${contentWrapClassName} .infos`).append(str);
  163. $(`.${contentWrapClassName} .anchors ul`).append(anchors);
  164. }
  165. function addScrollEvent() {
  166. var scrollTop = $(`.${contentWrapClassName} .infos`).scrollTop()
  167. var divHeight = 0;
  168. for (var i = 0; i < list.length; i++) {
  169. divHeight = divHeight + parseInt($('#' + contentWrapClassName + i).css('height')) + parseInt($('#' + contentWrapClassName + i).parent().next().css('height')) + 20
  170. if (divHeight > scrollTop) {
  171. var anchor = 2 * i;
  172. $(`.${contentWrapClassName} .anchors ul`).children().eq(anchor).addClass('active').siblings().removeClass('active');
  173. return;
  174. }
  175. }
  176. }
  177. $(`.${contentWrapClassName} .infos`).scroll(throttle(addScrollEvent, 200));
  178. addLinkClickEvent(contentWrapClassName);
  179. adjustHeight();
  180. adjustWidth()
  181. }
  182. function renderContentscale(list, contentWrapClassName, name) {
  183. $(`.${contentWrapClassName} .infos .infos-box`).html('');
  184. var pushInfo = []
  185. var textType = []
  186. for (var i = 0; i < list[0].detailList.length; i++) {
  187. var item = list[0].detailList[i];
  188. if (item.textType == 11) {
  189. item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
  190. str = '<div class="infoBox scaleBox" data-id="' + item.id + '"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
  191. '">'
  192. str += item.content
  193. str += '</h2></div>'
  194. str = `<div class="infoWrapper">${str}</div>`
  195. $(`.${contentWrapClassName} .infos .infos-box`).append(str);
  196. for (var j = 0; j < item.subList.length; j++) {
  197. var items = item.subList[j];
  198. for (var k = 0; k < items.detailList.length; k++) {
  199. var it = items.detailList[k];
  200. it.content = it.content && it.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
  201. str = '<div class="contentList" data-id="' + it.parentId + '-' + it.groupNum + '"><div class="item-list">';
  202. if (it.selectType == 21) {
  203. str += '<p class="item-title">' + it.content + '</p>'
  204. } else if (it.selectType == 22) {
  205. str += '<p class="item-titles">' + it.content + '</p>'
  206. }
  207. str += '<div class="item-content" data-id="' + it.id + '">'
  208. str += '</div></div></div>'
  209. $(".scale .infos .infos-box .infoWrapper .infoBox[data-id=" + it.parentId + "]").append(str);
  210. for (var l = 0; l < it.subList[0].detailList.length; l++) {
  211. var its = it.subList[0].detailList[l];
  212. its.content = its.content && its.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
  213. str = '<div class="radio" name="scale' + its.parentId + '" value="' + its.score + '">';
  214. if (it.selectType == 21 && item.resultType == 1) {
  215. str += '<label><input class="radio_type" type="radio" name="scale' + its.parentId + '" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '"/>'
  216. } else if (it.selectType == 22 && item.resultType == 1) {
  217. str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '"/>'
  218. } else if (it.selectType == 21 && item.resultType == 2) {
  219. str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '"/>'
  220. } else if (it.selectType == 22 && item.resultType == 2) {
  221. str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '"/>'
  222. }
  223. str += its.content
  224. if (item.resultType == 1) {
  225. str += '<span class="num">(' + its.score + ')</span>'
  226. }
  227. str += '</label>'
  228. str += `${its.match == 1 ? `<img class="recommend" src="./../images/recommend.png" />` : ``}</div>`
  229. $(".scale .infos .infos-box .infoWrapper .infoBox[data-id=" + it.parentId + "] .contentList .item-content[data-id=" + its.parentId + "]").append(str);
  230. }
  231. }
  232. }
  233. }
  234. if (item.textType == 12) {
  235. item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
  236. str = '<div class="infoBox scaleBox" data-id="' + item.id + '"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
  237. '">'
  238. str += item.content
  239. str += '</h2></div>'
  240. str = `<div class="infoWrapper">${str}</div>`
  241. $(`.${contentWrapClassName} .infos .infos-box`).append(str);
  242. for (var j = 0; j < item.subList.length; j++) {
  243. var items = item.subList[j];
  244. for (var k = 0; k < items.detailList.length; k++) {
  245. var it = items.detailList[k];
  246. it.content = it.content && it.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
  247. str = '<div class="contentList" data-id="' + it.parentId + '-' + it.groupNum + '"><div class="item-list">';
  248. str += '<p class="item-title">' + it.content + '</p>'
  249. str += '<div class="item-content" data-id="' + it.id + '">'
  250. str += '</div></div></div>'
  251. $(".scale .infos .infos-box .infoWrapper .infoBox[data-id=" + it.parentId + "]").append(str);
  252. }
  253. }
  254. }
  255. if (item.textType == 13) {
  256. for (var m = 0; m < item.subList[0].detailList[0].subList[0].detailList.length; m++) {
  257. var itl = item.subList[0].detailList[0].subList[0].detailList[m]
  258. let arr = {
  259. content: JSON.parse(itl.content),
  260. result: itl.result,
  261. pushInfo: itl.pushInfo
  262. }
  263. pushInfo.push(arr)
  264. }
  265. }
  266. }
  267. str = '<div class="scalebot">'
  268. str += '<button class="but">结果</button><p class="score"></p>'
  269. str += '</div>'
  270. str += `<div class="result"><div class="result_box"><div class="result_left"><img src="./../images/icon-hel.png" class="hel"/><span>结果:</span></div><p id="result_title" class="result_title"></p><textarea id="inputs"></textarea></div></div>`
  271. str += `<div class="foot"><div class="foot_box"><div class="printing"><img src="./../images/printing.png" class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
  272. $(`.${contentWrapClassName} .infos .infos-box`).append(str);
  273. // str = `<div class="foot"><div class="foot_box"><div class="printing"><img src=${printing} class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
  274. // $(`.${contentWrapClassName} .infos`).after(str);
  275. function addScrollEvent() {
  276. var scrollTop = $(`.${contentWrapClassName} .infos .infos-box`).scrollTop()
  277. var divHeight = 0;
  278. for (var i = 0; i < list.length; i++) {
  279. divHeight = divHeight + parseInt($('#' + contentWrapClassName + i).css('height')) + parseInt($('#' + contentWrapClassName + i).parent().next().css('height')) + 20
  280. if (divHeight > scrollTop) {
  281. var anchor = 2 * i;
  282. $(`.${contentWrapClassName} .anchors ul`).children().eq(anchor).addClass('active').siblings().removeClass('active');
  283. return;
  284. }
  285. }
  286. }
  287. $(`.${contentWrapClassName} .infos .infos-box`).scroll(throttle(addScrollEvent, 200));
  288. var mb = myBrowser();
  289. if ("IE" == mb) {
  290. $('.result_left').css({
  291. 'position': 'relative', //高度自动
  292. })
  293. $('.result_title').css({
  294. 'margin-left': '0', //高度自动
  295. })
  296. }
  297. addLinkClickEvent(contentWrapClassName);
  298. adjustHeight();
  299. adjustWidth()
  300. getcheck()
  301. getResult(pushInfo, textType)
  302. copy(name)
  303. getprinting()
  304. }
  305. function getprinting() {
  306. $('.printing').click(function () {
  307. $('.foot').hide()
  308. // $('.hel').hide()
  309. $('#Print').css({
  310. 'height': 'auto', //高度自动
  311. }).jqprint();
  312. $('.foot').show()
  313. // $('.hel').show()
  314. $('#Print').css({
  315. 'height': '100%', //高度自动
  316. });
  317. })
  318. }
  319. function getcheck() {
  320. $('input:radio').click(function () {
  321. const domName = $(this).attr('name');
  322. const $radio = $(this);
  323. const id = $(this).parents('.contentList').data("id");
  324. if ($radio.data('waschecked') == true) {
  325. $radio.prop('checked', false);
  326. $("input:radio[name='" + domName + "']").data('waschecked', false);
  327. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", false);
  328. if (isclick) {
  329. getchecks()
  330. $(".score").html('');
  331. $(".result_title").html('');
  332. $(".result").css('display', 'none')
  333. $(".foot").css('display', 'none')
  334. }
  335. } else {
  336. $radio.prop('checked', true);
  337. $("input:radio[name='" + domName + "']").data('waschecked', false);
  338. $radio.data('waschecked', true);
  339. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
  340. if (isclick) {
  341. getchecks()
  342. $(".score").html('');
  343. $(".result_title").html('');
  344. $(".result").css('display', 'none')
  345. $(".foot").css('display', 'none')
  346. }
  347. }
  348. });
  349. $('input:checkbox').click(function () {
  350. const domName = $(this).attr('name');
  351. const $radio = $(this);
  352. const id = $(this).parents('.contentList').data("id");
  353. $radio.parents('.contentList').each(function (i) {
  354. if ($(this).find('input[type="checkbox"]:checked').val() == undefined) {
  355. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", false);
  356. if (isclick) {
  357. getchecks()
  358. $(".score").html('');
  359. $(".result_title").html('');
  360. $(".result").css('display', 'none')
  361. $(".foot").css('display', 'none')
  362. }
  363. } else {
  364. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
  365. if (isclick) {
  366. getchecks()
  367. $(".score").html('');
  368. $(".result_title").html('');
  369. $(".result").css('display', 'none')
  370. $(".foot").css('display', 'none')
  371. }
  372. }
  373. })
  374. });
  375. }
  376. function copy(name) {
  377. $(".copy").click(function () {
  378. var texts = document.getElementById("result_title").innerText;
  379. if (texts == '') {
  380. Toast('结果为空,无法复制', 500, 'warn')
  381. return
  382. }
  383. var inputs = document.getElementById("inputs");
  384. inputs.value = name + '结果为:' + texts; // 修改文本框的内容(赋值内容)
  385. console.log(inputs.value)
  386. inputs.select(); // 选中文本
  387. document.execCommand("copy"); // 执行浏览器复制命令
  388. Toast('复制成功', 500, 'success')
  389. })
  390. }
  391. function getchecks() {
  392. $(".contentList").each(function (i) {
  393. if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
  394. $(this).find(".item-title").addClass('chColor');
  395. } else {
  396. $(this).find(".item-title").removeClass('chColor');
  397. }
  398. if ($(this).find('input[type="checkbox"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
  399. $(this).find(".item-titles").addClass('chColor');
  400. } else {
  401. $(this).find(".item-titles").removeClass('chColor');
  402. }
  403. });
  404. }
  405. function getResult(pushInfo, textType) {
  406. $(".but").click(function () {
  407. let arr = [];
  408. let multarr = []
  409. let multname
  410. let num = 0
  411. let result
  412. let key = false
  413. let proposal = ''
  414. let proposals = []
  415. isclick = true
  416. $(".contentList").each(function (i) {
  417. if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
  418. $(this).find(".item-title").addClass('chColor');
  419. } else {
  420. $(this).find(".item-title").removeClass('chColor');
  421. }
  422. if ($(this).find('input[type="checkbox"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
  423. $(this).find(".item-titles").addClass('chColor');
  424. } else {
  425. $(this).find(".item-titles").removeClass('chColor');
  426. }
  427. });
  428. if (!$(".contentList").find(".item-title").hasClass('chColor') && !$(".contentList").find(".item-titles").hasClass('chColor')) {
  429. $('input[type="radio"]:checked').each(function () {
  430. if (!isNaN($(this).val())) {
  431. num += parseFloat($(this).val())
  432. } else {
  433. arr.push($(this).attr("data_obj"))
  434. proposals.push($(this).attr("proposal"))
  435. }
  436. });
  437. $('input[type="checkbox"]:checkbox:checked').each(function () {
  438. if (!isNaN($(this).val())) {
  439. num += parseFloat($(this).val())
  440. } else {
  441. arr.push($(this).attr("data_obj"))
  442. proposals.push($(this).attr("proposal"))
  443. }
  444. });
  445. tmp = arr.join(";");
  446. if (pushInfo.length > 0) {
  447. for (var i = 0; i < pushInfo.length; i++) {
  448. if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
  449. result = pushInfo[i].result + '(' + num + '分' + ')'
  450. proposal = pushInfo[i].pushInfo
  451. break
  452. } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
  453. result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
  454. proposal = pushInfo[i].pushInfo
  455. break
  456. } else {
  457. result = tmp
  458. }
  459. }
  460. } else {
  461. result = tmp
  462. proposal = proposals.join(";");
  463. }
  464. if (result == undefined) {
  465. if ($.inArray(13, textType) > 0) {
  466. $(".score").html('总分:' + num + '分');
  467. }
  468. $(".score").css('display', 'block')
  469. $(".copy").css('display', 'none')
  470. $(".foot").css('display', 'block')
  471. } else {
  472. $(".hel").attr({
  473. "title": proposal
  474. });
  475. $(".result_title").html(result);
  476. if ($.inArray(13, textType) > 0) {
  477. $(".score").html('总分:' + num + '分');
  478. }
  479. $(".result").css('display', 'block')
  480. $(".score").css('display', 'block')
  481. $(".copy").css('display', 'block')
  482. $(".foot").css('display', 'block')
  483. }
  484. } else {
  485. Toast('温馨提示:必填选项不能为空~', 500, 'warn')
  486. }
  487. })
  488. $(".printing").hover(
  489. function () {
  490. $(".slideImg").attr("src", "./../images/printing2.png");
  491. }, function () {
  492. $(".slideImg").attr("src", "./../images/printing.png");
  493. });
  494. }
  495. function addLinkClickEvent(contentWrapClassName) {
  496. $(`.${contentWrapClassName} .anchors li:first`).addClass("active");
  497. $(`.${contentWrapClassName} .anchors li>a`).on("click", function () {
  498. const that = this
  499. setTimeout(function () {
  500. $(`.${contentWrapClassName} .anchors .active`).removeClass('active');
  501. $(that).parent().addClass("active");
  502. }, 20)
  503. });
  504. }
  505. function renderTab(detailList, scale) {
  506. if (detailList['静态知识']) {
  507. $(".tabList").append(`<span class="tab" data-module="staticKnowledge" data-title="` + showName + `">静态知识</span>`)
  508. }
  509. if (detailList['临床路径']) {
  510. $(".tabList").append(`<span class="tab" data-module="clinicalPathway" data-title="` + clinicalPathwayName + `">临床路径</span>`)
  511. //$(".tabBox .title").html(clinicalPathwayName);
  512. }
  513. if (detailList['注意事项']) {
  514. $(".tabList").append(`<span class="tab" data-module="notice" data-title="` + noticeName + `">注意事项</span>`)
  515. //$(".tabBox .title").html(noticeName);
  516. }
  517. if (scale || getUrlArgObject('gauge') == 'gauge' || getUrlArgObject('type') == 8) {
  518. $(".tabList").append(`<span class="tab" data-module="scale" data-title="` + showName + `">评估内容</span>`)
  519. //$(".tabBox .title").html(noticeName);
  520. }
  521. let defaultModuleName
  522. if ((getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) || getUrlArgObject('scale') == 'scale') {
  523. $(".tabList .tab").eq(1).addClass("activeTab")
  524. defaultModuleName = $(".tabList .tab").eq(1).attr("data-module")
  525. } else {
  526. $(".tabList .tab").eq(0).addClass("activeTab")
  527. defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
  528. }
  529. if (detailList['静态知识'] == undefined) {
  530. $(".tabList .tab").eq(0).removeClass("activeTab")
  531. }
  532. $(`.${defaultModuleName}`).css("display", "block")
  533. bindTabClick()
  534. }
  535. function bindTabClick(){
  536. $(".tabList .tab").on("click", function(){
  537. const moduleName = $(this).attr("data-module")
  538. //const display = $(`.${moduleName}`).css("display")
  539. selectedTab=$('.tabList .tab').index(this);
  540. $(".titleCont .title").html($(this).attr('data-title'));
  541. //if(display == "none"){
  542. $(".activeTab").removeClass("activeTab")
  543. $(this).addClass("activeTab")
  544. $(".container").css("display","none")
  545. $(`.${moduleName}`).css("display","block")
  546. $(`.${moduleName} .infos`).scrollTop(0)
  547. //}
  548. })
  549. $("#openWin").on("click", function () {
  550. const type = getUrlArgObject('type');
  551. const hospitalId = getUrlArgObject('hospitalId');
  552. const hisName = getUrlArgObject('hisName');
  553. const hisDetailName = getUrlArgObject('hisDetailName');
  554. const scale = $('.activeTab').attr('data-module')
  555. openNewWin("informationOut.html?hospitalId=" + encodeURIComponent(hospitalId) + "&hisName=" + encodeURIComponent(hisName) + "&hisDetailName=" + encodeURIComponent(hisDetailName || '') + "&type=" + encodeURIComponent(type) + "&d=" + selectedDrop + "&t=" + selectedTab + "&scale=" + scale);
  556. })
  557. }
  558. function adjustHeight() {
  559. const extHt = window.opener?60:0;
  560. var ht = window.innerHeight || document.documentElement.clientHeight;
  561. $(".content").height(ht - 160 + "px");
  562. $(".content .infos").height(ht - 170 + "px");
  563. $(".content .anchors").height(ht - 217 + "px");
  564. }
  565. function adjustWidth() {
  566. var wt = window.innerWidth || document.documentElement.clientWidth;
  567. $(".titleH2").width(wt - 0.2 * wt - 33 - 200 - 17 - 40 - 15 + 'px')
  568. $(".content .infos").width(wt - 243 + 'px');
  569. }
  570. $(window).on('resize', function(){
  571. adjustHeight()
  572. adjustWidth()
  573. })