
import BaseFilter from './BaseFilter'
import BaseTable from './BaseTable'
import BaseModel from './BaseModel'
import TagInput from './TagInput'
import BaseSelect from './BaseSelect'
import BaseControl from './BaseControl'
import BaseTablePage from './BaseTablePage'
import BaseChildrenPage from './BaseChildrenPage'
import BaseRadioGroup from './BaseRadioGroup'
import BaseUpload from './BaseUpload'
import BaseTree from './BaseTree'
import Editor from './Editor'
import Bpmn from './Bpmn'
import util from './utils'

const components = [ 
    {
        name: 'BaseRadioGroup',
        component: BaseRadioGroup
    },
    {
        name: 'BaseUpload',
        component: BaseUpload

    },
    {
        name: 'BaseTree',
        component: BaseTree
    },
    {
        name: 'BaseSelect',
        component: BaseSelect
    },
    {
        name: 'BaseFilter',
        component: BaseFilter
    },
    {
        name: 'BaseTable', 
        component: BaseTable
    },
    {
        name: 'BaseModel',
        component: BaseModel
    },
    {
        name: 'BaseControl',
        component: BaseControl
    },
    {
        name: 'BaseTablePage',
        component: BaseTablePage
    },
    {
        name: 'BaseChildrenPage',
        component: BaseChildrenPage
    },
    {
        name: 'TagInput',
        component: TagInput
    },
    {
        name: 'Editor',
        component: Editor
    },
    {
        name: 'Bpmn',
        component: Bpmn
    }
 ]
const install = function (Vue,options) {
    components.forEach(item => {
        Vue.component(item.name, options&&options[item.name] || item.component)
    })
    Vue.config.globalProperties.$util = util;
    if(options&&options.resPath) Vue.config.globalProperties.$resPath = options.resPath;
    if(options&&options.pageKeys) Vue.config.globalProperties.$pageKeys = options.pageKeys;
}

export default {
    install,
    BaseFilter,
    BaseTable,
    BaseModel,
    BaseSelect,
    BaseControl,
    BaseTablePage,
    BaseChildrenPage,
    BaseRadioGroup,
    BaseUpload,
    BaseTree,
    TagInput,
    Editor,
    Bpmn
}


