followup-tabs.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. function GetRequest() {
  2. var url = location.search; //获取url中"?"符后的字串
  3. var theRequest = new Object();
  4. if (url.indexOf("?") != -1) {
  5. var str = url.substr(1);
  6. strs = str.split("&");
  7. for(var i = 0; i < strs.length; i ++) {
  8. theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
  9. }
  10. }
  11. return theRequest;
  12. }
  13. new Vue({
  14. el: '#app',
  15. data: {
  16. followUpTabs:[{
  17. url: 'followup_register.html'+location.search,
  18. name: '随访登记'
  19. },{
  20. url: 'followup_symptom.html'+location.search,
  21. name: '症状'
  22. },{
  23. url: 'followup_sign.html'+location.search,
  24. name: '体征'
  25. },{
  26. url: 'followup_inspect.html'+location.search,
  27. name: '实验室检查'
  28. },{
  29. url: 'followup_guidance.html'+location.search,
  30. name: '生活方式指导'
  31. },{
  32. url: 'followup_evaluate.html'+location.search,
  33. name: '评价'
  34. },{
  35. url: 'followup_medication.html'+location.search,
  36. name: '用药情况'
  37. },{
  38. url: 'followup_target.html'+location.search,
  39. name: '控制目标'
  40. },{
  41. url: 'followup_education.html'+location.search,
  42. name: '健康教育'
  43. },{
  44. url: 'followup_referral.html'+location.search,
  45. name: '转诊'
  46. }],
  47. activeidx: 0,
  48. clickOtherTab: true//其他是否可以点击
  49. },
  50. mounted: function() {
  51. var query = GetRequest();
  52. this.activeidx = query.pro_id || 0;
  53. }
  54. })
  55. $(function(){
  56. $("#fv_tabs").on('click', 'a', function(){
  57. var $this = $(this),
  58. $li = $this.parent(),
  59. index = $li.index();
  60. if(parent.clickOtherTab){
  61. $li.siblings().removeClass("active");
  62. $li.addClass("active");
  63. selectedTab = $this.data('index');
  64. // reqLinkList.push(links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx);
  65. var url = links[selectedTab].url;
  66. parent.document.getElementById('fv_main').src = url;
  67. }else{
  68. return false;
  69. }
  70. })
  71. })
  72. parent.goFollowupNextQuestionaire = function(){
  73. selectedTab ++;
  74. $("#fv_tabs a").eq(selectedTab).trigger('click');
  75. }