import { objAssign, randomCode, tableAction } from "@/plugins/utils";
// mixins
import commonMixins from "../mixins/common";
import privilegeMixins from "../mixins/privilege";
// components
import ViewFooter from "@/components/ViewFooter.vue";
import MoreText from "@/components/MoreText.vue";
import MoreBtn from "@/components/MoreBtn.vue";
import RoomSelect from "../components/base/RoomSelect.vue";
import PlaceSelect from "../components/base/PlaceSelect.vue";
import PrintPlanSelect from "../components/base/PrintPlanSelect.vue";
import CardRuleSelect from "../components/base/CardRuleSelect.vue";
import CourseSelect from "../components/base/CourseSelect.vue";
import CourseCommonSelect from "../components/base/CourseCommonSelect.vue";
import PaperNumberSelect from "../components/base/PaperNumberSelect.vue";
import QuestionTeacherSelect from "../components/base/QuestionTeacherSelect.vue";
import QuestionTeacherUserSelect from "../components/base/QuestionTeacherUserSelect.vue";
import SchoolSelect from "../components/base/SchoolSelect.vue";
import PrintRoomSelect from "../components/base/PrintRoomSelect.vue";
import TeachingRoomSelect from "../components/base/TeachingRoomSelect.vue";
import FacultySelect from "../components/base/FacultySelect.vue";
import SemesterSelect from "../components/base/SemesterSelect.vue";
import CollegeSelect from "../components/base/CollegeSelect.vue";
import ClazzSelect from "../components/base/ClazzSelect.vue";
import MajorSelect from "../components/base/MajorSelect.vue";
import ClassSelect from "../components/base/ClassSelect.vue";
import MajorClassSelect from "../components/base/MajorClassSelect.vue";
import ExamSelect from "../components/base/ExamSelect.vue";
import OrgSelect from "../components/base/OrgSelect.vue";
import DataTaskDialog from "../components/base/DataTaskDialog.vue";
import StatusSelect from "../components/base/StatusSelect.vue";
import ProfessionalSelect from "../components/base/ProfessionalSelect.vue";
import TrainingPlanSelect from "../components/base/TrainingPlanSelect.vue";
import TrainingPlanCourseSelect from "../components/base/TrainingPlanCourseSelect.vue";
// base
import OrgCourseSelect from "../components/base/OrgCourseSelect.vue";
// other
import SecpSelect from "../components/SecpSelect.vue";

const components = {
  ViewFooter,
  MoreText,
  MoreBtn,
  RoomSelect,
  PlaceSelect,
  PrintPlanSelect,
  CardRuleSelect,
  CourseSelect,
  CourseCommonSelect,
  PaperNumberSelect,
  QuestionTeacherSelect,
  QuestionTeacherUserSelect,
  SchoolSelect,
  PrintRoomSelect,
  TeachingRoomSelect,
  FacultySelect,
  SemesterSelect,
  CollegeSelect,
  ClazzSelect,
  MajorSelect,
  ClassSelect,
  MajorClassSelect,
  ExamSelect,
  OrgSelect,
  DataTaskDialog,
  StatusSelect,
  ProfessionalSelect,
  TrainingPlanSelect,
  TrainingPlanCourseSelect,
  // base
  OrgCourseSelect,
  // other
  SecpSelect,
};

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);
    Vue.mixin(privilegeMixins);
  },
};
