<template>
  <div class="production">
    <div class="pro_tabs">
      <Tabs v-model:active="active" :sticky="true">
        <Tab title="母猪" :name="1"></Tab>
        <Tab title="公猪" :name="2"></Tab>
        <Tab title="商品猪" :name="3"></Tab>
      </Tabs>
    </div>
    <div class="pro_content">
      <div class="chart_content">
        <chart-post :id="0"></chart-post>
      </div>
      <div class="plan">
        <x-line text="生产计划"></x-line>
        <div class="plan_box">
          <nut-grid :column-num="4">
            <nut-grid-item>
              <template #default>
                <div class="box icon1"></div>
                <div class="icon_num">96头</div>
                <div class="icon_text">待配种</div>
              </template>
            </nut-grid-item>
            <nut-grid-item>
              <template #default>
                <div class="box icon2"></div>
                <div class="icon_num">96头</div>
                <div class="icon_text">待妊检</div>
              </template>
            </nut-grid-item>
            <nut-grid-item>
              <template #default>
                <div class="box icon3"></div>
                <div class="icon_num">96头</div>
                <div class="icon_text">待分娩</div>
              </template>
            </nut-grid-item>
            <nut-grid-item>
              <template #default>
                <div class="box icon4"></div>
                <div class="icon_num">96头</div>
                <div class="icon_text">待断奶</div>
              </template>
            </nut-grid-item>
            <nut-grid-item>
              <template #default>
                <div class="box icon5"></div>
                <div class="icon_num">96头</div>
                <div class="icon_text">待淘汰</div>
              </template>
            </nut-grid-item>
            <nut-grid-item>
              <template #default>
                <div class="box icon6"></div>
                <div class="icon_num">96头</div>
                <div class="icon_text">待免疫</div>
              </template>
            </nut-grid-item>
          </nut-grid>
        </div>
      </div>
      <div class="norm">
        <x-line text="生产指标"></x-line>
        <div class="norm_table">
          <div class="norm_item blue">
            <nut-row>
              <nut-col :span="12">指标</nut-col>
              <nut-col :span="12">数值</nut-col>
            </nut-row>
          </div>
          <div class="norm_item">
            <nut-row>
              <nut-col :span="12">产房存活率</nut-col>
              <nut-col :span="12">96.97%</nut-col>
            </nut-row>
          </div>
          <div class="norm_item">
            <nut-row>
              <nut-col :span="12">育肥存活率</nut-col>
              <nut-col :span="12">96.97%</nut-col>
            </nut-row>
          </div>
          <div class="norm_item">
            <nut-row>
              <nut-col :span="12">肥猪存活率</nut-col>
              <nut-col :span="12">96.97%</nut-col>
            </nut-row>
          </div>
          <div class="norm_item">
            <nut-row>
              <nut-col :span="12">7日断配率</nut-col>
              <nut-col :span="12">96.97%</nut-col>
            </nut-row>
          </div>
          <div class="norm_item">
            <nut-row>
              <nut-col :span="12">配种分娩率</nut-col>
              <nut-col :span="12">96.97%</nut-col>
            </nut-row>
          </div>
          <div class="norm_item">
            <nut-row>
              <nut-col :span="12">PSY</nut-col>
              <nut-col :span="12">23</nut-col>
            </nut-row>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Production"
}
</script>
<script setup>
  import { Tab, Tabs } from 'vant'
  import { ref } from 'vue'
  import ChartPost from "./charts/ChartPost.vue";
  import XLine from "../../components/XLine.vue";

  const active = ref(1)
</script>

<style scoped>
  .production {
    width: 100%;
    height: 100%;
  }
  .pro_content {
    height: calc(100% - 44px);
    overflow: auto;
    box-sizing: border-box;
    border-top: 1px solid #F7F8F9;
  }
  .chart_content {
    width: 100%;
    height: 300px;
    background-color: #fff;
  }
  .plan {
    width: 100%;
    background-color: #fff;
    margin-top: 10px;
    box-sizing: border-box;
    padding: 10px;
    margin-bottom: 10px;
  }
  .plan_box {
    margin-top: 10px;
  }
  .box {
    width: 30px;
    height: 30px;
  }
  .icon1 {
    background: url("../../assets/images/production/dai.png") no-repeat;
    background-size: 100% 100%;
  }
  .icon2 {
    background: url("../../assets/images/production/ren.png") no-repeat;
    background-size: 100% 100%;
  }
  .icon3 {
    background: url("../../assets/images/production/fen.png") no-repeat;
    background-size: 100% 100%;
  }
  .icon4 {
    background: url("../../assets/images/production/duan.png") no-repeat;
    background-size: 100% 100%;
  }
  .icon5 {
    background: url("../../assets/images/production/tai.png") no-repeat;
    background-size: 100% 100%;
  }
  .icon6 {
    background: url("../../assets/images/production/zhen.png") no-repeat;
    background-size: 100% 100%;
  }
  .icon_text {
    font-size: 14px;
  }
  .icon_num {
    margin-top: 5px;
    color: #808080;
    font-size: 13px;
  }
  .norm {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
  }
  .norm_table {
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
  }
  .norm_item {
    width: 100%;
    height: 40px;
    line-height: 40px;
    text-align: center;
  }
  .blue {
    background-color: #008EFF;
    color: #fff;
  }
</style>
