import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
// UI
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);
import { message } from "@/utils/resetMessage";
Vue.prototype.$message = message;
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
Vue.component("ElImageViewer", ElImageViewer);
// 公共样式
import "@/assets/css/normalize.css";
import "@/assets/css/reset.css";
import "@/assets/css/common.less";
import "@/assets/css/tailwindcss.css";

// 事件总线
Vue.prototype.$bus = new Vue();

// moment 时间处理
import moment from "moment";
Vue.prototype.$moment = moment;
// 全局过滤器
import * as filters from "@/filters";
Object.keys(filters).forEach((key) => {
  Vue.filter(key, filters[key]);
});
// 引入注册全局指令
import * as directives from "@/directive";
Object.keys(directives).forEach((name) =>
  Vue.directive(name, directives[name])
);
// 引入echarts
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
// swiper
import "swiper/css/swiper.min.css";
// 注册全局组件
import customComponents from "@/components";
Vue.use(customComponents);
// 重置表单
import { resetForm, clearSelection } from "@/utils";
Vue.prototype.$resetForm = resetForm;
Vue.prototype.$clearSelection = clearSelection;

// 深拷贝
import { cloneDeep } from "lodash-es";
Vue.prototype.$cloneDeep = cloneDeep;

import DatePicker from "@/pages/engineSearch/components/date-picker";
Vue.use(DatePicker);

Vue.config.productionTip = false;
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
