Blame view

src/main.js 2.15 KB
yangwei committed
1 2 3
/*
 * @Author: yangwei
 * @Date: 2023-01-16 09:10:12
任超 committed
4
 * @LastEditors: Please set LastEditors
5
 * @LastEditTime: 2023-03-27 16:54:34
yangwei committed
6 7 8 9 10
 * @FilePath: \bdcjg-web\src\main.js
 * @Description: 
 * 
 * Copyright (c) 2023 by ${yangwei}, All Rights Reserved. 
 */
任超 committed
11 12 13 14 15 16
import Vue from 'vue'
import App from './App'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui'
import '@/styles/element-variables.scss'
import '@/styles/index.scss'
17
import Base from './base' // 全局组件引入
任超 committed
18
import mixin from '@/utils/mixin/theme.js'
任超 committed
19
import axios from 'axios'
任超 committed
20
import dataV from '@jiaminghi/data-view';
yangwei committed
21
import * as echarts from "echarts"
任超 committed
22 23
import { startLoadingAddCount, endLoadingSubCount } from './utils/requestLoading'
Vue.mixin(mixin)
xiaomiao committed
24
import './directive/vxe-table'
任超 committed
25 26 27 28 29 30 31 32 33 34 35 36
// 按需引入vue-awesome图标
import Icon from 'vue-awesome/components/Icon';
import 'vue-awesome/icons/chart-bar.js';
import 'vue-awesome/icons/chart-area.js';
import 'vue-awesome/icons/chart-pie.js';
import 'vue-awesome/icons/chart-line.js';
import 'vue-awesome/icons/align-left.js';

// 全局加载
Vue.prototype.$startLoading = startLoadingAddCount
Vue.prototype.$endLoading = endLoadingSubCount

任超 committed
37 38 39 40 41 42
// 弹框
import { popupDialog, popupCacel } from "@/utils/popup.js";
// 全局加载
Vue.prototype.$popupDialog = popupDialog
Vue.prototype.$popupCacel = popupCacel

任超 committed
43 44
import { theme } from "@/directive/theme.js"
Vue.directive("theme", theme)
任超 committed
45 46 47 48 49
Vue.directive('fo', {
    inserted (el, binding, vnode) {
        el.querySelector('input').focus()
    }
})
任超 committed
50 51 52
import './image/icons' // icon
import store from './store'
import router from './router'
任超 committed
53
import _ from 'lodash'
任超 committed
54 55 56 57 58
Vue.use(Element, { size: 'small', zIndex: 1000 })
Vue.use(Base)
Vue.component('icon', Icon);
Vue.prototype.$echarts = echarts
Vue.use(dataV)
任超 committed
59 60 61
axios.get("./config.json")
    .then((res) => {
        Vue.prototype.BASE_API = res.data
任超 committed
62
        localStorage.setItem('ApiUrl', JSON.stringify(res.data));
任超 committed
63
        require('./permission')
任超 committed
64 65 66 67 68 69
        new Vue({
            el: '#app',
            router,
            store,
            render: h => h(App)
        })
70
        window.document.documentElement.setAttribute("data-theme", 'blue');
任超 committed
71
    })