informationOut.js 24 KB

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