<template>
  <div>
    <div class="my-title">查看</div>
    <div style="margin-left: 20px; margin-right: 20px">
      <e-desc title="基本信息" column="3">
        <e-desc-item label="印章" span="3">{{ dataForm.useSeal }}</e-desc-item>
        <e-desc-item label="使用人" span="3">{{ dataForm.useName }}</e-desc-item>
        <e-desc-item label="使用时间" span="3">{{ dataForm.createTime }}</e-desc-item>
       
        <e-desc-item label="用章说明" span="3">{{ dataForm.purpose }}</e-desc-item>
        
      </e-desc>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="onChose">返回</el-button>
    </span>

    <!-- 文件预览 -->
    <preview-component v-if="previewVisible" ref="preview"/>
  </div>
</template>

<script>
import EDesc from '../common/e-desc'
import EDescItem from '../common/e-desc-item'
import PreviewComponent from '../common/preview-component'
export default {
  name: 'seal-manage-detail',
  components: {
    EDesc,
    EDescItem,
    PreviewComponent
  },
  data () {
    return {
      visible: false,
      id: 0,
      dataForm: {},
      previewVisible: false
    }
  },
  methods: {
    onChose () {
      this.$emit('onChose')
    },
    async init (item) {
      this.visible = true
      this.dataForm = item
    },
     // 预览
    previewFile (fileName, url) {
      this.previewVisible = true
      this.$nextTick(() => {
        this.$refs.preview.init(fileName, url)
      })
    }
  }
}
</script>

<style scoped>
.my-line {
  border-bottom: 1px solid #c0c4cc;
  margin-bottom: 10px;
}
.title {
  padding: 10px 0;
}
</style>
