informationOut.js 26 KB

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