staticInfo.js 23 KB

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