home.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. new Vue({
  2. el: '#main',
  3. data: {
  4. roles: [{
  5. "code": "350205",
  6. "level": "3",
  7. "name": "海沧区",
  8. "isManage": "1",
  9. "authOperate": "1",
  10. "areas": "350205"
  11. }, {
  12. "code": "350200",
  13. "level": "2",
  14. "name": "厦门市卫生与计划生育委员会",
  15. "isManage": "1",
  16. "authOperate": "1",
  17. "areas": "350200"
  18. }, {
  19. "code": "3502050100",
  20. "level": "4",
  21. "name": "海沧区嵩屿街道社区卫生服务中心",
  22. "isManage": "1",
  23. "authOperate": "1",
  24. "areas": "3502050100"
  25. }],
  26. selectedRole: "",
  27. isopen: true,
  28. signAnalysis: [{
  29. photo: '../../images/qianyujingzhan_icon.png',
  30. label: '签约进展',
  31. url: 'sign-progress.html'
  32. }, {
  33. photo: '../../images/xuqianjingzhan_icon.png',
  34. label: '续签进展',
  35. url: 'renew-progress.html'
  36. }, {
  37. photo: '../../images/jumingfenxi_icon.png',
  38. label: '居民分析',
  39. url: 'resident-analysis.html'
  40. }, {
  41. photo: '../../images/tuigaiqian_icon.png',
  42. label: '退改签',
  43. url: 'change-back.html'
  44. }, {
  45. photo: '../../images/lianglvfenxi_icon.png',
  46. label: '两率分析',
  47. url: 'two-rate-analysis.html'
  48. }],
  49. serviceAnalysis: [{
  50. photo: '../../images/zongtifenxi_icon.png',
  51. label: '总体分析',
  52. url: 'comprehensive-analysis.html'
  53. }, {
  54. photo: '../../images/zixunfenxi_icon.png',
  55. label: '咨询分析',
  56. url: 'consulting-analysis.html'
  57. }, {
  58. photo: '../../images/pijianfenxi_icon.png',
  59. label: '评价分析',
  60. url: 'estimate-analysis.html'
  61. }, {
  62. photo: '../../images/changcufangfenxi_icon.png',
  63. label: '长处方分析',
  64. url: 'prescription-analysis.html'
  65. }]
  66. },
  67. methods: {
  68. open: function() {
  69. EventBus.$emit('open-click', {});
  70. },
  71. showDetail: function(url) {
  72. window.location.href = url;
  73. }
  74. },
  75. mounted: function() {
  76. var selected = window.localStorage.getItem("selectedRole");
  77. if(selected) {
  78. this.selectedRole = JSON.parse(selected).code;
  79. } else {
  80. this.selectedRole = this.roles[0].code;
  81. var selected = this.roles[0];
  82. window.localStorage.setItem("selectedRole", JSON.stringify(selected));
  83. }
  84. },
  85. watch: {
  86. selectedRole: function(val) {
  87. var selected = _.findWhere(this.roles, {
  88. code: val
  89. });
  90. window.localStorage.setItem("selectedRole", JSON.stringify(selected));
  91. }
  92. }
  93. })