<template>
  <div class="c-info">
    <div class="l-flex--row c-info__block">
      <div class="l-flex--row l-flex__fill c-info__item">
        <div class="l-flex__none c-info__title">厂家名称</div>
        <div class="l-flex__fill c-info__value">{{ manufacturer }}</div>
      </div>
      <div class="l-flex--row l-flex__fill c-info__item">
        <div class="l-flex__none c-info__title">拓扑结构文件</div>
        <div class="l-flex__fill c-info__value">{{ topology }}</div>
      </div>
    </div>
    <div class="l-flex--row c-info__block">
      <div class="l-flex--row l-flex__fill c-info__item">
        <div class="l-flex__none c-info__title">设备型号</div>
        <auto-text
          class="l-flex__fill c-info__value"
          :text="screen"
        />
      </div>
      <div class="l-flex--row l-flex__fill c-info__item">
        <div class="l-flex__none c-info__title">设备类型</div>
        <div class="l-flex__fill c-info__value">{{ type }}</div>
      </div>
    </div>
    <div class="l-flex--row c-info__block">
      <div class="l-flex--row l-flex__fill c-info__item">
        <div class="l-flex__none c-info__title">支持温度监测</div>
        <div class="l-flex__fill c-info__value">{{ temperature }}</div>
      </div>
      <div class="l-flex--row l-flex__fill c-info__item">
        <div class="l-flex__none c-info__title">支持电压监测</div>
        <div class="l-flex__fill c-info__value">{{ voltage }}</div>
      </div>
    </div>
    <div class="l-flex--row c-info__block">
      <div class="l-flex--row l-flex__fill c-info__item">
        <div class="l-flex__none c-info__title">设备IP</div>
        <div class="l-flex__fill c-info__value">{{ ip }}</div>
      </div>
      <div class="l-flex__fill c-info__item" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'ReceivingCardInfo',
  props: {
    info: {
      type: Object,
      required: true
    }
  },
  computed: {
    manufacturer () {
      return this.info.manufacturerName
    },
    topology () {
      return this.info.topology ? '已上传' : '未上传'
    },
    screen () {
      return this.info.screen
    },
    type () {
      return this.info.async ? '异步盒' : '非异步盒'
    },
    temperature () {
      return this.info.temperature ? '是' : '否'
    },
    voltage () {
      return this.info.voltage ? '是' : '否'
    },
    ip () {
      return this.info.ip
    }
  }
}
</script>
