<template>
  <component :is="parentObj.activeName"/>
</template>

<script>
import List from './components/List'
import Add from './components/add'
import RecordList from './components/RecordList'
export default {
  components: {
    List,
    RecordList,
    Add
  },
  data() {
    return {
      parentObj: {
        activeName: 'List',
        TYPE: '',
        ENTERPRISE_ID: ''
      }
    }
  },
  methods: {
    setActiveName(activeName) {
      this.parentObj.activeName = activeName
    },
    setType(TYPE) {
      this.parentObj.TYPE = TYPE
    },
    setEnterpriseId(ENTERPRISE_ID) {
      this.parentObj.ENTERPRISE_ID = ENTERPRISE_ID
    }
  },
  provide() {
    return {
      parentObj: this.parentObj,
      setActiveName: this.setActiveName,
      setType: this.setType,
      setEnterpriseId: this.setEnterpriseId
    }
  }
}
</script>

<style scoped>

</style>
