2025-08-18 16:50:57 +08:00
|
|
|
|
import * as ElIcons from "@element-plus/icons-vue";
|
2025-09-18 15:58:57 +08:00
|
|
|
|
import Axios from "axios";
|
|
|
|
|
|
import { createApp } from "vue";
|
2025-08-18 16:50:57 +08:00
|
|
|
|
import App from "./App.vue";
|
|
|
|
|
|
import router from "./router";
|
|
|
|
|
|
import store from "./store";
|
|
|
|
|
|
import installElementPlus from "./plugins/element";
|
|
|
|
|
|
import plugins from "./plugins";
|
|
|
|
|
|
import "./assets/css/element-plus.scss";
|
|
|
|
|
|
import "./assets/css/layout.scss";
|
|
|
|
|
|
import "./assets/css/pulic.scss";
|
2025-09-18 15:58:57 +08:00
|
|
|
|
import ELMessage from "element-plus";
|
|
|
|
|
|
import InfiniteScroll from "./utils/lazyLoad";
|
2025-08-18 16:50:57 +08:00
|
|
|
|
|
|
|
|
|
|
// echart图表
|
2025-09-18 15:58:57 +08:00
|
|
|
|
// import * as echarts from "echarts";
|
2025-08-18 16:50:57 +08:00
|
|
|
|
// Vue.prototype.$echarts = echarts
|
|
|
|
|
|
const app = createApp(App);
|
2025-09-18 15:58:57 +08:00
|
|
|
|
|
2025-08-18 16:50:57 +08:00
|
|
|
|
//注册自定义指令
|
2025-09-18 15:58:57 +08:00
|
|
|
|
app.use(InfiniteScroll);
|
2025-08-18 16:50:57 +08:00
|
|
|
|
Object.keys(ElIcons).forEach((key) => {
|
|
|
|
|
|
//全局注册 element 图标
|
|
|
|
|
|
app.component(key, ElIcons[key]);
|
|
|
|
|
|
});
|
2025-09-18 15:58:57 +08:00
|
|
|
|
app.config.globalProperties.$http = axios;
|
2025-08-18 16:50:57 +08:00
|
|
|
|
|
|
|
|
|
|
//告诉前页面内的事件监听器内部是否会调用preventDefault函数来阻止事件的默认行为,以便浏览器根据这个信息更好地做出决策来优化页面性能
|
|
|
|
|
|
// import "default-passive-events";
|
|
|
|
|
|
import installDirective from "@/directives";
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化样式表
|
|
|
|
|
|
import "@/styles/base.scss";
|
|
|
|
|
|
|
|
|
|
|
|
// import '@/styles/common.scss';
|
|
|
|
|
|
// 导入svgIcon
|
|
|
|
|
|
import installIcons from "@/icons";
|
|
|
|
|
|
|
|
|
|
|
|
//导入路由鉴权
|
|
|
|
|
|
import "./permission";
|
|
|
|
|
|
|
|
|
|
|
|
//全局属性(v2过滤器)
|
|
|
|
|
|
import installFilter from "@/filters";
|
|
|
|
|
|
//事件总线
|
|
|
|
|
|
import mitt from "mitt";
|
|
|
|
|
|
|
2025-09-18 15:58:57 +08:00
|
|
|
|
import { resetForm } from "@/utils/validate";
|
|
|
|
|
|
import { getDict, setCascader } from "@/utils/dict";
|
2025-08-18 16:50:57 +08:00
|
|
|
|
import axios from "axios";
|
|
|
|
|
|
|
|
|
|
|
|
//挂载全局方法
|
|
|
|
|
|
app.config.globalProperties.resetForm = resetForm;
|
|
|
|
|
|
app.config.globalProperties.$dict = getDict; //字典公共函数
|
|
|
|
|
|
app.config.globalProperties.$message = ELMessage; //element提示组件
|
|
|
|
|
|
app.config.globalProperties.$set = setCascader; //设置级联选择器回显
|
|
|
|
|
|
app.config.globalProperties.mittBus = new mitt(); //配置事件总线
|
|
|
|
|
|
|
|
|
|
|
|
installElementPlus(app);
|
|
|
|
|
|
installFilter(app);
|
|
|
|
|
|
installDirective(app);
|
|
|
|
|
|
app.use(store).use(ELMessage).use(router).use(plugins).mount("#app");
|