67 lines
1.5 KiB
JavaScript
67 lines
1.5 KiB
JavaScript
import { createApp } from "vue";
|
|
import ElementPlus from "element-plus";
|
|
import "element-plus/dist/index.css";
|
|
import "element-plus/theme-chalk/display.css";
|
|
import scui from "./scui";
|
|
import ehsui from "./ehs";
|
|
import i18n from "./locales";
|
|
import router from "./router";
|
|
import store from "./store";
|
|
import App from "./App.vue";
|
|
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
|
|
import preventReClick from "./utils/preventReClick";
|
|
import Print from "./utils/print2";
|
|
import Xlsx from "./utils/xlsx";
|
|
import jsBarCode from "./utils/jsBarCode";
|
|
import DataVVue3 from "@kjgl77/datav-vue3";
|
|
import htmlToPdf from "./utils/htmlToPdf";
|
|
|
|
import * as Cesium from "cesium";
|
|
|
|
const app = createApp(App);
|
|
|
|
app.use(store);
|
|
app.use(router);
|
|
app.use(ElementPlus);
|
|
app.use(Cesium);
|
|
app.use(i18n);
|
|
app.use(scui);
|
|
app.use(ehsui);
|
|
app.use(preventReClick);
|
|
app.use(Print);
|
|
app.use(Xlsx);
|
|
app.use(htmlToPdf);
|
|
app.use(jsBarCode);
|
|
app.use(DataVVue3);
|
|
|
|
//挂载app
|
|
app.mount("#app");
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
app.component(key, component);
|
|
}
|
|
|
|
const debounce = (fn, delay) => {
|
|
let timer = null;
|
|
|
|
return function () {
|
|
let context = this;
|
|
|
|
let args = arguments;
|
|
|
|
clearTimeout(timer);
|
|
|
|
timer = setTimeout(function () {
|
|
fn.apply(context, args);
|
|
}, delay);
|
|
};
|
|
};
|
|
|
|
const _ResizeObserver = window.ResizeObserver;
|
|
|
|
window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
|
|
constructor(callback) {
|
|
callback = debounce(callback, 16);
|
|
super(callback);
|
|
}
|
|
};
|