import Vue from 'vue'
import App from './App.vue'
import store from '@/store/index.js';
import api from '@/services/urlConfig.js'; //导入请求的环境地址配置
import router from '@/router';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; //导入ele-ui 的样式
// import $ from 'jquery'; //引入JQuery
import $ from '@/assets/jquery-3.7.1.min'; //引入JQuery
import axios from '@/services/request.js'; //重新定义axios,向里面添加一些参数
import '@/services/requestConfig.js'; //导入请求的拦截器
// import '@/utils/rem.js'; //rem单位的使用
import Mint from 'mint-ui';
import 'mint-ui/lib/style.css';

import '@/assets/common.css'; //公共样式
import "@/assets/font/iconfont.css"; //引用公共icon库
import * as WebAudioSpeechRecognizer from "@/assets/speechrecognizer.js"; //引用腾讯语音识别SDK
// import popUpComponent from "@/components/popUpComponent/popUpComponent.js"; // 公共弹框样式
// import previewComponent from "@/components/previewComponent/previewComponent.js"; // 公共图片视频预览
// import "@/utils/command.js"; // 自定义指令
import {message} from "@/utils/resetMessage";

import mynavbar from '@/components/mynavbar/mynavbar.vue'
import 'amfe-flexible';	//自动设置font-size的基准值
// import checkPermission from "@/utils/permission";

Vue.use(ElementUI); //导入ele-ui
Vue.use(Mint);
Vue.component('mynavbar', mynavbar)
// Vue.prototype.$popUp = popUpComponent;
// Vue.prototype.$preview = previewComponent;
window.$bus = new Vue(); //定义一个事件总线对象-方便组件通讯
window.axios = axios;
window.$ = $;
window.WebAudioSpeechRecognizer = WebAudioSpeechRecognizer;
Vue.prototype.$http = axios;
Vue.prototype.axios = axios;
// Vue.prototype.checkPermission = checkPermission; // 权限校验
Vue.config.productionTip = false; //阻止启动生产消息
Vue.prototype.$message = message//重写提示

// 引入echarts
import * as echarts from 'echarts'
window.echarts = echarts;

console.log('***process.env***production', process.env);
window.env = process.env.NODE_ENV;
env = env == 'development' ? 'test2' : env;
window.$config = api(env);
console.log("window.$config", window.$config);

// runtime模式-运行时
// new Vue({
//   render: h => h(App),
// }).$mount('#app')

// compiler（模板）
window.mapVue = new Vue({
    el: '#app',
    router,
    store,
    components: { App },
    template: '<App/>',
});
