123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- var routes = [
- { path: '/', component: IndexPage,
- children: [
- {
- path: '/',
- components: {
- leftView: TemplateList,
- rightView: NewTemplate
- }
- },
- {
- path: '/new-template-form',
- components: {
- leftView: TemplateList,
- rightView: NewTemplateForm
- }
- },
- {
- path: '/template-items',
- components: {
- leftView: TemplateItemsSelect,
- rightView: TemplateItems
- }
- },
- {
- path: '/template-items-select',
- components: {
- leftView: TemplateItemsSelect,
- rightView: TemplateItems
- }
- },
- {
- path: '/template-item-detail',
- components: {
- leftView: TemplateItemsSelect,
- rightView: ItemDetail
- }
- },
- ]
- }
- ],
- router = new VueRouter({
- routes: routes
- }),
- storage = {
- docInfo: null,
- patient: null, // url中patient,用来来判断是否是"发送"模式
- planId: null
- }
- new Vue({
- data: {
- },
- router: router,
- created: function() {
- var vm = this
- vm.loading.show()
- homeAPI.baseinfo().then(function(res) {
- if(res.status == 200) {
- vm.loading.close()
- var infoStr = JSON.stringify(res.data);
- localStorage.setItem("docInfo", infoStr);
- storage.docInfo = res.data
- vm.$mount('#app')
- } else {
- vm.loading.close()
- toastr && toastr.error(res.msg)
- }
- })
- },
- methods: {
- backPage: function(){
- window.history.go(-1);
- },
- refreshPage: function(){
- window.location.reload();
- }
- },
- components: {
- }
- })
|