<template>
  <the-common :filter="filter" :param="query" :title-obj="titleObj" type="1"></the-common>
</template>

<script>
import { getDeptDict } from '@/api/report'
import TheCommon from './common/theCommon'
export default {
  name: 'the-default',
  components: { TheCommon },
  data () {
    return {
      titleObj: {
        msg: '集团薪酬职位分位值',
        key: 'value'
      },
      filter: {
        list: [
          {
            type: 'select',
            key: 'value',
            value: null,
            label: '集团部门',
            clearable: true,
            items: [],
            change: this.handleChange
          }
        ]
      },
      query: {
        value: null
      }
    }
  },
  created () {
    this.getDeptDict()
  },
  methods: {
    handleChange (val) {
      this.query.value = val
    },
    // 获取部门列表
    async getDeptDict () {
      try {
        const { data } = await getDeptDict()
        this.filter.list.find(_e => _e.key === 'value').items = data
      } catch (error) {
        this.$snackbar.error(error)
      }
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
