import "@/assets/icons/iconfont/iconfont.js";
import MyDeptTree from "@/components/my-dept-tree";
import MyProcessDetail from "@/components/my-process-detail";
import MyProcessRunning from "@/components/my-process-running";
import MyRadioGroup from "@/components/my-radio-group";
import MyRegionTree from "@/components/my-region-tree";
import MySelect from "@/components/my-select";
import ElementPlus from "element-plus";
import "element-plus/theme-chalk/display.css";
import "element-plus/theme-chalk/index.css";
import { createApp } from "vue";
import { createPinia } from "pinia";
import VXETable from "vxe-table";
import "vxe-table/lib/style.css";
import "xe-utils";
import App from "./App.vue";
import { initI18n } from "./i18n";
import router from "./router";
import * as ElementPlusIcons from "@element-plus/icons-vue";

import VForm3 from "@/../lib/vform/designer.umd.js";
import "../lib/vform/designer.style.css";

import axios from "axios";
import "virtual:svg-icons-register";

VXETable.setup({
  zIndex: 3000,
  select: {
    transfer: true
  }
});

const app = createApp(App);
Object.keys(ElementPlusIcons).forEach((iconName) => {
  app.component(iconName, ElementPlusIcons[iconName as keyof typeof ElementPlusIcons]);
});

// flowable 流程设计器
import "@/components/my-flowable/package/theme/index.scss";
import MyFlowable from "@/components/my-flowable/package/index.js";
app.use(MyFlowable);

app
  .use(createPinia())
  .use(router)
  .use(MyRadioGroup)
  .use(MySelect)
  .use(MyDeptTree)
  .use(MyRegionTree)
  .use(MyProcessRunning)
  .use(MyProcessDetail)
  .use(ElementPlus, { size: "default" })
  .use(VForm3)
  .use(VXETable)
  .use(initI18n)
  .mount("#app");

window.axios = axios;
