import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// 引入ant-design
import Antd from 'ant-design-vue'
// import 'ant-design-vue/dist/antd.less'
import '@/assets/css/antstyle.less'
Vue.use(Antd)

// 引入datav
import dataV from '@jiaminghi/data-view'
Vue.use(dataV)

// 引入vuescroll
import vuescroll from 'vuescroll';
Vue.use(vuescroll, {
  ops: {
    mode: 'native',
    sizeStrategy: 'percent',
    detectResize: true,
  }, // 在这里设置全局默认配置
  name: 'vuescroll' // 在这里自定义组件名字，默认是vueScroll
});

// 按需引入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.component('icon', Icon)

import '@/permission' // permission control

// 适配flex
import '@/common/flexible.js'

// 引入全局css
import './assets/css/style.scss'


//引入echart
import echarts from 'echarts'
Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

// 获取配置文件
import axios from 'axios'
import service from '@/utils/request'
axios.get('static/project.config.json').then((result) => {
  console.log('get config')
  Vue.prototype.baseConfig = result.data
  document.title = result.data.title // 首先设置网页的title
  service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址
  new Vue({
    router,
    store,
    render: (h) => h(App),
  }).$mount('#app')
}).catch((error) => {
  console.log('get baseConfig error...' + error)
})


