Former-commit-id: c4aafa90eef4fa78782d750fc33e484d071e93af [formerly c4aafa90eef4fa78782d750fc33e484d071e93af [formerly c4aafa90eef4fa78782d750fc33e484d071e93af [formerly c4aafa90eef4fa78782d750fc33e484d071e93af [formerly 2ef73ea49b3405be63a1552eaa45649af7d559df [formerly e8792780e531de7b81bec704953a57fb05c3255e]]]]] Former-commit-id: 80c8177590bbadb58158ea371d1aa67f05de60f5 Former-commit-id: ef3cdcd6a5eed24569fa9a0c38ead6903d8f84b0 Former-commit-id: 9874c1f8f43c8beda5404b222d53697774f808bb [formerly 810d6baa2283c6310dd8ae35fa99b810331cd7f3] Former-commit-id: cd5531c1a53a55fa62d897a8ffa27b30b0d5be50 Former-commit-id: 79be8e7248a71c1b608c009d4b200c6cf04572ca Former-commit-id: 0d797ed715b7091e9b9a3748dd85152a7c86549e Former-commit-id: c175d6cb3db552a3b8749fa51c0cb6375fcfc0a7 Former-commit-id: 6c2d3338e77a6f3ca12fee92621d23ea795f7a3d
77 lines
2.2 KiB
JavaScript
77 lines
2.2 KiB
JavaScript
// polyfill
|
|
import 'babel-polyfill'
|
|
// Vue
|
|
import Vue from 'vue'
|
|
import App from './App'
|
|
// store
|
|
import store from '@/store/index'
|
|
// 模拟数据
|
|
import '@/mock'
|
|
// 多国语
|
|
import i18n from './i18n'
|
|
// 核心插件
|
|
import d2Admin from '@/plugin/d2admin'
|
|
|
|
// [ 可选插件组件 ]D2-Crud
|
|
import D2Crud from '@d2-projects/d2-crud'
|
|
// [ 可选插件组件 ] 图表
|
|
import VCharts from 'v-charts'
|
|
// [ 可选插件组件 ] 右键菜单
|
|
import contentmenu from 'v-contextmenu'
|
|
import 'v-contextmenu/dist/index.css'
|
|
// [ 可选插件组件 ] JSON 树状视图
|
|
import vueJsonTreeView from 'vue-json-tree-view'
|
|
// [ 可选插件组件 ] 网格布局组件
|
|
import { GridLayout, GridItem } from 'vue-grid-layout'
|
|
// [ 可选插件组件 ] 区域划分组件
|
|
import SplitPane from 'vue-splitpane'
|
|
|
|
// 菜单和路由设置
|
|
import router from './router'
|
|
import { menuHeader, menuAside } from '@/menu'
|
|
import { frameInRoutes } from '@/router/routes'
|
|
|
|
// 核心插件
|
|
Vue.use(d2Admin)
|
|
|
|
// 可选插件组件
|
|
Vue.use(D2Crud)
|
|
Vue.use(VCharts)
|
|
Vue.use(contentmenu)
|
|
Vue.use(vueJsonTreeView)
|
|
Vue.component('d2-grid-layout', GridLayout)
|
|
Vue.component('d2-grid-item', GridItem)
|
|
Vue.component('SplitPane', SplitPane)
|
|
|
|
new Vue({
|
|
router,
|
|
store,
|
|
i18n,
|
|
render: h => h(App),
|
|
created () {
|
|
// 处理路由 得到每一级的路由设置
|
|
this.$store.commit('d2admin/page/init', frameInRoutes)
|
|
// 设置顶栏菜单
|
|
this.$store.commit('d2admin/menu/headerSet', menuHeader)
|
|
// 初始化菜单搜索功能
|
|
this.$store.commit('d2admin/search/init', menuHeader)
|
|
},
|
|
mounted () {
|
|
// 展示系统信息
|
|
this.$store.commit('d2admin/releases/versionShow')
|
|
// 用户登录后从数据库加载一系列的设置
|
|
this.$store.dispatch('d2admin/account/load')
|
|
// 获取并记录用户 UA
|
|
this.$store.commit('d2admin/ua/get')
|
|
// 初始化全屏监听
|
|
this.$store.dispatch('d2admin/fullscreen/listen')
|
|
},
|
|
watch: {
|
|
// 监听路由 控制侧边栏显示
|
|
'$route.matched' (val) {
|
|
const _side = menuAside.filter(menu => menu.path === val[0].path)
|
|
this.$store.commit('d2admin/menu/asideSet', _side.length > 0 ? _side[0].children : [])
|
|
}
|
|
}
|
|
}).$mount('#app')
|