<template>
  <a-drawer
    title="词典分类详情"
    width="640"
    placement="right"
    :visible="visible"
    @close="onClose">
    <a-descriptions :column="{ sm: 2, xs: 1 }">
      <a-descriptions-item label="词典名称">{{ model.dictionaryName }}</a-descriptions-item>
      <a-descriptions-item label="词典标识">{{ model.dictionaryCode }}</a-descriptions-item>
      <a-descriptions-item label="创建时间">{{ model.createTime | moment('YYYY-MM-DD HH:mm:ss') }}</a-descriptions-item>
      <a-descriptions-item label="最近修改">{{ model.updateTime | moment('YYYY-MM-DD HH:mm:ss') }}</a-descriptions-item>
    </a-descriptions>
  </a-drawer>
</template>

<script>
import { dictionaryGet } from '@/api/sys/dictionary'

export default {
  data () {
    return {
      model: {},
      visible: false
    }
  },
  methods: {
    show (id) {
      this.visible = true
      dictionaryGet({ id: id }).then(data => {
        this.model = data.data
      })
    },
    onClose () {
      this.model = {}
      this.visible = false
    }
  }
}
</script>
