<template>
  <div class="list">
    <div
      :class="[
        `containerBox`,
        {
          online: item.状态 === `作业中`,
        },
      ]"
      v-for="(item, index) in list"
      :key="index"
    >
      <div class="textBox">
        <p class="title">
          <span>{{ item.名称 }}</span>
          <img
            :src="状态[item.状态]"
            :class="{ 'animated infinite flash s5': item.状态 === `故障` }"
            alt=""
          />
        </p>
        <p>设备IP：{{ item.ip || '' }}</p>
        <p>管理员：{{ item.管理人员 }}</p>
        <p>联系方式：{{ item.联系电话 || '' }}</p>
      </div>
      <div class="imgBox">
        <img v-if="item.图片" :src="item.图片[0]" alt="风景图" />
      </div>
    </div>
  </div>
</template>

<script>
import 故障 from '@/assets/img2/种植分析详情/故障状态.png'
import 关机 from '@/assets/img2/种植分析详情/关机.png'
import 运行中 from '@/assets/img2/种植分析详情/关机_1.png'

export default {
  name: `LayoutExample`,
  data() {
    return {
      状态: {
        离线: 关机,
        在线: 运行中,
        作业中: 运行中,
        故障,
      },
    }
  },
  props: {
    list: {
      type: Array,
      default: () => [],
    },
  },
  async created() {},
}
</script>

<style scoped lang="less">
.list {
  padding: 16px;
  width: 357px;
  height: 750px;
  overflow: auto;
  .containerBox {
    &.online {
      outline: 4px solid rgba(22, 248, 116, 0.5);
      // border: 4px solid rgba(22, 248, 116, 0.5);
      border-radius: 6px;
    }
    .s5 {
      animation-duration: 4s;
    }
    cursor: pointer;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    background: rgba(168, 168, 168, 0.15);
    backdrop-filter: blur(8px);
    padding: 10px;
    .textBox {
      order: 2;
      width: 100%;
      .title {
        display: inline-block;
        font-size: 20px;
        min-width: 100%;
        line-height: 1.2em;
        color: #fff;
        padding-right: 20px;
        position: relative;
        img {
          position: absolute;
          right: 0;
          top: 0;
        }
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(151, 151, 151, 0.3);
      }
      p {
        padding: 0;
        margin: 0;
        color: #bec1cc;
        line-height: 1.5em;
        font-size: 14px;
        margin-bottom: 5px;
      }
    }
    .imgBox {
      order: 1;
      padding-right: 10px;
      img {
        width: 105px;
        height: 105px;
        border-radius: 10px;
      }
    }
  }
}
</style>
