<template>
  <div>
    <el-dialog
      v-dialogDrag
      :visible.sync="showModal"
      width="700px"
      title="我的消息"
    >
      <div class="maxHeight">
        <table class="tableClass">
          <tbody>
            <tr>
              <th style="width: 80px;">
                类型
              </th>
              <td v-if="obj.type == 0">
                通知
              </td>
              <td v-else-if="obj.type == 1">
                消息
              </td>
              <td v-else>
                待办
              </td>
            </tr>
            <tr>
              <th style="width: 80px;">
                标题
              </th>
              <td>{{ obj.title }}</td>
            </tr>
            <tr>
              <th style="width: 80px;">
                内容
              </th>
              <td>{{ obj.content }}</td>
            </tr>
            <tr>
              <th style="width: 80px;">
                开始时间
              </th>
              <td>{{ beginTime }}</td>
            </tr>
            <tr>
              <th style="width: 80px;">
                结束时间
              </th>
              <td>{{ endTime }}</td>
            </tr>
          </tbody>
        </table>
      </div>
    </el-dialog>
  </div>
</template>
<script>
/**
 * 我的消息表详情
 */
export default {
  data() {
    return {
      obj: {},
      beginTime: '/',
      endTime: '/',
      showModal: false
    }
  },
  methods: {
    _open(obj) {
      this.showModal = true
      this.obj = obj
      if (obj.beginTime) {
        this.beginTime = this.$dateformat(obj.beginTime, 'yyyy-mm-dd HH:MM')
      } else {
        this.beginTime = '/'
      }
      if (obj.endTime) {
        this.endTime = this.$dateformat(obj.endTime, 'yyyy-mm-dd HH:MM')
      } else {
        this.endTime = '/'
      }
    }
  }
}
</script>
