<template>
  <!-- 子订单盒子 -->
  <div :class="hoverStatus ? 'body bodyHover ' : 'body'">
    <div class="topArea">
      <div class="productName">{{ item.materialName }}</div>
      <div class="productMsg">
        <span :class="hoverStatus ? 'msgName msgNameHover' : 'msgName'">产品型号</span>
        <span class="msgValue">{{ item.materialModel }}</span>
      </div>
      <div class="productMsg">
        <span :class="hoverStatus ? 'msgName msgNameHover' : 'msgName'">工单编号</span>
        <span class="msgValue">{{ item.workOrderCode }}</span>
      </div>
      <div class="productMsg">
        <span :class="hoverStatus ? 'msgName msgNameHover' : 'msgName'">计划编号</span>
        <span class="msgValue">{{ item.orderCode }}</span>
      </div>
    </div>
    <div class="bottomArea">
      <div class="bottomBox">
        <div class="boxNum">{{ parseInt(item.planNum) }}</div>
        <div :class="hoverStatus ? 'boxText boxTextHover' : 'boxText'">
          产品数量
        </div>
      </div>
      <div class="textDivider">
        <div class="dividerBox">
          <el-divider direction="vertical" style="height: 60%" />
        </div>
      </div>
      <div class="bottomBox">
        <div class="boxNum">{{ parseInt(item.planNum) }}</div>
        <div :class="hoverStatus ? 'boxText boxTextHover' : 'boxText'">
          主料齐套
        </div>
      </div>
    </div>
    <!-- 右下角状态盒子 -->
    <div class="statusBox">未开始</div>
  </div>
</template>

<script lang="ts" setup>
import { reactive, ref } from "vue";

defineProps<{
  hoverStatus?: boolean;
  item: object;
}>();
</script>

<style lang="scss" scoped>
//盒子间隔在MAR-bottom
.body {
  position: relative;
  width: 100%;
  height: 244px;
  border-radius: 16px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px 0 15px 20px;
  background-color: #ffffff;
}

.bodyHover {
  background-color: $select-hover;
  color: white;
}

.boxTextHover {
  color: white !important;
}

.productName {
  font-size: $f24;
}

.msgName {
  font-size: $f20;
  color: $font-default-60;
}

.msgNameHover {
  color: white !important;
}

.msgValue {
  margin-left: 5px;
  font-size: $f20;
}

.bottomArea {
  height: 60px;
}

.bottomBox {
  width: 80px;
  display: inline-block;
}

.textDivider {
  display: inline-block;

  .dividerBox {
    height: 60px;
    display: flex;
  }
}

.boxNum {
  text-align: center;
  line-height: 38px;
  font-size: $f38;
}

.boxText {
  text-align: center;
  font-size: $f20;
  line-height: 20px;
  color: $font-default-60;
}

.statusBox {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 90px;
  height: 40px;
  border-radius: 10px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: $select-hover;
  font-size: $f20;
}
</style>
