staticInfo.js 22 KB

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