informationOut.js 25 KB

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