<template>
  <div class="info-container">
    <div class="title">{{ tLang('device', '设备信息') }}</div>
    <div class="content">
      <div class="info-item" v-for="item of infoList">
        <span class="info-name">{{ item.name }}:</span>
        <span>{{ item.value }}</span>
      </div>
    </div>
  </div>
</template>

<script setup>
import { computed } from 'vue';

const {proxy} = getCurrentInstance();
let prop = defineProps({
    data: {
        type: Object,
        default: () => {
            return {}
        }
    }
})

let infoList = computed(() => {
  return [
    {name: proxy.tLang('device','设备名称'), value: prop.data.name},
    {name: proxy.tLang('message','机架号'), value: prop.data.devCode},
    {name: proxy.tLang('message','最后保养'), value: prop.data.checkTime},
]
})
</script>

<style lang="scss" scoped>
.title {
    width: 100%;
    height: 20px;
    line-height: 20px;
    font-size: 14px;
    color: #cfcfcf;

}

.content {
    width: 100%;
    height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.info-container {
    width: 100%;
    height: 100%;
    .content {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      .info-item {
        width: 100%;
        height: 26px;
        margin: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .info-name {
          font-size: 12px;
          color: #999898;
        }
        span {
          margin: 0 10px;
        }
      }
    }
}
</style>
