<template>
  <a-modal
    :title="modalTitle"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <detail-list title="" :col="1">
      <detail-list-item term="类型">{{ typeDict[model.detailType] }}</detail-list-item>
      <detail-list-item term="内容">{{ model.content }}</detail-list-item>
      <detail-list-item term="时间">{{ model.createdTime }}</detail-list-item>
    </detail-list>

    <template slot="footer">
      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
    </template>
  </a-modal>
</template>

<script>
import DetailList from '@/components/tools/DetailList'
const DetailListItem = DetailList.Item

export default {
  name: 'WorkplaceBacklogDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      typeDict: {},
      model: {
        'detailType': null,
        'createdTime': null,
        'content': null
      }
    }
  },
  created () {
    this.typeDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE)
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '详情'
      if (this.BaseTool.Object.isBlank(record)) {
        this.model = {}
      } else {
        this.model = record
      }
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    }

  }
}
</script>
