在昨天的基础上: 1. 引入了flex.css,这个工具可以在实际开发中继续方便快速构建业务页面 —— 可以加一个页面说明 2. 将布局的部分从样式中脱离出来,在html里一目了然。 3. 测试情况: 测试环境:Chrome,IE11,Edge —— 显示正常 —— 边框没有1px的问题 —— 标签过多显示正常 Former-commit-id: ed2ba5a009542d7ac1567c42445ba0cf0cf3b6f9 [formerly 175c91524fec7b37b134643b51eab50e4e9c2bc7] [formerly ed2ba5a009542d7ac1567c42445ba0cf0cf3b6f9 [formerly 175c91524fec7b37b134643b51eab50e4e9c2bc7] [formerly ed2ba5a009542d7ac1567c42445ba0cf0cf3b6f9 [formerly 175c91524fec7b37b134643b51eab50e4e9c2bc7] [formerly 175c91524fec7b37b134643b51eab50e4e9c2bc7 [formerly 75fc769098a2dd22f2570580e1e38a9211ba59a3 [formerly f5bb3ce14be07f93eeb61ef9b88df0a63a01a491]]]]] Former-commit-id: 4ffb48d759ea3ba129aeeb77cfefb7b86fd91c76 Former-commit-id: f882c1ae2673b927ceb11f6eadeff0b43d5660d2 Former-commit-id: 0fec60f6d05afe04465adf11b0f3130c4b454b58 [formerly 072223429c32f5c05283726b1b5ad67cc7a6054b] Former-commit-id: 7f6b6f9f23a0379c39bbedf03fe6520d437747ac Former-commit-id: 9d55f0ff8170414c478360c6dddd74dafcc50e17 Former-commit-id: 3e81c2411638572ae500f07f2efb9976e8c1e710 Former-commit-id: b82c259e86a5a604901a12128a768da8262581b0 Former-commit-id: b0152867003988582a71dc6797f74f9189c7e051
105 lines
2.7 KiB
JavaScript
105 lines
2.7 KiB
JavaScript
import 'babel-polyfill'
|
|
import Vue from 'vue'
|
|
import App from './App'
|
|
// flex.css
|
|
import 'flex.css'
|
|
import ElementUI from 'element-ui'
|
|
import 'element-ui/lib/theme-chalk/index.css'
|
|
import VCharts from 'v-charts'
|
|
import screenfull from 'screenfull'
|
|
import contentmenu from 'v-contextmenu'
|
|
import 'v-contextmenu/dist/index.css'
|
|
import vueJsonTreeView from 'vue-json-tree-view'
|
|
import i18n from './i18n'
|
|
import util from '@/libs/util.js'
|
|
import store from '@/store/index'
|
|
import '@/assets/svg-icons'
|
|
import '@/components'
|
|
import '@/plugin/axios'
|
|
import '@/mock/register'
|
|
import pluginImport from '@/plugin/import'
|
|
import pluginExport from '@/plugin/export'
|
|
import pluginOpen from '@/plugin/open'
|
|
|
|
// 菜单和路由设置
|
|
import router from './router'
|
|
import { menuHeader, menuAside } from '@/menu'
|
|
import { frameInRoutes } from '@/router/routes'
|
|
|
|
Vue.use(ElementUI)
|
|
Vue.use(VCharts)
|
|
Vue.use(contentmenu)
|
|
Vue.use(pluginImport)
|
|
Vue.use(pluginExport)
|
|
Vue.use(pluginOpen)
|
|
Vue.use(vueJsonTreeView)
|
|
|
|
Vue.config.productionTip = false
|
|
|
|
Vue.prototype.$env = process.env.NODE_ENV
|
|
Vue.prototype.$baseUrl = process.env.BASE_URL
|
|
|
|
new Vue({
|
|
router,
|
|
store,
|
|
i18n,
|
|
render: h => h(App),
|
|
created () {
|
|
// 处理路由 得到每一级的路由设置
|
|
this.getAllPageFromRoutes()
|
|
// 设置顶栏菜单
|
|
this.$store.commit('d2adminMenuHeaderSet', menuHeader)
|
|
},
|
|
mounted () {
|
|
// D2Admin 开发环境检查更新
|
|
util.checkUpdate(this)
|
|
// 获取并记录用户 UA
|
|
this.$store.commit('d2adminUaGet')
|
|
// 展示系统信息
|
|
util.showInfo()
|
|
// 用户登陆后从数据库加载一系列的设置
|
|
this.$store.commit('d2adminLoginSuccessLoad')
|
|
// 初始化全屏监听
|
|
this.fullscreenListenerInit()
|
|
},
|
|
watch: {
|
|
// 监听路由 控制侧边栏显示
|
|
'$route.matched' (val) {
|
|
const _side = menuAside.filter(menu => menu.path === val[0].path)
|
|
this.$store.commit('d2adminMenuAsideSet', _side.length > 0 ? _side[0].children : [])
|
|
}
|
|
},
|
|
methods: {
|
|
/**
|
|
* 初始化全屏监听
|
|
*/
|
|
fullscreenListenerInit () {
|
|
if (screenfull.enabled) {
|
|
screenfull.on('change', () => {
|
|
if (!screenfull.isFullscreen) {
|
|
this.$store.commit('d2adminFullScreenSet', false)
|
|
}
|
|
})
|
|
}
|
|
},
|
|
/**
|
|
* 处理路由 得到所有的页面
|
|
*/
|
|
getAllPageFromRoutes () {
|
|
const pool = []
|
|
const push = function (routes) {
|
|
routes.forEach(route => {
|
|
if (route.children) {
|
|
push(route.children)
|
|
} else {
|
|
const { meta, name, path } = route
|
|
pool.push({ meta, name, path })
|
|
}
|
|
})
|
|
}
|
|
push(frameInRoutes)
|
|
this.$store.commit('d2adminPagePoolSet', pool)
|
|
}
|
|
}
|
|
}).$mount('#app')
|