main.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { createApp } from "vue";
  2. import App from "./App.vue";
  3. import router from "./router";
  4. import store from "./store";
  5. import "font-awesome/css/font-awesome.min.css";
  6. // 引入 element-ui
  7. import ElementPlus from "element-plus";
  8. import "element-plus/dist/index.css";
  9. // import "element-plus/lib/theme-chalk/index.css";
  10. import locale from "element-plus/lib/locale/lang/zh-cn";
  11. // // 引入环境配置
  12. // import "@modeConfig/modeConfig.js";
  13. import "@/lib/global-import.js";
  14. // 引入请求工具
  15. import axios from "@api/axios";
  16. // 引入基础工具
  17. import basicTool from "@tools/basicTool";
  18. import animated from "animate.css";
  19. /**
  20. * 对 Date 的扩展,将 Date 转化为指定格式的字符串
  21. * @param {String} fmt 传入一个字符串,根据所传字符串的格式返回转换后特定格式的日期。
  22. * 调用姿势:new Date().formatDate("yyyy-MM-dd hh:mm:ss");
  23. */
  24. Date.prototype.formatDate = function (fmt) {
  25. let o = {
  26. "M+": this.getMonth() + 1, //月份
  27. "d+": this.getDate(), //日
  28. "h+": this.getHours(), //小时
  29. "m+": this.getMinutes(), //分
  30. "s+": this.getSeconds(), //秒
  31. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  32. "S": this.getMilliseconds() //毫秒
  33. };
  34. if (/(y+)/.test(fmt)) {
  35. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  36. }
  37. for (let k in o) {
  38. if (new RegExp("(" + k + ")").test(fmt)) {
  39. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  40. }
  41. }
  42. return fmt;
  43. }
  44. window.__STATICVUE__ = createApp(App);
  45. window.__STATICVUE__.use(ElementPlus, { locale });
  46. window.__STATICVUE__.use(store);
  47. window.__STATICVUE__.use(router);
  48. window.__STATICVUE__.use(animated);
  49. window.__STATICVUE__.config.globalProperties.API = axios; //全局注册
  50. window.__STATICVUE__.config.globalProperties.BASE = basicTool; //全局注册
  51. // window.__STATICVUE__.config.globalProperties.$Cesium = Cesium;
  52. window.__STATICVUE__.mount('#app');