index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var routes = [
  2. { path: '/', component: IndexPage,
  3. children: [
  4. {
  5. path: '/',
  6. component: PersonEditPanel,
  7. redirect: 'person-edit-panel'
  8. },
  9. {
  10. path: 'person-new-panel',
  11. component: PersonNewPanel
  12. },
  13. {
  14. path: 'person-edit-panel',
  15. component: PersonEditPanel
  16. },
  17. {
  18. path: 'team-new-panel',
  19. component: TeamNewtPanel
  20. },
  21. {
  22. path: 'team-edit-panel',
  23. component: TeamEditPanel
  24. },
  25. {
  26. path: 'temp-send-panel',
  27. component: TempSendPanel
  28. },
  29. {
  30. path: 'system-send-panel',
  31. component: SystemSendPanel
  32. },
  33. {
  34. path: 'preview-panel',
  35. component: PreviewPanel
  36. }
  37. ]
  38. }
  39. ],
  40. router = new VueRouter({
  41. routes: routes
  42. }),
  43. storage = {
  44. docInfo: null,
  45. patient: null, // url中patient,用来来判断是否是"发送"模式
  46. planId: null
  47. }
  48. new Vue({
  49. data: {
  50. },
  51. router: router,
  52. created: function() {
  53. var vm = this
  54. vm.loading.show()
  55. homeAPI.baseinfo().then(function(res) {
  56. if(res.status == 200) {
  57. vm.loading.close()
  58. var infoStr = JSON.stringify(res.data);
  59. localStorage.setItem("docInfo", infoStr);
  60. storage.docInfo = res.data
  61. vm.$mount('#app')
  62. } else {
  63. vm.loading.close()
  64. toastr && toastr.error(res.msg)
  65. }
  66. })
  67. },
  68. methods: {
  69. chooseTab: function(val){
  70. this.selectedTab = val;
  71. }
  72. }
  73. })