staticInfo.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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"/><span>结果:</span></div><p id="result_title" class="result_title"></p><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. })
  232. }
  233. function getcheck() {
  234. $('input:radio').click(function () {
  235. const domName = $(this).attr('name');
  236. const $radio = $(this);
  237. const id = $(this).parents('.contentList').data("id");
  238. if ($radio.data('waschecked') == true) {
  239. $radio.prop('checked', false);
  240. $("input:radio[name='" + domName + "']").data('waschecked', false);
  241. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('label').css("color", "#666666");
  242. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.item-titles').css("color", "#333333");
  243. if (isclick) {
  244. getchecks()
  245. $(".score").html('');
  246. $(".result_title").html('');
  247. $(".result").css('display', 'none')
  248. $(".foot").css('display', 'none')
  249. }
  250. } else {
  251. $radio.prop('checked', true);
  252. $("input:radio[name='" + domName + "']").data('waschecked', false);
  253. $radio.data('waschecked', true);
  254. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
  255. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('label').css("color", "#C7C7C7");
  256. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.item-titles').css("color", "#C7C7C7");
  257. if (isclick) {
  258. getchecks()
  259. $(".score").html('');
  260. $(".result_title").html('');
  261. $(".result").css('display', 'none')
  262. $(".foot").css('display', 'none')
  263. }
  264. }
  265. });
  266. $('input:checkbox').click(function () {
  267. const domName = $(this).attr('name');
  268. const $radio = $(this);
  269. const id = $(this).parents('.contentList').data("id");
  270. $radio.parents('.contentList').each(function (i) {
  271. if ($(this).find('input[type="checkbox"]:checked').val() == undefined) {
  272. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", false);
  273. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('label').css("color", "#666666");
  274. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.item-titles').css("color", "#333333");
  275. if (isclick) {
  276. getchecks()
  277. $(".score").html('');
  278. $(".result_title").html('');
  279. $(".result").css('display', 'none')
  280. $(".foot").css('display', 'none')
  281. }
  282. } else {
  283. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
  284. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('label').css("color", "#C7C7C7");
  285. $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.item-titles').css("color", "#C7C7C7");
  286. if (isclick) {
  287. getchecks()
  288. $(".score").html('');
  289. $(".result_title").html('');
  290. $(".result").css('display', 'none')
  291. $(".foot").css('display', 'none')
  292. }
  293. }
  294. })
  295. });
  296. }
  297. function copy(name) {
  298. $(".copy").click(function () {
  299. var texts = document.getElementById("result_title").innerText;
  300. if (texts == '') {
  301. Toast('温馨提示:结果为空,无法复制', 500, 'warn')
  302. return
  303. }
  304. var inputs = document.getElementById("inputs");
  305. inputs.value = name + '结果为:' + texts; // 修改文本框的内容(赋值内容)
  306. console.log(inputs.value)
  307. inputs.select(); // 选中文本
  308. document.execCommand("copy"); // 执行浏览器复制命令
  309. Toast('复制成功', 500, 'success')
  310. })
  311. }
  312. function getchecks() {
  313. $(".contentList").each(function (i) {
  314. if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
  315. $(this).find(".item-title").addClass('chColor');
  316. } else {
  317. $(this).find(".item-title").removeClass('chColor');
  318. }
  319. if ($(this).find('input[type="checkbox"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
  320. $(this).find(".item-titles").addClass('chColor');
  321. } else {
  322. $(this).find(".item-titles").removeClass('chColor');
  323. }
  324. });
  325. }
  326. function getResult(pushInfo) {
  327. $(".but").click(function () {
  328. let arr = [];
  329. let multarr = []
  330. let multname
  331. let num = 0
  332. let result
  333. let key = false
  334. let proposal = ''
  335. let proposals = []
  336. let scrollTop = []
  337. isclick = true
  338. $(".contentList").each(function (i) {
  339. if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
  340. $(this).find(".item-title").addClass('chColor');
  341. } else {
  342. $(this).find(".item-title").removeClass('chColor');
  343. }
  344. if ($(this).find('input[type="checkbox"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
  345. $(this).find(".item-titles").addClass('chColor');
  346. } else {
  347. $(this).find(".item-titles").removeClass('chColor');
  348. }
  349. scrollTop.push($(this).eq(0).find(".chColor").offset())
  350. });
  351. var v = scrollTop.find(value => value != undefined);
  352. if(v){
  353. $(`.scale .infos`).scrollTop(v.top + 346)
  354. }
  355. if (!$(".contentList").find(".item-title").hasClass('chColor') && !$(".contentList").find(".item-titles").hasClass('chColor')) {
  356. $('input[type="radio"]:checked').each(function () {
  357. if ($(this).attr("resultType") == 1) {
  358. num += parseFloat($(this).val())
  359. } else {
  360. arr.push($(this).attr("data_obj"))
  361. proposals.push($(this).attr("proposal"))
  362. }
  363. });
  364. $('input[type="checkbox"]:checkbox:checked').each(function () {
  365. if ($(this).attr("resultType") == 1) {
  366. num += parseFloat($(this).val())
  367. } else {
  368. arr.push($(this).attr("data_obj"))
  369. proposals.push($(this).attr("proposal"))
  370. }
  371. });
  372. tmp = arr.join(";");
  373. if (pushInfo.length > 0) {
  374. for (var i = 0; i < pushInfo.length; i++) {
  375. if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
  376. result = pushInfo[i].result + '(' + num + '分' + ')'
  377. if (proposals.join(";")){
  378. proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
  379. }else{
  380. proposal = pushInfo[i].pushInfo
  381. }
  382. break
  383. } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
  384. result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
  385. if (proposals.join(";")) {
  386. proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
  387. } else {
  388. proposal = pushInfo[i].pushInfo
  389. }
  390. break
  391. } else {
  392. result = tmp
  393. proposal = proposals.join(";");
  394. }
  395. }
  396. } else {
  397. result = tmp
  398. proposal = proposals.join(";");
  399. }
  400. if (result == undefined) {
  401. if (num > 0) {
  402. $(".score").html('总分:' + num + '分');
  403. }
  404. $(".score").css('display', 'block')
  405. $(".copy").css('display', 'none')
  406. $(".foot").css('display', 'block')
  407. } else {
  408. $(".hel").attr({
  409. "title": proposal
  410. });
  411. $(".result_title").html(result);
  412. if (num > 0) {
  413. $(".score").html('总分:' + num + '分');
  414. }
  415. $(".result").css('display', 'block')
  416. $(".score").css('display', 'block')
  417. $(".copy").css('display', 'block')
  418. $(".foot").css('display', 'block')
  419. }
  420. } else {
  421. Toast('温馨提示:必填选项不能为空~', 500, 'warn')
  422. }
  423. })
  424. $(".printing").hover(
  425. function () {
  426. $(".slideImg").attr("src", "./../images/printing2.png");
  427. }, function () {
  428. $(".slideImg").attr("src", "./../images/printing.png");
  429. });
  430. }
  431. function addLinkClickEvent(contentWrapClassName) {
  432. $(`.${contentWrapClassName} .anchors li:first`).addClass("active");
  433. $(`.${contentWrapClassName} .anchors li>a`).on("click", function () {
  434. const that = this
  435. setTimeout(function () {
  436. $(`.${contentWrapClassName} .anchors .active`).removeClass('active');
  437. $(that).parent().addClass("active");
  438. }, 20)
  439. });
  440. }
  441. function renderTab(detailList, scale) {
  442. if (detailList['静态知识']) {
  443. $(".tabList").append(`<span class="tab" data-module="staticKnowledge" data-title="` + showName + `">静态知识</span>`)
  444. }
  445. if (detailList['临床路径']) {
  446. $(".tabList").append(`<span class="tab" data-module="clinicalPathway" data-title="` + clinicalPathwayName + `">临床路径</span>`)
  447. //$(".tabBox .title").html(clinicalPathwayName);
  448. }
  449. if (detailList['注意事项']) {
  450. $(".tabList").append(`<span class="tab" data-module="notice" data-title="` + noticeName + `">注意事项</span>`)
  451. //$(".tabBox .title").html(noticeName);
  452. }
  453. if (!!scale && getUrlArgObject('type') == 8) {
  454. console.log(1)
  455. $(".tabList").append(`<span class="tab" data-module="scale" data-title="` + showName + `">评估内容</span>`)
  456. //$(".tabBox .title").html(noticeName);
  457. }
  458. let defaultModuleName
  459. if (getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) {
  460. $(".tabList .tab").eq(1).addClass("activeTab")
  461. defaultModuleName = $(".tabList .tab").eq(1).attr("data-module")
  462. } else {
  463. $(".tabList .tab").eq(0).addClass("activeTab")
  464. defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
  465. }
  466. $(`.${defaultModuleName}`).css("display", "block")
  467. bindTabClick()
  468. }
  469. function bindTabClick() {
  470. $(".tabList .tab").on("click", function () {
  471. const moduleName = $(this).attr("data-module")
  472. const display = $(`.${moduleName}`).css("display")
  473. $(".tabBox .title").html($(this).attr('data-title'));
  474. if (display == "none") {
  475. $(".activeTab").removeClass("activeTab")
  476. $(this).addClass("activeTab")
  477. $(".container").css("display", "none")
  478. $(`.${moduleName}`).css("display", "block")
  479. $(`.${moduleName} .infos`).scrollTop(0)
  480. }
  481. })
  482. $("#openWin").on("click", function () {
  483. const type = getUrlArgObject('type');
  484. const name = getUrlArgObject('name');
  485. const position = getUrlArgObject('position');
  486. openNewWin("staticInfo.html?name=" + encodeURIComponent(name) + "&position=" + encodeURIComponent(position) + "&type=" + encodeURIComponent(type));
  487. })
  488. }
  489. function adjustHeight() {
  490. var ht = window.innerHeight || document.documentElement.clientHeight;
  491. $(".content").height(ht - 160 + "px");
  492. $(".content .infos").height(ht - 170 + "px");
  493. $(".content .anchors").height(ht - 217 + "px");
  494. }
  495. function adjustWidth() {
  496. var wt = window.innerWidth || document.documentElement.clientWidth;
  497. $(".titleH2").width(wt - 0.2 * wt - 33 - 200 - 17 - 40 - 15 + 'px')
  498. $(".content .infos").width(wt - 210 - 33 - 17 - 40 - 15 + 'px');
  499. }
  500. $(window).on('resize', function () {
  501. adjustHeight()
  502. adjustWidth()
  503. })
  504. //如果是子窗口,隐藏网页查看按钮
  505. if (window.opener) {
  506. $("#openWin").hide();
  507. }