<script setup lang="ts">
import { computed, PropType } from "vue";
// import MoreFilled from "@iconify-icons/ant-design/ellipsis-outlined";
import myLogo from "@/assets/static/myLogo.png";
// import { MoreFilled } from "@element-plus/icons-vue";

defineOptions({
  name: "ReCard"
});

interface CardProductType {
  type: number;
  isSetup: boolean;
  leader: string;
  name: string;
  phone: number;
  modelNum: number;
}

const props = defineProps({
  product: {
    type: Object as PropType<CardProductType>
  }
});

const cardClass = computed(() => [
  "list-card-item",
  { "list-card-item__disabled": !props.product.isSetup }
]);

const cardLogoClass = computed(() => [
  "list-card-item_detail--logo",
  { "list-card-item_detail--logo__disabled": !props.product.isSetup }
]);
</script>

<template>
  <div :class="cardClass">
    <div class="list-card-item_detail bg-bg_color">
      <div :class="cardLogoClass">
        <img :src="myLogo" class="bg" />
      </div>
      <div class="list-card-item_content">
        <p class="list-card-item_detail--title">
          <span>苏胜天文字OCR识别算法</span>
          <span>经典算法</span>
        </p>
        <p class="list-card-item_detail--version">
          <span>v1.6.25</span>
        </p>
        <p class="list-card-item_detail--update">
          更新时间：<span>2023.09.10</span>
        </p>
        <p class="list-card-item_detail--update">提供方：<span>苏胜天</span></p>
        <p class="list-card-item_detail--desc">
          针对企业人员是否有违章违规的问题，首先采用高性能的深度学习目标检测算法对图像中的人员进行定位，然后对定位出来的人员图像通过基于卷积神经网络进行分类判断是否按要求，如未带安全帽、未穿工作服、未戴口罩、吸烟、接打电话等行为等。
        </p>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.list-card-item {
  display: flex;
  flex-direction: column;
  padding: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  // &_content {
  //   padding: 16px 16px 8px;
  // }

  &_detail {
    flex: 1;
    min-height: 140px;

    &--logo {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      width: 100%;
      margin-bottom: 10px;

      &__disabled {
        color: #a1c4ff;
      }
    }

    &--operation {
      display: flex;
      height: 100%;

      &--tag {
        border: 0;
      }
    }

    &--name {
      margin-bottom: 8px;
      font-size: 16px;
      font-weight: 400;
      // font-family: "PingFang SC";
      color: #333;
    }

    &--desc {
      font-family: "Helvetica Neue", Helvetica, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
      font-size: 14px;
      font-weight: 400;
      line-height: 22px;
      color: 333;
    }

    &--title {
      display: flex;
      align-items: center;
      justify-content: flex-start;

      span:first-child {
        margin-right: 12px;
        font-family: "Helvetica Neue", Helvetica, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
        font-size: 14px;
        font-weight: bold;
        line-height: 18px;
        color: #333;
      }

      span:last-child {
        width: 56px;
        height: 26px;
        font-family: "Helvetica Neue", Helvetica, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
        font-size: 12px;
        font-weight: bold;
        line-height: 26px;
        color: #fff;
        text-align: center;
        background: #67c23a;
        border-radius: 2px;
      }
    }

    &--version {
      margin-bottom: 12px;

      span {
        font-family: "Helvetica Neue", Helvetica, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
        font-size: 12px;
        font-weight: 400;
        line-height: 18px;
      }
    }

    &--update {
      margin-bottom: 12px;
      font-family: "Helvetica Neue", Helvetica, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
      font-size: 14px;
      font-weight: 400;
      line-height: 22px;
      color: #666;

      span {
        color: #333;
      }
    }
  }

  // &__disabled {
  //   .list-card-item_detail--name,
  //   .list-card-item_detail--desc {
  //     // color: var(--el-text-color-disabled);
  //   }

  //   .list-card-item_detail--operation--tag {
  //     // color: #bababa;
  //   }
  // }
}
</style>
