cdss.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. require('./../css/reset.css');
  2. require('./../css/cdss.less');
  3. require('./../css/popup.css');
  4. require('./../css/staticSearch.css')
  5. require('./../js/staticSearch.js')
  6. require('./../images/empty.png')
  7. require('./../images/loading.gif')
  8. require('./../images/right.png')
  9. // require('./popupEdit.js');
  10. var Promise = require("bluebird");
  11. let infoImg = require('./../images/icon_info.png')
  12. let infoImgOn = require('./../images/icon_info_on.png')
  13. let iconArrowUp = require('./../images/icon_arrow_up.png')
  14. let iconArrowDown = require('./../images/icon_arrow_down.png')
  15. let iconMark = require('./../images/icon_mark.png')
  16. const $ = require("jquery");
  17. const { post,config,getUrlArgObject,openNewWin,titleConfig } = require('./promise.js');
  18. const { transConf } = require('./util.js');
  19. // const {renderWrapper, renderCaseStandard,renderWarning,renderRecommendInfo,renderMultRecommendInfo,renderRecommendConditTips} = require('./cdssDom.js');
  20. const { data } = require('jquery');
  21. const { render } = require('less');
  22. //静态知识类型: 1:诊断 2.药品 3.化验套餐 4.化验明细 5.辅检 6.手术和操作
  23. let moduleConfig={
  24. auxiliary:"recommendWrap",
  25. qc:"qcWrap",
  26. medical:"medicalKonwledgeWrap"
  27. }
  28. let allInterface = 0
  29. let hasCompleteTnterface = 0
  30. let moduleNum = 0
  31. let mrId = getUrlArgObject('mrId')
  32. const tipsMode = getUrlArgObject('tipsMode') || 1
  33. let planCode = getUrlArgObject('planCode') || 'all'
  34. let msg;
  35. function getMRInfo() {
  36. return post(config.getMr2,{mrId:mrId})
  37. }
  38. // $('.loading').css("display","block")
  39. $('.empty').css("display","none")
  40. getMRInfo().then(res =>{
  41. if(res.data.code == '0'){
  42. msg = res.data.data ||{}
  43. window.msg = msg
  44. getConf().then(res =>{
  45. if(res.data.code == '0'){
  46. // const configArr = res.data.data.pushSetList || []
  47. // getPageInfo(configArr)
  48. const data = res.data.data&&res.data.data[0]
  49. renderPage(data)
  50. }
  51. })
  52. // getAnalyse().then(res =>{
  53. // renderCaseStandard('CaseStandard', '病例书写规范', res.data.data.warning)
  54. // })
  55. // getHosptDeptUsal().then(res =>{
  56. // const diagCommon = res.data.data
  57. // renderRecommendInfo(5,'diagCommon', '常见症状', diagCommon, true,7,2);
  58. // })
  59. }
  60. }).catch(function (err) {
  61. console.log(err);
  62. })
  63. // var msg = {
  64. // age: getUrlArgObject('age'),
  65. // sex: getUrlArgObject('sex') == '男'?1:(getUrlArgObject('sex') == '女'?2:(getUrlArgObject('sex') == '通用'?3:getUrlArgObject('sex'))),
  66. // symptom: getUrlArgObject('symptomJson'),
  67. // vital: getUrlArgObject('vitalJson'),
  68. // lis: getUrlArgObject('lisJson')? JSON.parse(getUrlArgObject('lisJson')) : [],
  69. // pacs: getUrlArgObject('pacsJson'),
  70. // diag: getUrlArgObject('diagJson'),
  71. // diseaseName: getUrlArgObject('diseaseName'),
  72. // other: getUrlArgObject('otherJson') + getUrlArgObject('pastJson'),
  73. // hosCode:getUrlArgObject('hospitalCode') || '',
  74. // plan:getUrlArgObject('plan') || '0',
  75. // }//推送相关信息
  76. // // http://localhost:8082/indexVert.html?age=28&diseaseId=280&lisJson=&diagJson=%E6%80%A5%E6%80%A7%E8%83%B0%E8%85%BA%E7%82%8E&pastJson=%E6%97%A0%E5%BF%83%E8%84%8F%E7%97%85&otherJson=%E6%97%A0%E9%AB%98%E8%A1%80%E5%8E%8B&pacsJson=%E8%85%B9%E9%83%A8B%E8%B6%85:%E6%97%A0%E5%BC%82%E5%B8%B8,%20%E6%8A%A5%E5%91%8A%E6%97%A5%E6%9C%9F:2019-05-07&sex=%E7%94%B7&symptomJson=%E6%81%B6%E5%BF%83%E5%91%95%E5%90%90%E8%85%B0%E7%97%9B&vitalJson=%E8%A1%80%E5%8E%8B%E5%B7%A6%E4%B8%8A%E8%82%A213/12mmHg
  77. // window.msg = msg
  78. // window.pushMessage = {}
  79. function getConf() {
  80. var msg = window.msg
  81. return post(config.getPushSet,{hospitalId: msg.hospitalId||1,planCode: planCode})
  82. }
  83. function getPushInfo() {
  84. return post(config.pushInner,Object.assign(msg,{featureType: '1,4,5,6,7,8,9',hospitalId:msg.hospitalId||2,ruleType:config.ruleTypeMap['22']}))
  85. }
  86. function getPusgWarning(){
  87. return post(config.indicationPush,Object.assign(msg,{ruleType: '1,2,3',hospitalId:msg.hospitalId||2}))
  88. }
  89. function getAnalyse() {
  90. const param = getAnalyseParam()
  91. return post(config.analyse,param)
  92. }
  93. function getHosptDeptUsal(){
  94. var msg = window.msg
  95. const param ={
  96. age: msg.age,
  97. deptName: msg.deptName,
  98. hospitalCode: msg.hosCode,
  99. sexType: msg.sex,
  100. type: 1,
  101. }
  102. return post(config.getHosptDeptUsal,param)
  103. }
  104. function getPushData(res){
  105. if(res&&res.data&&res.data.data&&res.data.data.dis&&res.data.data.dis){
  106. let dis = res.data.data.dis;
  107. //急诊显示规则,主诊断有急诊优先显示,没有则显示推送的,推送也没有就不显示
  108. if(dis&&dis['页面急诊']&&(dis['页面急诊'].length>0)){
  109. let name = dis['页面急诊'][0].name || ''
  110. $(".allDis .disName").html(name)
  111. disName = name
  112. if(name){
  113. $(".singleDis").css("display","block")
  114. }
  115. }else if(dis&&dis['急诊']&&dis['急诊'].length>0){
  116. let name = dis['急诊'][0].name || ''
  117. $(".allDis .disName").html(name)
  118. disName = name
  119. if(name){
  120. $(".singleDis").css("display","block")
  121. }
  122. }
  123. }
  124. }
  125. let disName=""
  126. function handleShow(){
  127. const newinConf = {
  128. width: '600', //窗口的文档显示区的宽度。以像素计。
  129. height: '826', //窗口文档显示区的高度。以像素计。
  130. left: '0', //窗口的 x 坐标。以像素计。
  131. top: '0', //窗口的 y 坐标。以像素计。
  132. openMode: "_blank" //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
  133. }
  134. const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top} scrollbars=yes`
  135. window.open('./emergency.html?disName='+disName, newinConf.openMode, newWindowLocation)
  136. }
  137. $(document).on('click',".allDis .allName",function(){
  138. handleShow()
  139. })
  140. $(document).on('click',".singleDis",function(){
  141. $(this).next().css("display","block")
  142. $(this).css("display","none")
  143. })
  144. $(document).on('click',".allDis .right,.allDis .secDis",function(){
  145. $(".allDis").css("display","none")
  146. $(".singleDis").css("display","block")
  147. })
  148. function moreInfo() {
  149. $('.moreInfo').click(function(){
  150. const name = $(this).attr('data-name')
  151. const type = $(this).attr('data-type')
  152. openNewWin(`information.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}`)
  153. })
  154. }
  155. function getVersion() {
  156. post(config.getVersion, 'confArr').then((res) => {
  157. const data = res.data.data;
  158. const ver = localStorage.getItem('versionTime');
  159. const time = data.refreshTime;
  160. if(!ver||ver===time+"=new"||time!==ver.replace("=new","")){ //判断版本是否更新
  161. $(".version-tip").addClass('new-icon');
  162. localStorage.setItem('versionTime',time+"=new"); //保存版本更新时间
  163. }else{
  164. $(".version-tip").removeClass("new-icon");
  165. }
  166. })
  167. }
  168. function getDisclaimer() {
  169. post(config.disclaimer, {}).then((res) => {
  170. const data = res.data.data.find(item => item.disclaimerCode == "2");
  171. $(".responsibility").html(data.description);
  172. // $(".iframeWrap").css({height: $(window).height()-115-$(".responsibility").height()+"px"})
  173. })
  174. }
  175. function renderPage(pageSet){
  176. renderTab(pageSet.sysSetInfo)
  177. const iframeHei = $(".bodyWrap").height()
  178. const tabHei = $(".tabList").height()
  179. $(".contentWrapper").css("height",iframeHei-tabHei-10-20-30+'px')
  180. const hasAuxiliary = hasTab("辅助信息",pageSet.sysSetInfo)
  181. const hasMedical = hasTab("医学知识",pageSet.sysSetInfo)
  182. if(hasAuxiliary){
  183. renderModuleWrapper(hasAuxiliary.planDetails)
  184. let needPush = isNeedPush(hasAuxiliary.planDetails)
  185. let needPushWarning = isNeedPushWarning(hasAuxiliary.planDetails)
  186. if(needPush || needPushWarning){
  187. renderPushData()
  188. allInterface++
  189. }
  190. if(needPushWarning){
  191. renderPushWarning()
  192. allInterface++
  193. }
  194. }
  195. }
  196. function renderPushData(){
  197. return getPushInfo().then(res =>{
  198. hasCompleteTnterface++
  199. if(res.data.code == "0"){
  200. const result = res.data.data
  201. let diagPush = result.dis
  202. let lisPush = result.lis || []
  203. let pacsPush = result.pacs || []
  204. let symptomPush = result.symptom ||[]
  205. let checkupPush = result.vital ||[]
  206. let medicinesPush = result.medicines || []
  207. let operationsPush = result.operations ||[]
  208. // let lisPush =[{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  209. // let pacsPush = [{name:"胸部x射线",hisNameList:null},{name:"心电图",hisNameList:null}]
  210. // let checkupPush = [{name:"神志表情",hisNameList:null},{name:"面部表情",hisNameList:null}]
  211. let lisNum = $(".moduleItem.lis").attr("data-num") || 5
  212. let pacsNum = $(".moduleItem.pacs").attr("data-num") || 5
  213. let checkupNum = $(".moduleItem.vital").attr("data-num") || 5
  214. let symptomNum = $(".moduleItem.symptom").attr("data-num") || 5
  215. let medicinesNum = $(".moduleItem.medicine").attr("data-num") || 5
  216. let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
  217. renderLis(lisPush,lisNum,3,true)
  218. renderPacs(pacsPush,pacsNum,5,true)
  219. renderCheckup(checkupPush,checkupNum,null,false)
  220. renderSymptomPush(symptomPush,symptomNum,null,false)
  221. renderDiag(diagPush)
  222. renderMedicinesPush(medicinesPush,medicinesNum,2,true)
  223. renderOperationPush(operationsPush,operationsNum,6,false)
  224. // if(hasCompleteTnterface === allInterface){
  225. // $('.loading').css("display","none")
  226. // if(moduleNum === 0){
  227. // empty()
  228. // }
  229. // }
  230. bindOpenInfo()
  231. bindSlide()
  232. }
  233. })
  234. }
  235. function isNeedPush(list){
  236. let pushCode = ["diag","lis","pacs","symptom","vital"]
  237. for(let i = 0; i < list.length; i++){
  238. if(pushCode.indexOf(list[i].code)>-1){
  239. return true
  240. }
  241. }
  242. return false
  243. }
  244. function isNeedPushWarning(list){
  245. let pushCode = ["tips"]
  246. for(let i = 0; i < list.length; i++){
  247. if(pushCode.indexOf(list[i].code)>-1){
  248. return true
  249. }
  250. }
  251. return false
  252. }
  253. function renderPushWarning(){
  254. return getPusgWarning().then(res =>{
  255. hasCompleteTnterface++
  256. if(res.data.code == '0'){
  257. const result = res.data.data
  258. let billMsgList = result.billMsgList || [] //开单合理性提醒
  259. let highRiskList = result.highRiskList || [] //高危药品、手术
  260. let criticalValList = result.criticalValList || [] //危急值提醒
  261. let noteList = result.noteList || [] //检查内容注意事项
  262. let dubugStr = result.dubugStr || [] //注意调试信息
  263. $('.moduleItem.tips').append(titleStr('warning'))
  264. renderBillingPush(billMsgList,'开单合理性提醒')
  265. renderBillingPush(highRiskList,'高风险提示')
  266. renderBillingPush(criticalValList,'危急值提醒')
  267. renderBillingPush(noteList,'检查内容注意事项')
  268. // renderBillingPush(dubugStr,'注意调试信息')
  269. }
  270. // if(hasCompleteTnterface === allInterface){
  271. // $('.loading').css("display","none")
  272. // if(moduleNum === 0){
  273. // empty()
  274. // }
  275. // }
  276. })
  277. }
  278. function renderBillingPush(list,name){
  279. if(list.length === 0){
  280. return
  281. }
  282. let str = ``
  283. for(let i = 0; i < list.length; i++){
  284. str += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${list[i].msg}</div>`
  285. }
  286. let titleStr = titleStr2(name)
  287. let boxStr = `<div class="moduleBox">
  288. ${titleStr}
  289. ${str}
  290. </div>`
  291. $(".tips").append(boxStr)
  292. $('.moduleItem.tips').css("display","block")
  293. }
  294. function renderDiag(diagPush){
  295. let possibleDiagPush = diagPush["可能诊断"] || []
  296. let firstDiagPush = diagPush["初步诊断"] || []
  297. let identifyDiagPush = diagPush["鉴别诊断"] || []
  298. let warningDiagPush = diagPush["警惕"] || []
  299. let number = $('.moduleItem.diag').attr("data-num") || 5
  300. let warnNumber = $('.moduleItem.warning').attr("data-num") || 5
  301. $('.moduleItem.diag').append(titleStr("diagPush"))
  302. // let firstDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  303. // let identifyDiagPush = diagPush["鉴别诊断"] || [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  304. renderDiagItem(possibleDiagPush,"可能诊断",number)
  305. renderDiagItem(firstDiagPush,"初步诊断",number)
  306. renderDiagItem(identifyDiagPush,"鉴别诊断",number)
  307. // renderWarningDiag(warningDiagPush,"警惕",warnNumber)
  308. }
  309. function renderDiagItem(list,name,number){
  310. if(list.length === 0){
  311. return
  312. }
  313. let titleStr = titleStr2(name)
  314. let {shortStr, longStr} = renderItemWrapper(list,number,1,true)
  315. let boxStr = `<div class="moduleBox">
  316. ${titleStr}
  317. ${shortStr}
  318. ${longStr}
  319. </div>`
  320. $(".diag").append(boxStr)
  321. $('.moduleItem.diag').css("display","block")
  322. }
  323. function renderWarningDiag(list,name,number){
  324. if(list.length > 0 && $(".moduleItem.warning").length > 0){
  325. moduleNum++
  326. $('.moduleItem.warning').append()
  327. let str = ``
  328. for(let i = 0; i < list.length; i++){
  329. str+= renderPushItem(list[i].name,1,true)
  330. }
  331. $('.moduleItem.warning').append(str)
  332. $('.moduleItem.lis').css("display","block")
  333. }
  334. }
  335. function renderLis(list,showNum,type,hasInfo){
  336. if(list.length > 0 && $(".moduleItem.lis").length > 0){
  337. moduleNum++
  338. $('.moduleItem.lis').append(titleStr("lisPush"))
  339. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  340. $('.moduleItem.lis').append(shortStr).append(longStr)
  341. $('.moduleItem.lis').css("display","block")
  342. }
  343. }
  344. function renderPacs(list,showNum,type,hasInfo){
  345. if(list.length > 0 && $(".moduleItem.pacs").length > 0){
  346. moduleNum++
  347. $(".moduleItem.pacs").append(titleStr("pacsPush"))
  348. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  349. $(".moduleItem.pacs").append(shortStr).append(longStr)
  350. $('.moduleItem.pacs').css("display","block")
  351. }
  352. }
  353. function renderCheckup(list,showNum,type,hasInfo){
  354. if(list.length > 0 && $(".moduleItem.vital").length > 0){
  355. moduleNum++
  356. $(".moduleItem.vital").append(titleStr("checkupPush"))
  357. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  358. $(".moduleItem.vital").append(shortStr).append(longStr)
  359. $('.moduleItem.vital').css("display","block")
  360. }
  361. }
  362. function renderSymptomPush(list,showNum,type,hasInfo){
  363. $(".moduleItem.symptom").append(titleStr('symptomPush'))
  364. if(list.length > 0 && $(".moduleItem.symptom").length > 0){
  365. moduleNum++
  366. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  367. $(".moduleItem.symptom").append(shortStr).append(longStr)
  368. $(".moduleItem.symptom").css("display","block")
  369. }
  370. }
  371. function renderMedicinesPush(list,showNum,type,hasInfo){
  372. $(".moduleItem.medicine").append(titleStr('drugPush'))
  373. if(list.length > 0 && $(".moduleItem.medicine").length > 0){
  374. moduleNum++
  375. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  376. $(".moduleItem.medicine").append(shortStr).append(longStr)
  377. $(".moduleItem.medicine").css("display","block")
  378. }
  379. }
  380. function renderOperationPush(list,showNum,type,hasInfo){
  381. $(".moduleItem.operation").append(titleStr('operationPush'))
  382. if(list.length > 0 && $(".moduleItem.operation").length > 0){
  383. moduleNum++
  384. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  385. $(".moduleItem.operation").append(shortStr).append(longStr)
  386. $(".moduleItem.operation").css("display","block")
  387. }
  388. }
  389. function renderItemWrapper(list,showNum,type,hasInfo){
  390. let showNum1 = showNum || 5
  391. let shortStr = '', longStr = ''
  392. for(let i = 0; i < list.length; i++){
  393. if(i <= showNum1-1){
  394. shortStr += renderPushItem(list[i].name,type,hasInfo)
  395. }
  396. longStr += renderPushItem(list[i].name,type,hasInfo)
  397. }
  398. if(showNum1 >= list.length){
  399. return {
  400. shortStr:`<div class="shortBox">${shortStr}</div>`,
  401. longStr:''
  402. }
  403. }else{
  404. shortStr += `<span class="showMore">更多 <img class="iconArrowImg" src="${iconArrowDown}"></span>`
  405. longStr += `<span class="showLess">收起 <img class="iconArrowImg" src="${iconArrowUp}"></span>`
  406. return {
  407. shortStr:`<div class="shortBox clearfix">${shortStr}</div>`,
  408. longStr:`<div class="longBox clearfix">${longStr}</div>`
  409. }
  410. }
  411. }
  412. function renderPushItem(name,type,hasInfo){
  413. if(hasInfo){
  414. str= `<span class="pushItemBox"><span class="pushItemName">${name}</span><img class="infoImg" src="${infoImg}"></span>`
  415. }else{
  416. str= `<span class="pushItemBox">${name}</span>`
  417. }
  418. return str
  419. }
  420. function bindOpenInfo(){
  421. $(".infoImg").on("mouseenter", function(){
  422. $(this).attr("src", infoImgOn)
  423. }).on("mouseleave", function(){
  424. $(this).attr("src", infoImg)
  425. })
  426. }
  427. function bindSlide(){
  428. $(".showMore").on("click", function(){
  429. $(this).parent().parent().find(".longBox").css("display","block")
  430. $(this).parent().parent().find(".shortBox").css("display","none")
  431. })
  432. $(".showLess").on("click", function(){
  433. $(this).parent().parent().find(".longBox").css("display","none")
  434. $(this).parent().parent().find(".shortBox").css("display","block")
  435. })
  436. }
  437. function renderModuleWrapper(moduleList){
  438. let moduleStr = ''
  439. for(let i = 0; i < moduleList.length; i++){
  440. // if(moduleList[i].status !='0'){
  441. if(moduleList[i].code == 'treat'){
  442. moduleStr += `<div class="moduleItem medicine" data-num="${moduleList[i].number}" style="display:none"></div>`
  443. moduleStr += `<div class="moduleItem operation" data-num="${moduleList[i].number}" style="display:none"></div>`
  444. }else if(moduleList[i].code == 'tips'){
  445. moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"></div>`
  446. moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"></div>`
  447. }else{
  448. moduleStr += `<div class="moduleItem ${moduleList[i].code }" data-num="${moduleList[i].number}" style="display:none"></div>`
  449. }
  450. // }
  451. }
  452. $(".recommendWrap").append(moduleStr)
  453. }
  454. function hasTab(tabName,tabList){
  455. for(let i = 0; i < tabList.length; i++){
  456. if(tabList[i].name == tabName){
  457. return tabList[i]
  458. }
  459. }
  460. return false
  461. }
  462. function renderTab(tabList){
  463. let tabStr = ''
  464. for(let i = 0; i < tabList.length; i++){
  465. tabStr += `<span class="tab ${i === 0 ? 'activeTab':''}" data-name="${tabList[i].code}" >${tabList[i].name}<span class="activeLine"></span></span>`
  466. }
  467. $(".tabList").append(tabStr)
  468. getModuleShow(moduleConfig[tabList[0].code])
  469. bindTabClick()
  470. }
  471. function titleStr(type){
  472. let titleStr = ''
  473. titleStr += `<h4 class="moduleTitle" style="background:${titleConfig[type].background}"><img class="titleIcon" src=${titleConfig[type].icon}>${titleConfig[type].name}</h4>`
  474. return titleStr
  475. }
  476. function titleStr2(name){
  477. let titleStr = ''
  478. titleStr += `<p class="moduleBoxTitle">${name}:</p>`
  479. return titleStr
  480. }
  481. function bindTabClick(){
  482. $(".tabList .tab").on("click", function(){
  483. $(".activeTab").removeClass("activeTab")
  484. $(this).addClass("activeTab")
  485. const moduleName = $(this).attr("data-name")
  486. getModuleShow(moduleConfig[moduleName])
  487. })
  488. }
  489. function getModuleShow(moduleClassName){
  490. if( $(`.${moduleClassName}`).css("display") =="none"){
  491. $(".moduleWrapper").css("display","none")
  492. $(`.${moduleClassName}`).css("display","block")
  493. }
  494. }
  495. function empty(){
  496. $('.empty').css("display","block")
  497. }
  498. $(function(){
  499. getDisclaimer(); //获取免责声明
  500. getVersion(); //获取版本信息
  501. $(".disclaimerInfo").on("click", function(){
  502. openNewWin("disclaimer.html")
  503. });
  504. $(".version-tip").on("click", function(){
  505. const ver = localStorage.getItem('versionTime');
  506. $(".version-tip").removeClass('new-icon');
  507. localStorage.setItem('versionTime',ver.replace("=new",""));
  508. openNewWin("version.html");
  509. });
  510. });