<template>
  <a-card :bordered='false' v-show='visible' class='card' :title='modalTitle'>
    <a-row :gutter='48' slot='extra'>
      <a-col :md='48' :sm='48'>
              <span class='table-page-search-submitButtons' style='float: right'>
                <a-button style='margin-left: 8px' type='default' @click='handleCancel()'>返回</a-button>
              </span>
      </a-col>
    </a-row>
    <a-descriptions :column="3" bordered>
      <a-descriptions-item label='维修人'>{{ model.createdUserName }}</a-descriptions-item>
      <a-descriptions-item label='维修时间'>{{ model.createdTime }}</a-descriptions-item>
      <a-descriptions-item label='结束时间'>{{ model.updateTime }}</a-descriptions-item>
      <a-descriptions-item label='维修时长'>{{ model.repairHours }}</a-descriptions-item>
      <a-descriptions-item label='主管建议' :span="2">{{ model.opinion }}</a-descriptions-item>
      <a-descriptions-item label="维修描述" :span="3">{{ model.dataRemark }}</a-descriptions-item>
      <a-descriptions-item label="维修图片" :span="3">
        <div v-if="model.imageList != null && model.imageList.length > 0">
          <viewer :images="model.imageList" @inited="inited" ref="viewer" :index="1" >
            <img
              v-for="item in model.imageList"
              :src="item.url"
              :key="item.id"
              class="image"
              width="200px"
              style="margin:10px;">
          </viewer></div>
        <div v-if="model.imageList == null || model.imageList.length === 0"> 暂无</div>
      </a-descriptions-item>
    </a-descriptions>
  </a-card>
</template>

<script>
import DetailList from '@/components/tools/DetailList'

const DetailListItem = DetailList.Item

export default {
  name: 'DetailRepairRecord',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'dataRemark': null,
        'imageList': null,
        'createdUserName': null,
        'createdTime': null,
        'updateTime': null,
        'opinion': null,
        'repairHours': null
      }
    }
  },
  created () {
    // 下拉框map
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '维修详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
      this.$emit('ok')
    }
  }
}
</script>
