import Vue from "vue";
import { CoreConfig } from "@/model/CoreConfig";
import ApprovalMain from "@/components/approval-process/ApprovalMain.vue";
import filterService from "./filtres/filter.service";
export * from "./components/index";
export * from "./constants/index";
export * from "./model/index";
export * from "./services/index";
export * from "./stores/index";
export * from "./types/ec";

const components: any = {
  ApprovalMain: ApprovalMain
};
const install: any = function(vue: typeof Vue, options: CoreConfig) {
  if (install.installed) return;
  install.installed = true;
  Object.keys(components).forEach(key => {
    vue.component(key, components[key]);
  });
  vue.prototype.$apData = {
    sysId: options.sysId || "",
    baseApi: options.baseApi || "",
    fileApi: options.fileApi || "",
    processServiceUrl: (options.processServiceUrl || "") + "/ebtrust-project",
    apiPrefix: options.apiPrefix || ""
  };
  /*注册全局过滤器*/
  filterService.init();
};

const VueApproval = {
  install
};
export default VueApproval;
