informationOut.js 23 KB

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