main.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import {createApp} from 'vue';
  2. import App from './App.vue';
  3. // 全局样式
  4. import './assets/styles/index.scss';
  5. // 引入字体
  6. import './assets/fonts/iconfont/iconfont.css';
  7. import './assets/fonts/AlimamaShuHeiTiBold/Alimama_ShuHeiTi_Bold.css';
  8. import './assets/fonts/DingTalkJinBuTiRegular/DingTalk_JinBuTi_Regular.css';
  9. // 引入路由
  10. import router from './router/index.js';
  11. // 自定义拖拽指令
  12. import {drag} from "./assets/js/directive.js";
  13. import http from './utils/http.js'
  14. // 引入elementUI 样式
  15. import 'element-plus/dist/index.css';
  16. // 全局引入ElementPlus,无需按需引入
  17. import ElementPlus from 'element-plus';
  18. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  19. import md5 from "js-md5"
  20. import {createPinia} from 'pinia'
  21. import * as echarts from "echarts";
  22. //全局弹出框组件
  23. import jtpopup from './components/jt-popup/jt-popup.vue'
  24. import jtpopup2 from './components/jt-popup/jt-popup2.vue'
  25. import jtpopup3 from './components/jt-popup/jt-popup3.vue'
  26. import jtpopupif from './components/jt-popup/jt-popup-if.vue'
  27. import jtdrawer from './components/jt-drawer/drawer.vue'
  28. import jtcharts from './components/jt-charts/charts.vue'
  29. import jtecharts from './components/jt-echarts/jt-echarts.vue'
  30. // 引入jt3dSDK
  31. import '/public/jt3dSDK/index.css';
  32. import * as jt3dSDK from '/public/jt3dSDK/jt3d.es.js';
  33. import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
  34. // import 'amfe-flexible';//rem适配
  35. import Print from 'vue3-print-nb'; //引入打印模块
  36. // 创建 Pinia 实例
  37. const pinia = createPinia();
  38. pinia.use(piniaPluginPersistedstate);
  39. // 创建实例
  40. let app = createApp(App);
  41. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  42. app.component(key, component)
  43. }
  44. //挂载到vue根实例上
  45. app.config.globalProperties.$http = http
  46. app.config.globalProperties.$md5 = md5
  47. app.config.globalProperties.jt3dSDK = jt3dSDK
  48. app.config.globalProperties.$echarts = echarts
  49. app.directive('drag', drag)
  50. app.component("jt-popup",jtpopup)
  51. app.component("jt-popup2",jtpopup2)
  52. app.component("jt-popup3",jtpopup3)
  53. app.component("jt-popup-if",jtpopupif)
  54. app.component("jt-drawer",jtdrawer)
  55. app.component("jt-charts",jtcharts)
  56. app.component("jt-echarts",jtecharts)
  57. // app.use(pinia) 在store使用
  58. app.use(router);
  59. app.use(ElementPlus);
  60. app.use(Print);
  61. app.mount('#app');