import { objAssign, randomCode, tableAction } from "@/plugins/utils";
// mixins
import commonMixins from "../mixins/common";
// components
import ViewFooter from "@/components/ViewFooter.vue";
import MoreText from "@/components/MoreText.vue";
import SchoolSelect from "@/components/base/SchoolSelect.vue";
import SemesterSelect from "@/components/base/SemesterSelect.vue";
import EcsExamSelect from "@/components/base/EcsExamSelect.vue";
import ExamTypeSelect from "@/components/base/ExamTypeSelect.vue";
import CollegeSelect from "@/components/base/CollegeSelect.vue";
import CourseSelect from "@/components/base/CourseSelect.vue";
import KcCollegeSelect from "@/components/base/KcCollegeSelect.vue";
import ClazzSelect from "@/components/base/ClazzSelect.vue";
import TeacherSelect from "@/components/base/TeacherSelect.vue";

const components = {
  ViewFooter,
  MoreText,
  SchoolSelect,
  SemesterSelect,
  EcsExamSelect,
  ExamTypeSelect,
  CollegeSelect,
  CourseSelect,
  KcCollegeSelect,
  ClazzSelect,
  TeacherSelect,
};

export default {
  install: function (Vue) {
    // 实例方法
    Vue.prototype.$tableAction = tableAction;
    Vue.prototype.$objAssign = objAssign;
    Vue.prototype.$randomCode = randomCode;

    // 注册全局组件
    Object.keys(components).forEach((key) => {
      Vue.component(key, components[key]);
    });

    //全局 mixins
    Vue.mixin(commonMixins);
  },
};
