<template>
  <a-modal
    :title="modalTitle"
    :width="850"
    :visible="visible"
    :confirmLoading="confirmLoading"
    class="ant-modal2"
    @cancel="handleCancel"
  >
    <detail-list title="" :col="2">
      <detail-list-item term="设备id">{{ model.sbId }}</detail-list-item>
      <detail-list-item term="停用时间">{{ model.stopTime }}</detail-list-item>
      <detail-list-item term="停用原因">{{ model.stopReason }}</detail-list-item>
      <detail-list-item term="停用人">{{ model.stopUserId }}</detail-list-item>
      <detail-list-item term="启用时间">{{ model.startTime }}</detail-list-item>
      <detail-list-item term="启用原因">{{ model.startReason }}</detail-list-item>
      <detail-list-item term="启用人">{{ model.startUserId }}</detail-list-item>
      <detail-list-item term="停机时长分钟">{{ BaseTool.Amount.formatter(model.stopDuration) }}</detail-list-item>
      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
      <detail-list-item term="创建人">{{ model.createdUserId }}</detail-list-item>
      <detail-list-item term="更新人">{{ model.updateUserId }}</detail-list-item>
      <detail-list-item term="更新日期">{{ model.updateTime }}</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: 'SbStopLogDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      statusMap: {},
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'sbId': null,
        'stopTime': null,
        'stopReason': null,
        'stopUserId': null,
        'startTime': null,
        'startReason': null,
        'startUserId': null,
        'stopDuration': null,
        'remark': null,
        'createdUserId': null,
        'updateUserId': null,
        'updateTime': null
      }
    }
  },
  created () {
    // 下拉框map
    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    }

  }
}
</script>
