<script>
export default {
  name: "AppStoreKeyGoods",
  label: "表格",
  data() {
    return {
      columns: [
        {label: "重点单品", prop: "name"},
        {label: "当日目标", prop: "targetNum", width: "70px"},
        {label: "销售数量", prop: "saleNum", width: "70px"},
        {label: "库存数量", prop: "stockNum", width: "70px"},
        {label: "预计销售数量", prop: "preSaleNum", width: "70px"},
        {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
      ]
    }
  },
  computed: {
    refs: v => v.$parent.getItemRefs(),
    tableData: v => v.$storeBoard.storeKeyGoods || [],
    tableConfig: v => {
      return {
        headerBGC: 'rgba(13, 48, 99, 0.6)',
        oddRowBGC: window.evenRowBGC(), evenRowBGC: "transparent",
        header: v.columns.map(e => e.label),
        columnWidth: v.columns.map(e => e.width || "0;flex:1;min-width:0;"),
        align: v.columns.map(e => e.align || "left"),
        data: v.tableData.map(e => v.columns.map(column => e[column.prop])),
      }
    },
  },
}
</script>

<template>
  <section class="AppStoreKeyGoods">
    <div class="subTitle" v-text="'重点单品情况'"/>
    <dv-scroll-board :config="tableConfig" @click=""/>
  </section>
</template>

<style>
.AppStoreKeyGoods {
  color: #fff;
  box-sizing: border-box;
}

.AppStoreKeyGoods .subTitle {
  line-height: 20px;
  width: fit-content;
  margin: 24px auto 12px;
  background-image: url("http://10.0.97.209/img/kengee/kengee5.png");
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: center bottom;
}
</style>
