import './styles/common-old.scss'
import './styles/common.scss'
import './styles/iconfont/iconfont.css'

import layout from './layout' // 布局组件
import searchTree from './search-tree' // 树搜索组件
import selectProject from './select-project' // 项目选择组件
import selectTree from './select-tree' // 表单树选择器
import SearchBar from './search-bar' // 搜索工具栏
import simpleSearchBar from './simple-search-bar' // 简单搜索栏组件
import inputMore from './input-more' // 简单搜索栏组件
import paging from './paging'
import baseDialog from './base-dialog'
import newSearchBar from './newSearchBar' // 高级筛选
import table from './table' // 表格组件
import dragSet from './drag-set'
import buttonEllipsis from './button-ellipsis'
import topTabs from './top-tabs'
export { default as Progress } from './progress';
const { buttonList, buttonItem } = buttonEllipsis

// 存储组件列表
const components = [layout, searchTree, selectProject, selectTree, buttonItem, buttonList, SearchBar, simpleSearchBar, inputMore, paging, newSearchBar, table, dragSet, topTabs, baseDialog]

// 定义 install 方法，接收 Vue 作为参数。如果使用 use 注册插件，则所有的组件都将被注册
const install = function (Vue) {
  // 判断是否可以安装
  if (install.installed) return
  // 遍历注册全局组件
  components.map((component) => Vue.component(component.name, component))
}

// 判断是否是直接引入文件
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export default {
  // 导出的对象必须具有 install，才能被 Vue.use() 方法安装
  install,
  // 以下是具体的组件列表
  layout,
  searchTree,
  selectProject,
  selectTree,
  buttonItem,
  buttonList,
  SearchBar,
  simpleSearchBar,
  inputMore,
  paging,
  newSearchBar,
  table,
  topTabs,
  dragSet,
  baseDialog
}
