/*上链信息*/
<template>
  <el-dialog
    title="上链信息"
    :visible.sync="chainInfoConfig.isShow"
    width="500px"
  >
    <div class="chain-info">
      <div class="item">
        <p>文件名称：</p>
        <span>{{ chainInfoConfig.infoData.fileName }}</span>
      </div>
      <div class="item">
        <p>文件哈希：</p>
        <span>{{ chainInfoConfig.infoData.hashCode }}</span>
      </div>
      <div class="item">
        <p>区块地址：</p>
        <span>{{ chainInfoConfig.infoData.blockAddr }}</span>
      </div>
      <div class="item">
        <p>区块高度：</p>
        <span>{{ chainInfoConfig.infoData.blockHeight }}</span>
      </div>
      <div class="item">
        <p>上链时间：</p>
        <span>{{ formatTime(chainInfoConfig.infoData.blockTimeStamp) }}</span>
      </div>
      <div class="item">
        <p>时间戳：</p>
        <span>{{ chainInfoConfig.infoData.blockTimeStamp }}</span>
      </div>
      <div class="item">
        <p>资产ID：</p>
        <span>{{ chainInfoConfig.infoData.blockAssertId }}</span>
      </div>
      <div class="item">
        <p>事务ID：</p>
        <span>{{ chainInfoConfig.infoData.blockTxid }}</span>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" type="primary" @click="close">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { parseTime } from '@/utils/index'
export default {
  name: 'ChainInfo',
  props: {
    chainInfoConfig: {
      isShow: {
        type: Boolean,
        default: () => false,
      },
      infoData: {
        type: Object,
        default: () => {},
      },
    },
  },
  data() {
    return {}
  },
  created() {},
  methods: {
    // 点击关闭
    close() {
      this.$emit('putChainInfo', false)
    },
    formatTime(time) {
      return parseTime(time)
    },
  },
}
</script>

<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/mixin.scss';
.chain-info {
  .item {
    @include flex(flex-start, flex-start);
    padding: 5px 0;
    font-size: 14px;
    color: $color_6;
    p {
      font-weight: 700;
      display: inline-block;
      @include w_h(75px);
    }
    span {
      display: inline-block;
      @include w_h(calc(100% - 70px));
      color: $color_3;
    }
  }
}
</style>
