<template>
  <a-card :bordered="false">
    <dictionary-details-view
      v-if="selectId"
      :id="selectId"
      :visible.sync="detailVisible"
    />
    <x-form-table
      serviceName="af-system"
      :queryParamsName="queryParamsName"
      title="字典"
      @action="toDetail">
    </x-form-table>
  </a-card>
</template>

<script>
  import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
  import DictionaryDetailsView from '@vue2-client/base-client/components/system/DictionaryDetailsView'

  export default {
    name: 'Dictionary',
    components: {
      XFormTable,
      DictionaryDetailsView
    },
    data () {
      return {
        // 选中的编号
        selectId: undefined,
        // 查询配置文件名
        queryParamsName: 'crud_dictionary_manage',
        // 是否显示详情抽屉
        detailVisible: false
      }
    },
    methods: {
      toDetail (record, id) {
        this.selectId = id + ''
        this.detailVisible = true
      }
    }
  }
</script>
