<template>
  <div
    :class="[
      'card',
      info.systemList.length ? 'cursor-pointer' : 'cursor-not-allowed',
    ]"
    @click="handleClick"
  >
    <div>{{ info.name }}</div>
    <el-tag
      size="small"
      type="danger"
      color="#fff"
      v-if="!info.systemList.length"
    >
      <i class="el-icon-link"></i>
      等待对接</el-tag
    >
    <div class="cur flex gap-2" v-else>
      <el-tag v-for="(v, i) in info.systemList" :key="i" size="small">{{
        v
      }}</el-tag>
    </div>
    <div class="card-date" v-if="info.systemList.length">
      对接时间：{{ info.date }}
    </div>
    <div class="mask" v-else></div>
  </div>
</template>

<script>
export default {
  props: {
    info: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  data() {
    return {};
  },
  methods: {
    handleClick() {
      if (this.info.systemList.length) {
        this.$emit("click", this.info);
      }
    },
  },
};
</script>

<style lang="less" scoped>
.card {
  width: 100%;
  height: 100%;
  color: #fff;
  background: url("@/assets/img/changningxian.png") no-repeat center / 100% 100%;
  border-radius: 4px;
  color: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  .card-date {
    width: 100%;
    padding: 2px 10px;
    font-size: 12px;
    position: absolute;
    left: 0px;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.3);
  }
  .mask {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
  }
}
</style>
