rehabilitation_guidance.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. var routes = [
  2. { path: '/', component: IndexPage2,
  3. children: [
  4. {
  5. path: '/',
  6. component: TempSendPanel,
  7. redirect: 'temp-send-panel'
  8. },
  9. {
  10. path: 'temp-send-panel',
  11. component: TempSendPanel
  12. },
  13. {
  14. path: 'preview-panel',
  15. component: PreviewPanel
  16. }
  17. ]
  18. }
  19. ],
  20. router = new VueRouter({
  21. routes: routes
  22. }),
  23. storage = {
  24. docInfo: null,
  25. patient: null, // url中patient,用来来判断是否是"发送"模式
  26. planId: null
  27. }
  28. var httpData = GetRequest()
  29. new Vue({
  30. data: {
  31. },
  32. router: router,
  33. created: function() {
  34. var vm = this
  35. vm.loading.show()
  36. homeAPI.baseinfo().then(function(res) {
  37. if(res.status == 200) {
  38. vm.loading.close()
  39. var infoStr = JSON.stringify(res.data);
  40. localStorage.setItem("docInfo", infoStr);
  41. storage.docInfo = res.data
  42. vm.$mount('#app')
  43. } else {
  44. vm.loading.close()
  45. toastr && toastr.error(res.msg)
  46. }
  47. })
  48. },
  49. methods: {
  50. chooseTab: function(val){
  51. this.selectedTab = val;
  52. }
  53. }
  54. })