index.js 1.7 KB

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