<template>
  <div class="app-container">
    <el-table
      v-loading="loading"
      :data="parityCorrectionList"
      style="width: 100%"
      border
      stripe
    >
      <el-table-column label="胎次" align="center" prop="parity" width="120" />
      <el-table-column label="系数" align="center" prop="coef" width="120" />
    </el-table>
  </div>
</template>

<script setup name="ParityCorrection">
import { listParityCorrection } from '@/api/dairyProducts/parityCorrection/parityCorrection.js'
import { ref, onMounted } from 'vue'

const loading = ref(false)
const parityCorrectionList = ref([])

function getList() {
  loading.value = true
  listParityCorrection().then(res => {
    parityCorrectionList.value = res.rows || res.data || []   // 兼容两种返回风格
  }).finally(() => {
    loading.value = false
  })
}

onMounted(() => {
  getList()
})
</script>

<style scoped>
.app-container {
  padding: 20px;
}
</style>