<template>
  <div>
    <Modal v-model="showDetailModal" v-drag title="详情" class="modal-footer-none">
      <div class="maxHeight">
        <table class="tableClass">
          <tbody>
            <tr>
              <th>名称</th>
              <td>{{ obj.name }}</td>
            </tr>
            <tr>
              <th>关键字</th>
              <td>{{ obj.key }}</td>
            </tr>
            <tr>
              <th>编码值</th>
              <td>{{ obj.code }}</td>
            </tr>
            <tr>
              <th>分类</th>
              <td>{{ obj.type }}</td>
            </tr>
            <tr>
              <th>排序</th>
              <td>{{ obj.sort }}</td>
            </tr>
            <tr>
              <th>状态</th>
              <td>{{ obj.status===0?'禁用':'正常' }}</td>
            </tr>
            <tr>
              <th>备注</th>
              <td>{{ obj.remark }}</td>
            </tr>
          </tbody>
        </table>
      </div>
    </Modal>
  </div>
</template>
<script>
/**
 * 详情
 */
const dateFormat = require('dateformat')
export default {
  data() {
    return {
      obj: {},
      showDetailModal: false,
      ctime: ''
    }
  },
  methods: {
    _open(obj) {
      this.showDetailModal = true
      this.obj = obj
      if (obj.ctime !== undefined) {
        this.ctime = dateFormat(obj.ctime, 'yyyy-mm-dd HH:MM:ss')
      } else {
        this.ctime = ''
      }
    }
  }
}
</script>
