main.js 2.08 KB
/*
 * @Author: yangwei
 * @Date: 2023-01-16 09:10:12
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-03-21 15:00:04
 * @FilePath: \bdcjg-web\src\main.js
 * @Description: 
 * 
 * Copyright (c) 2023 by ${yangwei}, All Rights Reserved. 
 */
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'
import Base from './base' // 全局组件引入
import mixin from '@/utils/mixin/theme.js'
import axios from 'axios'
import dataV from '@jiaminghi/data-view';
import * as echarts from "echarts"

import { startLoadingAddCount, endLoadingSubCount } from './utils/requestLoading'
Vue.mixin(mixin)
import './directive/vxe-table'
// 按需引入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

// 弹框
import { popupDialog, popupCacel } from "@/utils/popup.js";
// 全局加载
Vue.prototype.$popupDialog = popupDialog
Vue.prototype.$popupCacel = popupCacel

import { theme } from "@/directive/theme.js"
Vue.directive("theme", theme)
Vue.directive('fo', {
    inserted (el, binding, vnode) {
        el.querySelector('input').focus()
    }
})
import './image/icons' // icon
import store from './store'
import router from './router'
import _ from 'lodash'
Vue.use(Element, { size: 'small', zIndex: 1000 })
Vue.use(Base)
Vue.component('icon', Icon);
Vue.prototype.$echarts = echarts
Vue.use(dataV)
axios.get("./config.json")
    .then((res) => {
        Vue.prototype.BASE_API = res.data
        localStorage.setItem('ApiUrl', JSON.stringify(res.data));
        require('./permission')
        new Vue({
            el: '#app',
            router,
            store,
            render: h => h(App)
        })
    })