123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- import { createApp } from 'vue'
- import Antd from 'ant-design-vue'
- import App from './App'
- import router from './router'
- import store from './store'
- import 'ant-design-vue/dist/antd.css'
- import '@/vab'
- // import 'default-passive-events'
- // 引入 ElementUI
- import ElementPlus from 'element-plus'
- import 'element-plus/dist/index.css'
- import zhCn from 'element-plus/lib/locale/lang/zh-cn' // 中文
- import '@/assets/css/index.scss'
- import '@/assets/css/global.scss'
- import * as echarts from 'echarts';
- import '@/icons'
- import SvgIcon from "@/components/SvgIcon"
- import 'video.js/dist/video-js.css'
- /**
- * 引入vue.grid-layout
- */
- import VueGridLayout from 'vue-grid-layout'
- /**
- * @author chuzhixin 1204505056@qq.com
- * @description 正式环境默认使用mock,正式项目记得注释后再打包
- */
- // if (process.env.NODE_ENV === 'production') {
- // const { mockXHR } = require('@/utils/static')
- // mockXHR()
- // }
- var app = createApp(App)
- app.config.globalProperties.$echarts = echarts
- app.directive("drag", { //指令的名称
- inserted: function (el, binding) { //当被绑定的元素插入到 DOM 中时
- binding
- el.onmousedown = function (e) {
- var x = e.clientX - el.offsetLeft;
- var y = e.clientY - el.offsetTop;
- document.onmousemove = function (eve) {
- el.style.left = eve.clientX - x + "px";
- el.style.top = eve.clientY - y + "px";
- }
- document.onmouseup = function () {
- document.onmousemove = null;
- document.onmouseup = null;
- }
- }
- }
- })
- app
- .component("svg-icon", SvgIcon)
- .use(store)
- .use(router)
- .use(ElementPlus, { locale: zhCn, size: 'small' })
- .use(Antd)
- .use(VueGridLayout)
- .mount('#app')
- /**
- * @需添加路由拦截 --登录后执行
- */
- router.beforeEach((to) => {
- if (to.path != '/login') {
- store.commit("publicSiteList");
- store.commit('publicDeviceList')
- console.log(to.meta.title)
- store.commit('getAuthorities', to.meta.title)
- // store.commit('getMiddleConfig')
- // console.log('store.state.authorities')
- // console.log(store.state.authorities)
- // next()
- }
- // if (to.path == '/home') {
- // if (window.location.host.indexOf('localhost') != -1) {
- // window.location.href = "http://localhost:8080/#/home";
- // // } else if (window.location.host.indexOf('pcdev.ewoogi.com') != -1) {
- // // window.location.href = "https://pcdev.ewoogi.com/vuefiv#/home";
- // } else {
- // window.location.href = "http://101.133.214.75:13201/";
- // }
- // }
- })
- router.afterEach((to) => {
- to
- })
|