<!-- 安全生产责任书详情 -->
<template>
  <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" append-to-body class="safe-book-dialog">
    <h4>安全生产责任书</h4>
    <el-image
      :src="require('../../../assets/notice.jpg')"
      :preview-src-list="[require('../../../assets/notice.jpg'), nameImgUrl]"
    />
    <h4>签名图片</h4>
    <el-image
      :src="nameImgUrl"
      :preview-src-list="[require('../../../assets/notice.jpg'), nameImgUrl]"
    />
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="cancel">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'AddUserDialog',
  data() {
    return {
      dialogFormVisible: false, // 对话框是否显示
      dialogStatus: '', // 对话框类型：create,update
      textMap: {
        update: '编辑',
        create: '新增',
        detail: '详情'
      }, // 表头显示标题
      bookUrl: '../../../assets/notice.jpg', // 安全生产责任书图片
      nameImgUrl: '' // 签名图片
    }
  },
  created() {
    // this.fetchPrincipalList()
    // this.fetchDeptList()
  },
  methods: {
    // 初始化对话框
    initDialog: function(dialogStatus, dialogFormVisible, row = null) {
      this.dialogStatus = dialogStatus // 类型 新增create 编辑update 详情detail
      this.dialogFormVisible = dialogFormVisible // 对话框显隐
      this.nameImgUrl = row.signImage
    },
    // 点击取消
    cancel: function() {
      this.dialogFormVisible = false
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .el-select{
    width: 100%;
  }
  .el-date-editor{
    width: 100%;
  }
</style>
<style lang="scss">
.safe-book-dialog {
  .el-dialog__body {
    max-height: 380px;
    overflow: auto;
  }
}
</style>
