<template>
  <section class="matters-config">
    <component :is="currentPage" v-bind="$props"/>
  </section>
</template>

<script>
import addConfig from './components/addConfig'
import configList from "./components/configList";
import guidance from "./components/guidance";

export default {
  name: "AppMattersConfig",
  label: '事项配置',
  components: {addConfig, guidance},
  props: {
    instance: Function,
    dict: Object,
    permissions: Function
  },
  computed: {
    currentPage() {
      const {hash} = this.$route
      return hash == "#add" ? addConfig : hash == "#guidance" ? guidance : configList
    },
  },
  created() {
    this.dict.load("hbDepartment", 'sex', 'nation', 'marital', 'native_place', 'education', 'candidateApproverType', 'scopeCandidates', 'nodeType')
  }
}
</script>

<style lang="scss" scoped>
.matters-config {
  height: 100%;
  background: #f3f6f9;
  overflow: auto;

  .iconfont {
    user-select: none;
    cursor: pointer;
  }
}
</style>
